A kind of heuristic network load balancing method
Technical field
The present invention relates to a kind of heuristic network load balancing method, belong to computer network resource management technology neck
Domain.
Background technology
In recent years, it is right as mobile Internet, Internet of Things, social networks, big data treatment, smart city become increasingly popular
Large-scale calculations, the demand of storage capacity are increasingly lifted, and cloud computing has obtained quick development.Because cloud computing system is by mutual
Networking realizes realization calculating, storage, the convergence of information resources, forms resource pool and externally provides service, and this allows for cloud system
It is referred to as the place that data communication is most concentrated as the core of internet.Substantial amounts of network data is transferred to cloud system, in system
Also frequently communicated between each server of portion, multi-layer switches need to forward substantial amounts of data.Here it is so that cloud system
Network capacity turns into the key factor for determining service quality, and the in large scale and complexity of the business that cloud platform is carried is various
Property, the service quality to cloud data center proposes requirement higher.
In order to preferably provide cloud service, it is ensured that the quality of service, it is necessary to carry out effective management to cloud system network, carry
The utilization rate of Internet resources high and the transmittability of network.In actual network, it is often the case that a part of chain
Road needs the data flow of transmission very big, and link congestion easily occurs, and simultaneously very idle on some links, and this results in net
Network load is extremely uneven, and resource utilization is low, it is impossible to efficiently using whole network resource, making it difficult to ensure higher
Transmittability.Thus how to ensure that Network Load Balance turns into the emphasis of concern.
Traditional network architecture can not increasingly meet the demand of automatic network load balancing, and mesh is received in the lifting of service quality
The limitation of preceding network is restricted.By the development of the past few decades, procotol miscellaneous is constantly suggested and develops,
But relatively independent between agreement, every kind of agreement is often intended merely to solve certain problem, and numerous procotols are aggravated
The complexity of network.As data center's scale expands rapidly, network equipment quantity is increased, and is configured and is managed and be hundreds and thousands of
The network equipment also cause that network becomes complicated, increase operation cost.In addition, some algorithms in many cases in traditional network
Determine path according only to the destination address of packet, the packet with identical destination address is transmitted along single-pathway, or
So all there is substantial amounts of redundant link empty all the time as transmission path in person's such as tradition OSPF algorithms selection wall scroll shortest paths
In the spare time, it is not fully utilized, greatly wastes Internet resources.Some agreements for supporting multipath are also implicitly present in addition, such as
Equal cost multipath (Equal-Cost Multi Path, the ECMP) agreement being widely used.But being limited in that for it does not examine
Consider actual state of network traffic, mulitpath is placed on equal status.Therefore how cloud system network is effectively managed, it is ensured that
Network Load Balance, so that cloud service quality is improved, the problem as urgent need to resolve.
The content of the invention
The technical problems to be solved by the invention are to provide a kind of heuristic network load balancing method, solve existing skill
Art is not enough, can be effectively according to the service condition of each link of network, rationally using redundancy, idle link source mesh main frame choosing
Select most appropriate data transfer path, it is ensured that offered load is as balanced as possible, reduce network congestion to a certain extent can
Can property and the transmittability that improve network.
In order to solve the above-mentioned technical problem the present invention uses following technical scheme:The present invention devises a kind of heuristic network
Load-balancing method, source telephone net node is wrapped to the acquisition of optimal path between purpose telephone net node in realizing meshed network
Include following steps:
Step A. initializes N number of particle, and count initialized parameter i=0, subsequently into step B;
Step B. is directed to each particle respectively, and source telephone net node has currently been explored the in network path as particle
One telephone net node, and B01 to step B07 as follows, perform ith iteration, subsequently into step C;
Step B01. judges whether i is equal to 0, is, end telephone net node in network path has currently been explored for particle
Each neighboring switch node, according to the available bandwidth of each link in meshed network, calculates each neighboring switch section respectively
The probability of the next telephone net node respectively as last telephone net node is put, subsequently into step B02;Particle is otherwise directed to respectively
Current each neighboring switch node for having explored last telephone net node in network path, as follows (1):
Obtain Probability p of the neighboring switch node as next telephone net node of last telephone net nodeIt is adjacent, and then obtain respectively
Probability of each neighboring switch node respectively as next telephone net node of last telephone net node is obtained, subsequently into step
B02;Wherein, α represent neighboring switch node appear in global optimum path in weight;β represents that neighboring switch node goes out
Weight in local optimum path corresponding to present particle;p'It is adjacentIt is general in expression neighboring switch the i-th -1 time iterative process of node
Rate;nAdjacent 1Represent the number of times that neighboring switch node occurs in current all global paths, nAdjacent 2Represent that neighboring switch node exists
The number of times occurred in current all local paths;nAll neighbours 3Represent all neighboring switch nodes of last telephone net node current
The number of times occurred in all global paths, nAll neighbours 4Represent that all neighboring switch nodes of last telephone net node own currently
The number of times occurred in local path;
Step B02. has currently explored each neighboring switch node of last telephone net node in network path for particle
Randomly ordered and corresponding according to each neighboring switch node difference probability is carried out, by each neighboring switch node
Sequence, adds up by 0, divides and obtains each neighboring switch node shared probability share respectively, subsequently into step B03;
Step B03. obtains random number X ∈ (0,1), based on the shared probability share of each neighboring switch node difference, choosing
The corresponding neighboring switch node of probability share where X is selected, then judges whether the neighboring switch node is located at particle current
Explore in network path, be then to enter step B04;The neighboring switch node network has currently otherwise been explored into as particle
Next telephone net node of last telephone net node in path, is added to during particle currently explored network path, subsequently into step
Rapid B05;
Step B04. judges that particle has currently explored each neighboring switch node of last telephone net node in network path
Whether all by the judgement of step B03, it is to define particle currently to have explored network path invalid, particle has currently been explored
Network path corresponds to the local path of ith iteration as particle, and defines local path of the particle corresponding to ith iteration
Comfort level be 0, subsequently into step B07;Otherwise return to step B03;
Step B05. judges that particle has currently explored whether last telephone net node in network path is purpose telephone net node,
It is that particle has currently been explored the local path that network path corresponds to ith iteration as particle, and enters step B06;
Otherwise return to step B01;
Step B06. is according to equation below:
The comfort level F that particle corresponds to the local path of ith iteration is obtained, subsequently into step B07;Wherein, SiTable
Show that particle corresponds to total available bandwidth of the local path of ith iteration;LiRepresent that particle corresponds to the local road of ith iteration
Footpath link bar number;LmaxIn expression meshed network in all paths corresponding to source telephone net node to purpose telephone net node
MAXPATHLEN;LminIn expression meshed network in all paths corresponding to source telephone net node to purpose telephone net node
Shortest path length;0≤ω≤1, ω represents default adjustment factor;
Step B07. judges whether i is equal to 0, is that particle then is corresponded into the local path of ith iteration as particle institute
Corresponding local optimum path;Otherwise correspond to the comfort level of the local path of ith iteration, and particle correspondence based on particle
Each comfort level of local path in preceding i-1 iteration, the local path corresponding to selection maximal comfort, is updated to particle
Corresponding local optimum path;
According in ith iteration, the corresponding local path comfort level of each particle difference selects maximal comfort to step C.
Corresponding local path as ith iteration global path, subsequently into step D;
Step D. judges whether i is equal to 0, is then using the global path of ith iteration as global optimum path;Otherwise base
Each comfort level of global path in the comfort level of the global path of ith iteration, and preceding i-1 iteration, selection is maximum
Global path corresponding to comfort level, is updated to global optimum path, subsequently into step E;
Step E. judges whether i is equal to default iterations, and source exchanges during Shi Ze global optimums path is meshed network
Machine node to purpose telephone net node optimal path;Otherwise carry out Jia 1 renewal, and return to step B for the value corresponding to i.
As a preferred technical solution of the present invention:The value of the ω is 0.6.
As a preferred technical solution of the present invention:The ratio of the α and β is 1.5.
As a preferred technical solution of the present invention:Cycle performs step A to step E, and source is handed in realizing meshed network
Node to optimal path between purpose telephone net node of changing planes is periodically updated.
A kind of heuristic network load balancing method of the present invention compared with prior art, is had using above technical scheme
There is following technique effect:The heuristic network load balancing method of present invention design, solves prior art deficiency, can be effective
Ground, according to the service condition of each link of network, is that mesh Selection of chiller most appropriate data in source are passed rationally using redundancy, idle link
Defeated path, it is ensured that offered load is as balanced as possible, reduces the possibility of network congestion and improves network to a certain extent
Transmittability, wherein, this method periodically monitors network link loads, in time by the partial discharge on heavier loads link
It is transferred on the link of light load, makes full use of the link of free time in network, data transfer task is balancedly divided as far as possible
It is scattered in each link, finally realizes each balancing link load of network;Also this method can realize Network Load Balance, will
Data flow is distributed on a plurality of redundant link, reduces the data volume of part of links, when eventually reducing overall network transmission
Prolong;And this method can realize Network Load Balance, reduce in link and the possibility of network congestion occur, it is ensured that data
Transmission quality, eventually reduces network packet loss rate;Moreover, this method realizes Network Load Balance, has reasonably planned number
According to flow direction, idle link is made full use of, speeding up data transmission finally improves network throughput.
Brief description of the drawings
Fig. 1 is the schematic flow sheet of heuristic network load balancing method designed by the present invention.
Specific embodiment
Specific embodiment of the invention is described in further detail with reference to Figure of description.
The technical problems to be solved by the invention are the effectively network resource administrations in large-scale cloud computing system, fully
Using the redundancy in network, idle link, the utilization of Internet resources is improved, reach the purpose of Network Load Balance, it is final to realize
Network low time delay, low packet loss ratio and high-throughput.Each of the links load is different in network, how in so many links
Suitable path is selected, this is the direction of a very worth research.The present invention periodically monitors each link bandwidth in network
Packet forward-path between utilization power, main frame of adaptively being made rational planning for according to link load using heuritic approach, is repaiied
Change the forwarding rule of related route, some data flows are tuned away on light load link from heavier loads link, it is right to realize
Flow multipath is dispatched, so as to ensure that each balancing link load as far as possible, while effectively reducing network packet loss rate, time delay, is carried
The reliability and throughput of network high.
The algorithm in the searching reasonable transmission path that the present invention is used has used for reference the part thought of population and ant group algorithm, is
A kind of heuritic approach based on colony.For the N number of particle in colony, single particle effect is limited, but particle and grain
Influenced each other before son so that overall search variation, greatly promote performance.Each particle is an abstract concept, is represented
A solution in a paths, i.e. route searching, the data transfer path from source address to destination address is searched for.Each path by
Several nodes are constituted, and node is the interchanger in network.In search procedure, particle is constantly to itself optimal solution and the overall situation
Optimal solution is drawn close, in real time the next node in itself history optimal solution, the globally optimal solution adjusts path of whole colony,
Optimal solution is exactly the optimal path that this paper algorithms are tried to achieve in final all particles.
Based on described above, as shown in figure 1, the present invention devises a kind of heuristic network load balancing method, section is realized
Source telephone net node specifically includes following steps A to step to the acquisition of optimal path between purpose telephone net node in spot net
Rapid E, and the cycle perform step A to step E, realize in meshed network source telephone net node between purpose telephone net node most
Shortest path is periodically updated.
Step A. initializes N number of particle, and count initialized parameter i=0, subsequently into step B.
Step B. is directed to each particle respectively, and source telephone net node has currently been explored the in network path as particle
One telephone net node, and B01 to step B07 as follows, perform ith iteration, subsequently into step C.
Step B01. judges whether i is equal to 0, is, end telephone net node in network path has currently been explored for particle
Each neighboring switch node, according to the available bandwidth of each link in meshed network, calculates each neighboring switch section respectively
The probability of the next telephone net node respectively as last telephone net node is put, subsequently into step B02;Particle is otherwise directed to respectively
Current each neighboring switch node for having explored last telephone net node in network path, as follows (1):
Obtain Probability p of the neighboring switch node as next telephone net node of last telephone net nodeIt is adjacent, and then obtain respectively
Probability of each neighboring switch node respectively as next telephone net node of last telephone net node is obtained, subsequently into step
B02;Wherein, α represent neighboring switch node appear in global optimum path in weight;β represents that neighboring switch node goes out
The size of the ratio between the weight in local optimum path corresponding to present particle, α and β determines which direction particle is more biased towards, and α is more than
During β, particle deflection global optimum is drawn close in path, it is to avoid when being absorbed in local optimum, and α less than β, particle is partial to along particle itself
Optimal direction is explored, and expands Path diversity, it is to avoid particle terminates search early, and under the conciliation of the two coefficients, particle is continuous
Ground is drawn close to final optimal path.Find that algorithm just rapidly enters convergence state when the ratio between α and β is larger in experimentation,
Most of particles are all partial to same paths, lose colony's multifarious feature in itself, but the paths are not usually global
Optimal path, often more excellent path is searched out.And when α and β it is smaller when, particle can search out many bars
Reachable path, the diversity of prominent particle, but particle Experiential Search path more according to itself, lack it is global see,
Cause algorithmic statement slow, influence the efficiency of algorithm.In practical application, according to experimental result determine the ratio between α and β for 1.5 when the most
Properly;p'It is adjacentRepresent the probability in neighboring switch the i-th -1 time iterative process of node;nAdjacent 1Represent neighboring switch node current
The number of times occurred in all global paths, nAdjacent 2Represent the number of times that neighboring switch node occurs in current all local paths;
nAll neighbours 3Represent the number of times that all neighboring switch nodes of last telephone net node occur in current all global paths, nAll neighbours 4
Represent the number of times that all neighboring switch nodes of last telephone net node occur in current all local paths.
Step B02. has currently explored each neighboring switch node of last telephone net node in network path for particle
Randomly ordered and corresponding according to each neighboring switch node difference probability is carried out, by each neighboring switch node
Sequence, adds up by 0, divides and obtains each neighboring switch node shared probability share respectively, subsequently into step B03.
Step B03. obtains random number X ∈ (0,1), based on the shared probability share of each neighboring switch node difference, choosing
The corresponding neighboring switch node of probability share where X is selected, then judges whether the neighboring switch node is located at particle current
Explore in network path, be then to enter step B04;The neighboring switch node network has currently otherwise been explored into as particle
Next telephone net node of last telephone net node in path, is added to during particle currently explored network path, subsequently into step
Rapid B05.
Step B04. judges that particle has currently explored each neighboring switch node of last telephone net node in network path
Whether all by the judgement of step B03, it is to define particle currently to have explored network path invalid, particle has currently been explored
Network path corresponds to the local path of ith iteration as particle, and defines local path of the particle corresponding to ith iteration
Comfort level be 0, subsequently into step B07;Otherwise return to step B03.
Step B05. judges that particle has currently explored whether last telephone net node in network path is purpose telephone net node,
It is that particle has currently been explored the local path that network path corresponds to ith iteration as particle, and enters step B06;
Otherwise return to step B01.
Step B06. is according to equation below:
The comfort level F that particle corresponds to the local path of ith iteration is obtained, subsequently into step B07;Wherein, SiTable
Show that particle corresponds to total available bandwidth of the local path of ith iteration;LiRepresent that particle corresponds to the local road of ith iteration
Footpath link bar number;LmaxIn expression meshed network in all paths corresponding to source telephone net node to purpose telephone net node
MAXPATHLEN;LminIn expression meshed network in all paths corresponding to source telephone net node to purpose telephone net node
Shortest path length;0≤ω≤1, ω represents default adjustment factor, in practical application, ω=0.6.
Step B07. judges whether i is equal to 0, is that particle then is corresponded into the local path of ith iteration as particle institute
Corresponding local optimum path;Otherwise correspond to the comfort level of the local path of ith iteration, and particle correspondence based on particle
Each comfort level of local path in preceding i-1 iteration, the local path corresponding to selection maximal comfort, is updated to particle
Corresponding local optimum path.
According in ith iteration, the corresponding local path comfort level of each particle difference selects maximal comfort to step C.
Corresponding local path as ith iteration global path, subsequently into step D.
Step D. judges whether i is equal to 0, is then using the global path of ith iteration as global optimum path;Otherwise base
Each comfort level of global path in the comfort level of the global path of ith iteration, and preceding i-1 iteration, selection is maximum
Global path corresponding to comfort level, is updated to global optimum path, subsequently into step E.
Step E. judges whether i is equal to default iterations, and source exchanges during Shi Ze global optimums path is meshed network
Machine node to purpose telephone net node optimal path;Otherwise carry out Jia 1 renewal, and return to step B for the value corresponding to i.
Heuristic network load balancing method designed by above-mentioned technical proposal, solves prior art deficiency, Neng Gouyou
Effect ground, according to the service condition of each link of network, is the most appropriate data of source mesh Selection of chiller rationally using redundancy, idle link
Transmission path, it is ensured that offered load is as balanced as possible, reduces the possibility of network congestion and improves net to a certain extent
The transmittability of network, wherein, this method periodically monitors network link loads, in time flows the part on heavier loads link
Amount is transferred on the link of light load, makes full use of the link of free time in network, by data transfer task as far as possible balancedly
It is distributed in each link, finally realizes each balancing link load of network;Also this method can realize Network Load Balance,
Data flow is distributed on a plurality of redundant link, the data volume of part of links is reduced, overall network transmission is eventually reduced
Time delay;And this method can realize Network Load Balance, reduce in link and the possibility of network congestion occur, it is ensured that number
According to transmission quality, network packet loss rate is eventually reduced;Moreover, this method realizes Network Load Balance, reasonably plans
Data flow, makes full use of idle link, and speeding up data transmission finally improves network throughput.
Embodiments of the present invention are explained in detail above in conjunction with accompanying drawing, but the present invention is not limited to above-mentioned implementation
Mode, in the ken that those of ordinary skill in the art possess, can also be on the premise of present inventive concept not be departed from
Make a variety of changes.