Document

Internet Traffic Engineering by
Optimizing OSPF Weights


Bernard Fortz (Université Libre de Bruxelles)
Mikkel Thorup (AT&T Labs-Research)
Presented by : Mordo Shalom
The Routing (Load)
Optimization Problem

Input:




A
A
A
A

directed graph G=(N,A)

D
:
N

N
demand function
R

c
:
A
capacity function
R
cost function  : R   R  R 
 (l , c ) is the cost incured by a routing with
load l on an arc with capacity c.
An instance is given by a triple (G,D,c),
known a priori.

is
The Objective

Any routing R, implies a load function
on the edges l : A R
The cost induced by this load is:


 (l (a))  (l (a), c(a))
a

The total cost of the routing
 R    a (l (a))
aA

The Objective :Find a routing R such
that  R is minimized.
OSPF Routing



The network administrator assigns a

weight to each arc (link): w : A R
OSPF routes packets on the shortest
path induced by the function w.
When there are multiple shortest paths
packets are routed on each of them
with equal probability.
The OSPF Routing
Optimization Problem
Find a weight function
. OSPF ( w) is minimized.

w: A

R such that
The cost function


For each arc a  a is a piecewise-linear non
decreasing function.
In fact any convex function would do the
job.
 1
 3

 10
 a '( x)   70

 500

5000
for
0  x / c(a)  1/ 3
for
1/ 3  x / c(a)  2 / 3
for 2 / 3  x / c(a)  9 /10
for
9 /10  x / c(a)  1
for
1  x / c(a)  11/10
for
11/10  x / c(a)
The Cost Function
70
60
50
40
Cost
30
20
10
0
0
1/3
c(a)
2/3
c(a)
0.9c(a) c(a)
1.1
c(a)
Some Typical Routings




OPT(G,D,c) : the optimal routing for the
instance (G,D,c)
OPTOSPF(G,D,c) : the optimal OSPF
routing …
UNITOSPF(G,D,c) : the OSPF routing for
w(a)=1
INVCAP(G,D,c) : the OSPF routing for
w(a) = 1/c(a)
A normalized cost



d1(s,t) is the length of the shortest path
from s to t where w(a)=1 for all a.
When a  A, c(a)   then  a( x)  x , in
particular  a(l (a))  l (a) .
The cost of the OSPF routing under this
(G, D, )  l   D(s, t )  d (s, t )
setting:

The above value is called 
(G, D)
UNITOSPF

1
a
UNCAP
Properties of UNCAP

It is a lower bound for the cost of any
routing: R, (G, D)   (G, D, c)
In particular:  (G, D)   (G, D, c)
By definition :
UNCAP


UNCAP

OPT
R
OPT
(G, D, c)   OPTOSPF (G, D, c)   UNITOSPF (G, D, c)
Properties of UNCAP (cont’d)
(l (a), c(a))  5000l (a)
(l (a), )  l (a)
(l (a), c(a))  5000(l (a), )
Therefore for any routing R:

R
(G, D, c)  5000 R(G, D, )
In particular:

UNITOSPF
(G, D, c)  5000UNITOSPF (G, D, )  5000UNCAP (G, D)
Properties of UNCAP (cont’d)
Summarizing:


UNCAP
(G, D)   UNITOSPF (G, D, )   OPT (G, D, c) 
OPTOSPF
We define:
(G, D, c)   UNITOSPF (G, D, c)  5000 UNCAP(G, D)

*
R
(G, D, c)   R(G, D, c) /  UNCAP(G, D)
We have:
1   OPT (G, D, c)   OPTOSPF (G, D, c)   UNITOSPF (G, D, c)  5000
*
*
*
The Main Results

For each n there is an instance such that
lim  OPTOSPF  5000
n 




OPT
OPT(G,D,c) can be found in polynomial time.
To find OPTOSPF is NP-Hard, moreover it is
NP-Hard to find a 1.77-approximation to
OPTOSPF
A Local Search Heuristic to approximate
OPTOSPF
The first result
The family of instances (G n, Dn, c n)
3n
3n
3n
s
1
2
3
3
3
3
n
3
n2-2
3
n2-3
n2-4
n2-n-1
3
3
 n x  s, y  t
D ( x, y )  
0 otherwise
3
t
A possible (general) Routing
1
a, l (a)  c(a)
3
3n
3n
3n
s
1
2
3
3
3
3
n
3
n2-2
n2-3
1
a
Each path has length n2
 
OPT
1
1
n2-4
n2-n-1
 (l (a))  l (a)
1
t
R
n
3
A typical OSPF routing
i,
n
s
1
n
2
i
3
n/2
3
2
n/4 3
3
n
3
 3.3   a(l (a))  5000l (a) 
n/2
n/4
n/8
19468
c(a)  5000l (a)  O(1)
3
3
  (n  i )(5000  O(1))  5000 n
2
2
2
i
n2-2
n2-3
n2-4
n2-n-1
n
i
i
 O( n 2 )
lim  OSPF
 5000
3
n 
t
n
The Second Result

There is a polynomial time algorithm to
find OPT(G,D,c)
( s ,t )
Proof: Define f a as the part of the
demand D(s,t) routed through arc a.
Formulate the problem as a Linear
Programming problem.
The Linear Program for OPT
Minimize  a
a A
s.t.
y, s, t  N
 f
( s ,t )
( x, y )
( x , y ) A
a  A, l a  
f
( s ,t )

 f
( y , z ) A
( s ,t )
a
a  A,  a  l a
a  A,  a  3l a  (2 / 3)c( a )
a  A,  a  10l a  (16 / 3)c( a )
...
f
( s ,t )
a
, l a,  a  0
  D ( s, t )
( s ,t )

  D ( s, t )
( y,z)

0

if
ys
if
y t
otherwise
A Local Search Heuristic(HEUR)

W={1,2,…,wmax} is the set of all
possible weights.
The search is on all possible functions
(vectors) w : A W (W )
Start with a random vector x  w W
Do {

} Until x meets some optimality criteria


A
A

RAND
x  SEARCH ( N ( x)  W )
A
The Neighborhood Structure

x '  N ( x) if x’ can be obtained from x
by one of the following two:

Single weight change:



Choose an arc and change its weight
There are |A|x(|W|-1) such neighbors
Evenly balance flows:


Choose a node x and a destination t and
balance
There are |N|x(|N|-1) such neighbors
Evenly Balancing Flows
x1
P1
x2
x
P2
x3
t
P3
xp
Pp
*
w
 1  max{w( P i ) |1  i  p}
w 'i  w  w( P i)
*
Every xi is on a shortest path to t.
Evenly Balancing (cont’d)

We do not want to load already congested arcs,
therefore we make the balancing on a maximal
subset B such that:
if i  B, j  B then
x1
x
x2
x3
xp
B
w
( x,
l
xi)
 w( P i )  w( x ,
xi)  
c ( x, x i )
x j)
 w( P j )
( x,
Where  is chosen from
[0.25,1] at random to diversify
Evenly Balancing (cont’d)

We do not want w’ > wmax, therefore we impose on
B the following additional condition:
W ( B)  {w( P i ) | i  B}
max W ( B)  min W ( B)  wmax  1
Local Search

Do {
x  SEARCH ( N ( x))




} Until x is a local minimum
SEARCH returns x’ s.t. cost(x’)<cost(x)
Problem: A local minimum may be far
from global minimum
Solution: Allow non-improving moves
Local Search (cont’d)




Problem: We may encounter cycles.
Solution: Tabu Search (maintain a tabu
list of the attributes of visited points)
HEUR uses a hash function h and a
table T with 1 bit for each possible
value of h.
If T(h(x’))=true, SEARCH does not
return x’.
Local Search (cont’d)



Problem: Duplicate neighbors due to
the complex neighborhood structure.
Solution: SEARCH maintains an internal
hash table T’.
If T’(h(x’))=true, SEARCH does not
evaluate the cost of x’.
Local Search (cont’d)


Problem: Too much neighbors.
Solution:




r=0.2
At each iteration evaluate only a subset of
the neighbors such that | N '( x) | r | N ( x) |
If (the cost is improved) {r=max(0.01,r/3)}
Else {r=min(1,10c)}
Diversification


Choose  at random as described
before.
If cost is not improved for 300
iterations, perturb x by adding a
random perturbation, selected at
random from [-2,2] to %10 of the
weights.
Cost Calculation


Compute
Compute
l  f
t
a
sN
l  l
a
tN
( s ,t )
a
t
a

Compute  a  (l a, c(a))

Compute     a
aA
Calculation of lat


Compute d(x,t) for each x using Dijkstra’s
algorithm.
Compute the set of arcs At which are on a
shortest path to t:
A  ( x, y)  A | d ( x, t )  d ( y, t )  w
t

t
x


| y  N | ( x, y)  A |
t
( x, y )  A, l ( x , y ) 
t


( x, y )

1 
t
D
(
x
,
t
)


l ( z,x) 
t 
(
z
,
x
)

A

x 

Compute l
by visiting the nodes y in
decreasing order of d(y,t).
t
( x, y )
Recalculation of lat

At each iteration the calculation should
be repeated due to the changes in the
weights:


Recalculation of d(x,t) : At each iteration
only edges emanating from a single node
are changed.
We use the Ramalingam & Reps algorithm
(Dijkstra on dynamic graphs). Its running
time is proportional to the number of edges
incident to nodes for which d(x,t) changed.
Recalculation of


t
la
(cont’d)
In the same manner At’ is calculated for
edges incident to nodes x with d(x,y)
changed.
Maintain a set M of critical nodes:

Initially M contains all the nodes with incident
edges in At  At ' i.e. the nodes with d(x,y)
changed and their neighbors.
Numerical Results

Two Additional routings are measured, along
the others:



L2OSPF : weights proportional to the Euclidean
distance between nodes.
RANDOMOSPF : Weight are assigned randomly
(The first step of HEUR).
The algorithms are compared on real and
synthetic networks:


AT&T proposed backbone (real)
2-level graphs (synthetic)
Costs on a real network
14
12
OPT
RANDOM
HEUR
UNITOSPF
L2OSPF
INVCAP
THRESHOLD
10
8
6
4
2
0
Demand
Max. Utilization on a real network
1.4
1.2
OPT
RANDOM
HEUR
UNITOSPF
L2OSPF
INVCAP
THRESHOLD
1
0.8
0.6
0.4
0.2
0
Demand
Max Utilization on a 2-level network
Conclusions from Numerical Results

HEUR is the best algorithm.



InvCap is the best oblivious algorithm


In fact it is the only algorithm “knowing” the
demands
It achieves performance close to %2 of OPT.
Surprisingly UnitOSFP performs almost as good as
InvCap
L2OSPF and RANDOMOSPF are worst.

In fact there is almost no difference between the
two.