Professional Documents
Culture Documents
Computer Networks
Dr. Jorge A. Cobb
Solving an SPP
Given an SPP, can we check if it is solvable?
Sure,
• enumerate all possible states
• For each state, check if it is stable
Exponential complexity!!
Can be done for only tiny examples.
Can we do better?
Solvability of SPP is NP-Complete
• What does that mean? The best way we know takes
exponential time in the size of the input (i.e. the size of
S)
2
Network Algorithms for Solving SPP
Centralized (static):
• All nodes learn the SPP S = (G, P,Λ)
• Solve SPP locally
• Exponential worst case
Distributed (dynamic):
• Pick the best path from the set of your neighbor’s
paths, tell your neighbors when you change your
mind
• Can diverge
• Not guaranteed to find a solution, even when one
exists
• No bound on convergence time
3
Distributed Solution may wander forever
= assignment = solution
4
Another Picture
Can diverge
SPP solvable
5
Naughty Gadget
Has a unique solution (see below)
(1 3 0) (2 1 0)
(1 0) 1 2 (2 0)
(3 4 2 0) (4 3 0)
3 4
(3 0) (4 2 0)
(1 3 0) (2 1 0)
(1 0) 1 2 (2 0)
(3 4 2 0) (4 3 0)
3 4
(3 0) (4 2 0)
7
Naughty Gadget (divergence)
(1 3 0) (2 1 0)
(1 0) 1 2 (2 0)
(3 4 2 0) (4 3 0)
3 4
(3 0) (4 2 0)
8
Naughty Gadget (divergence)
(1 3 0) (2 1 0)
(1 0) 1 2 (2 0)
(3 4 2 0) (4 3 0)
3 4
(3 0) (4 2 0)
9
Naughty Gadget (divergence)
(1 3 0) (2 1 0)
(1 0) 1 2 (2 0)
(3 4 2 0) (4 3 0)
3 4
(3 0) (4 2 0)
10
Naughty Gadget (divergence)
(1 3 0) (2 1 0)
(1 0) 1 2 (2 0)
(3 4 2 0) (4 3 0)
3 4
(3 0) (4 2 0)
11
Naughty Gadget (divergence)
(1 3 0) (2 1 0)
(1 0) 1 2 (2 0)
(3 4 2 0) (4 3 0)
3 4
(3 0) (4 2 0)
12
Naughty Gadget (divergence)
(1 3 0) (2 1 0)
(1 0) 1 2 (2 0)
(3 4 2 0) (4 3 0)
3 4
(3 0) (4 2 0)
13
Naughty Gadget (divergence)
(1 3 0) (2 1 0)
(1 0) 1 2 (2 0)
(3 4 2 0) (4 3 0)
3 4
(3 0) (4 2 0)
14
Naughty Gadget (divergence)
(1 3 0) (2 1 0)
(1 0) 1 2 (2 0)
(3 4 2 0) (4 3 0)
3 4
(3 0) (4 2 0)
15
BGP converge problems
SOLVABILITY
• The existence of a stable state
REACHABILITY
• In every stable state, whether AS v has a path to AS w
ASYMMETRY
• In every stable state, whether the AS path from AS v
to w is the reverse path from AS w to v
TRAPPED
• The existence of a trap (never reach a stable state if
you enter the set of trapped states).
16
BGP converge problems (Cont.)
K-Robust
• Will solvable set of routing policies remain solvable
under any k links failure
Unique
• Uniqueness of final state
Multiple
• Whether a solvable set of routing policies has more
than one final state
17
Complexity results
REACHABILITY is NP-complete
ASYMETRY is NP-complete
SOLVABILITY is NP-complete;
TRAPPED is NP-hard
K- ROBUST is NP-hard
UNIQUE is NP-hard
MULTIPLE is NP-complete
18
A Sufficient Condition for Sanity
If an instance of SPP has an acyclic dispute digraph,
then
19
Dispute Digraph
The “nodes” in the graph correspond to paths in the
SPP instance.
There are two types of arcs (or edges) in the directed
dispute graph:
• Conflict arcs
• Transmission arcs.
If this graph is acyclic, then the SPP instance has all
the nice properties of the previous slide.
If this graph has cycles, we cannot infer anything.
20
Dispute Arc
P
u v 0
… …
(u v)P Q
… …
(u v)Q P Q
... ... Note: it is also possible that (u v)Q is not
allowed at u
Gives the dispute arc
Q (u v)P
21
Transmission arc
P
u v 0
… …
(u,v)P P
... ...
P (u,v)P
22
Dispute Digraph Example
130 210 20 10
10 20
1 2 420 210
0 CYCLE
3420
3 4
3420 430
430 130
30 420
NAUGHTY GADGET 30
23
Dispute Digraph Example cont.
130 210 10
10 20
210
1 2 130
24
Dispute Wheels
u0 u0, u1, … , uk are nodes (not
Rk R0
uk u1 necessarily distinct)
R1
Q0 Ri is a path from ui to u(i+1)
Q1 u2
Qk Qi is a path from ui to 0
Q2 Qi and Ri Q(i+1) ∈ Pui
λui(Qi) ≤ λui (Ri Q(i+1))
Q(i+1)
There exists a dispute
Qi wheel iff there exists cycle
in the dispute digraph
u(i+1)
Ri
ui
25
An Application
c is a cost function on edges in SPP.
c is coherent if all cycles have positive cost (> 0).
An SPP specification is consistent with c if
… v Q
Q
c(P) ≥ c(Q)
…
implies
P
...
P
27
A Dynamic Solution
Extend SPP with a history attribute
A route’s history contains a path in the dispute
digraph that “explains” how the route was obtained,
A route history will contain a dispute cycle if and only
if a policy dispute is dynamically realized.
If a route’s history contains a cycle, then suppress it
….
Nodes read their neighbor’s current path and the
associated path history of the path.
28
Updating the history
If your new path is better than your previous path
(higher ranked)
• Add your new path (with a + sign) to the history of your
neighbor.
If your new path is worse (lower ranked) than your
previous path
• Add your PREVIOUS path (with a – sign) to the history
of your neighbor
29
BAD GADGET
210
2
20 420
4 430
1 3
130 3420
10 30
30
path event history for path
1 : (1 0) e
2 : (2 0) e
3 : (3 4 2 0) e
4 : (4 2 0) e
… … … …
TIME
1 : (1 0) e
2 : (2 1 0) (+ 2 1 0)
3 : (3 0) (- 3 4 2 0) (- 4 2 0) (+ 2 1 0)
4:( ) (- 4 2 0) (+ 2 1 0)
1 : (1 3 0) (+ 1 3 0) (- 3 4 2 0) (- 4 2 0) (+ 2 1 0)
2 : (2 1 0) (+ 2 1 0)
3 : (3 0) (- 3 4 2 0) (- 4 2 0) (+ 2 1 0)
4:( ) (- 4 2 0) (+ 2 1 0)
1 : (1 3 0) (+ 1 3 0) (- 3 4 2 0) (- 4 2 0) (+ 2 1 0)
2 : (2 0) (- 2 1 0) (+ 1 3 0) (- 3 4 2 0) (- 4 2 0) (+ 2 1 0) A CYCLE!
3 : (3 0) (- 3 4 2 0) (- 4 2 0) (+ 2 1 0)
4:( ) (- 4 2 0) (+ 2 1 0)
… …
31
What’s going on ?
32