CN104811383B - A kind of message forwarding method and equipment - Google Patents

A kind of message forwarding method and equipment Download PDF

Info

Publication number
CN104811383B
CN104811383B CN201510121593.1A CN201510121593A CN104811383B CN 104811383 B CN104811383 B CN 104811383B CN 201510121593 A CN201510121593 A CN 201510121593A CN 104811383 B CN104811383 B CN 104811383B
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.)
Active
Application number
CN201510121593.1A
Other languages
Chinese (zh)
Other versions
CN104811383A (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.)
New H3C Technologies Co Ltd
Original Assignee
New 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 New H3C Technologies Co Ltd filed Critical New 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 present application discloses a kind of message forwarding method and equipment, pass through the technical scheme proposed using the embodiment of the present application, on the basis of the VIP of load balancing network is consistent with the RIP of each server, modification and recovery based on message VIP and MIP, forwarding of the message in load balancing network is realized, so as to solve NAT mode in prior art and require that performance and trip path must be consistent, networking can be limited, the problem of efficient forwarding of message can not be realized.

Description

A kind of message forwarding method and equipment
Technical field
The present invention relates to communication technical field, more particularly to a kind of message forwarding method and equipment.
Background technology
Load balancing (Load Balance) is established on existing network infrastructure, there is provided a kind of cheap effectively transparent Method extended network equipment and the bandwidth of server, increase handling capacity, Strengthens network data-handling capacity, improve the flexible of network Property and availability.
It is right that one or two load-balancing device (Load Balancer, LB) is generally comprised in existing load balancing framework Outer offer VIP (Virtual IP, virtual IP address) is as the address for providing service.Hung with LB equipment rear end more physical machines or Virtual machine.When LB equipment receives an application request, certain back-end physical machine can be redirected requests to according to certain algorithm Or virtual machine, really provide service.
As shown in FIG. 1A and 1B, respectively the load balancing framework of series model networking and other extension pattern in the prior art The structural representation of the load balancing framework of networking.
Either any application scenarios, after LB equipment therein selectes back-end server according to certain algorithm, LB is set It is standby that the request message that user sends over is square according to NAT (Network Address Translation, network address translation) Formula/Full NAT modes are transmitted to back-end server.
LB equipment is according to RFC (Request For Comments are a series of to number the file being ranked) standard, to turning TCP (Transmission Control Protocol, the transmission control being dealt into inside the message address and message of back-end server Agreement processed) or UDP (User Datagram Protocol, User Datagram Protocol) port numbers changed.After conversion Destination address is the actual address of back-end server.If using Full NAT modes, after being sent to the message conversion of server Source address be then converted to the address of LB equipment.If using common NAT modes, the message source address for being sent to server is Original address, without conversion.Back-end server directly handles the message after conversion, and provides back message.Back message Source address is the address of back-end server.Back message is had to by LB equipment, so as to LB equipment can by message address and Port numbers are converted to original message and port numbers, are sent to real client.
During the application is realized, inventor has found that prior art at least has problems with:
For NAT modes/Full NAT modes, it is contemplated that some protocol massages, except in heading include address and Outside port information, also include relevant information in message content.Therefore, LB equipment to message carry out transfer process in, it is necessary to Association message is identified, and message content is handled.The performance of this meeting large effect LB equipment.And due to forwarding backhaul Message is also had to by LB equipment, and message is converted to original address and port.This performance to LB equipment can produce into The influence of one step, and networking can be limited, the efficient forwarding of message can not be realized.
The content of the invention
The embodiment of the present application provides a kind of message forwarding method and equipment, solves in existing scheme NAT mode performance and past Returning path must be consistent, can limit networking, the problem of can not realizing the efficient forwarding of message.
To reach above-mentioned purpose, on the one hand the embodiment of the present application provides a kind of message forwarding method, applied to by negative Carry in the load balancing network that balancing equipment and multiple servers are formed, the corresponding virtual IP address of the load balancing network Location, the real ip address of each server is consistent with the virtual ip address, and each server corresponds to one not respectively Same management ip address, and include proxy module respectively, methods described includes:
The destination address that the load-balancing device transmission is received when a server is right for the server itself During the message for the management ip address answered, management ip address of the server according to corresponding to the server itself and the void Intend the corresponding relation of IP address, be revised as the destination address of the message by the proxy module included by itself described virtual IP address;
The server is handled the amended message of destination address.
On the other hand, the embodiment of the present application additionally provides a kind of server, applied to passing through load-balancing device and multiple In the load balancing network that server is formed, the corresponding virtual ip address of the load balancing network, each server Real ip address it is consistent with the virtual ip address, each server respectively correspond to a different management ip address, The server includes:
Communication module, for receiving the message transmitted by the load-balancing device;
Proxy module, the destination address for receiving the load-balancing device transmission when the communication module is described During the message of the management ip address corresponding to server itself, management ip address and institute according to corresponding to the server itself The corresponding relation of virtual ip address is stated, the destination address of the message is revised as the virtual ip address;
Processing module, for being handled through the amended message of the proxy module destination address.
On the other hand, the embodiment of the present application additionally provides a kind of message forwarding method, applied to passing through load-balancing device In the load balancing network formed with multiple servers, the corresponding virtual ip address of the load balancing network is each described The real ip address of server is consistent with the virtual ip address, and each server corresponds to a different management IP respectively Address, and include proxy module respectively, methods described includes:
When the destination address that the load-balancing device receives client transmission is the message of the virtual ip address, The load-balancing device selects according to load balancing and the management ip address of each server in the multiple server Handle the destination server of the message;
The destination address of the message is revised as the management corresponding to the destination server by the load-balancing device IP address;
The amended message of destination address is sent to the proxy module of the destination server by the load-balancing device, So that pair of management ip address of the proxy module according to corresponding to the destination server itself and the virtual ip address It should be related to, the amended message is restored, and Message processing is carried out by the destination server.
On the other hand, the embodiment of the present application additionally provides a kind of load-balancing device, applied to passing through load-balancing device In the load balancing network formed with multiple servers, the corresponding virtual ip address of the load balancing network is each described The real ip address of server is consistent with the virtual ip address, and each server corresponds to a different management IP respectively Address, and include proxy module respectively, the load-balancing device includes:
Receiving module, for receiving client or the message transmitted by each server;
Decision-making module, the destination address for receiving client transmission when the receiving module is the virtual ip address Message when, according to load balancing and the management ip address of each server, the selection processing institute in the multiple server State the destination server of message;
Address modified module, the destination address of the message for the receiving module to be received are revised as described determine The management ip address corresponding to destination server selected by plan module;
Sending module, for the address modified module progress amended message of destination address to be sent into the purpose The proxy module of server, so that management ip address and institute of the proxy module according to corresponding to the destination server itself The corresponding relation of virtual ip address is stated, the amended message is restored, and message is carried out by the destination server Processing.
Compared with prior art, the technical scheme that the embodiment of the present application is proposed has advantages below:
By the technical scheme proposed using the embodiment of the present application, VIP and each server in load balancing network On the basis of RIP is consistent, without the content of message is identified, it is only necessary in heading message VIP and MIP modification and multiple Original, realize forwarding of the message in load balancing network, so as to, solve in prior art NAT mode require performance and Trip path must be consistent, limits networking, the problem of can not realizing the efficient forwarding of message.
Brief description of the drawings
Figure 1A is the structural representation of the load balancing framework of series model networking in the prior art;
Figure 1B is the structural representation of the load balancing framework of other extension pattern networking in the prior art;
A kind of schematic flow sheet for message forwarding method that Fig. 2 is proposed by the embodiment of the present application;
Fig. 3 is illustrated by a kind of flow of the message forwarding method that the embodiment of the present application proposes in load-balancing device side Figure;
The flow signal of message forwarding method in a kind of concrete application scene that Fig. 4 is proposed by the embodiment of the present application one Figure;
Fig. 5 is illustrated by a kind of message forwarding method that the embodiment of the present application one proposes in a kind of flow fed back under scene Figure;
Fig. 6 is shown by a kind of flow of the message forwarding method that the embodiment of the present application one proposes under another feedback scene It is intended to;
The flow signal of message forwarding method in a kind of concrete application scene that Fig. 7 is proposed by the embodiment of the present application two Figure;
Fig. 8 is illustrated by a kind of message forwarding method that the embodiment of the present application two proposes in a kind of flow fed back under scene Figure
Fig. 9 is shown by a kind of flow of the message forwarding method that the embodiment of the present application two proposes under another feedback scene It is intended to
A kind of structural representation for server that Figure 10 is proposed by the embodiment of the present application;
A kind of a kind of structural representation of the server that Figure 11 is proposed by the embodiment of the present application under concrete application scene;
A kind of structural representation of the server that Figure 12 is proposed by the embodiment of the present application under another concrete application scene Figure;
A kind of structural representation of the server that Figure 13 is proposed by the embodiment of the present application under another concrete application scene Figure;
A kind of structural representation for load-balancing device that Figure 14 is proposed by the embodiment of the present application.
Embodiment
NAT mode performance and trip path must be consistent in order to solve in existing scheme, can limit networking, can not realize report The problem of efficient forwarding of text, present applicant proposes a kind of message forwarding method, VIP and each server in load balancing network RIP it is consistent on the basis of, based on message VIP modification, realize forwarding of the message in load balancing network.
As shown in Fig. 2 a kind of schematic flow sheet of the message forwarding method proposed by the embodiment of the present application, this method should For in the load balancing network that is made up of load-balancing device and multiple servers, the load balancing network corresponding one Individual virtual ip address, the real ip address of each server is consistent with the virtual ip address, each server difference A corresponding different management ip address, and include proxy module respectively.
This method specifically includes following steps:
Step S201, when the destination address that a server receives the load-balancing device transmission is the server During the message of the management ip address corresponding to itself, management IP of the server according to corresponding to the server itself Location and the corresponding relation of the virtual ip address, the destination address of the message is changed by the proxy module included by itself For the virtual ip address.
In specific application scenarios, the management ip address corresponding to the server itself is corresponding with virtual ip address Relation, generated especially by the following manner:
Server receives the corresponding relation for carrying management ip address and virtual ip address corresponding to the server itself The configuration message of information, management IP corresponding to the server itself is generated in server local and/or proxy module Location and the corresponding relation of virtual ip address;Or,
Server is consulted by proxy module and load-balancing device, determines the management IP corresponding to the server itself Address and the corresponding relation of virtual ip address, and be stored in server local and/or proxy module.
In specific application scenarios, can according to be actually needed determine use which kind of above-mentioned mode, either which kind of Mode, as long as management ip address corresponding to the server itself can be provided for server and proxy module with virtual IP address The corresponding relation of location, the protection domain of the application would not be influenceed.
In follow-up operating process, it is contemplated that application of the proxy module to above-mentioned respective modules is, it is necessary to which explanation is:
If above-mentioned corresponding relation is stored in server local, proxy module needs to read above-mentioned pair from server It should be related to, such processing can save the local storage resource of proxy module;
And if above-mentioned corresponding relation is stored in proxy module, then proxy module directly can be read out and use, Such processing can shorten the flow of acquisition of information, simplify operating process, improve response speed.
Step S202, described server is handled the amended message of destination address.
It should be noted that after the server of this step is completed to Message processing, if generating generation source address For the response message of the virtual ip address, then according to the difference of pass-through mode, can be wrapped for the processing procedure of response message Include two ways:
Mode one, the response message that source address is virtual ip address is directly transmitted, without address conversion.
In this fashion, the server is after generation source address is the response message of the virtual ip address, directly The response message is forwarded into the response message to client according to the destination address of the response message, does not do any repair Change.
In this way, the source address of response message is the virtual ip address (VIP) corresponding to book server, and purpose Address is then the client ip address (Client IP, CIP) corresponding to client, for such message, can be entered to client Row directly forwarding, under such a scene, can pass through load-balancing device, can also without load-balancing device, still, It is pointed out that because the source address of response message is virtual ip address, so, load-balancing device need not enter row address and turn Change.
In specific application scenarios, the response message directly can be sent to client by the server under the manner, The response message can also be sent to client as the proxy module included by server, no matter which kind of sending method, due to The source address of the response message is the virtual ip address corresponding to book server, namely the virtual IP address of present load equalising network Location, so, for client, the response message of the destination return of transmitted message, can be normally received before being all, Follow-up processing procedure is not interfered with.
Mode two, load-balancing device is sent to by proxy module, carries out address conversion.
In this fashion, the server generation source address for the virtual ip address response message after, according to The corresponding relation of management ip address and the virtual ip address corresponding to the server itself, passes through the generation included by itself Manage management ip address of the module by the source address modification of the response message corresponding to the server itself;
Response message after source address modification is sent to described by the server by the proxy module included by itself Load-balancing device, so that the source address modification of the response message is being the virtual ip address by the load-balancing device Afterwards, the response message is forwarded according to the destination address of the response message.
In this way, response message experienced three phases:
Stage A, generation phase.
Initially, the source address of the response message of server generation is virtual ip address (VIP) corresponding to book server, mesh Address be client ip address (Client IP, CIP) corresponding to client.
Stage B, modification stage.
Management ip address (Management of the proxy module by the source address modification of response message corresponding to the server IP, MIP), it is thus possible to be transmitted in load balancing network internal, load-balancing device is sent to by proxy module.
Stage C, recovery phase.
After response message after source address modification is sent to load-balancing device, by load-balancing device by management ip address Restored, i.e., be original virtual ip address by source address modification, so as to allow load-balancing device to be carried out to client The forwarding of response message, that is, carry out the outside transmission of load balancing network.
It should be noted that the mode of two kinds of above-mentioned forwardings can realize the passback of response message, difference is that Whether the no passback that response message is carried out by load-balancing device, i.e., it is management IP to need the source address modification of response message Address, specifically, can be according to actual scene it needs to be determined that using which kind of mode, such change can't influence the application Protection domain.
In summary, it is contemplated that the recovery of management ip address needs, it can be seen that if responded by proxy module The feedback of message, and carried out the modification of source address, then have to pass through load-balancing device and carry out restoration disposal, and if do not had The modification of source address is carried out, and directly carries out the feedback of response message, then needs not move through load-balancing device and carries out restoration disposal.
Further, it is contemplated that load balancing network organizing pattern includes series model and other extension pattern, then response message Feedback scene can include following four situation:
Feed back scene 1, under series model, server by proxy module to load-balancing device transmission source address be MIP, Destination address is CIP response message, and after source address is restored into VIP by load-balancing device, response message is sent to Client, this feedback scene have further corresponded to foregoing mode two.
Feed back under scene 2, series model, server is set by proxy module (or without proxy module) to load balancing Standby transmission source address is VIP, and destination address is CIP response message, and in the process, proxy module does not carry out source address Conversion (or feedback procedure does not directly pass through proxy module), and because source address is VIP, so, load-balancing device Source address conversion need not be carried out, response message directly can be sent to client, this feedback scene has further corresponded to foregoing Mode one.
Feed back under scene 3, other extension pattern, server (without proxy module) is directly to client transmission source address VIP, destination address are CIP response message, and this feedback scene has further corresponded to foregoing mode one.
Feed back scene 4, under other extension pattern, server is VIP directly to client transmission source address by proxy module, mesh Address be CIP response message, in the process, proxy module does not carry out the conversion of source address, this feedback scene enter one Step has corresponded to foregoing mode one.
Feed back under scene 5, other extension pattern, server is to load-balancing device transmission source address by proxy module MIP, destination address are CIP response message, and after source address is restored into VIP by load-balancing device, response message is sent out Client is given, this feedback scene has further corresponded to foregoing mode two.
Which kind of in specific application scenarios, can determine to use above-mentioned mode, such change according to being actually needed The protection domain of the application can't be influenceed.
Described above be the application in the implementation process of client-side, accordingly, the application also proposed above-mentioned technical side Case load-balancing device side implementation process, specifically as shown in figure 3, this method specifically includes following steps:
Step S301, when the destination address that the load-balancing device receives client transmission is the virtual ip address Message when, the load-balancing device is according to load balancing and the management ip address of each server, in the multiple clothes It is engaged in selecting the destination server for handling the message in device.
It is pointed out that because the virtual ip address and real IP address of the use of each server are all identicals, so, In the processing of this step, load-balancing device makes a distinction by management ip address to each server, and specific mistake Journey is specific load balance process flow, selects suitable server to be responsible for specific business processing, will not be repeated here.
It is right that the destination address of the message is revised as destination server institute by step S302, described load-balancing device The management ip address answered.
The modification of management ip address corresponding to the destination server itself can facilitate message in load balancing network In internal transmission.
The amended message of destination address is sent to the destination server by step S303, described load-balancing device Proxy module, so that management ip address of the proxy module according to corresponding to the destination server itself and the virtual IP address The corresponding relation of address, the amended message is restored, and Message processing is carried out by the destination server.
Specifically, explanation of the processing of server side referring to step S201 to step S202, is not repeated herein.
In view of two kinds of feedback systems of foregoing response message, wherein, mode one will not be sent to load-balancing device Response message, so, corresponding processing procedure is unrelated with load-balancing device side.
And for mode two, the source address that load-balancing device receives server return is the response of management ip address Message, certainly, from explanation before, such a response message is sent indeed through proxy module, such a In the case of, it is virtual ip address that load-balancing device, which is needed the source address modification of response message, that is, is completed to response message Restore, then, load-balancing device forwards the response message after source address modification according to the destination address of response message.
It should be noted that it is in the case where response message passes through load-balancing device, just corresponding to above-mentioned processing The processing that can be carried out, specifically, above-mentioned processing has corresponded to foregoing feedback scene 1 and 5, the explanation of concrete processing procedure referring to Foregoing teachings, it is not repeated.
The source address for the response message that the purpose of respective handling is to make to be transmitted to client by load-balancing device is Which kind of virtual ip address, can specifically be selected using processing mode according to specific scene difference, such change is not The protection domain of the application can be influenceed.
Compared with prior art, the technical scheme that the embodiment of the present application is proposed has advantages below:
By the technical scheme proposed using the embodiment of the present application, VIP and each server in load balancing network On the basis of RIP is consistent, based on message VIP and MIP modification and recovery, forwarding of the message in load balancing network is realized, So as to solve NAT mode in prior art and require that performance and trip path must be consistent, networking, Wu Fashi can be limited The problem of efficient forwarding of existing message.
In order to which the technological thought of the application is expanded on further, in conjunction with specific application scenarios, to the technical side of the application Case illustrates.
In the technical scheme that the application is proposed, each server provide application service real IP address (Real IP, RIP it is consistent) to be configured to the virtual IP address of the service with externally providing application, i.e., under the technical scheme that the application is proposed, VIP= RIP。
According to the modification that source address whether is carried out during foregoing feedback response message, i.e., whether server is by agency Module carries out the situation of message feedback, and the application is illustrated by two embodiments to the implementation process of the application.
Embodiment one, the forwarding that response message is directly carried out to client, without load-balancing device.
As shown in figure 4, message forwarding method in a kind of concrete application scene proposed by the embodiment of the present application one Schematic flow sheet, this method include:
Step S401, load-balancing device (hereinafter referred to as LB equipment) receives request message of the client to application.
Now, the message content that LB equipment receives is as follows.
Wherein, CIP is client ip address, and VIP is with externally providing the virtual IP address of application for current load balancing network Location.
Step S402, LB equipment provides the real server of service according to certain algorithm for request message selection.
Specific algorithm, i.e. load balancing, it can be set according to being actually needed, such change can't shadow Ring the protection domain of the application.
Step S403, LB equipment is with being converted to the destination address of the request message management IP of opposite rear end server Location, and send the amended request message.
Amended request message form now transmitted by LB equipment is as follows.Wherein the part of destination address is to be set by LB Standby amended part, remainder are not changed then.
Step S404, the request message forwards for two layers or three layers by go-between, reaches the Agent (generations of server Reason) module.
Step S405, Agent modules carry out the restoration disposal of destination address to the request message, and forward asking after restoring Seek message.
Processing performed by Agent modules is the reverse conversion process of LB equipment, the MIP and VIP pair used during conversion Should be related to can also be obtained by manual configuration by LB equipment and Agent modules auto negotiation.
Agent modules receive request message, and destination address is replaced with into present load equalising network externally provides service The request message is transferred to the corresponding application module of server after virtual ip address and carries out subsequent treatment.Message after replacement is such as Shown in lower, its destination address changes go back to VIP addresses.Now message is consistent with original message.
Step S406, the application module of server receives the request message, and after the completion of processing, generates corresponding response report Text.
Now, response message content is as follows.
Step S407, server sends response message to client.
It should be noted that the transmission process of this step, can be that server directly sends response message to client, Can be that server sends response message by Agent modules to client, however, it is desirable to explanation, although passing through Agent modules carry out the transmission of response message, and still, Agent modules do not make any modification to response message.
Step S408, client receives response message, completes the request processing procedure of current application.
So far, under the scene without load-balancing device, complete message forward process process terminates, and due to In the load balancing network of series model, load-balancing device be located at server and client must through on path, so, do not deposit The situation of client is being transmitted directly to without load-balancing device, by contrast, under other extension pattern, then according to whether By Agent modules, two kinds of different feedback scenes be present, respectively as shown in Figure 5 and Figure 6, two kinds of scenes are directly to visitor Family end carries out the feedback of response message, and difference is whether pass through Agent modules.
Embodiment two, load-balancing device is sent to by Agent modules.
As shown in fig. 7, message forwarding method in a kind of concrete application scene proposed by the embodiment of the present application two Schematic flow sheet, this method include:
It is step S701~step S706, identical with foregoing step S401~step S406, it will not be repeated here.
Step S707, server completes the source address modification of response message by Agent modules.
It is that MIPn is (corresponding with current server to manage IP by source address modification by the message of Agent module forwards Address).
Amended response message content is as follows.
Step S708, server sends amended response message by Agent modules to LB equipment.
Because the response message have passed through Agent modules, and source address is replaced with into MIPn, then the response message has to By LB equipment.
Step S709, LB equipment carries out the restoration disposal of source address to the request message.
LB equipment receives response message, and source address is replaced with into the virtual IP address that present load equalising network externally provides service Address.Message after replacement is as follows, and its source address modification goes back to VIP addresses.Now message is consistent with original message.
Step S710, LB equipment sends the response message after restoring to client.
Step S711, client receives response message, completes the request processing procedure of current application.
So far, under the scene Jing Guo LB equipment, complete message forward process process terminates, in series model and other extension Under pattern, two kinds of different feedback scenes be present, respectively as shown in Figure 8 and Figure 9, two kinds of scenes are to client by LB equipment End carries out the feedback of response message, and difference is the pattern differentials of load balancing network.
Compared with prior art, the technical scheme that the embodiment of the present application is proposed has advantages below:
By the technical scheme proposed using the embodiment of the present application, VIP and each server in load balancing network On the basis of RIP is consistent, based on message VIP and MIP modification and recovery, forwarding of the message in load balancing network is realized, So as to solve NAT mode in prior art and require that performance and trip path must be consistent, networking, Wu Fashi can be limited The problem of efficient forwarding of existing message.
In order to realize the technical scheme of the application, the application also proposed a kind of server, applied to passing through load balancing In the load balancing network that equipment and multiple servers are formed, the corresponding virtual ip address of the load balancing network, respectively The real ip address of the server is consistent with the virtual ip address, and each server corresponds to a different pipe respectively IP address is managed, as shown in Figure 10, the structure of the server includes:
Communication module 101, for receiving the message transmitted by the load-balancing device;
Proxy module 102, for receiving the destination address of the load-balancing device transmission when the communication module 101 For the management ip address corresponding to the server itself message when, according to the management IP corresponding to the server itself Address and the corresponding relation of the virtual ip address, the virtual ip address is revised as by the destination address of the message;
Processing module 103, for being handled through the 102 amended message of proxy module destination address.
Specifically, the communication module 101, is additionally operable to:
Receive the corresponding relation letter for carrying the management ip address corresponding to the server itself and the virtual ip address The configuration message of breath, generated in the server local and/or the proxy module 102 corresponding to the server itself The corresponding relation of management ip address and the virtual ip address;Or,
Consulted by the proxy module 102 and the load-balancing device, determined corresponding to the server itself The corresponding relation of management ip address and the virtual ip address, and it is stored in the server local and/or the proxy module In 102.
In specific application scenarios, can according to be actually needed determine use which kind of above-mentioned mode, either which kind of Mode, would not shadow as long as the corresponding relation of management ip address and virtual ip address can be provided for server and proxy module Ring the protection domain of the application.
In follow-up operating process, it is contemplated that application of the proxy module to above-mentioned respective modules is, it is necessary to which explanation is:
If above-mentioned corresponding relation is stored in server local, proxy module needs to read above-mentioned pair from server It should be related to, such processing can save the local storage resource of proxy module;
And if above-mentioned corresponding relation is stored in proxy module, then proxy module directly can be read out and use, Such processing can shorten the flow of acquisition of information, simplify operating process, improve response speed.
It should be further stated that in the scene of response message feedback is directly carried out to client,
The processing module 103, it is additionally operable to according to result, generation source address is the response report of the virtual ip address Text, and the response message is sent to the proxy module 102 or the communication module 101;
The proxy module 102, it is described virtual to be additionally operable to receiving the source address transmitted by the processing module 103 During the response message of IP address, the response message is sent to the communication module 101;
The communication module 101, it is additionally operable to receiving transmitted by the processing module 103 or the proxy module 102 Source address be the virtual ip address response message when, the destination address by the response message according to the response message Forward the response message.
In the scene of response message feedback is carried out to client by load-balancing device,
The processing module 103, it is additionally operable to according to result, generation source address is the response report of the virtual ip address Text, and the response message is sent to the proxy module 102;
The proxy module 102, it is described virtual to be additionally operable to receiving the source address transmitted by the processing module 103 During the response message of IP address, the management ip address according to corresponding to the server itself is corresponding with the virtual ip address Relation, it is the management ip address corresponding to the server itself by the source address modification of the response message, and by source address Amended response message is sent to the communication module 101;
The communication module 101, the sound being additionally operable to after the source address modification transmitted by the proxy module 102 is received When answering message, the response message after the source address modification is sent to the load-balancing device, so that the load balancing Equipment is after by the source address modification of the response message for the virtual ip address, according to the destination of the response message Location forwards the response message.
It should be further stated that in specific application scenarios, the realization of above-mentioned proxy module 102 can include Several scenes below:
Scene one, proxy module 102 are the trawl performance or kernel message processing module (MPM) inside operating system, and it is illustrated Figure is as shown in figure 11, and its specific processing procedure can include:
It is right according to configuration information in network interface card packet receiving interrupt processing function in the flow of trawl performance received data packet Relative address in packet is modified, and configuration information herein is pair of foregoing management ip address and virtual ip address It should be related to, corresponding modification is that management ip address is replaced with into virtual ip address.
In the flow that trawl performance sends packet, in network interface card gives out a contract for a project function, according to configuration information in packet Relative address modify, configuration information herein is the corresponding relation of foregoing management ip address and virtual ip address, Corresponding modification is that virtual ip address is replaced with into management ip address.
In the flow of the kernel message processing module (MPM) received data packet of operating system, such as the ip_ in linux kernel In rcv, NF_IP_PRE_ROUTING Hook Function is mounted, the IP address for receiving message is modified, will the message Management ip address replaces with virtual ip address.
In the kernel message processing module (MPM) of operating system sends the flow of packet, such as the ip_ in linux kernel In snd, NF_IP_PRE_ROUTING Hook Function is mounted, the IP address of the message of transmission is modified, will the message Virtual ip address replace with management ip address.
Scene two, proxy module 102 are the virtual switch (virtual in virtualized environment in physical server Switch, Vswitch), its schematic diagram is as shown in figure 12, and more virtual machines (VMware, VM) are connected on virtual switch.
Scene three, proxy module 102 are the physical network device close to server, the now network equipment (Device) and clothes It is double layer network between business device (Server), its schematic diagram is as shown in figure 13.
Which kind of in the application scenarios of reality, can specifically be selected using above-mentioned implementation according to being actually needed Select, such change can't influence the protection domain of the application.
On the other hand, present invention also provides a kind of load-balancing device, applied to passing through load-balancing device and multiple In the load balancing network that server is formed, the corresponding virtual ip address of the load balancing network, each server Real ip address it is consistent with the virtual ip address, each server respectively correspond to a different management ip address, And include proxy module respectively, as shown in figure 14, the structure of the load-balancing device includes:
Receiving module 141, for receiving client or the message transmitted by each server;
Decision-making module 142, for receiving the destination address of client transmission when the receiving module 141 to be described virtual During the message of IP address, according to load balancing and the management ip address of each server, selected in the multiple server Handle the destination server of the message;
Address modified module 143, the destination address of the message for the receiving module 141 to be received are revised as The management ip address corresponding to destination server selected by the decision-making module 142;
Sending module 144, institute is sent to for the address modified module 143 to be carried out into the amended message of destination address The proxy module of destination server is stated, so that management IP of the proxy module according to corresponding to the destination server itself Location and the corresponding relation of the virtual ip address, the amended message is restored, and is entered by the destination server Row Message processing.
In the scene of response message feedback is carried out to client by load-balancing device,
The receiving module 141, it is purpose clothes to be additionally operable to receiving the source address that the destination server returns During the response message for the management ip address being engaged in corresponding to device itself, the response message is sent to the address modified module 143;
The address modified module 143, it is described to be additionally operable to receiving the source address transmitted by the receiving module 141 During the response message of the management ip address corresponding to destination server itself, the source address modification by the response message is described Virtual ip address, and the response message after source address modification is sent to the sending module 114;
The sending module 114, it is additionally operable to after the source address modification transmitted by the address modified module 143 is received Response message when, according to the destination address of the response message, forward the response message after the source address modification.
Compared with prior art, the technical scheme that the embodiment of the present application is proposed has advantages below:
By the technical scheme proposed using the embodiment of the present application, VIP and each server in load balancing network On the basis of RIP is consistent, without the content of message is identified, it is only necessary in modification of the heading based on VIP and MIP and again Original, realize forwarding of the message in load balancing network, so as to, solve in prior art NAT mode require performance and Trip path must be consistent, can limit networking, the problem of can not realizing the efficient forwarding of message.
Through the above description of the embodiments, those skilled in the art can be understood that the application can lead to Hardware realization is crossed, the mode of necessary general hardware platform can also be added by software to realize.Based on such understanding, this Shen Technical scheme please can be embodied in the form of software product, and the software product can be stored in a non-volatile memories In medium (can be CD-ROM, USB flash disk, mobile hard disk etc.), including some instructions are causing a computer equipment (can be Personal computer, server, or network equipment etc.) perform each implement scene of the application described in method.
It will be appreciated by those skilled in the art that accompanying drawing is a schematic diagram for being preferable to carry out scene, module in accompanying drawing or Flow is not necessarily implemented necessary to the application.
It will be appreciated by those skilled in the art that the module in device in implement scene can be described according to implement scene into Row is distributed in the device of implement scene, can also carry out one or more dresses that respective change is disposed other than this implement scene In putting.The module of above-mentioned implement scene can be merged into a module, can also be further split into multiple submodule.
Above-mentioned the application sequence number is for illustration only, does not represent the quality of implement scene.
Disclosed above is only several specific implementation scenes of the application, and still, the application is not limited to this, Ren Heben What the technical staff in field can think change should all fall into the protection domain of the application.

Claims (10)

  1. A kind of 1. message forwarding method, applied to the load balancing network being made up of load-balancing device and multiple servers In, the load balancing network corresponds to virtual ip address, it is characterised in that the real ip address of each server and the void It is consistent to intend IP address, each server corresponds to a different management ip address respectively, and includes proxy module, institute respectively The method of stating includes:
    When server receives management of the destination address of the load-balancing device transmission corresponding to the server itself During the message of IP address, management ip address of the server according to corresponding to the server itself and the virtual ip address Corresponding relation, the destination address of the message is revised as by the virtual ip address by the proxy module included by itself;
    The server is handled the amended message of destination address.
  2. 2. the method as described in claim 1, it is characterised in that management ip address corresponding to the server itself with it is described The corresponding relation of virtual ip address, is generated especially by the following manner:
    It is corresponding with the virtual ip address that the server receives the management ip address carried corresponding to the server itself The configuration message of relation information, it is right that the server itself institute is generated in the server local and/or the proxy module The corresponding relation of the management ip address answered and the virtual ip address;Or,
    The server is consulted by the proxy module and the load-balancing device, determines corresponding to the server itself Management ip address and the virtual ip address corresponding relation, and be stored in the server local and/or described act on behalf of mould In block.
  3. 3. the method as described in claim 1, it is characterised in that the server to the amended message of destination address at After reason, in addition to:
    The server generation source address is the response message of the virtual ip address;
    The corresponding relation of management ip address of the server according to corresponding to the server itself and the virtual ip address, Pass through pipe of the proxy module included by itself by the source address modification of the response message corresponding to the server itself Manage IP address;
    Response message after source address modification is sent to described by the server by the proxy module included by itself Load-balancing device, so that the source address modification of the response message is being the virtual ip address by the load-balancing device Afterwards, the response message is forwarded according to the destination address of the response message.
  4. 4. a kind of server, applied in the load balancing network being made up of load-balancing device and multiple servers, institute State the corresponding virtual ip address of load balancing network, it is characterised in that the real ip address of each server and the void It is consistent to intend IP address, each server corresponds to a different management ip address respectively, and the server includes:
    Communication module, for receiving the message transmitted by the load-balancing device;
    Proxy module, the destination address for receiving the load-balancing device transmission when the communication module is the service During the message of the management ip address corresponding to device itself, management ip address and the void according to corresponding to the server itself Intend the corresponding relation of IP address, the destination address of the message is revised as the virtual ip address;
    Processing module, for being handled through the amended message of the proxy module destination address.
  5. 5. server as claimed in claim 4, it is characterised in that the communication module, be additionally operable to:
    Receive the management ip address and the correspondence relationship information of the virtual ip address corresponding to the carrying server itself Message is configured, the management IP corresponding to the server itself is generated in the server local and/or the proxy module Address and the corresponding relation of the virtual ip address;Or,
    Consulted by the proxy module and the load-balancing device, with determining management IP corresponding to the server itself Location and the corresponding relation of the virtual ip address, and be stored in the server local and/or the proxy module.
  6. 6. server as claimed in claim 4, it is characterised in that
    The processing module, it is additionally operable to according to result, generation source address is the response message of the virtual ip address, and will The response message is sent to the proxy module;
    The proxy module, it is additionally operable to receiving the sound that the source address transmitted by the processing module is the virtual ip address When answering message, the corresponding relation of management ip address and the virtual ip address according to corresponding to the server itself, by institute State the management ip address of the source address modification of response message corresponding to the server itself, and by the sound after source address modification Message is answered to be sent to the communication module;
    The communication module, it is additionally operable in the response message after receiving the source address modification transmitted by the proxy module, Response message after the source address modification is sent to the load-balancing device, so that the load-balancing device is by institute State response message source address modification be the virtual ip address after, according to the destination address of the response message forwarding described in Response message.
  7. A kind of 7. message forwarding method, applied to the load balancing network being made up of load-balancing device and multiple servers In, the corresponding virtual ip address of the load balancing network, it is characterised in that the real ip address of each server and institute State that virtual ip address is consistent, each server corresponds to a different management ip address respectively, and includes acting on behalf of mould respectively Block, methods described include:
    It is described when the destination address that the load-balancing device receives client transmission is the message of the virtual ip address Load-balancing device is according to load balancing and the management ip address of each server, the selection processing in the multiple server The destination server of the message;
    The destination address of the message with being revised as the management IP corresponding to the destination server by the load-balancing device Location;
    The amended message of destination address is sent to the proxy module of the destination server by the load-balancing device, so that Management ip address of the proxy module according to corresponding to the destination server itself is corresponding with the virtual ip address to close System, the amended message is restored, and carries out Message processing by the destination server.
  8. 8. method as claimed in claim 7, it is characterised in that the load-balancing device is by the amended message of destination address It is sent to after the proxy module of the destination server, in addition to:
    When the source address that the load-balancing device receives the destination server return is the destination server itself institute During the response message of corresponding management ip address, the source address modification of the response message is described by the load-balancing device Virtual ip address;
    The load-balancing device forwards the response message after source address modification according to the destination address of the response message.
  9. A kind of 9. load-balancing device, applied to the load balancing network being made up of load-balancing device and multiple servers In, the corresponding virtual ip address of the load balancing network, it is characterised in that the real ip address of each server and institute State that virtual ip address is consistent, each server corresponds to a different management ip address respectively, and includes acting on behalf of mould respectively Block, the load-balancing device include:
    Receiving module, for receiving client or the message transmitted by each server;
    Decision-making module, the destination address for receiving client transmission when the receiving module are the report of the virtual ip address Wen Shi, according to load balancing and the management ip address of each server, the selection processing report in the multiple server The destination server of text;
    Address modified module, the destination address of the message for the receiving module to be received are revised as the decision model The management ip address corresponding to destination server selected by block;
    Sending module, for the address modified module progress amended message of destination address to be sent into the purpose service The proxy module of device, so that management ip address of the proxy module according to corresponding to the destination server itself and the void Intend the corresponding relation of IP address, the amended message is restored, and Message processing is carried out by the destination server.
  10. 10. load-balancing device as claimed in claim 9, it is characterised in that
    The receiving module, it is the destination server itself to be additionally operable to receiving the source address that the destination server returns During the response message of corresponding management ip address, the response message is sent to the address modified module;
    The address modified module, it is the destination server to be additionally operable to receiving the source address transmitted by the receiving module During the response message of the management ip address corresponding to itself, by the source address modification of the response message for the virtual IP address Location, and the response message after source address modification is sent to the sending module;
    The sending module, the response message being additionally operable to after the source address modification transmitted by the address modified module is received When, according to the destination address of the response message, forward the response message after the 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 CN104811383A (en) 2015-07-29
CN104811383B true 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)

Families Citing this family (6)

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

Citations (5)

* 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
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4664257B2 (en) * 2006-09-06 2011-04-06 富士通株式会社 Attack detection system and attack detection method

Patent Citations (5)

* 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
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

Also Published As

Publication number Publication date
CN104811383A (en) 2015-07-29

Similar Documents

Publication Publication Date Title
CN104811383B (en) A kind of message forwarding method and equipment
EP3355553B1 (en) Reliable load-balancer using segment routing and real-time application monitoring
JP7281531B2 (en) Multi-cloud connectivity using SRv6 and BGP
US20230283661A1 (en) Coordinating inter-region operations in provider network environments
CN106686085B (en) Load balancing method, device and system
KR101862274B1 (en) Low latency connections to workspaces in a cloud computing environment
US9397946B1 (en) Forwarding to clusters of service nodes
CN109937401A (en) Via the real-time migration for the load balancing virtual machine that business bypass carries out
US11436111B2 (en) Highly-available distributed network address translation (NAT) architecture with failover solutions
US9300731B2 (en) Connection following during network reconfiguration
US9843554B2 (en) Methods for dynamic DNS implementation and systems thereof
US20140280775A1 (en) Network Stack and Related Techniques
KR102540776B1 (en) address migration service
CN109937400A (en) The stream mode of real-time migration for virtual machine transmits
US20150304450A1 (en) Method and apparatus for network function chaining
CN104618243B (en) Method for routing, apparatus and system, Scheduling of Gateway method and device
JP2016509822A (en) Ethernet packet forwarding
CN109525684A (en) Message forwarding method and device
JP6693925B2 (en) Server, communication control system, and communication control method
CN110324244A (en) A kind of method for routing and server based on Linux virtual server
JP2024507143A (en) Scaling IP addresses in overlay networks
JP2024507142A (en) Cloud infrastructure resources for connecting service provider private networks to customer private networks
JP2017173995A (en) Server device, cloud system, and web application switching method
CN116962490A (en) Thermomigration method, first network element, service device, communication system and storage medium

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

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.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant