an alternative genetic algorithm to optimize ospf weights

7

Click here to load reader

Upload: em-legacy

Post on 15-Apr-2017

94 views

Category:

Education


2 download

TRANSCRIPT

Page 1: An Alternative Genetic Algorithm to Optimize OSPF Weights

An Alternative Genetic Algorithm to Optimize OSPF Weights

Eueung Mulyana, Ulrich KillatDepartment of Communication Networks, Technical University Hamburg-Harburg

Denickestrasse 17, D-21073 Hamburg, Germanyphone: (+49) 40-42878-2925, fax: (+49) 40-42878-2941

email: [email protected]

Abstract

In this paper, a method based on genetic algorithm (GA),is presented to optimize administrative weights for OSPFrouting. This method can be seen as an alternative to thelocal-search method in [1] or another GA-based methodin [11]. However, the GA as well as the objective func-tion we use are different. Instead of minimizing a con-vex cost function we prefer to minimize the maximumand average utilization directly. This objective function issimilar as one proposed in [7, 8]. In addition we imple-ment a method to search weights for both single and mul-tiple shortest paths routing and propose an enhancementto the objective function to minimize weight changes foran existing operational network. We will demonstrateour method in a case of small networks and comparethe results with MIP-based (Mixed Integer Programming)method from [7, 8, 10]. Afterwards we will show the re-sults for a bigger network with increasing traffic demands,compared with the results of some conventional weightsettings as well as with the lower bound of general opti-mal routing (linear program / LP solution).

Keywords: OSPF, genetic algorithm, traffic engineering,routing optimization

1 Introduction

Routing protocols in IP networks are usually classifiedas Interior Gateway Protocols (IGP) and Exterior Gate-way Protocols (EGP). OSPF (Open Shortest Path First) isthe most popular IGP used in today’s IP networks. OSPFcalculates routes as follows. Each link is assigned a di-mensionless metric, called cost or weight. This cost is aninteger ranging from 1 to 65535 (= 216 − 1). The costof a path is the sum of link costs. Paths are selected us-ing Dijkstra’s shortest path algorithm. Given a networktopology and predicted traffic demands, the OSPF weightsetting (OSPFWS [11]) problem is to find a set of OSPFweights that optimizes network performance. The chosenarc weights determine the shortest paths, which in turn de-termine the routing of traffic flows, the loads on the arcsand the value of the cost function.

In the case of multiple shortest paths, some vendorshave implemented OSPF with ECMP (Equal Cost Multi-Path) so that it will use load balancing and split the trafficflow over several shortest paths roughly evenly. The evensplitting is a nice tool for balancing the flows in orderto avoid congestion in the network, but it is consideredharmful for several reasons [2]. First, the exact details ofthe splitting method depend on the individual router, andmay not be released by the vendor. Secondly, the split-ting is typically not exactly even. The possibility of un-even splitting makes it difficult to predict link loads evenwith a given demand matrix. The question whether sin-gle shortest path routing is better than multiple shortestpaths routing or not, is beyond the scope of this paper.Here we simply implement both of single and multipleshortest paths to see the results and compare them. In ourimplementation we use an exact even-splitting in case ofmultiple shortest paths and use the method proposed byThorup [2] to get a single shortest path routing.

In the following we first present a mathematical modelof the objective function and some related constraints forthe general routing problem. In Section 3, OSPF routingmechanism will be shortly discussed. After that (in Sec-tion 4) we will refer to a MIP-based (Mixed Integer Pro-gramming) approach as published in [7, 8, 10]. In Sec-tion 5 we present an enhancement of the objective func-tion to minimize weight changes in a dynamic scenario.In Section 6 we explain the genetic algorithm (GA) weused to solve the problem. Finally, the results of sometest-networks will be presented.

2 General Routing Problem

In the general routing problem, there are no limitationson how flows can be distributed along the paths fromsource to destination, and the problem can be formulatedand solved in polynomial time as a multi commodity flowproblem [1, 11]. A directed network G(V, E) is given,where V is the set of vertices (nodes) representing thenetwork’s routers and E is the set of edges (arcs) repre-senting the network’s links. Each link (i, j) ∈ E has a ca-pacity cij . Furthermore, we have a demand fuv for eachpair (u, v) ∈ V ×V , giving the demand to be carried from

Page 2: An Alternative Genetic Algorithm to Optimize OSPF Weights

source u to destination v. A real variable luvij is associated

with the load on link (i, j) resulting from flow demandfuv . Thus, the general routing problem optimization canbe formulated as follows:

min {(at · t) +1

|E|

ij

uv

luvij

cij

}

∀(i, j) ∈ E, ∀(u, v) ∈ V × V (1)

δunfuv +∑

m∈V

luvmn = δnvfuv +

m∈V

luvnm

∀(u, v) ∈ V × V, ∀n, m ∈ V (2)

uv

luvij

cij

≤ t ∀(i, j) ∈ E (3)

luvij ≥ 0 ∀(i, j) ∈ E, ∀(u, v) ∈ V × V (4)

Equation 1 is the objective function to minimize uti-lization t on the most utilized link (Eq. 3) and averageutilization. A constant at is used to trade between thesetwo components. Eq. 2 describes flow conservation con-straints that ensure the desired traffic flow to be routedfrom source to destination.

3 OSPF Weight Setting (OSPFWS)Problem

As mentioned in section 1, in OSPF routing we choose aweight wk for each arc. The routing of the demands isdetermined by the shortest paths computed by Dijkstra’salgorithm, which is in turn determined by the weightswe assign to the arcs. Thus for each source destina-tion pair (u, v) and link (i, j), the variable luv

ij = 0 iflink (i, j) is not on a shortest path from u to v and be-cause of even-splitting luv

im = luvin if both (i, m) and (i, n)

are on shortest paths from u to v. For a given demandfuv , ∀(u, v) ∈ V × V and a given set of weights wecan compute the load distribution in the network. Notethat this load distribution is not dependent on link capac-ities i.e. some weight configurations may cause a con-gestion as the total traffic to be routed on a certain linkmay exceed its capacity. In this case for the link uti-

lization∑

uv

luvij

cij> 1 holds. We apply no constraints

to force a solution to have a utilization below 1, but sim-ply minimize a certain cost function, which in our case isequation (1). The desired result then is a set of weightswhich corresponds to the minimized cost function. An-other technique to get this result is based on Mixed Inte-ger Programming (MIP). Fortz and Thorup [1] used a lo-cal search heuristic and a convex cost function as a func-tion of link utilizations in the network, which was derivedfrom their experimental study.

4 MIP-based Optimization

Mixed Integer Programming (MIP) as a method to op-timize routing within a specific network is already wellknown [7, 8, 13, 14, 15]. In [7, 8, 13, 14] two formula-tions are needed. The first formulation is to optimize themaximum and average utilization and the second formu-lation is to compute the link weights. The approach in[7, 8] uses no load balancing so that the result obtainedby this method is always a single path routing pattern.

So far, the usage of MIP on routing optimization is re-stricted to small or at most medium-sized networks, de-pending on the associated link structure. An exact solu-tion will not always be possible in reasonable computa-tional time because some problems are NP-hard [15] andas the network grows the resulting integer program is toocomplex to be solved. In such cases heuristics have tobe deployed. A heuristic is more flexible in terms of op-timization criterion (constraints) and scalability problem.Recent work such as [9] tries to utilize MIP on large net-works by using a decomposition method and optimize theparts of the network independently. Such an approach canbe seen as a form of heuristic as well. We will dispensewith a detailed explanation of MIP-based method and useonly the results from [7, 10] to verify our method.

5 Minimizing Weight Changes

Weight changes should be avoided as much as possible[2] for an operational network. The weight change hasto be flooded in the network. As the routers learn aboutthe change, they recompute their shortest paths to updatetheir routing tables, and it may take seconds before allrouters agree on the new shortest paths. The more weightchanges we try to flood simultaneously, the more chaoswe introduce in the network with packets being sent backand forth between routers.

Thus a modification of administrative metric valuesused by OSPF or generally IGP is not desirable too oftenand should be confined to a medium or long term basis[15]. Also, if we want to modify the metric values to op-timize network performance, it is worth to change onlyan amount as small as possible. In the following we in-troduce a different version of the objective function in Eq.(1) in order to minimize the changes to be performed.

(at · t) + (1

|E|·∑

ij

uv

luvij

cij

) + (ay

|E|·∑

k∈E

yk) (5)

yk =

{

1 if wk 6= wrk

0 else(6)

The last term in Eq. (5) measures similaritiesbetween current weights’ configuration as reference〈wr

1, wr

2, · · · , wr

k, · · · , wr|E|〉 and a new configuration to

Page 3: An Alternative Genetic Algorithm to Optimize OSPF Weights

be evaluated 〈w1, w2, · · · , wk, · · · , w|E|〉. The constantsat and ay can be used to trade between the different com-ponents in Eq. (5). Note that k is a vectorized version ofmatrix index ij where i 6= j and cij 6= 0.

6 An Alternative GA for OSPFWSProblem

As mentioned earlier, in [11] a GA for optimizing OSPFweights is proposed. However the GA that we proposein this paper is different. It is based on earlier work byBeckmann [3, 4, 5] with several modifications to adapt tothe problem.

Exit Condition Selection

Add newpopulation

Mutation

Selection

populationStart

yes

no

Reproduction

Figure 1: A GA proposed

Figure 1 shows a block diagram from our GA imple-mentation. We begin with a randomly generated initialpopulation of 50 chromosomes. In contrast to [11] wemake no partitions and all chromosomes belong to thepopulation. After this, the population goes to the evo-lution loop. The exit condition is ideal if the best fitnessfound matches the global optimum of the fitness value.As for most cases we do not know this global optimum,the program will terminate based on a predefined numberof iterations (exit condition). At the beginning of eachiteration some vectors of high quality are selected to pro-duce new, hopefully better solutions. After this selectionprocess there follow two genetic mechanisms ”reproduc-tion” and ”mutation” to form some new chromosomes.Afterwards we construct the next population by substitut-ing the least successful chromosomes of the previous it-eration by the new ones. In the following we will discussthe method in more detail.

6.1 Encoding

In order to apply a genetic algorithm, generally a suit-able encoding of possible solutions in a vector (i.e.chromosome) representation is needed. In our case a

chromosome is represented by a set of link weights〈w1, w2, · · · , wk , · · · , w|E|〉 where wk ∈ [1, MAX ] foreach edge k = 1, ..., |E| and the maximum value forMAX is 65535. Each chromosome has a fitness valueaccording to Eq. (1) and corresponds to a certain linkutilization resulting from a load distribution computed byDijkstra’s shortest path algorithm.

6.2 Selection

All chromosomes will be selected according to their fit-ness. In our case we want a fitness value as small as pos-sible. There are two selection mechanisms i.e. to selectparent chromosomes for a new generation and to removesome of bad chromosomes from the current population.For the first task we implement so called ”rank selection”to make the probability to be selected a little bit more bal-anced for all chromosomes in the population. We firstrank the population and then every chromosome receivesa probability value from this ranking. The probabilityvalue is measured relative to the probability value of thelast (worst) chromosome i.e. the last but one will havetwice that probability etc. For the second task we simplysort the chromosomes according to their fitness from goodto bad and then remove some of the last chromosomes.

6.3 Reproduction

The reproduction strategy used is similar to the one usedin [11], however with different parameters. We have agood convergence for const1 = 0.03 and const2 = 0.53.With an assumption that the random numbers generatedare uniformly distributed in the interval [0, 1], these pa-rameters mean that the chance for gen’s mutation is 3%and the chance for gen’s inheritation from the two parentchromosomes is 50% and 47%. In the following is thepseudocode for this strategy.

for all genes k ∈ [1, |E|]generate r = random [0,1]if r < const1 then

wO1

k , wO2

k = random [1,MAX]else if r < const2 then

wO1

k = wP1

k , wO2

k = wP2

k

elsewO1

k = wP2

k , wO2

k = wP1

k

end ifend for

This process combines both crossover and mutation di-rectly. For all genes we generate a random real number inthe interval [0, 1]. If this number is less than const1, theoffsprings’ genes wO1

k and wO2

k will be mutated by choos-ing a random integer number in the interval [1, MAX ]. Ifthe number is between const1 and const2, wO1

k will beinherited from the gene wP1

k of parent 1 and wO2

k fromthe gene wP2

k of parent 2. If the number is more thanconst2, wO1

k will be inherited from wP2

k and wO2

k fromwP1

k . From this reproduction process we obtain two newchromosomes O1 and O2 (Figure 2).

Page 4: An Alternative Genetic Algorithm to Optimize OSPF Weights

P1 P2

O1 O2

Reproduction

O3O4

MutationMutation

(a) Forming a new generation

������������

������������

������������

������������

Population50 Chromosomes

Population45 Chromosomes

Reproduction

Mutation

8 ChromosomesSelection (parents)

Selection(remove 10%)

Population61 Chromosomes

Offsprings

16 Chromosomes

(best 50 chromosomes)Selection

(b) Population dynamics

Figure 2: Forming a new generation and population dy-namics

6.4 Additional Mutation

In addition to the reproduction process one type of mu-tation is additionally implemented. We apply a heuristicto mutate some genes from offsprings 1 and 2 that do notsatisfy a particular condition. We simply add (substract)a random number to the weight wk if the link utilizationfrom an arc k is bigger (lower) than a particular tresholdbecause we know that the bigger the weight, the lowerthe chance that traffic will get routed on that link and viceversa. With this type of mutation we hope, that the off-springs O3 and O4 have a better link utilization at k, andhopefully also a better maximum and average utilization.This can be seen as a ”targeted” mutation proposed forother problems in [3]. The process to form a new genera-tion and the population dynamics are depicted in Figure 2.

c2c3c1

c4

av0 s1 s2 s3 s4 Link Utilization

Figure 3: A mutation heuristic

Figure 3 shows an example of this heuristic in moredetail. If the current link utilization is larger than s4, weincrease the link cost for that arc by a factor c4. If the cur-rent link utilization is lower than s1, we decrease the linkcost for that arc by a factor c1 etc. The constants ci areactually implemented as upper bounds for these weightchanges i.e. the actual constants are thus randomly gen-erated with these ci as upper bounds. Therefore we do not”disturb” the randomness of the GA.

7 Results

Weight settings and link utilization. First we testedour method with two small networks from [7, 8] con-sisting of only 6 and 10 routers, respectively, in order tocompare our results to those from MIP optimization. Wepresent here only the results and for the capacities andtraffic matrices we refer to the above mentioned papers.

Figure 4: Simulation result of 6 routers network

For the 6 routers network the MAX value was set to6 and we got the optimum value of maximum utilizationof 35.7% and average utilization of 22.7% about 95 timesfrom 100 independent program runs and for each run weused 100 iterations (Figure 4). For the 10 routers networkthe MAX value was set to 30 and we got the optimumvalue of maximum utilization of 96.7% and average uti-lization of 82.9% about 32 times from 100 times indepen-dent program runs and for each run we used 300 iterations(Figure 5). The chance to find the global optimum can beincreased by increasing the number of iterations executed

Page 5: An Alternative Genetic Algorithm to Optimize OSPF Weights

in the GA.

Figure 5: Simulation result of 10 routers network

To give a fair comparison with [7, 8] which used noload balancing: the ”penalty factor” of Thorup’s method[12] was set quite high, so that the resulting weight set-tings yield a single shortest path routing.

Minimizing changes. Figure 6 shows the results withthe modified cost function (Eq. 5). The figures at thetop show the ”current” network, in terms of the weightconfigurations (left) based on inverse capacities and theresulting link utilization (right). With this configurationwe have an average utilization of 22.4% and a maximumutilization of 42.9%. The figures at the bottom show theoptimized network configuration, with an average utiliza-tion of 22.7% and a maximum utilization of 35.7%; this isidentical to the results found in connection with Figure 5.But in this case we only need to change 4 link costs (or28.6% of all) namely (2, 1), (3, 4), (4, 5) and (5, 6). Bycontrast, the solution depicted in Figure 5 was obtainedwithout any considerations to the ”current” weight set-tings.

Convergence. In the following figures we will demon-strate the convergence characteristic of the proposed GA.Figure 7 shows the convergence of average fitness in thepopulation. Figure 8 shows the fitness convergence ofbest chromosome found in the population. The networkused for this simulation is the AT&T network adoptedfrom [16] and consisting of 29 nodes and 100 directedarcs with randomly generated traffic demand. Curves(1) result from 10 independent program runs, using onlythe reproduction strategy mentioned in Section 6.3 andcurves (2) are from a GA using both reproduction and ad-ditional mutations described in Section 6.4. The averagefitness from additionally mutated population convergesfaster than the other one. And of course if the averagefitness in a population is better, then the chance that wehave a better solution is also bigger. But adding additional

Figure 6: Result of minimizing changes

new chromosomes means an increase in computation timefor determining the fitness. Thus we must trade speed forquality. In our case the additional mutation results in adoubling of the run time for one iteration.

100

101

102

0

5

10

15

20

25

Evolution Loop

Fit

nes

s

LP lower boundpopulation average fitness (1)population average fitness (2)

Figure 7: Average population fitness

Increasing traffic. Finally we present the results of ourmethod for the case of increasing traffic demands. InFigure 9 and Figure 10 we compare maximum utiliza-tion based on some common metrics to our results andto a lower bound resulting from a linear programmingresult for the general routing problem. In Figure 9 weused Eq. 1 as objective function. In Figure 10 we usedthe modified objective function (Eq. 5). For compar-ison we considered hop count metric (denoted by Uni-tOSPF) and inverse capacities metric (denoted by InvCa-pOSPF). GA1OSPF denotes the result of our method withload balancing and GA2OSPF denotes one without loadbalancing (single shortest path routing). For both typesof calculations, the value of MAX was set to 99. Fig-

Page 6: An Alternative Genetic Algorithm to Optimize OSPF Weights

100

101

102

0

1

2

3

4

5

6

7

8

Evolution Loop

Fit

nes

sLP lower boundbest chromosome fitness (1)best chromosome fitness (2)

Figure 8: Best chromosome fitness

ure 9 shows that in comparison with InvCapOSPF andUnitOSPF, we can increase the network capacity by fac-tors of at least 35% and 450% respectively, before thenetwork becomes congested. In order to use Eq. 5 areference set of weights is needed. Here we used ran-domly generated weights representing a solution a littlebit better than one resulting from hop count metric. Nev-ertheless we can find solutions that outperform than theperformance of InvCapOSPF and UnitOSPF by factorsof at least 20% and 400%, respectively. The numbers inpercent on the figures show the relative changes to be per-formed from reference weight settings i.e. the last term ofEq. (5). Note that the term ”maximum utilization” usedhere is the theoretical link utilization as discussed in Sec-tion 3.

0.5 1 1.5 2 2.5 3 3.5

x 104

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2

Traffic Volume

Max

Uti

lizat

ion

UnitOSPFInvCapOSPFGA1OSPFGA2OSPFLP lower bound

Figure 9: Increasing traffic (AT&T model network con-sisting of 29 nodes and 100 arcs with Eq. (1) as objectivefunction)

0.5 1 1.5 2 2.5 3 3.5

x 104

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2

Traffic Volume

Max

Uti

lizat

ion

5%

34% 17%

12% 19%

59%30%

59%31%

29% 45%

29%37%

59%

41%

13%

39%

39%

53%

86%

UnitOSPFInvCapOSPFGA1OSPFGA2OSPFLP lower boundReference Setting

Figure 10: Increasing traffic and minimizing changes(AT&T model network consisting of 29 nodes and 100arcs with Eq. (5) as objective function)

8 Conclusions

We have considered the problem of OSPF or generallyIGP link costs setting with an alternative genetic algo-rithm, using the objective function from [7, 8] and en-hancing it in order to minimize changes to be made foran operational network. We proposed in addition a mu-tation heuristic to improve solution quality and to speedup convergence. The program is written in C++ with STL(Standard Template Library) and all calculations are doneon an unloaded PC (800 MHz) running Linux operatingsystem. A single run for the AT&T model network con-sisting of 29 nodes and 100 arcs needs about 10 minutesfor 300 iterations. The application of our method to big-ger networks as reported on in [1, 11] is subject of ourfuture research.

References

[1] B. Fortz, M. Thorup: Internet Traffic Engineeringby Optimizing OSPF Weights, Proc. IEEE Infocom,March 2000.

[2] B. Fortz, M. Thorup: Optimizing OSPF/IS-ISWeights in a Changing World, to appear in IEEEJSAC Special Issue on Advances in Fundamentalsof Network Management, Spring 2002.

[3] D. Beckmann: Algorithmen zur Planung und Opti-mierung moderner Kommunikationsnetze, Disserta-tion, Technical University Hamburg-Harburg, 2001.

[4] D. Beckmann, U. Killat: Routing and WavelengthAssignment in Optical Networks Using GeneticAlgorithms, European Trans. Telecommunications,Vol. 10, Nr. 5, S. 537-544, September 1999.

[5] D. Beckmann, U. Killat: Planning of SurvivableATM Networks Based on the Virtual Path Concept,

Page 7: An Alternative Genetic Algorithm to Optimize OSPF Weights

In 2nd Int. Workshop on the Design of ReliableCommunication Networks, S. 166-173, April 2000.

[6] D. Beckmann, J. Thurow: Global optimization ofSDH networks: a practical application, to appear inInt. Journal of Network Management, John Wiley &Sons Ltd, 2002.

[7] D. Staehle, S. Koehler, U. Kohlhaas: Optimizationof IP Routing by Link Cost Specification, Universityof Wuerzburg, 2000.

[8] D. Staehle, S. Koehler, U. Kohlhaas: Towardsan optimization of the routing parameters for IPnetworks, Technical Report 258, University ofWuerzburg, May 2000.

[9] J. Milbrant, S. Koehler, D. Staehle, L. Berry: De-composition of Large IP Networks for Routing Op-timization, Technical Report 293, University ofWuerzburg, February 2002.

[10] L. Berry, S. Koehler, D. Staehle, P. Tran-Gia: Fastheuristics for optimal routing in large IP networks,Technical Report 262, University of Wuerzburg,July 2000.

[11] M. Ericsson, M.G.C. Resende, P.M. Pardalos: Agenetic algorithm for the weight setting prob-lem in OSPF routing, to appear in J. of Com-binatorial Optimization, preprint October 2001,http://www.research.att.com/∼mgcr/papers.html.

[12] M. Thorup: Avoiding Ties in Short-est Path First Routing, available athttp://www.research.att.com/∼mthorup.

[13] P. Gajowniczek, M. Pioro, A. Szentesi, J.Harmatos,A. Juttner: Solving an OSPF Routing Problem withSimulated Allocation, First Polish-German Teletraf-fic Symposium, PGTS 2000.

[14] P. Karas, M. Pioro: Optimisation Problems Re-lated to the Assignment of Administrative Weightsin the IP Networks’ Routing Protocols, First Polish-German Teletraffic Symposium, PGTS 2000.

[15] W. Ben-Ameur, N. Michel, B. Liau: Rout-ing Strategies for IP-Networks, available athttp://puck.nether.net/lists/irtf-rr/att-0029/.

[16] AT&T Backbone Network, available athttp://www.ipservices.att.com/backbone/.