CN104811383A - Message forwarding method and equipment - Google Patents

Message forwarding method and equipment Download PDF

Info

Publication number
CN104811383A
CN104811383A CN201510121593.1A CN201510121593A CN104811383A CN 104811383 A CN104811383 A CN 104811383A CN 201510121593 A CN201510121593 A CN 201510121593A CN 104811383 A CN104811383 A CN 104811383A
Authority
CN
China
Prior art keywords
address
server
message
load
virtual
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201510121593.1A
Other languages
Chinese (zh)
Other versions
CN104811383B (en
Inventor
郑上闽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201510121593.1A priority Critical patent/CN104811383B/en
Publication of CN104811383A publication Critical patent/CN104811383A/en
Application granted granted Critical
Publication of CN104811383B publication Critical patent/CN104811383B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the application discloses a message forwarding method and equipment. With application of the technical scheme provided by the embodiment of the application, forwarding of messages in a load balancing network is realized on the basis of consistency of VIP of the load balancing network and RIP of all servers based on modification and recovery of the message VIP and MIP so that problems in the technical schemes of the prior art that high-efficiency forwarding of the messages cannot be realized due to networking restriction caused by the fact that consistency of performance and reciprocating paths is required by an NAT mode can be solved.

Description

A kind of message forwarding method and equipment
Technical field
The present invention relates to communication technical field, particularly a kind of message forwarding method and equipment.
Background technology
Load balancing (Load Balance) is based upon on existing network infrastructure, provides the bandwidth of the effectively transparent method extended network equipment of a kind of cheapness and server, increase throughput, Strengthens network data-handling capacity, the flexibility improving network and availability.
Generally comprising one or two load-balancing device (Load Balancer, LB) in existing load balancing framework externally provides VIP (Virtual IP, virtual IP address) as the address providing service.Multiple stage physical machine or virtual machine is hung with in LB equipment rear end.When LB equipment receives an application request, according to certain algorithm, request can be redirected to certain back-end physical machine or virtual machine, really provide service.
As shown in FIG. 1A and 1B, the structural representation of the load balancing framework of series model networking in prior art and the load balancing framework of other extension pattern networking is respectively.
No matter be any application scenarios, after LB equipment wherein selectes back-end server according to certain algorithm, the request message that user sends over by LB equipment is transmitted to back-end server according to NAT (Network Address Translation, network address translation) mode/Full NAT mode.
LB equipment is according to RFC (Request For Comments, a series of to number the file be ranked) standard, to TCP (the Transmission Control Protocol of the message address and message inside that are forwarded to back-end server, transmission control protocol) or UDP (User Datagram Protocol, User Datagram Protocol) port numbers change.The actual address that destination address after changing is back-end server.If adopt Full NAT mode, the source address be sent to after the message conversion of server is then converted to the address of LB equipment.If adopt common NAT mode, then the message source address being sent to server is original address, does not change.Back-end server directly processes the message after conversion, and provides back message.The source address of back message is the address of back-end server.Back message through LB equipment, so that message address and port numbers can be converted to original message and port numbers by LB equipment, must send to real client.
In the process realizing the application, inventor finds that prior art at least exists following problem:
For NAT mode/Full NAT mode, consider some protocol massages, except comprise address and port information in heading except, also include relevant information at message content.Therefore, carry out in transfer process at LB equipment to message, need to identify association message, and message content is processed.The performance affecting LB equipment that this meeting is larger.And also through LB equipment, message must be converted to original address and port owing to forwarding return packet.This can produce further impact to the performance of LB equipment, and can limit networking, cannot realize the efficient forwarding of message.
Summary of the invention
The embodiment of the present application provides a kind of message forwarding method and equipment, and solving NAT mode performance and trip path in existing scheme unanimously, must can limit networking, cannot realize the problem of the efficient forwarding of message.
For achieving the above object, the embodiment of the present application provides a kind of message forwarding method on the one hand, be applied in the load balancing network formed by load-balancing device and multiple server, the corresponding virtual ip address of described load balancing network, the real ip address of each described server is consistent with described virtual ip address, each described server management ip address that correspondence one is different respectively, and comprise proxy module respectively, described method comprises:
When a station server receives the message of the management ip address of destination address corresponding to described server self that described load-balancing device sends, the destination address of described message, according to the corresponding relation of described management ip address and described virtual ip address, is revised as described virtual ip address by the proxy module included by self by described server;
Described server processes the amended message of destination address.
On the other hand, the embodiment of the present application additionally provides a kind of server, be applied in the load balancing network formed by load-balancing device and multiple server, the corresponding virtual ip address of described load balancing network, the real ip address of each described server is consistent with described virtual ip address, each described server management ip address that correspondence one is different respectively, described server comprises:
Communication module, for receiving the message that described load-balancing device sends;
Proxy module, during for receiving the message of the management ip address of destination address corresponding to described server self that described load-balancing device sends when described communication module, according to the corresponding relation of described management ip address and described virtual ip address, the destination address of described message is revised as described virtual ip address;
Processing module, for processing through the amended message of described proxy module destination address.
On the other hand, the embodiment of the present application additionally provides a kind of message forwarding method, be applied in the load balancing network formed by load-balancing device and multiple server, the corresponding virtual ip address of described load balancing network, the real ip address of each described server is consistent with described virtual ip address, each described server management ip address that correspondence one is different respectively, and comprise proxy module respectively, described method comprises:
When the destination address that described load-balancing device receives client transmission is the message of described virtual ip address, described load-balancing device, according to the management ip address of load balancing and each server, selects the destination server of the described message of process in described multiple server;
The destination address of described message is revised as the management ip address corresponding to described destination server by described load-balancing device;
Amended for destination address message is sent to the proxy module of described destination server by described load-balancing device, to make described proxy module according to the corresponding relation of described management ip address and described virtual ip address, described amended message is restored, and carries out Message processing by described destination server.
On the other hand, the embodiment of the present application additionally provides a kind of load-balancing device, be applied in the load balancing network formed by load-balancing device and multiple server, the corresponding virtual ip address of described load balancing network, the real ip address of each described server is consistent with described virtual ip address, each described server management ip address that correspondence one is different respectively, and comprise proxy module respectively, described load-balancing device comprises:
Receiver module, for receiving the message that client or each described server send;
Decision-making module, when the destination address sent for receiving client when described receiver module is the message of described virtual ip address, according to the management ip address of load balancing and each server, in described multiple server, select the destination server of the described message of process;
Address modified module, for the management ip address corresponding to the destination server that the destination address of the described message received by described receiver module is revised as selected by described decision-making module;
Sending module, for described address modified module is carried out the proxy module that the amended message of destination address sends to described destination server, to make described proxy module according to the corresponding relation of described management ip address and described virtual ip address, described amended message is restored, and carries out Message processing by described destination server.
Compared with prior art, the technical scheme that the embodiment of the present application proposes has the following advantages:
By the technical scheme that application the embodiment of the present application proposes, on the basis that the VIP of load balancing network is consistent with the RIP of each server, without the need to identifying the content of message, only need in the amendment of heading message VIP and MIP and recovery, realize the forwarding of message in load balancing network, thus, solve NAT mode in prior art and require that performance and trip path must be consistent, restriction networking, cannot realize the problem of the efficient forwarding of message.
Accompanying drawing explanation
Figure 1A is the structural representation of the load balancing framework of series model networking in prior art;
Figure 1B is the structural representation of the load balancing framework of other extension pattern networking in prior art;
The schematic flow sheet of a kind of message forwarding method that Fig. 2 proposes for the embodiment of the present application;
The schematic flow sheet of a kind of message forwarding method in load-balancing device side that Fig. 3 proposes for the embodiment of the present application;
The schematic flow sheet of the message forwarding method in a kind of embody rule scene that Fig. 4 proposes for the embodiment of the present application one;
A kind of message forwarding method that Fig. 5 proposes for the embodiment of the present application one is at a kind of schematic flow sheet fed back under scene;
The schematic flow sheet of a kind of message forwarding method under another kind feedback scene that Fig. 6 proposes for the embodiment of the present application one;
The schematic flow sheet of the message forwarding method in a kind of embody rule scene that Fig. 7 proposes for the embodiment of the present application two;
A kind of message forwarding method that Fig. 8 proposes for the embodiment of the present application two is at a kind of schematic flow sheet fed back under scene
The schematic flow sheet of a kind of message forwarding method under another kind feedback scene that Fig. 9 proposes for the embodiment of the present application two
The structural representation of a kind of server that Figure 10 proposes for the embodiment of the present application;
The structural representation of a kind of server under a kind of embody rule scene that Figure 11 proposes for the embodiment of the present application;
The structural representation of a kind of server under another kind of embody rule scene that Figure 12 proposes for the embodiment of the present application;
The structural representation of a kind of server under another kind of embody rule scene that Figure 13 proposes for the embodiment of the present application;
The structural representation of a kind of load-balancing device that Figure 14 proposes for the embodiment of the present application.
Embodiment
In order to solve in existing scheme, NAT mode performance and trip path must be consistent, networking can be limited, the problem of the efficient forwarding of message cannot be realized, present applicant proposes a kind of message forwarding method, on the basis that the VIP of load balancing network is consistent with the RIP of each server, based on the amendment of message VIP, realize the forwarding of message in load balancing network.
As shown in Figure 2, for the schematic flow sheet of a kind of message forwarding method that the embodiment of the present application proposes, the method is applied in the load balancing network consisted of load-balancing device and multiple server, the corresponding virtual ip address of described load balancing network, the real ip address of each described server is consistent with described virtual ip address, each described server management ip address that correspondence one is different respectively, and comprise proxy module respectively.
The method specifically comprises the following steps:
Step S201, when a station server receives the message of the management ip address of destination address corresponding to described server self that described load-balancing device sends, the destination address of described message, according to the corresponding relation of described management ip address and described virtual ip address, is revised as described virtual ip address by the proxy module included by self by described server.
In concrete application scenarios, the corresponding relation of management ip address and virtual ip address, generates especially by with under type:
Server receives the configuration messages carrying the correspondence relationship information of management ip address and virtual ip address, generates the corresponding relation of management ip address and virtual ip address in server this locality and/or proxy module; Or,
Server is consulted by proxy module and load-balancing device, determines the corresponding relation of management ip address and virtual ip address, and is kept in server this locality and/or proxy module.
In concrete application scenarios; can determine to adopt which kind of above-mentioned mode according to actual needs; no matter be which kind of mode, as long as the corresponding relation of management ip address and virtual ip address can be provided for server and proxy module, the protection range of the application would not be affected.
In follow-up operating process, consider the application of proxy module to above-mentioned respective modules, it should be noted that:
If above-mentioned corresponding relation is kept at server this locality, then proxy module needs from server, read above-mentioned corresponding relation, and such process can save the storage resources of proxy module this locality;
And if above-mentioned corresponding relation is kept in proxy module, then proxy module can directly carry out reading and using, and such process can shorten the flow process of acquisition of information, simplifies the operation course, and improves response speed.
Step S202, described server process the amended message of destination address.
It should be noted that, after the server of this step completes Message processing, generate if generated the response message that source address is described virtual ip address, then according to the difference of pass-through mode, the processing procedure for response message can comprise two kinds of modes:
Mode one, directly transmission source address are the response message of virtual ip address, do not carry out address transition.
In this fashion, described response message, after generation source address is the response message of described virtual ip address, is directly forwarded described response message according to the destination address of described response message to client, does not make any amendment by described server.
In this way, the source address of response message is the virtual ip address (VIP) corresponding to book server, destination address is then client ip address (the Client IP corresponding to client, CIP), for this type of message, directly can forward to client, under this kind of scene, can through load-balancing device, also can without load-balancing device, but, it is to be noted, source address due to response message is virtual ip address, so load-balancing device is without the need to carrying out address transition.
In concrete application scenarios, this response message directly can be sent to client by the server under the manner, also the proxy module included by server this response message can be sent to client, no matter which kind of send mode, source address due to this response message is the virtual ip address corresponding to book server, also be the virtual ip address of present load equalizing network, so, for client, before being all send message the response message that returns of destination, normally can receive, follow-up processing procedure can not be affected.
Mode two, send to load-balancing device by proxy module, carry out address transition.
In this fashion, described server is after generation source address is the response message of described virtual ip address, according to the corresponding relation of described management ip address and described virtual ip address, by the proxy module included by self by the management ip address of the source address modification of described response message corresponding to described server self;
Response message after source address modification is sent to described load-balancing device by the proxy module included by self by described server, to make described load-balancing device after the source address modification of described response message is described virtual ip address, forward described response message according to the destination address of described response message.
In this way, response message experienced by three phases:
Stage A, generation phase.
At first, the source address of the response message that server generates is the virtual ip address (VIP) corresponding to book server, and destination address is the client ip address (Client IP, CIP) corresponding to client.
Stage B, modification stage.
Proxy module by the management ip address of the source address modification of response message corresponding to this server (Management IP, MIP), thus, can transmit in load balancing network internal, send to load-balancing device by proxy module.
Stage C, recovery phase.
After response message after source address modification sends to load-balancing device, by load-balancing device, management ip address is restored, by the virtual ip address that source address modification is original, thus, make load-balancing device can carry out the forwarding of response message to client, namely carry out the external transmission of load balancing network.
It should be noted that; the above-mentioned two kinds modes forwarded all can realize the passback of response message; difference is the passback whether being carried out response message by load-balancing device; namely the need of being management ip address by the source address modification of response message; concrete; can determine to adopt which kind of mode according to the needs of actual scene, such change can't affect the protection range of the application.
In sum, consider the recovery needs of management ip address, can find out, if carry out the feedback of response message through proxy module, and carried out the amendment of source address, then have to pass through load-balancing device and carry out restoration disposal, and if do not carry out the amendment of source address, and directly carry out the feedback of response message, then without the need to carrying out restoration disposal through load-balancing device.
Further, consider that load balancing network organizing pattern comprises series model and other extension pattern, then the feedback scene of response message can comprise following four kinds of situations:
Under feedback scene 1, series model, server is MIP by proxy module to load-balancing device transmission source address, destination address is the response message of CIP, after by load-balancing device source address being restored to VIP, response message is sent to client, aforesaid mode two that this feedback scene is corresponding further.
Under feedback scene 2, series model, server is VIP by proxy module (or without proxy module) to load-balancing device transmission source address, destination address is the response message of CIP, in the process, proxy module does not carry out the conversion (or feedback procedure is not directly through proxy module) of source address, and due to source address be VIP, so, load-balancing device is also without the need to carrying out source address conversion, directly response message can be sent to client, aforesaid mode one that this feedback scene is corresponding further.
Under feedback scene 3, other extension pattern, server (without proxy module) is VIP directly to client transmission source address, and destination address is the response message of CIP, aforesaid mode one that this feedback scene is corresponding further.
Under feedback scene 4, other extension pattern, server is VIP by proxy module directly to client transmission source address, and destination address is the response message of CIP, in the process, proxy module does not carry out the conversion of source address, aforesaid mode one that this feedback scene is corresponding further.
Under feedback scene 5, other extension pattern, server is MIP by proxy module to load-balancing device transmission source address, destination address is the response message of CIP, after by load-balancing device source address being restored to VIP, response message is sent to client, aforesaid mode two that this feedback scene is corresponding further.
In concrete application scenarios, can determine to adopt which kind of above-mentioned mode, such change can't affect the protection range of the application according to actual needs.
Above-mentionedly be illustrated as the realization flow of the application at client-side, accordingly, the application also proposed the realization flow of technique scheme in load-balancing device side, and specifically as shown in Figure 3, the method specifically comprises the following steps:
Step S301, when described load-balancing device receive client send destination address be the message of described virtual ip address time, described load-balancing device, according to the management ip address of load balancing and each server, selects the destination server of the described message of process in described multiple server.
It is to be noted, the virtual ip address adopted due to each server and real IP address are all identical, so, in the process of this step, load-balancing device is distinguished each server by management ip address, and concrete process is concrete load balance process flow process, selects the Business Processing that suitable network in charge is concrete, do not repeat them here.
The destination address of described message is revised as the management ip address corresponding to described destination server by step S302, described load-balancing device.
The amendment of management ip address can facilitate the internal transmission of message in load balancing network.
Amended for destination address message is sent to the proxy module of described destination server by step S303, described load-balancing device, to make described proxy module according to the corresponding relation of described management ip address and described virtual ip address, described amended message is restored, and carries out Message processing by described destination server.
Concrete, the process of server side, see the explanation of step S201 to step S202, no longer repeats at this.
Consider two kinds of feedback systems of aforesaid response message, wherein, mode one can not send response message to load-balancing device, so corresponding processing procedure and load-balancing device side have nothing to do.
And for mode two, it is the response message of management ip address that load-balancing device receives the source address that server returns, certainly, from explanation before, this kind of response message comes indeed through proxy module sends, in such cases, it is virtual ip address that load-balancing device needs the source address modification of response message, namely completes the recovery to response message, then, load-balancing device, according to the destination address of response message, forwards the response message after source address modification.
It should be noted that, above-mentioned process correspondence be when response message through load-balancing device, the process just can carried out, concrete, aforesaid feedback scene 1 and 5 that above-mentioned process is corresponding, the explanation of concrete processing procedure, see foregoing teachings, is not repeated.
The object of respective handling is that the source address making to be transmitted to by load-balancing device the response message of client is virtual ip address; which kind of processing mode of concrete employing can be selected according to concrete scene difference, and such change can't affect the protection range of the application.
Compared with prior art, the technical scheme that the embodiment of the present application proposes has the following advantages:
By the technical scheme that application the embodiment of the present application proposes, on the basis that the VIP of load balancing network is consistent with the RIP of each server, based on amendment and the recovery of message VIP and MIP, realize the forwarding of message in load balancing network, thus, solve NAT mode in prior art and require that performance and trip path must be consistent, can networking be limited, the problem of the efficient forwarding of message cannot be realized.
In order to set forth the technological thought of the application further, now in conjunction with concrete application scenarios, the technical scheme of the application is described.
In the technical scheme that the application proposes, each server provides the real IP address (Real IP, RIP) of application service to be configured to consistent with the virtual IP address of the service externally providing application, under the technical scheme namely proposed in the application, and VIP=RIP.
According to the amendment whether carrying out source address in aforesaid feedback response message process, namely whether server carries out the situation of message feedback through proxy module, and the application is described by the implementation procedure of two embodiments to the application.
Embodiment one, carry out the forwarding of response message directly to client, without load-balancing device.
As shown in Figure 4, be the schematic flow sheet of the message forwarding method in a kind of embody rule scene that the embodiment of the present application one proposes, the method comprises:
Step S401, load-balancing device (hereinafter referred to as LB equipment) receive the request message of client to application.
Now, the message content that receives of LB equipment is as follows.
Source address destination address
CIP VIP Payload (load)
Wherein, CIP is client ip address, and VIP externally provides the virtual ip address of application for current load balancing network.
Step S402, LB equipment according to certain algorithm for this request message selects to provide the real server of service.
Concrete algorithm, i.e. load balancing, can set according to actual needs, and such change can't affect the protection range of the application.
The destination address of this request message is converted to the management ip address of opposite rear end server by step S403, LB equipment, and sends this amended request message.
Now the amended request message form that sends of LB equipment is as follows.Wherein the part of destination address be by LB apparatus modifications after part, remainder is not then modified.
Source address destination address
CIP MIPn Payload (load)
Step S404, this request message, through go-between two layers or three layers of forwarding, arrive Agent (agency) module of server.
Step S405, Agent module carry out the restoration disposal of destination address to this request message, and forward the request message after restoring.
Process performed by Agent module is the reverse conversion process of LB equipment, and the corresponding relation of MIP and the VIP used during conversion by manual configuration, also can obtain by LB equipment and Agent module auto negotiation.
Agent module receives request message, is replaced with by destination address after present load equalizing network externally provides the virtual ip address of service, this request message to be transferred to the corresponding application module of server and to carry out subsequent treatment.Message after replacement is as follows, and its destination address revises go back to VIP address.Now message is consistent with original message.
Source address destination address
CIP VIP Payload (load)
The application module of step S406, server receives this request message, and after having processed, generates corresponding response message.
Now, response message content is as follows.
Source address destination address
VIP CIP Payload (load)
step S407, server send response message to client.
It should be noted that, the process of transmitting of this step, can be that server sends response message directly to client, also can be that server sends response message by Agent module to client, but, it should be noted that, although be the transmission being carried out response message by Agent module, but Agent module does not make any amendment to response message.
Step S408, client receive response message, complete the request processing procedure of current application.
So far, without under the scene of load-balancing device, complete message repeating processing procedure terminates, and due in the load balancing network of series model, what load-balancing device was positioned at server and client must on path, so, there is not the situation directly sending to client without load-balancing device, by contrast, under other extension pattern, then whether basis is through Agent module, there are two kinds of different feedback scenes, respectively as shown in Figure 5 and Figure 6, two kinds of scenes are all the feedbacks of carrying out response message directly to client, whether difference is through Agent module.
Embodiment two, send to load-balancing device by Agent module.
As shown in Figure 7, be the schematic flow sheet of the message forwarding method in a kind of embody rule scene that the embodiment of the present application two proposes, the method comprises:
Step S701 ~ step S706, identical with aforesaid step S401 ~ step S406, do not repeat them here.
Step S707, server complete the source address modification of response message by Agent module.
Through the message of Agent module forwards, be MIPn (management ip address corresponding with current server) by source address modification.
Amended response message content is as follows.
Source address destination address
MIPn CIP Payload (load)
Step S708, server send amended response message by Agent module to LB equipment.
Because this response message have passed through Agent module, and source address is replaced with MIPn, then this response message must through LB equipment.
Step S709, LB equipment carry out the restoration disposal of source address to this request message.
LB equipment receives response message, source address is replaced with the virtual ip address that present load equalizing network externally provides service.Message after replacement is as follows, and its source address modification goes back to VIP address.Now message is consistent with original message.
Source address destination address
CIP VIP Payload (load)
Step S710, LB equipment send the response message after restoring to client.
Step S711, client receive response message, complete the request processing procedure of current application.
So far, under the scene through LB equipment, complete message repeating processing procedure terminates, under series model and other extension pattern, there are two kinds of different feedback scenes, respectively as shown in Figure 8 and Figure 9, two kinds of scenes are all through LB equipment carries out feedback from response message to client, and difference is the pattern differentials of load balancing network.
Compared with prior art, the technical scheme that the embodiment of the present application proposes has the following advantages:
By the technical scheme that application the embodiment of the present application proposes, on the basis that the VIP of load balancing network is consistent with the RIP of each server, based on amendment and the recovery of message VIP and MIP, realize the forwarding of message in load balancing network, thus, solve NAT mode in prior art and require that performance and trip path must be consistent, can networking be limited, the problem of the efficient forwarding of message cannot be realized.
In order to realize the technical scheme of the application, the application also proposed a kind of server, be applied in the load balancing network formed by load-balancing device and multiple server, the corresponding virtual ip address of described load balancing network, the real ip address of each described server is consistent with described virtual ip address, each described server management ip address that correspondence one is different respectively, as shown in Figure 10, the structure of this server comprises:
Communication module 101, for receiving the message that described load-balancing device sends;
Proxy module 102, during for receiving the message of the management ip address of destination address corresponding to described server self that described load-balancing device sends when described communication module 101, according to the corresponding relation of described management ip address and described virtual ip address, the destination address of described message is revised as described virtual ip address;
Processing module 103, for processing through the amended message of described proxy module 102 destination address.
Concrete, described communication module 101, also for:
Receive the configuration messages carrying the correspondence relationship information of described management ip address and described virtual ip address, in described server this locality and/or described proxy module 102, generate the corresponding relation of described management ip address and described virtual ip address; Or,
Consulted with described load-balancing device by described proxy module 102, determine the corresponding relation of described management ip address and described virtual ip address, and be kept in described server this locality and/or described proxy module 102.
In concrete application scenarios; can determine to adopt which kind of above-mentioned mode according to actual needs; no matter be which kind of mode, as long as the corresponding relation of management ip address and virtual ip address can be provided for server and proxy module, the protection range of the application would not be affected.
In follow-up operating process, consider the application of proxy module to above-mentioned respective modules, it should be noted that:
If above-mentioned corresponding relation is kept at server this locality, then proxy module needs from server, read above-mentioned corresponding relation, and such process can save the storage resources of proxy module this locality;
And if above-mentioned corresponding relation is kept in proxy module, then proxy module can directly carry out reading and using, and such process can shorten the flow process of acquisition of information, simplifies the operation course, and improves response speed.
Need to further illustrate, carrying out directly to client in the scene of response message feedback,
Described processing module 103, also for according to result, generates the response message that source address is described virtual ip address, and described response message is sent to described proxy module 102 or described communication module 101;
Described proxy module 102, also for when receiving source address that described processing module 103 sends and being the response message of described virtual ip address, sends to described communication module 101 by described response message;
Described communication module 101, also for when receiving source address that described processing module 103 or described proxy module 102 send and being the response message of described virtual ip address, described response message is forwarded described response message according to the destination address of described response message.
Carrying out in the scene of response message feedback by load-balancing device to client,
Described processing module 103, also for according to result, generates the response message that source address is described virtual ip address, and described response message is sent to described proxy module 102;
Described proxy module 102, also for when receiving source address that described processing module 103 sends and being the response message of described virtual ip address, according to the corresponding relation of described management ip address and described virtual ip address, by the management ip address of the source address modification of described response message corresponding to described server self, and the response message after source address modification is sent to described communication module 101;
Described communication module 101, time also for response message after receiving the source address modification that described proxy module 102 sends, response message after described source address modification is sent to described load-balancing device, to make described load-balancing device after the source address modification of described response message is described virtual ip address, forward described response message according to the destination address of described response message.
Need to further illustrate, in concrete application scenarios, the realization of above-mentioned proxy module 102 can comprise following several sight:
Sight one, proxy module 102 are trawl performance or the kernel message processing module (MPM) of operating system inside, and as shown in figure 11, its concrete processing procedure can comprise its schematic diagram:
Receive in the flow process of packet at trawl performance, in network interface card packet receiving interrupt processing function, according to configuration information, relative address in packet is modified, configuration information is herein the corresponding relation of aforesaid management ip address and virtual ip address, and corresponding amendment is and management ip address is replaced with virtual ip address.
Send in the flow process of packet at trawl performance, give out a contract for a project in function at network interface card, according to configuration information, the relative address in packet is modified, configuration information is herein the corresponding relation of aforesaid management ip address and virtual ip address, and corresponding amendment is and virtual ip address is replaced with management ip address.
Receive in the flow process of packet in the kernel message processing module (MPM) of operating system, such as in the ip_rcv of linux kernel, the Hook Function of mounting NF_IP_PRE_ROUTING, modify to the IP address receiving message, the management ip address by this message replaces with virtual ip address.
Send in the flow process of packet in the kernel message processing module (MPM) of operating system, such as in the ip_snd of linux kernel, the Hook Function of mounting NF_IP_PRE_ROUTING, modify to the IP address of the message sent, the virtual ip address by this message replaces with management ip address.
Sight two, proxy module 102 are virtual switch (the virtual switch in virtualized environment in physical server, Vswitch), as shown in figure 12, multiple stage virtual machine (VMware, VM) is connected on virtual switch its schematic diagram.
Sight three, proxy module 102 are the physical network device of next-door neighbour's server, and be now double layer network between the network equipment (Device) and server (Server), its schematic diagram as shown in figure 13.
In the application scenarios of reality, concrete employing can select which kind of above-mentioned implementation according to actual needs, and such change can't affect the protection range of the application.
On the other hand, present invention also provides a kind of load-balancing device, be applied in the load balancing network formed by load-balancing device and multiple server, the corresponding virtual ip address of described load balancing network, the real ip address of each described server is consistent with described virtual ip address, each described server management ip address that correspondence one is different respectively, and comprises proxy module respectively, as shown in figure 14, the structure of this load-balancing device comprises:
Receiver module 141, for receiving the message that client or each described server send;
Decision-making module 142, when the destination address sent for receiving client when described receiver module 141 is the message of described virtual ip address, according to the management ip address of load balancing and each server, in described multiple server, select the destination server of the described message of process;
Address modified module 143, for the management ip address corresponding to the destination server that the destination address of the described message received by described receiver module 141 is revised as selected by described decision-making module 142;
Sending module 144, for described address modified module 143 is carried out the proxy module that the amended message of destination address sends to described destination server, to make described proxy module according to the corresponding relation of described management ip address and described virtual ip address, described amended message is restored, and carries out Message processing by described destination server.
Carrying out in the scene of response message feedback by load-balancing device to client,
Described receiver module 141, also for when receiving source address that described destination server returns and being the response message of described management ip address, sends to described address modified module 143 by described response message;
Described address modified module 143, also for when receiving source address that described receiver module 141 sends and being the response message of described management ip address, be described virtual ip address by the source address modification of described response message, and the response message after source address modification is sent to described sending module 114;
Described sending module 114, time also for response message after receiving the source address modification that described address modified module 143 sends, according to the destination address of described response message, forwards the response message after described source address modification.
Compared with prior art, the technical scheme that the embodiment of the present application proposes has the following advantages:
By the technical scheme that application the embodiment of the present application proposes, on the basis that the VIP of load balancing network is consistent with the RIP of each server, without the need to identifying the content of message, only need at heading based on the amendment of VIP and MIP and recovery, realize the forwarding of message in load balancing network, thus, solve NAT mode in prior art and require that performance and trip path must be consistent, can networking be limited, the problem of the efficient forwarding of message cannot be realized.
Through the above description of the embodiments, those skilled in the art can be well understood to the application can by hardware implementing, and the mode that also can add necessary general hardware platform by software realizes.Based on such understanding, the technical scheme of the application can embody with the form of software product, it (can be CD-ROM that this software product can be stored in a non-volatile memory medium, USB flash disk, portable hard drive etc.) in, comprise some instructions and perform each method implementing described in scene of the application in order to make a computer equipment (can be personal computer, server, or the network equipment etc.).
It will be appreciated by those skilled in the art that accompanying drawing is a schematic diagram preferably implementing scene, the module in accompanying drawing or flow process might not be that enforcement the application is necessary.
It will be appreciated by those skilled in the art that the module in the device implemented in scene can carry out being distributed in the device of enforcement scene according to implementing scene description, also can carry out respective change and being arranged in the one or more devices being different from this enforcement scene.The module of above-mentioned enforcement scene can merge into a module, also can split into multiple submodule further.
Above-mentioned the application's sequence number, just to describing, does not represent the quality implementing scene.
Be only the several concrete enforcement scene of the application above, but the application is not limited thereto, the changes that any person skilled in the art can think of all should fall into the protection range of the application.

Claims (10)

1. a message forwarding method, be applied in the load balancing network formed by load-balancing device and multiple server, the corresponding virtual ip address of described load balancing network, it is characterized in that, the real ip address of each described server is consistent with described virtual ip address, each described server management ip address that correspondence one is different respectively, and comprise proxy module respectively, described method comprises:
When server receives the message of the management ip address of destination address corresponding to described server self that described load-balancing device sends, the destination address of described message, according to the corresponding relation of described management ip address and described virtual ip address, is revised as described virtual ip address by the proxy module included by self by described server;
Described server processes the amended message of destination address.
2. the method for claim 1, is characterized in that, the corresponding relation of described management ip address and described virtual ip address, generates especially by with under type:
Described server receives the configuration messages carrying the correspondence relationship information of described management ip address and described virtual ip address, generates the corresponding relation of described management ip address and described virtual ip address in described server this locality and/or described proxy module; Or,
Described server is consulted by described proxy module and described load-balancing device, determines the corresponding relation of described management ip address and described virtual ip address, and is kept in described server this locality and/or described proxy module.
3. the method for claim 1, is characterized in that, described server also comprises after processing the amended message of destination address:
Described server generates the response message that source address is described virtual ip address;
Described server according to the corresponding relation of described management ip address and described virtual ip address, by the proxy module included by self by the management ip address of the source address modification of described response message corresponding to described server self;
Response message after source address modification is sent to described load-balancing device by the described proxy module included by self by described server, to make described load-balancing device after the source address modification of described response message is described virtual ip address, forward described response message according to the destination address of described response message.
4. a server, be applied in the load balancing network formed by load-balancing device and multiple server, the corresponding virtual ip address of described load balancing network, it is characterized in that, the real ip address of each described server is consistent with described virtual ip address, each described server management ip address that correspondence one is different respectively, described server comprises:
Communication module, for receiving the message that described load-balancing device sends;
Proxy module, during for receiving the message of the management ip address of destination address corresponding to described server self that described load-balancing device sends when described communication module, according to the corresponding relation of described management ip address and described virtual ip address, the destination address of described message is revised as described virtual ip address;
Processing module, for processing through the amended message of described proxy module destination address.
5. server as claimed in claim 4, is characterized in that, described communication module, also for:
Receive the configuration messages carrying the correspondence relationship information of described management ip address and described virtual ip address, in described server this locality and/or described proxy module, generate the corresponding relation of described management ip address and described virtual ip address; Or,
Consulted by described proxy module and described load-balancing device, determine the corresponding relation of described management ip address and described virtual ip address, and be kept in described server this locality and/or described proxy module.
6. server as claimed in claim 4, is characterized in that,
Described processing module, also for according to result, generates the response message that source address is described virtual ip address, and described response message is sent to described proxy module;
Described proxy module, also for when receiving source address that described processing module sends and being the response message of described virtual ip address, according to the corresponding relation of described management ip address and described virtual ip address, by the management ip address of the source address modification of described response message corresponding to described server self, and the response message after source address modification is sent to described communication module;
Described communication module, time also for response message after receiving the source address modification that described proxy module sends, response message after described source address modification is sent to described load-balancing device, to make described load-balancing device after the source address modification of described response message is described virtual ip address, forward described response message according to the destination address of described response message.
7. a message forwarding method, be applied in the load balancing network formed by load-balancing device and multiple server, the corresponding virtual ip address of described load balancing network, it is characterized in that, the real ip address of each described server is consistent with described virtual ip address, each described server management ip address that correspondence one is different respectively, and comprise proxy module respectively, described method comprises:
When the destination address that described load-balancing device receives client transmission is the message of described virtual ip address, described load-balancing device, according to the management ip address of load balancing and each server, selects the destination server of the described message of process in described multiple server;
The destination address of described message is revised as the management ip address corresponding to described destination server by described load-balancing device;
Amended for destination address message is sent to the proxy module of described destination server by described load-balancing device, to make described proxy module according to the corresponding relation of described management ip address and described virtual ip address, described amended message is restored, and carries out Message processing by described destination server.
8. method as claimed in claim 7, it is characterized in that, described load-balancing device also comprises after amended for destination address message is sent to the proxy module of described destination server:
When to receive source address that described destination server returns be the response message of described management ip address to described load-balancing device, the source address modification of described response message is described virtual ip address by described load-balancing device;
Described load-balancing device, according to the destination address of described response message, forwards the response message after source address modification.
9. a load-balancing device, be applied in the load balancing network formed by load-balancing device and multiple server, the corresponding virtual ip address of described load balancing network, it is characterized in that, the real ip address of each described server is consistent with described virtual ip address, each described server management ip address that correspondence one is different respectively, and comprise proxy module respectively, described load-balancing device comprises:
Receiver module, for receiving the message that client or each described server send;
Decision-making module, when the destination address sent for receiving client when described receiver module is the message of described virtual ip address, according to the management ip address of load balancing and each server, in described multiple server, select the destination server of the described message of process;
Address modified module, for the management ip address corresponding to the destination server that the destination address of the described message received by described receiver module is revised as selected by described decision-making module;
Sending module, for described address modified module is carried out the proxy module that the amended message of destination address sends to described destination server, to make described proxy module according to the corresponding relation of described management ip address and described virtual ip address, described amended message is restored, and carries out Message processing by described destination server.
10. load-balancing device as claimed in claim 9, is characterized in that,
Described receiver module, also for when receiving source address that described destination server returns and being the response message of described management ip address, sends to described address modified module by described response message;
Described address modified module, also for when receiving source address that described receiver module sends and being the response message of described management ip address, be described virtual ip address by the source address modification of described response message, and the response message after source address modification is sent to described sending module;
Described sending module, time also for response message after receiving the source address modification that described address modified module sends, according to the destination address of described response message, forwards the response message after described source address modification.
CN201510121593.1A 2015-03-19 2015-03-19 A kind of message forwarding method and equipment Active CN104811383B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510121593.1A CN104811383B (en) 2015-03-19 2015-03-19 A kind of message forwarding method and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510121593.1A CN104811383B (en) 2015-03-19 2015-03-19 A kind of message forwarding method and equipment

Publications (2)

Publication Number Publication Date
CN104811383A true CN104811383A (en) 2015-07-29
CN104811383B CN104811383B (en) 2018-01-09

Family

ID=53695892

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510121593.1A Active CN104811383B (en) 2015-03-19 2015-03-19 A kind of message forwarding method and equipment

Country Status (1)

Country Link
CN (1) CN104811383B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106572197A (en) * 2015-10-10 2017-04-19 阿里巴巴集团控股有限公司 Network address conversion method, apparatus and system thereof
CN107846365A (en) * 2017-10-24 2018-03-27 赞同科技股份有限公司 A kind of load balancing based on SDN realizes system and method
CN108377524A (en) * 2016-10-11 2018-08-07 大唐移动通信设备有限公司 A kind of transmission method and device of terminal data packet
CN109413224A (en) * 2018-11-12 2019-03-01 杭州数梦工场科技有限公司 Message forwarding method and device
CN109639589A (en) * 2018-12-27 2019-04-16 杭州迪普科技股份有限公司 A kind of load-balancing method and device
CN111193773A (en) * 2019-12-06 2020-05-22 腾讯云计算(北京)有限责任公司 Load balancing method, device, equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0648038A3 (en) * 1993-09-11 2001-11-14 International Business Machines Corporation A data processing system for providing user load levelling in a network
CN1426211A (en) * 2001-12-06 2003-06-25 富士通株式会社 Server load sharing system
US20080059596A1 (en) * 2006-09-06 2008-03-06 Fujitsu Limited Attack detecting system and attack detecting method
CN103023942A (en) * 2011-09-27 2013-04-03 奇智软件(北京)有限公司 Load balancing method, device and system of server
CN103491053A (en) * 2012-06-08 2014-01-01 北京百度网讯科技有限公司 UDP load balancing method, UDP load balancing system and UDP load balancing device
CN103780502A (en) * 2012-10-17 2014-05-07 阿里巴巴集团控股有限公司 System, method and device for data interaction under load balancing

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0648038A3 (en) * 1993-09-11 2001-11-14 International Business Machines Corporation A data processing system for providing user load levelling in a network
CN1426211A (en) * 2001-12-06 2003-06-25 富士通株式会社 Server load sharing system
US20080059596A1 (en) * 2006-09-06 2008-03-06 Fujitsu Limited Attack detecting system and attack detecting method
CN103023942A (en) * 2011-09-27 2013-04-03 奇智软件(北京)有限公司 Load balancing method, device and system of server
CN103491053A (en) * 2012-06-08 2014-01-01 北京百度网讯科技有限公司 UDP load balancing method, UDP load balancing system and UDP load balancing device
CN103780502A (en) * 2012-10-17 2014-05-07 阿里巴巴集团控股有限公司 System, method and device for data interaction under load balancing

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106572197A (en) * 2015-10-10 2017-04-19 阿里巴巴集团控股有限公司 Network address conversion method, apparatus and system thereof
CN106572197B (en) * 2015-10-10 2020-01-14 阿里巴巴集团控股有限公司 Network address translation method, device and system
CN108377524A (en) * 2016-10-11 2018-08-07 大唐移动通信设备有限公司 A kind of transmission method and device of terminal data packet
CN107846365A (en) * 2017-10-24 2018-03-27 赞同科技股份有限公司 A kind of load balancing based on SDN realizes system and method
CN109413224A (en) * 2018-11-12 2019-03-01 杭州数梦工场科技有限公司 Message forwarding method and device
CN109413224B (en) * 2018-11-12 2022-03-01 杭州数梦工场科技有限公司 Message forwarding method and device
CN109639589A (en) * 2018-12-27 2019-04-16 杭州迪普科技股份有限公司 A kind of load-balancing method and device
CN111193773A (en) * 2019-12-06 2020-05-22 腾讯云计算(北京)有限责任公司 Load balancing method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN104811383B (en) 2018-01-09

Similar Documents

Publication Publication Date Title
EP3355553B1 (en) Reliable load-balancer using segment routing and real-time application monitoring
CN107465590B (en) Network infrastructure system, method of routing network traffic and computer readable medium
CN104811383A (en) Message forwarding method and equipment
US9397946B1 (en) Forwarding to clusters of service nodes
EP3225014B1 (en) Source ip address transparency systems and methods
US20190007322A1 (en) Virtual network device and related method
US20140280775A1 (en) Network Stack and Related Techniques
CN108718278B (en) Message transmission method and device
US11233737B2 (en) Stateless distributed load-balancing
US11436111B2 (en) Highly-available distributed network address translation (NAT) architecture with failover solutions
CN105554065A (en) Method, conversion unit and application unit for message processing
CN109728962B (en) Method and equipment for sending message
JP2017518710A (en) Service flow processing method, apparatus, and device
US8984114B2 (en) Dynamic session migration between network security gateways
CN104283785A (en) Method and device for processing flow table rapidly
US20140280813A1 (en) Optimizing application performance in a network environment
CN101827039B (en) Method and equipment for load sharing
CN109547354B (en) Load balancing method, device, system, core layer switch and storage medium
CN109525684B (en) Message forwarding method and device
KR102059971B1 (en) Data routing method and apparatus
CN112671938B (en) Business service providing method and system and remote acceleration gateway
WO2021008591A1 (en) Data transmission method, device, and system
CN104618243A (en) Routing method, device and system, and gateway scheduling method and device
CN116112426A (en) Intelligent network card assembly, physical machine, cloud service system and message sending method
CN104994022A (en) Message transmission method and service board

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Applicant after: Xinhua three Technology Co., Ltd.

Address before: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Applicant before: Huasan Communication Technology Co., Ltd.

GR01 Patent grant
GR01 Patent grant