CN107948087A - A kind of method and apparatus of load balancing - Google Patents
A kind of method and apparatus of load balancing Download PDFInfo
- Publication number
- CN107948087A CN107948087A CN201711287522.4A CN201711287522A CN107948087A CN 107948087 A CN107948087 A CN 107948087A CN 201711287522 A CN201711287522 A CN 201711287522A CN 107948087 A CN107948087 A CN 107948087A
- Authority
- CN
- China
- Prior art keywords
- interchanger
- message
- server
- path
- group service
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/12—Avoiding congestion; Recovering from congestion
- H04L47/125—Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L49/00—Packet switching elements
- H04L49/25—Routing or path finding in a switch fabric
- H04L49/252—Store and forward routing
Abstract
The invention discloses a kind of method and apparatus of load balancing, message to be sorted out is received the described method includes interchanger, wherein, the purpose internet protocol address that the message to be sorted out carries is the address of the server in cluster;The message to be sorted out is included into the group service stream of classification corresponding with the transmission information by the transmission information that interchanger message to be sorted out according to carries;The interchanger determines the forward-path of the group service stream according to the mapping relations between the classification and forward-path of the group service stream pre-established;Interchanger message to be sorted out according to definite forward-path forwarding.
Description
Technical field
The present invention relates to switch technology field, more particularly to a kind of method and apparatus of load balancing.
Background technology
In the prior art, in business data flow after interchanger is entered, interchanger searches road with the destination IP of Business Stream
Cluster VIP forwardings are found by table and export corresponding ECMP groups, interchanger is selected according to the hash value that the feature calculation of Business Stream goes out
After the corresponding ECMP Entry in outlet that Business Stream will export, the output interface and envelope of NHOP acquisition of information data flows are indexed
Information is filled, and then business data flow is sent to corresponding cluster server.
Then, it is upper use interchanger as load-balancing device meeting problem is encountered that, when the service being connected with interchanger
When device quantity changes such as a certain server is delayed machine or dilatation, since the Hash of specific stream is constant, and can be forwarded in cluster
Number of path Path_Number will change, then, interchanger will recalculate the forward-path of each data flow
Forward Path, the forward-path of each data flow finally obtained will may change, such as originally be balanced to A outlets
The data flow of server X, at this time can rebalancing method to B output port server Y, since most IP services are Transmission Control Protocol, A at this time
Flowing corresponding source terminal equipment needs to be connected with server B again vertical TCP, and re-establishing the process of TCP connections can cause entirely
There is of short duration interruption in Business Stream, and this process influences the forwarding of all business data flows, and then all business numbers occurs
According to the short interruptions problem of stream.
So in the prior art, easily occurs the technical problem of short interruption when traffic data forwards.
The content of the invention
The embodiment of the present invention provides a kind of method and apparatus of load balancing, for solving in the prior art, in Business Stream
Easily occurs the technical problem of short interruption during data forwarding.
For this reason, concrete technical scheme provided in an embodiment of the present invention is as follows:
A kind of method of load balancing, including:
Interchanger receives message to be sorted out, wherein, the purpose Internet protocol IP that the message to be sorted out carries
Location is the address of the server in cluster;
The transmission information that interchanger message to be sorted out according to carries the message to be sorted out is included into and
The transmission information corresponds to the group service stream of classification;
The interchanger is determined according to the mapping relations between the classification and forward-path of the group service stream pre-established
The forward-path of the group service stream;
Interchanger message to be sorted out according to definite forward-path forwarding.
Optionally, in the interchanger according to the mapping between the classification and forward-path of the group service stream pre-established
Relation, before the forward-path for determining the group service stream, further includes:
The interchanger receives test packet, and the test transmission message identification that the test packet is used to be carried according to it is each
The classification of group service stream;
The interchanger carries out equalization algorithm computing using the test packet, obtains turning for all kinds of group service streams respectively
Send out path;
The interchanger establishes the mapping relations between all kinds of group service streams and its forward-path.
Optionally, the interchanger establishes the mapping relations between all kinds of group service streams and its forward-path, including:
The interchanger establishes the flow table Flow ID of corresponding unique mark for all kinds of group service streams respectively;
Established according to the forward-path of the flow table Flow ID and all kinds of group service streams of acquisition and represent all kinds of
The forwarding-table item of mapping relations between group service stream and its forward-path.
Optionally, before interchanger message to be sorted out according to definite forward-path forwarding, including:
When the first server that the interchanger is determined in the cluster is in active state;
The next-hop mark of first server in active state is updated to forward by the interchanger, wherein, institute
Interchanger is stated to be forwarded to the forwarding outlet in forward-path in the first server for the message of the first server.
Optionally, before interchanger message to be sorted out according to definite forward-path forwarding, including:
When the first server that the interchanger is determined in the cluster is in an inactive state and second server is in
Active state;
The interchanger is filled using the forwarding information of the second server and an inactive state is in the cluster
The next-hop mark of first server, wherein, the forwarding outlet in forward-path is the first server by the interchanger
Message be forwarded to the second server.
Optionally, after interchanger message to be sorted out according to definite forward-path forwarding, including:
If the interchanger does not receive any sort group service stream in all kinds of group service streams again in preset duration
When the message sorted out, then the interchanger deletes any sort group service stream.
Optionally, the transport packet includes at least one following:The source address of message, purpose IP address, destination
Slogan and IP protocol type.
On the other hand, the embodiment of the present invention additionally provides a kind of switch device, including:
Transceiver module, for receiving message to be sorted out, wherein, the purpose internet protocol that the message to be sorted out carries
View IP address is the address of the server in cluster;
Flow point class Flow Classify modules, for the transmission information that message to be sorted out according to carries by described in
Message to be sorted out is included into the group service stream of classification corresponding with the transmission information;
Message domain handles Field Process modules, for the classification according to the group service stream pre-established and forwarding
Mapping relations between path, determine the forward-path of the group service stream;
Next hop information NHOP modules, for message to be sorted out according to definite forward-path forwarding.
Optionally, the Flow Classify modules are used for:
Test packet is received, the test packet is used to transmit each group service stream of message identification according to the test of its carrying
Classification;
Equalization algorithm computing is carried out using the test packet, obtains the forward-path of all kinds of group service streams respectively;
Establish the mapping relations between all kinds of group service streams and its forward-path.
Optionally, the Field Process modules, are used for:
The interchanger establishes the flow table Flow ID of corresponding unique mark for all kinds of group service streams respectively;
Established according to the forward-path of the flow table Flow ID and all kinds of group service streams of acquisition and represent all kinds of
The forwarding-table item of mapping relations between group service stream and its forward-path.
Optionally, the Integrated Management Module is used for:
When the first server in the definite cluster is in active state;
The next-hop mark of first server in active state is updated to forward, wherein, the interchanger will
Forwarding outlet in forward-path is forwarded in the first server for the message of the first server.
Optionally, the Integrated Management Module is used for:
When determining that the first server in the cluster is in an inactive state and second server is in active state;
The first server that an inactive state is in the cluster is filled using the forwarding information of the second server
Next-hop mark, wherein, the interchanger will in forward-path forwarding outlet for the first server message forward
To the second server.
Optionally, the Integrated Management Module is used for:
If the transceiver module does not receive any sort group service in all kinds of group service streams again in preset duration
Stream when the message sorted out passes, then delete any sort group service stream.
On the other hand, the embodiment of the present invention additionally provides a kind of computer-readable recording medium:
The computer-readable recording medium storage has computer instruction, when the computer instruction is run on computers
When so that computer performs the method as any one of claim 1-7.
Said one or multiple technical solutions in the embodiment of the present invention, at least have following one or more technology effects
Fruit:
, can be according to cluster when interchanger receives group service stream due to the technical solution in the embodiment of the present invention
Source address, purpose internet protocol address, destination slogan and the IP protocol type for the message that message carries in Business Stream
Message is sorted out, while interchanger has pre-established the mapping between the classification of each type of cluster Business Stream and forward-path
Relation so that interchanger can directly determine the forward-path namely software of each type of cluster Business Stream according to the mapping relations
Routing, it is not necessary to balancing operational is carried out to the group service stream that receives every time and determines forward-path, so, would not occur because
During to transfer the change of mouthful number in cluster (such as delay machine or dilatation), cause to re-start balancing operational determine forward-path with it is former
Forward-path is different, and exchanging needs the process for re-establishing TCP sessions that all business in cluster can be caused short interruption, shadow occur
Ring the message forwarding situation in all group service stream.So effective solve in the prior art, to forward in traffic data
There is the technical problem of short interruption in Shi Rongyi, has a case that short interruption occur when can reduce traffic data forwarding
Beneficial effect.
Simultaneously as interchanger can be according to the classification for having pre-established each type of cluster Business Stream in the embodiment of the present invention
Mapping relations between forward-path, directly determine the forward-path of each type of cluster Business Stream, compared with prior art in
Often receive a message to be required for calculating its forward-path, there is the forward efficiency of higher.
Further, since in the embodiment of the present invention, when a certain server in the cluster is unavailable, lived using being in cluster
Server of the forwarding information filling in inactive state of the server of jump state, so that forward-path is inactive
The message of server can be forwarded in active server, into turning for the message without influencing to be forwarded to inactive server
Hair, so, the forward efficiency of the message further improved.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, embodiment will be described below
Needed in attached drawing be briefly described, it should be apparent that, drawings in the following description be only the present invention some
Embodiment.
Fig. 1 is a kind of flow chart of load balancing provided in an embodiment of the present invention;
Fig. 2 is the specific implementation flow chart that can also carry out some steps in the embodiment of the present invention;
Fig. 3 is the specific implementation flow chart step of step S204 in the embodiment of the present invention
Fig. 4 is the specific implementation flow chart that can also carry out other steps in the embodiment of the present invention;
Fig. 5 is the specific implementation flow chart that can also carry out still other step in the embodiment of the present invention;
Fig. 6 is a kind of structure diagram of switch device provided in an embodiment of the present invention.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme is clearly and completely described, it is clear that described embodiment is skill of the present invention
The part of the embodiment of art scheme, instead of all the embodiments.It is general based on the embodiment described in file of the present invention, this area
Logical technical staff all other embodiments obtained without creative efforts, belong to the technology of the present invention side
The scope of case protection.
Please refer to Fig.1, be a kind of method of load balancing provided in an embodiment of the present invention, including:
Step S101:Interchanger receives message to be sorted out, wherein, the purpose internet that the message to be sorted out carries
Protocol IP address is the address of the server in cluster;
Step S102:The transmission information that interchanger message to be sorted out according to carries is by the report to be sorted out
Text is included into the group service stream of classification corresponding with the transmission information;
Step S103:The interchanger is according to the mapping between the classification and forward-path of the group service stream pre-established
Relation, determines the forward-path of the group service stream;
Step S104:Interchanger message to be sorted out according to definite forward-path forwarding.
The above-mentioned load-balancing method provided in the embodiment of the present invention is mainly used in interchanger, in concrete practice process
In, step S101 is first carried out in the above-mentioned load-balancing method in the embodiment of the present invention:Interchanger receives message to be sorted out, its
In, the purpose internet protocol address that the message to be sorted out carries is the address of the server in cluster, is then held again
Row step S102:The message to be sorted out is included into by the transmission information that interchanger message to be sorted out according to carries
The group service stream of classification corresponding with the transmission information,
In practical applications, interchanger includes flow point class Flow Classify modules, message domain processing Field
Process modules and next hop information NHOP modules, include one or more messages when customer service end equipment is sent to interchanger
Business Stream when, interchanger can just receive the Business Stream.In embodiments of the present invention, the Flow in interchanger
Classify module abbreviation FC modules can also filter out the collection in Business Stream first according to the purpose IP address of message in Business Stream
Group business stream, namely purpose IP address is that the message of the VIP of server in cluster just belongs to group service stream in Business Stream, so
Afterwards, the source address for the transmission information such as message that the FC modules in interchanger are carried further according to message in group service stream, destination
Slogan and IP protocol type are sorted out the message in the group service stream, therefore, the business that above-mentioned interchanger receives
Purpose IP address is that the message of the VIP of server in cluster can be described as message to be sorted out again in stream.
In practical applications, before interchanger carries out message forwarding, can be configured on switches by administrator in advance
The information of server in the cluster being connected with interchanger, the information of configuration include the VIP address informations of server in cluster, collection
The physical IP address of each server and the protocol information of server service in group, wherein, the protocol information of service includes:
IP protocol type and destination slogan, then, the FC modules in interchanger can be according to the above-mentioned cluster server of configured in advance
Information, make the rule classified for the transmission information carried according to the message in the group service stream that receives.
It is supposed that FC moulds rule group table Flow Group in the block are configured with two rules of Flow X and Flow Y,
Wherein, Flow X rules are used to identify the report of the Web (Transmission Control Protocol destination interface 80) that destination IP is VIP1 in group service stream
Text, and according to identify destination IP be VIP1 message entrained by message source address, destination slogan and IP agreement class
Type is sorted out message;Flow Y rules are used to identify FPT (the Transmission Control Protocol purposes that destination IP is VIP2 in group service stream
Port 21) message, and according to the destination IP identified be VIP2 message entrained by message source address, destination slogan
And IP protocol type is sorted out message.
It is supposed that the message in the group service stream that interchanger receives includes source address for A i.e. SIP=A, destination IP
Address is VIP1 i.e. DIP=VIP1, IP protocol type TCP, destination slogan is 80 namely DPORT=80, source port number
(the first message here can represent to meet source address as A i.e. SIP=A, purpose IP address to the first message of SPROT=1025
For VIP1, that is, DIP=VIP1, IP protocol type TCP, destination slogan is 80 namely DPORT=80, source port number SPROT=
1025 one or more message to be sorted out).
Message in the group service stream that interchanger receives further includes SIP=B, DIP=VIP1, IP protocol type is
TCP, DPORT=80, SPROT=1025 the second message (likewise, the second message here can represent to meet SIP=B,
DIP=VIP1, the one or more of IP protocol type TCP, DPORT=80, SPROT=1025 message to be sorted out), and
Including SIP=C, DIP=VIP2, IP protocol type TCP, DPORT=21, SPROT=1025 the 3rd message (likewise,
Here the 3rd message can be that expression meets SIP=C, DIP=VIP2, IP protocol type TCP, DPORT=21, SPROT
=1025 one or more message to be sorted out).
So, the Flow X rules that interchanger FC modules are configured according to Flow Group identify that purpose IP address is VIP1
The first message and the second message after, it is possible to source address A, destination slogan 80 and the IP carried according to the first message is assisted
Discuss type TCP and the first message is sorted out into first kind group service stream, according to the source address B of the second message carrying, destination slogan
Second message is sorted out the second type of cluster Business Stream by 80 and IP protocol type TCP;Interchanger FC modules are according to Flow Group
The Flow Y rules of configuration are identified after the 3rd message that purpose IP address is VIP2, it is possible to are carried according to the 3rd message
3rd message is sorted out three classes group service stream by source address C, destination slogan 21 and IP protocol type TCP.
Method in the embodiment of the present invention carries out step S103, Ye Jisuo after above-mentioned steps S102 has been performed
Interchanger is stated according to the mapping relations between the classification and forward-path of the group service stream pre-established, determines the cluster industry
The forward-path of business stream.
That is, sort out second by the first message classification first kind group service stream, by the second message in interchanger FC modules
Type of cluster Business Stream and by the 3rd message sort out three classes group service stream after, interchanger can be according to default cluster
Mapping relations between the classification and forward-path of Business Stream, determine respectively first kind group service stream forward-path, really
Make the forward-path of the second type of cluster Business Stream and the forward-path of three classes group service stream.
Please refer to Fig.2, in practical applications, interchanger can be following by performing before above-mentioned steps S103 is performed
Step, pre-establishes the mapping relations between the classification of group service stream and forward-path:
Step S201:The interchanger receives test packet, and the test packet is used to be transmitted according to the test of its carrying
The classification of each group service stream of message identification;
Step S202:The interchanger carries out equalization algorithm computing using the test packet, obtains each type of cluster respectively
The forward-path of Business Stream;
Step S203:The interchanger establishes the mapping relations between all kinds of group service streams and its forward-path.
Namely interchanger is connected on and receives when meeting the test packet for being included into first kind group service stream, interchanger FC modules
In Flow Action can will meet and be included into the test report of first kind group service stream and be transferred to integrated management in interchanger
In module, which includes CPU processor, and Integrated Management Module can be using the test packet as equalization algorithm
The input factor carries out accounting method computing, and then obtains the forward-path of first kind group service stream, for sake of convenience, by acquisition
The forward-path of first kind group service stream is known as the first forward-path, and it is cluster to assume that the forwarding of the first forward-path exports
In first server.
Receive when meeting the test packet for being included into the second type of cluster Business Stream, exchange likewise, interchanger is connected on
Machine FC moulds Flow Action in the block will meet the test packet that is included into the second type of cluster Business Stream and be transferred in interchanger
Integrated Management Module in, which account method as the input factor of equalization algorithm and transports by Integrated Management Module
Calculate, and then obtain the forward-path of the second type of cluster Business Stream, for sake of convenience, by the second type of cluster Business Stream of acquisition
Forward-path be known as the second forward-path, and assume that the forwarding port of the second forward-path is the second server in cluster;
Interchanger receive meet the test packet for being included into the three classes group service stream when, in interchanger FC modules
The Flow Action integrated management that will meet the test packet that is included into the three classes group service stream and be transferred in interchanger
In module, Integrated Management Module carries out accounting method computing using the test packet as the input factor of equalization algorithm, and then obtains
The forward-path of the three classes group service stream, for sake of convenience, by the forward-path of the three classes group service stream of acquisition
Referred to as the 3rd forward-path, and the forwarding port of the 3rd forward-path of hypothesis is the 3rd server in cluster.
Then, interchanger FC modules can be established each according to the forward-path of each type of cluster Business Stream of acquisition
The forward-path of type of cluster Business Stream and the mapping relations between its own, please refer to Fig.3, in practical applications, above-mentioned steps
S204 can also be implemented in the following way:
Step S301:The interchanger establishes the flow table of corresponding unique mark for all kinds of group service streams respectively
Flow ID;
Step S302:Built according to the forward-path of the flow table Flow ID and all kinds of group service streams of acquisition
The vertical forwarding-table item for representing the mapping relations between all kinds of group service streams and its forward-path.
In practical applications, interchanger FC modules can be respectively first kind group service stream, the second type of cluster Business Stream
And three classes group service stream establishes unique mark flow table Flow ID, here, suppose that established for first kind group service stream
Unique mark flow table is Flow X-1, and the unique mark flow table established for the second type of cluster Business Stream is Flow X-2, is the 3rd
The unique mark flow table that type of cluster Business Stream is established is Flow Y-1, then, switch cluster management module can establish bag
Include between the unique mark flow table Flow X-1 of first kind group service stream and the first forward-path mutually mapping, the second type of cluster
Mutually mapping and three classes group service stream between the unique mark flow table Flow X-2 of Business Stream and the second forward-path
The FP forwarding-table items mutually mapped between unique mark flow table Flow Y-1 and the 3rd forward-path, FP forwarding-table items just include
Mapping relations between the classification and forward-path of group service stream namely including the collection pre-established described in step S103
Mapping relations between the classification and forward-path of group business stream.
In practical applications, switch cluster management module, can be by the FP forwarding-table items after FP forwarding-table items are established
The Field Process module abbreviation FP modules being transferred in interchanger, so that FP modules can be by matching each type of cluster
The flow table Flow ID of Business Stream, determine the corresponding forward-path of each type of cluster Business Stream, specifically, in interchanger FC moulds
Above-mentioned first message sorted out first kind group service stream by block, the second message is sorted out to the second type of cluster Business Stream and by the 3rd
After message sorts out three classes group service stream, interchanger Field Process modules can be according in the FP forwarding-table items
The flow table Flow ID of each type of cluster Business Stream and the mapping relations of forward-path, determine respectively corresponding with Flow X-1
The first forward-path, first forward-path just be first kind group service stream forward-path;Determine and Flow X-2
Corresponding second forward-path, second forward-path are just the forward-path of the second type of cluster Business Stream;And determine with
Corresponding 3rd forward-paths of Flow Y-1, the 3rd forward-path are just the forward-path of three classes group service stream, then,
Interchanger can perform step S104, namely the report that the interchanger is to be sorted out according to definite forward-path forwarding
Text.
Please refer to Fig.4, in practical applications, interchanger can also carry out following step before above-mentioned steps S104 is performed
Suddenly:
Step S401:When the first server that the interchanger is determined in the cluster is in active state;
Step S402:The next-hop mark of first server in active state is updated to turn by the interchanger
Hair, wherein, the forwarding outlet in forward-path is forwarded to described first by the interchanger for the message of the first server
In server.
Namely the forward-path of first kind group service stream is forwarded according to the first forward-path, according to second turn in interchanger
Before sending out path forwarding road the second type of cluster Business Stream and forwarding three classes group service stream according to the 3rd forward-path, hand over
ARP request can be sent to determine each clothes in cluster by each server of the active ARP protocol active into cluster by changing planes
It is engaged in the active state of device, each server, will be anti-to interchanger after the ARP request of interchanger transmission is received in cluster
Present respective active state.
It is supposed that the first server, second server and the 3rd server in cluster are in active state, this
When, the next-hop NHOP marks for the active state that first server is characterized in interchanger NHOP modules will be updated to by interchanger
Fowarding, the next-hop NHOP for the active state that second server will be characterized in interchanger NHOP modules can be forwarded to identify more
New is the next-hop for the active state that can be forwarded Fowarding and the 3rd server will be characterized in interchanger NHOP modules
NHOP marks are updated to that Fowarding can be forwarded.
Then, interchanger can input the first forwarding road in the corresponding NHOP list items of NHOP moulds first server in the block
Forwarding outlet namely the MAC Address of first server and first server in footpath, so that interchanger can be according to the
The message being included into first kind group service stream is forwarded in first server by one forward-path;Likewise, interchanger can be with
The forwarding outlet namely second in the second forward-path is inputted in the corresponding NHOP list items of NHOP moulds second server in the block
The MAC Address of server and second server, so that interchanger can will be included into the second class according to the second forward-path
The second message in group service stream is forwarded in second server;Likewise, interchanger can be in NHOP moulds the in the block 3rd
The forwarding outlet in the 3rd forward-path namely the 3rd server and the 3rd service are inputted in the corresponding NHOP list items of server
The MAC Address of device, and then the 3rd message for being included into three classes group service stream is forwarded in the 3rd server.
Fig. 5 is refer to, in practical applications, can also deposit has one or more server to be in sluggish shape in the cluster
The situation of state, at this moment, interchanger can also carry out following steps:
Step S403:When the first server that the interchanger is determined in the cluster is in an inactive state and the second clothes
Business device is in active state;
Step S404:The interchanger is filled in the cluster using the information of the second server and is in inactive shape
The next-hop mark of the first server of state, wherein, the forwarding outlet in forward-path is the described first clothes by the interchanger
The message of business device is forwarded to the second server.
It is supposed that second server in cluster is in an inactive state, first server and the 3rd server are equal
In active state, then, interchanger is just capable of the feedback of first server, determines that first server is in active state,
According to the feedback of second server, determine that second server is in an inactive state, determined according to the feedback of the 3rd server
Go out the 3rd server and be in active state.
At this moment, interchanger will will characterize the next-hop NHOP of the active state of first server in interchanger NHOP modules
Mark is updated to that Fowarding can be forwarded, and then, interchanger can be in the corresponding NHOP tables of NHOP moulds first server in the block
Forwarding outlet namely the MAC Address of first server and first server in the first forward-path are inputted in, and then is made
Interchanger is obtained the message being included into first kind group service stream can be forwarded in first server according to the first forward-path.
Likewise, interchanger will will characterize the next-hop of the active state of the 3rd server in interchanger NHOP modules
NHOP marks are updated to that Fowarding can be forwarded, and then, interchanger can be corresponding in NHOP moulds the 3rd server in the block
Forwarding outlet namely the MAC Address of the 3rd server and the 3rd server in the 3rd forward-path are inputted in NHOP list items,
So that the message for being included into three classes group service stream can be forwarded to the 3rd service by interchanger according to the 3rd forward-path
In device.
Since second server is in disabled state, and at this moment exchange opportunity will characterize second in interchanger NHOP modules
The next-hop NHOP marks of the active state of server are filled out with the forwarding information for the server that active state is in cluster
Fill, here, suppose that first server of the selection in active state, then, interchanger will characterize the second clothes in NHOP modules
That first server is filled in the next-hop NHOP marks of the active state of business device forwards Fowarding information, this can be forwarded
Fowarding information includes first server and the connectivity port of interchanger and the MAC Address of first server, then, hands over
The forwarding outlet in the first forward-path can be inputted in the corresponding NHOP list items of NHOP moulds second server in the block by changing planes
Namely first server, so that the report that interchanger can will be included into the second type of cluster Business Stream according to the second forward-path
Text is forwarded in the first server in active state.
In practical application, the embodiment of the present invention can also carry out following steps after above-mentioned steps S104 has been performed:
If the interchanger does not receive any sort group service stream in all kinds of group service streams again in preset duration
Wait sort out when, then the interchanger deletes any sort group service stream.
That is, in practical applications, a preset duration can be set such as 1 minute, and 30 seconds, 10 minutes etc., when interchanger exists
Do not received again in preset duration meet the message for being included into first kind group service stream pass when, show to meet at this time and be included into institute
The message handling service for stating first kind group service stream has terminated, it is possible to will be used to identify that the Flow of first kind group service stream
First kind group service stream and the correspondence of Flow X-1 are deleted in X-1, and forwarding-table item, to save the appearance in interchanger
The purpose of amount.
Likewise, meet the report for being included into the second type of cluster Business Stream when interchanger does not receive again in preset duration
When text passes, show that meeting the message handling service for being included into the second type of cluster Business Stream at this time has terminated, it is possible to will be used for
The Flow X-2 of the second type of cluster Business Stream are identified, and the second type of cluster Business Stream is corresponding with Flow X-2 in forwarding-table item
Relation is deleted, to save the purpose of the capacity in interchanger.
When interchanger does not receive again in preset duration meets the message for being included into three classes group service stream biography,
Show that meeting the message handling service for being included into the three classes group service stream at this time has terminated, it is possible to will be used to identify that the 3rd
The Flow Y-1 of type of cluster Business Stream, and three classes group service stream and the correspondence of Flow Y-1 are deleted in forwarding-table item
Remove, to save the purpose of the capacity in interchanger.
So the method for above-mentioned load balancing provided in an embodiment of the present invention, when interchanger receives group service stream,
The source address of message that can be carried according to message in group service stream, purpose internet protocol address, destination slogan with
And IP protocol type is sorted out message, while interchanger has pre-established classification and the forwarding road of each type of cluster Business Stream
Mapping relations between footpath so that interchanger can directly determine the forwarding of each type of cluster Business Stream according to the mapping relations
Path namely software routing, it is not necessary to balancing operational is carried out to the group service stream received every time and determines forward-path, so,
Would not occur because when transferring the change of mouthful number in cluster (such as delay machine or dilatation), cause to re-start balancing operational and determine
Forward-path is different from former forward-path, and exchange needs the process for re-establishing TCP sessions that all business in cluster can be caused to go out
Existing short interruption, influences the message forwarding situation in all group service stream.So effective solution is in the prior art,
Easily there is the technical problem of short interruption when forwarding in traffic data, short with occurring when can reduce traffic data forwarding
The beneficial effect of situation about temporarily interrupting.
Simultaneously as interchanger can be according to the classification for having pre-established each type of cluster Business Stream in the embodiment of the present invention
Mapping relations between forward-path, directly determine the forward-path of each type of cluster Business Stream, compared with prior art in
Often receive message successively to be required for calculating its forward-path, there is the forward efficiency of higher.
Further, since in the embodiment of the present invention, when a certain server in the cluster is unavailable, lived using being in cluster
Server of the forwarding information filling in inactive state of the server of jump state, so that forward-path is inactive
The message of server can be forwarded in active server, into turning for the message without influencing to be forwarded to inactive server
Hair, so, the forward efficiency of the message further improved.
Based on same inventive concept, a kind of switch device, the load balancing of the equipment are provided in the embodiment of the present invention
Method specific implementation can be found in above method embodiment part description, overlaps will not be repeated, refer to Fig. 6, should
Equipment includes:
Transceiver module 10, for receiving message to be sorted out, wherein, the purpose internet that the message to be sorted out carries
Protocol IP address is the address of the server in cluster;
Flow point class Flow Classify modules 11, for the transmission information that the message to be sorted out according to carries by institute
State the group service stream that message to be sorted out is included into classification corresponding with the transmission information;
Message domain processing Field Process modules 12, for the classification according to the group service stream pre-established with turning
The mapping relations between path are sent out, determine the forward-path of the group service stream;
Next hop information NHOP modules 13, for message to be sorted out according to definite forward-path forwarding.
Optionally, the Flow Classify modules are used for:
Test packet is received, the test packet is used to transmit each group service stream of message identification according to the test of its carrying
Classification;
Equalization algorithm computing is carried out using the test packet, obtains the forward-path of all kinds of group service streams respectively;
Establish the mapping relations between all kinds of group service streams and its forward-path.
Optionally, the Field Process modules, are used for:
The interchanger establishes the flow table Flow ID of corresponding unique mark for all kinds of group service streams respectively;
Established according to the forward-path of the flow table Flow ID and all kinds of group service streams of acquisition and represent all kinds of
The forwarding-table item of mapping relations between group service stream and its forward-path.
Optionally, the Integrated Management Module is used for:
When the first server in the definite cluster is in active state;
The next-hop mark of first server in active state is updated to forward, wherein, the interchanger will
Forwarding outlet in forward-path is forwarded in the first server for the message of the first server.
Optionally, the Integrated Management Module is used for:
When determining that the first server in the cluster is in an inactive state and second server is in active state;
The first server that an inactive state is in the cluster is filled using the forwarding information of the second server
Next-hop mark, wherein, the interchanger will in forward-path forwarding outlet for the first server message forward
To the second server.
Optionally, the Integrated Management Module is used for:
If the transceiver module does not receive any sort group service in all kinds of group service streams again in preset duration
Stream wait sort out when, then delete any sort group service stream.
Optionally, the transport packet includes at least one following:The source address of message, purpose IP address, destination
Slogan and IP protocol type.
Based on same inventive concept, a kind of computer-readable recording medium is provided in the embodiment of the present invention:
The computer-readable recording medium storage has computer instruction, when the computer instruction is run on computers
When so that computer performs a kind of method of load balancing as described above.
It should be understood by those skilled in the art that, the embodiment of the present invention can be provided as method, system or computer program
Product.Therefore, the present invention can use the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware
Apply the form of example.Moreover, the present invention can use the computer for wherein including computer usable program code in one or more
The shape for the computer program product that usable storage medium is implemented on (including but not limited to magnetic disk storage and optical memory etc.)
Formula.
The present invention be with reference to according to the method for the embodiment of the present invention, the flow of equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that it can be realized by computer program instructions every first-class in flowchart and/or the block diagram
The combination of flow and/or square frame in journey and/or square frame and flowchart and/or the block diagram.These computer programs can be provided
The processors of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce
A raw machine so that the instruction performed by computer or the processor of other programmable data processing devices, which produces, to be used in fact
The device for the function of being specified in present one flow of flow chart or one square frame of multiple flows and/or block diagram or multiple square frames.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which produces, to be included referring to
Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or
The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted
Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, thus in computer or
The instruction performed on other programmable devices is provided and is used for realization in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in a square frame or multiple square frames.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art
God and scope.In this way, if these modifications and changes of the present invention belongs to the scope of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to comprising including these modification and variations.
Claims (15)
- A kind of 1. method of load balancing, it is characterised in that including:Interchanger receives message to be sorted out, wherein, the purpose internet protocol address that the message to be sorted out carries is The address of server in cluster;The transmission information that interchanger message to be sorted out according to carries by the message to be sorted out be included into it is described Transmission information corresponds to the group service stream of classification;The interchanger determines described according to the mapping relations between the classification and forward-path of the group service stream pre-established The forward-path of group service stream;Interchanger message to be sorted out according to definite forward-path forwarding.
- 2. the method as described in claim 1, it is characterised in that in the interchanger according to the group service stream pre-established Mapping relations between classification and forward-path, before the forward-path for determining the group service stream, further include:The interchanger receives test packet, and the test packet is used to transmit each cluster of message identification according to the test of its carrying The classification of Business Stream;The interchanger carries out equalization algorithm computing using the test packet, obtains the forwarding road of all kinds of group service streams respectively Footpath;The interchanger establishes the mapping relations between all kinds of group service streams and its forward-path.
- 3. method as claimed in claim 2, it is characterised in that the interchanger establishes all kinds of group service streams and forwards road with it Mapping relations between footpath, including:The interchanger establishes the flow table Flow ID of corresponding unique mark for all kinds of group service streams respectively;Established according to the forward-path of the flow table Flow ID and all kinds of group service streams of acquisition and represent each type of cluster The forwarding-table item of mapping relations between Business Stream and its forward-path.
- 4. such as the method any one of claim 1-4, it is characterised in that in the interchanger according to definite forwarding road Before message to be sorted out described in the forwarding of footpath, including:When the first server that the interchanger is determined in the cluster is in active state;The next-hop mark of first server in active state is updated to forward by the interchanger, wherein, the friendship Change planes and be forwarded to the forwarding outlet in forward-path in the first server for the message of the first server.
- 5. such as the method any one of claim 1-4, it is characterised in that in the interchanger according to definite forwarding road Before message to be sorted out described in the forwarding of footpath, including:It is in active when the first server that the interchanger is determined in the cluster is in an inactive state and second server State;The interchanger is filled using the forwarding information of the second server and the first of an inactive state is in the cluster The next-hop mark of server, wherein, report of the interchanger by the forwarding outlet in forward-path for the first server Text is forwarded to the second server.
- 6. such as the method any one of claim 1-4, it is characterised in that the interchanger is according to definite forward-path After message to be sorted out described in forwarding, including:If the interchanger does not receive treating for any sort group service stream in all kinds of group service streams again in preset duration During the message of classification, then the interchanger deletes any sort group service stream.
- 7. such as the method any one of claim 1-4, it is characterised in that the transport packet includes following at least one :Source address, purpose IP address, destination slogan and the IP protocol type of message.
- A kind of 8. switch device, it is characterised in that including:Transceiver module, for receiving message to be sorted out, wherein, the purpose Internet protocol IP that the message to be sorted out carries Address is the address of the server in cluster;Flow point class Flow Classify modules, the transmission information carried for message to be sorted out according to are waited to return by described The message of class is included into the group service stream of classification corresponding with the transmission information;Message domain handles Field Process modules, for the classification and forward-path according to the group service stream pre-established Between mapping relations, determine the forward-path of the group service stream;Next hop information NHOP modules, for message to be sorted out according to definite forward-path forwarding.
- 9. equipment as claimed in claim 7, it is characterised in that the Flow Classify modules are used for:Test packet is received, the test packet is used for the class of test transmission each group service stream of message identification according to its carrying Not;Equalization algorithm computing is carried out using the test packet, obtains the forward-path of all kinds of group service streams respectively;Establish the mapping relations between all kinds of group service streams and its forward-path.
- 10. equipment as claimed in claim 8, it is characterised in that the Field Process modules, are used for:The interchanger establishes the flow table Flow ID of corresponding unique mark for all kinds of group service streams respectively;Established according to the forward-path of the flow table Flow ID and all kinds of group service streams of acquisition and represent each type of cluster The forwarding-table item of mapping relations between Business Stream and its forward-path.
- 11. such as the equipment any one of claim 8-10, it is characterised in that the Integrated Management Module is used for:When the first server in the definite cluster is in active state;The next-hop mark of first server in active state is updated to forward, wherein, the interchanger will forward Forwarding outlet in path is forwarded in the first server for the message of the first server.
- 12. such as the equipment any one of claim 8-10, it is characterised in that the Integrated Management Module is used for:When determining that the first server in the cluster is in an inactive state and second server is in active state;Filled using the forwarding information of the second server in the cluster under the first server in an inactive state One jumps mark, wherein, the forwarding outlet in forward-path is forwarded to institute by the interchanger for the message of the first server State second server.
- 13. such as the equipment any one of claim 8-10, it is characterised in that the Integrated Management Module is used for:If the transceiver module does not receive any sort group service stream in all kinds of group service streams again in preset duration When the message sorted out passes, then any sort group service stream is deleted.
- 14. such as the equipment any one of claim 8-10, it is characterised in that the transport packet include it is following at least One:Source address, purpose IP address, destination slogan and the IP protocol type of message.
- A kind of 15. computer-readable recording medium, it is characterised in that:The computer-readable recording medium storage has computer instruction, when the computer instruction is run on computers, So that computer performs the method as any one of claim 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711287522.4A CN107948087A (en) | 2017-12-07 | 2017-12-07 | A kind of method and apparatus of load balancing |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711287522.4A CN107948087A (en) | 2017-12-07 | 2017-12-07 | A kind of method and apparatus of load balancing |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107948087A true CN107948087A (en) | 2018-04-20 |
Family
ID=61946181
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711287522.4A Pending CN107948087A (en) | 2017-12-07 | 2017-12-07 | A kind of method and apparatus of load balancing |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107948087A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108768878A (en) * | 2018-06-06 | 2018-11-06 | 北京奇艺世纪科技有限公司 | A kind of SiteServer LBS, method, apparatus and load-balancing device |
CN109587062A (en) * | 2018-12-07 | 2019-04-05 | 北京金山云网络技术有限公司 | Load-balancing information synchronous method, apparatus and processing equipment |
CN111884950A (en) * | 2020-07-27 | 2020-11-03 | 深圳市信锐网科技术有限公司 | Data transmission method, target switch, designated switch and switch system |
US10904719B2 (en) | 2019-05-06 | 2021-01-26 | Advanced New Technologies Co., Ltd. | Message shunting method, device and system based on user mode protocol stack |
CN113452691A (en) * | 2021-06-24 | 2021-09-28 | 未鲲(上海)科技服务有限公司 | Service flow detection method and device, server and storage medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101404619A (en) * | 2008-11-17 | 2009-04-08 | 杭州华三通信技术有限公司 | Method for implementing server load balancing and a three-layer switchboard |
CN101820391A (en) * | 2010-03-17 | 2010-09-01 | 中兴通讯股份有限公司 | Route forwarding method used for IP network and network equipment |
CN101827039A (en) * | 2010-06-04 | 2010-09-08 | 杭州华三通信技术有限公司 | Method and equipment for load sharing |
CN103078804A (en) * | 2012-12-28 | 2013-05-01 | 福建星网锐捷网络有限公司 | Method and device for processing equivalent multipath list as well as network equipment |
CN103650436A (en) * | 2013-07-25 | 2014-03-19 | 华为技术有限公司 | Service path distribution method, router and service execution entity |
CN105471770A (en) * | 2015-11-20 | 2016-04-06 | 福建星网锐捷网络有限公司 | Multi-core-processor-based message processing method and apparatus |
CN106549875A (en) * | 2015-09-18 | 2017-03-29 | ***通信集团浙江有限公司 | A kind of conversation managing method, device and load equalizer |
CN107294863A (en) * | 2017-06-22 | 2017-10-24 | 深圳市泰信通信息技术有限公司 | Network data stream forwarding method, device, system and readable storage medium storing program for executing |
-
2017
- 2017-12-07 CN CN201711287522.4A patent/CN107948087A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101404619A (en) * | 2008-11-17 | 2009-04-08 | 杭州华三通信技术有限公司 | Method for implementing server load balancing and a three-layer switchboard |
CN101820391A (en) * | 2010-03-17 | 2010-09-01 | 中兴通讯股份有限公司 | Route forwarding method used for IP network and network equipment |
CN101827039A (en) * | 2010-06-04 | 2010-09-08 | 杭州华三通信技术有限公司 | Method and equipment for load sharing |
CN103078804A (en) * | 2012-12-28 | 2013-05-01 | 福建星网锐捷网络有限公司 | Method and device for processing equivalent multipath list as well as network equipment |
CN103650436A (en) * | 2013-07-25 | 2014-03-19 | 华为技术有限公司 | Service path distribution method, router and service execution entity |
CN106549875A (en) * | 2015-09-18 | 2017-03-29 | ***通信集团浙江有限公司 | A kind of conversation managing method, device and load equalizer |
CN105471770A (en) * | 2015-11-20 | 2016-04-06 | 福建星网锐捷网络有限公司 | Multi-core-processor-based message processing method and apparatus |
CN107294863A (en) * | 2017-06-22 | 2017-10-24 | 深圳市泰信通信息技术有限公司 | Network data stream forwarding method, device, system and readable storage medium storing program for executing |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108768878A (en) * | 2018-06-06 | 2018-11-06 | 北京奇艺世纪科技有限公司 | A kind of SiteServer LBS, method, apparatus and load-balancing device |
CN109587062A (en) * | 2018-12-07 | 2019-04-05 | 北京金山云网络技术有限公司 | Load-balancing information synchronous method, apparatus and processing equipment |
CN109587062B (en) * | 2018-12-07 | 2021-05-25 | 北京金山云网络技术有限公司 | Load balancing information synchronization method, device and processing equipment |
US10904719B2 (en) | 2019-05-06 | 2021-01-26 | Advanced New Technologies Co., Ltd. | Message shunting method, device and system based on user mode protocol stack |
CN111884950A (en) * | 2020-07-27 | 2020-11-03 | 深圳市信锐网科技术有限公司 | Data transmission method, target switch, designated switch and switch system |
CN113452691A (en) * | 2021-06-24 | 2021-09-28 | 未鲲(上海)科技服务有限公司 | Service flow detection method and device, server and storage medium |
CN113452691B (en) * | 2021-06-24 | 2022-09-16 | 未鲲(上海)科技服务有限公司 | Service flow detection method and device, server and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107948087A (en) | A kind of method and apparatus of load balancing | |
US9736278B1 (en) | Method and apparatus for connecting a gateway router to a set of scalable virtual IP network appliances in overlay networks | |
US11463511B2 (en) | Model-based load balancing for network data plane | |
CN107819663B (en) | Method and device for realizing virtual network function service chain | |
US8705551B2 (en) | Method and system for management of flood traffic over multiple 0:N link aggregation groups | |
CN106664261A (en) | Method, device, and system for configuring flow entries | |
CN104468358A (en) | Message forwarding method and device of distributive virtual switch system | |
CN104022953A (en) | Message forwarding method and device based on Open Flow | |
CN107317879A (en) | The distribution method and system of a kind of user's request | |
CN107959625A (en) | Virtual router with dynamic stream relieving capacity | |
CN102075438A (en) | Unicast data frame transmission method and device | |
CN106878193A (en) | A kind of load sharing method and device | |
CN104202351B (en) | Distributed virtual safety device and the repeater system based on stream using virtual machine | |
CN101789949B (en) | Method and router equipment for realizing load sharing | |
CN104363170A (en) | Data flow forwarding method and device in software defined network (SDN) | |
CN105337819A (en) | Data processing method of broadband access gateway, broadband access gateway and network system | |
Xie et al. | Supporting seamless virtual machine migration via named data networking in cloud data center | |
CN106921572A (en) | A kind of method, apparatus and system for propagating qos policy | |
CN107846365A (en) | A kind of load balancing based on SDN realizes system and method | |
CN107579925A (en) | Message forwarding method and device | |
KR101841026B1 (en) | Service function chaining network system for path optimization | |
CN105379210A (en) | Data flow processing method and apparatus | |
CN104486226B (en) | A kind of message processing method and device | |
CN104618157A (en) | Network management method, device and system | |
CN106487709A (en) | A kind of file transmitting method and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180420 |
|
RJ01 | Rejection of invention patent application after publication |