CN103595649A - Method and system for achieving load balance - Google Patents
Method and system for achieving load balance Download PDFInfo
- Publication number
- CN103595649A CN103595649A CN201310595400.7A CN201310595400A CN103595649A CN 103595649 A CN103595649 A CN 103595649A CN 201310595400 A CN201310595400 A CN 201310595400A CN 103595649 A CN103595649 A CN 103595649A
- Authority
- CN
- China
- Prior art keywords
- assignment
- outgoing interface
- traffic ratio
- down hop
- sum
- 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
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention relates to the automatic load technology in the data communication field, and discloses a method for achieving load balance. According to the technical scheme, the method comprises the following steps: a, setting the flow distribution proportion of each output interface; b, converting the flow distribution proportion into the sum of next hops, and distributing the next hops according to the value of the flow distribution proportion of each output interface; and c, filling the sum of the next hops into a table of the sum of the next hops, and filling the next hops distributed to each output interface into an information table of the next hops. According to the method, the flow distribution proportion is converted into the sum of the next hops, the next hops are distributed according to the proportion, accounting for the flow distribution proportion, of each output interface, and therefore load balance can be carried out according to the flow distribution proportion set by users. The invention further discloses a system for achieving load balance. The load balance technology algorithm is simple and easy to implement.
Description
Technical field
The present invention relates to the automatic load technology of data communication field, especially relate to a kind of automatic load technology when a plurality of down hop line bandwidths are unequal.
Background technology
In current Client application network; for realizing circuit reliability; client can use two or Above Transmission Lines (in the majority with 2 circuit situations) conventionally; these two or Above Transmission Lines can be used for active-standby mode; also can be used for load model, depend on the route mode of operation that client configures on three-tier switch.Abnormal when a circuit, client's service traffics are switched on an other circuit and forward, thereby ensure data circuit reliability.
Active-standby mode.Because circuit lease expenses is very expensive; client can rent the circuit of a high bandwidth and a low bandwidth conventionally; low bandwidth circuit is easily congested; therefore for to avoid unnecessary line congestion to cause packet loss problem; client adopts the standby mode of a master one conventionally; only use high bandwidth as main line work, an other circuit is used as backup.Client's business datum enters after three-tier switch, owing to being active-standby mode therefore forward from main line, only having when main line is abnormal and just from spare line, forwards.For three-tier switch equipment, the corresponding active and standby route pattern of master spare circuit, during active and standby route pattern, for same route prefix, only have an outgoing interface and corresponding down hop, prefix, outgoing interface, down hop have all been written into kernel route table, and the outgoing interface and the corresponding down hop that correspond to spare line do not write kernel route table.When main line is abnormal, the outgoing interface down of corresponding main line for example, the route of corresponding main line is deleted, now corresponding spare line outgoing interface and corresponding down hop can be write to kernel route table and replace main line work.
Load model.Active-standby mode causes spare line when main line is normal not to be utilized completely, thus waste.If all simultaneously for forwarding, for being embroidered with two outlets and corresponding down hop before same, when client's service message is relatively during random distribution, these two track data converting flows can approach 1:1 by second spare line and article one circuit.
Correspond to two kinds of patterns above, its know-why as shown in Figure 1:
For three-tier switch, generally all support equal-cost route (Equal-Cost Multi-path Routing is called for short equal-cost route table) function.Exchange chip provides load-balancing function, adopts the mode of hash algorithm, from 2 or above down hop, chooses one of them down hop as the foundation of this message repeating.In this process, relate generally to two handling processes: 1, route querying; 2, down hop is selected.
Wherein down hop selects can be subdivided into again hash calculating and two parts of down hop management.
Hash calculates.Be according to specific key information (as information such as IP five-tuple, VRF, different chips may be chosen different information as key value) in this flow, according to hash computational methods, to carry out a hash to calculate, obtain a hash value.Unrelated to the invention because of hash computational methods, repeat no more.
Management information related in the management of down hop comprises: down hop sum table, equal-cost route information, next hop information table, wherein down hop sum table comprises the corresponding down hop total value of prefix in each route table items, represents the total several down hop outlets of a certain prefix.Equal-cost route packets of information is containing equal-cost route sign and down hop initial value, and down hop initial value represents the initial address of a certain prefix down hop, and equal-cost route sign is for representing whether corresponding prefix has a plurality of next-hop interfaces.Concrete next hop information table mainly comprises object mac address, outgoing interface, vlan information.
Traffic messages enters after three-tier switch, process logic in early stage judges that this message need to be routed forwarding, so search in routing table according to the prefix of this message, if return to the second value of the setting that equal-cost route is designated, as 0, represent that this prefix only has a down hop, this kind of situation is unrelated to the invention, and follow-up repeating process is omitted.If return to the first value that is designated setting in equal-cost route table, as 1, represent to be embroidered with a plurality of down hops before this, also can return to down hop total value and down hop initial value the same period.Then from header, obtain the required critical field information of hash and carry out hash calculating, obtain a hash value.By hash value and down hop total value complementation computing, obtain an index value.Index value is offset to find the down hop index value in equal-cost route information in conjunction with down hop initial value, according to down hop index value, in concrete next hop information table, search, just can obtain encapsulating the required header information of down hop, forward after then encapsulating corresponding heads information.
Generally speaking, in client's the critical field random distribution situations such as ip, hash result of calculation all can cover all down hops that comprise in whole down hop, so that really reach the effect of load balancing.
The subject matter that prior art exists:
Active-standby mode.If these two circuits adopt active-standby mode, three-tier switch is operated in route active-standby mode, and when main line is normal, spare line is not utilized completely, and customer resources does not obtain maximum using, waste resource.
Load model.Because circuit lease expenses is expensive, client can rent a high bandwidth and a low bandwidth circuit conventionally.If employing load model, when client's service message compares random distribution, these two track data forwardings can approach 1:1.Because low bandwidth circuit higher bandwidth line bandwidth is much lower, conventionally can not reach 1:1 line bandwidth ratio, prior art mode of loading can cause low bandwidth circuit packet loss, causes client's service disconnection, and this Time Bandwidth of high-bandwidth connections is not fully utilized yet.
In sum, when client uses two or Above Transmission Lines with extraneous communication, as long as these two or Above Transmission Lines bandwidth unequal, no matter communication equipment employing active-standby mode or load model, all cannot well solve these two kinds of problems that pattern is brought.Summary of the invention
For above-mentioned technical problem, object of the present invention is just to provide a kind of method that realizes load balancing, can carry out load balancing according to user configured outgoing interface assignment of traffic ratio.
The present invention solves its technical problem, and the technical scheme of employing is, realizes the method for load balancing, comprises step:
A, set the assignment of traffic ratio of each outgoing interface;
B, described assignment of traffic ratio is converted to down hop sum, and is next jumping figure of this interface assignment according to the assignment of traffic ratio value of each outgoing interface;
C, described down hop sum is inserted in down hop sum table, next jumping figure that each outgoing interface is distributed is inserted next hop information table.
Concrete, the bandwidth ratio that described assignment of traffic ratio is each outgoing interface.
Concrete, the load ratio that described assignment of traffic ratio is each outgoing interface.
Further, described step b specifically comprises:
B1, ask for a common divisor of the assignment of traffic ratio value of each outgoing interface, be denoted as CalA;
B2, ask for the summation of the assignment of traffic ratio value of all outgoing interfaces, be denoted as CalB;
B3, down hop add up to CalB/CalA, and the assignment of traffic ratio value that next jumping figure that each outgoing interface distributes is this outgoing interface is divided by CalA.
Another object of the present invention, provides a kind of system that realizes load balancing, it is characterized in that, comprises
Flow is divided module, for setting the assignment of traffic ratio of each outgoing interface;
Distribution module for described assignment of traffic ratio is converted to down hop sum, and is next jumping figure of this interface assignment according to the assignment of traffic ratio value of each outgoing interface;
Typing module, for described down hop sum being inserted to down hop sum table, next jumping figure that each outgoing interface is distributed is inserted next hop information table.
Concrete, the bandwidth ratio that described assignment of traffic ratio is each outgoing interface.
Concrete, the load ratio that described assignment of traffic ratio is each outgoing interface.
Further, the concrete calculating of described distribution module and distribution method are: ask for the common divisor of the assignment of traffic ratio value of each outgoing interface, be denoted as CalA; Ask for each value in the assignment of traffic ratio of all outgoing interfaces with, be denoted as CalB; Down hop adds up to CalB/CalA, and the assignment of traffic ratio value that next jumping figure that each outgoing interface distributes is this outgoing interface is divided by CalA.
The invention has the beneficial effects as follows, can solve under active-standby mode, the problem that spare line cannot effectively utilize, and under load model, when many line bandwidths are unequal, line bandwidth can not make full use of the problem with packet loss.Load-balancing technique algorithm of the present invention is simple, easily implements.
Accompanying drawing explanation
Fig. 1 is prior art data retransmission schematic flow sheet;
Fig. 2 is flow chart of the present invention;
Fig. 3 is that system module forms structural representation.
Embodiment
Below in conjunction with the drawings and the specific embodiments, describe technical scheme of the present invention in detail.
The present invention improves the form that in down hop management, the total down hop total value computational methods of showing of down hop and down hop index exist in equal-cost route table table and next skip list, no longer adopt prior art scheme only to represent the method for actual value, but assignment of traffic ratio is converted to down hop sum, and distribute next jumping figure according to each outgoing interface portion in assignment of traffic ratio, thereby the assignment of traffic ratio that can set according to user is carried out load balancing.
As shown in Figure 2, the method step of realizing load balancing of the present invention is as follows:
Step 1, set the assignment of traffic ratio of each outgoing interface.
User can set assignment of traffic ratio according to the load ratio of the bandwidth ratio of each outgoing interface or each outgoing interface.For example there are three outgoing interfaces, are denoted as respectively A, B, C, the assignment of traffic ratio of setting three outgoing interfaces is respectively 4:4:3.Here 4:4:3 can be bandwidth ratio or the load ratio of corresponding outgoing interface.
Step 2, the assignment of traffic ratio of setting is converted to down hop sum, and is next jumping figure of this interface assignment according to the assignment of traffic ratio value of each outgoing interface.
A kind of fairly simple computational methods are:
A common divisor first asking for the assignment of traffic ratio value of each outgoing interface, is denoted as CalA, then asks for the summation of the assignment of traffic ratio value of each outgoing interface, is denoted as CalB.Down hop adds up to CalB/CalA, and the assignment of traffic ratio value that next jumping figure that each outgoing interface distributes is this outgoing interface is divided by CalA.Conventionally CalA value is greatest common divisor, can simplify calculating.
When setting A, B, when the assignment of traffic ratio of tri-outgoing interfaces of C is respectively 4:4:3, the greatest common divisor CalA=1 of these three assignment of traffic ratio values now.The summation of setting the assignment of traffic ratio value of all outgoing interfaces is CalB=4+4+3, down hop adds up to CalB/CalA, be CalB/CalA=(4+4+3)/1=11, the assignment of traffic ratio value that next jumping figure that each outgoing interface distributes is this outgoing interface is divided by CalA, be A, B, the down hop that tri-outgoing interfaces of C distribute separately number is respectively 4,4,3.
Step 3, the above-mentioned down hop sum calculating is inserted in down hop sum table, and next jumping figure that each outgoing interface is distributed is inserted next hop information table.
For down hop total value, the down hop total value of calculating gained is inserted to the down hop sum table for down hop management; For next hop information table, with above-mentioned A, B, tri-outgoing interfaces of C are example, the CalB value 11 of calculating need to be inserted in the down hop sum table of down hop management, and in down hop original position, the down hop that each outgoing interface is distributed is inserted next hop information table, fills out 4 down hop A, 4 down hop B, 3 down hop C, the sequence independence of filling out.
Complete after above-mentioned steps, according to forwarding principle, when message carries out routing forwarding, can enter in forwarding logic, better at hash algorithm, in the situation that hash critical field information evenly (comes from message, i.e. the field such as the ip in message random distribution relatively), substantially can reach the assignment of traffic ratio of setting.
The present invention realizes the system of load balancing, and structure as shown in Figure 3, comprises
Flow is divided module, for setting the assignment of traffic ratio of each outgoing interface, as the load ratio of the bandwidth ratio of each outgoing interface or each outgoing interface.
Distribution module for described assignment of traffic ratio is converted to down hop sum, and is next jumping figure of this interface assignment according to the assignment of traffic ratio value of each outgoing interface.
The concrete calculating of distribution module and distribution method are: ask for the common divisor of the assignment of traffic ratio value of each outgoing interface, be denoted as CalA; Ask for each value in the assignment of traffic ratio of all outgoing interfaces with, be denoted as CalB; Down hop adds up to CalB/CalA, and the assignment of traffic ratio value that next jumping figure that each outgoing interface distributes is this outgoing interface is divided by CalA.
Typing module, for described down hop sum being inserted to down hop sum table, the down hop that each outgoing interface is distributed is inserted next hop information table.
Claims (8)
1. the method that realizes load balancing, comprises step:
A, set the assignment of traffic ratio of each outgoing interface;
B, described assignment of traffic ratio is converted to down hop sum, and is next jumping figure of this interface assignment according to the assignment of traffic ratio value of each outgoing interface;
C, described down hop sum is inserted in down hop sum table, next jumping figure that each outgoing interface is distributed is inserted next hop information table.
2. the method that realizes load balancing according to claim 1, is characterized in that, the bandwidth ratio that described assignment of traffic ratio is each outgoing interface.
3. the method that realizes load balancing according to claim 1, is characterized in that, the load ratio that described assignment of traffic ratio is each outgoing interface.
4. according to the method that realizes load balancing described in claim 1~3 any one, it is characterized in that, described step b specifically comprises:
B1, ask for a common divisor of the assignment of traffic ratio value of each outgoing interface, be denoted as CalA;
B2, ask for the summation of the assignment of traffic ratio value of all outgoing interfaces, be denoted as CalB;
B3, down hop add up to CalB/CalA, and the assignment of traffic ratio value that next jumping figure that each outgoing interface distributes is this outgoing interface is divided by CalA.
5. the system that realizes load balancing, is characterized in that, comprises
Flow is divided module, for setting the assignment of traffic ratio of each outgoing interface;
Distribution module for described assignment of traffic ratio is converted to down hop sum, and is next jumping figure of this interface assignment according to the assignment of traffic ratio value of each outgoing interface;
Typing module, for described down hop sum being inserted to down hop sum table, next jumping figure that each outgoing interface is distributed is inserted next hop information table.
6. the system that realizes load balancing according to claim 5, is characterized in that, the bandwidth ratio that described assignment of traffic ratio is each outgoing interface.
7. the system that realizes load balancing according to claim 5, is characterized in that, the load ratio that described assignment of traffic ratio is each outgoing interface.
8. according to the system that realizes load balancing described in claim 5~7 any one, it is characterized in that, the concrete calculating of described distribution module and distribution method are: ask for the common divisor of the assignment of traffic ratio value of each outgoing interface, be denoted as CalA; Ask for each value in the assignment of traffic ratio of all outgoing interfaces with, be denoted as CalB; Down hop adds up to CalB/CalA, and the assignment of traffic ratio value that next jumping figure that each outgoing interface distributes is this outgoing interface is divided by CalA.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310595400.7A CN103595649A (en) | 2013-11-21 | 2013-11-21 | Method and system for achieving load balance |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310595400.7A CN103595649A (en) | 2013-11-21 | 2013-11-21 | Method and system for achieving load balance |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103595649A true CN103595649A (en) | 2014-02-19 |
Family
ID=50085638
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310595400.7A Pending CN103595649A (en) | 2013-11-21 | 2013-11-21 | Method and system for achieving load balance |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103595649A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104506359A (en) * | 2014-12-25 | 2015-04-08 | 迈普通信技术股份有限公司 | Router mode identification method and router |
CN110995609A (en) * | 2019-12-20 | 2020-04-10 | 新华三半导体技术有限公司 | Message sending method and device, electronic equipment and storage medium |
CN111787060A (en) * | 2020-05-28 | 2020-10-16 | 网宿科技股份有限公司 | Traffic scheduling method, system and device |
CN113630319A (en) * | 2021-06-28 | 2021-11-09 | 济南浪潮数据技术有限公司 | Data distribution method, device and related equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6785750B1 (en) * | 2001-04-30 | 2004-08-31 | Lsi Logic Corporation | Integrated dynamic load balancing by an input/output interface |
CN1859276A (en) * | 2005-07-27 | 2006-11-08 | 华为技术有限公司 | Multiple port path selecting method for network equipment |
CN101610296A (en) * | 2009-07-21 | 2009-12-23 | 杭州华三通信技术有限公司 | A kind of network address translation (NAT) outgoing interface balancing method and device |
CN101753455A (en) * | 2009-12-15 | 2010-06-23 | 中兴通讯股份有限公司 | Retransmission method and device |
CN103188165A (en) * | 2013-03-12 | 2013-07-03 | 神州数码网络(北京)有限公司 | Intelligent router multipath output load balancing method and router |
-
2013
- 2013-11-21 CN CN201310595400.7A patent/CN103595649A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6785750B1 (en) * | 2001-04-30 | 2004-08-31 | Lsi Logic Corporation | Integrated dynamic load balancing by an input/output interface |
CN1859276A (en) * | 2005-07-27 | 2006-11-08 | 华为技术有限公司 | Multiple port path selecting method for network equipment |
CN101610296A (en) * | 2009-07-21 | 2009-12-23 | 杭州华三通信技术有限公司 | A kind of network address translation (NAT) outgoing interface balancing method and device |
CN101753455A (en) * | 2009-12-15 | 2010-06-23 | 中兴通讯股份有限公司 | Retransmission method and device |
CN103188165A (en) * | 2013-03-12 | 2013-07-03 | 神州数码网络(北京)有限公司 | Intelligent router multipath output load balancing method and router |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104506359A (en) * | 2014-12-25 | 2015-04-08 | 迈普通信技术股份有限公司 | Router mode identification method and router |
CN104506359B (en) * | 2014-12-25 | 2018-01-30 | 迈普通信技术股份有限公司 | A kind of route pattern knows method for distinguishing and router |
CN110995609A (en) * | 2019-12-20 | 2020-04-10 | 新华三半导体技术有限公司 | Message sending method and device, electronic equipment and storage medium |
CN111787060A (en) * | 2020-05-28 | 2020-10-16 | 网宿科技股份有限公司 | Traffic scheduling method, system and device |
CN113630319A (en) * | 2021-06-28 | 2021-11-09 | 济南浪潮数据技术有限公司 | Data distribution method, device and related equipment |
CN113630319B (en) * | 2021-06-28 | 2022-08-19 | 济南浪潮数据技术有限公司 | Data distribution method, device and related equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103166870B (en) | Load balancing clustered system and method for providing services by using load balancing clustered system | |
CN104243265A (en) | Gateway control method, device and system based on virtual machine migration | |
CN104871490B (en) | The multipath communication device of energy ecology and its method for distributing business for improving energy ecology can be improved | |
CN101692652A (en) | Method for preventing interrupt of traffics in aggregation link | |
CN102118277A (en) | Method and device for packet loss detection, and a router | |
CN101094185A (en) | Method and device for forwarding message based on multilink | |
EP3713160A1 (en) | Packet transmission method and apparatus | |
CN104065759A (en) | Method for improving utilization efficiency of NAT address pool resource and device thereof | |
CN101820395A (en) | Routing information configuration and private network label addition method and device based on MPLS (Multiple Protocol Label Switching) | |
CN102970231A (en) | Multicast flow forwarding implementation method and routing bridge (RB) | |
CN105763472A (en) | Trans-board forwarding method and device | |
CN106130920A (en) | A kind of message forwarding method and device | |
CN103595649A (en) | Method and system for achieving load balance | |
US10003526B1 (en) | Methods and apparatus for efficient use of link aggregation groups | |
CN103391249B (en) | Neighborhood relationship building method in a kind of IS-IS network and equipment | |
CN104618157A (en) | Network management method, device and system | |
CN102130829A (en) | Method, device and system for establishing label switch paths (LSP) | |
CN104394075B (en) | A kind of method and apparatus of message transmissions | |
WO2021147357A1 (en) | Method, device, and system for distributing routing information | |
US9596176B2 (en) | Pseudowire selection in a pseudowire redundancy network | |
CN106209634B (en) | Learning method and device of address mapping relation | |
CN111464443A (en) | Message forwarding method, device, equipment and storage medium based on service function chain | |
CN102244615B (en) | Forwarding entry sending method, device and system as well as autonomous system border router | |
CN113746734B (en) | Traffic forwarding method, device, equipment and medium | |
CN102647424B (en) | Data transmission method and data transmission device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information |
Address after: 610041 15-24 floor, 1 1 Tianfu street, Chengdu high tech Zone, Sichuan Applicant after: Maipu Communication Technologies Co., Ltd. Address before: 610041 Maple tower, 16 Hing Hing Road, nine High-tech Zone, Chengdu, Sichuan Applicant before: Maipu Communication Technologies Co., Ltd. |
|
CB02 | Change of applicant information | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20140219 |
|
RJ01 | Rejection of invention patent application after publication |