Network Routing DV
Network Routing DV
=
=
dest i 0
) 0 ( d
=
otherwise
) 0 (
i
d
26
Example
C B
7
1
Example
A
E
D
8
10
2
2
Consider D as destination; d(t) is a vector consisting of
ti ti f h d t d t
2
A B C E D
estimation of each node at round t
d(0)
0
d(1)
2 2 0
( )
2 2 0
d(2)
12 3 2 2 0
d(3)
10 3 2 2 0
d(4)
10 3 2 2 0
27
Observation: d(0) > d(1) > d(2) > d(3) > d(4) =d*
A Nice Property of SBF: Monotonicity
)) ( ( min ) 1 (
) (
h d d h d
j ij i N j i
+ = +
e
A Nice Property of SBF: Monotonicity
d f d( ) d d( ) Consider two configurations d(t) and d(t)
If d(t) > d(t)
i.e., each node has a higher estimate in one , g
scenario (d) than in another scenario (d),
then d(t+1) > d(t+1)
i.e., each node has a higher estimate in d than in d i.e., each node has a higher estimate in d than in d
after one round of synchronous update.
28
Correctness of SBF/
)) ( ( min ) 1 (
) (
h d d h d
j ij i N j i
+ = +
e
Correctness of SBF/
Claim: d
i
(h) is the length L
i
(h) of a Claim: d
i
(h) is the length L
i
(h) of a
shortest path from i to the destination
using h hops using h hops
base case: h = 0 is trivially true base case: h = 0 is trivially true
assume true for h assume true for h,
i.e., L
i
(h)= d
i
(h), L
i
(h-1)= d
i
(h-1),
29
Correctness of SBF/
)) ( ( min ) 1 (
) (
h d d h d
j ij i N j i
+ = +
e
Correctness of SBF/
consider h+1 hops: consider h 1 hops:
= + ) 1 (h L
i
))) ( ( min ), ( min(
) (
h L d h L
j ij i N j i
+
e
) (
i
))) ( ( min ), ( min(
) (
h d d h d
j ij i N j i
+ =
e
))) ( ( ) ( (
) ( j ij i N j i e
)) 1 ( ), ( min( + = h d h d
i i
))) ( ( ), ( (
) ( j ij i N j i e
)) 1 ( ), ( min( + h d h d
i i
since d
i
(h) d
i
(h-1)
) ( )) 1 ( ( min )) ( ( min ) 1 (
) ( ) (
h d h d d h d d h d
i j ij i N j j ij i N j i
= + s + = +
e e
30
) 1 ( ) 1 ( + = + h d h L
i i
Bellman Equation q
We referred to the equations as We referred to the equations as
Bellman equations (BE):
) ( min
) ( j ij i N j i
d d d + =
e
where d
D
= 0.
- SBF/ solves the equations in a
distributed way d str buted way
- Does the equation have a unique
s luti n (i th sh rt st p th n )?
31
solution (i.e., the shortest path one)?
Uniqueness of Solution to BE
) ( min
) ( j ij i N j i
d d d + =
e
Uniqueness of Solution to BE
h l d ll h h Assume another solution d, we will show that
d = d*
case 1: we show d > d*
Since d is a solution to BE we can construct Since d is a solution to BE, we can construct
paths as follows: for each i, pick a j which
satisfies the equation; since d* is shortest d > d* satisfies the equation; since d* is shortest, d > d*
1
C B
1
2
3
1
1
Dest.
A
C B
7
8
10
1
2
10
32
1
1
E
D
10
2
2
Uniqueness of Solution to BE
) ( min
) ( j ij i N j i
d d d + =
e
Uniqueness of Solution to BE
h d d* Case 2: we show d d*
assume we run SBF with two initial
configurations: configurations
one is d
another is SBF/ (d
) another is SBF/ (d ),
-> monotonicity and convergence of SBF/ imply m n n y an n rg n f F/ mp y
that d d*
33
Outline Outline
k Network overview
Control plane: routing overview p g
Distance vector protocols
synchronous Bellman-Ford (SBF) synchronous Bellman-Ford (SBF)
- SBF/
- SBF/-1 F/
34
SBF at another
Initial Configuration: SBF/ 1
C B
7
1
Initial Configuration: SBF/-1
A
E
D
8
10
2
2
Initialization (time 0):
2
=
=
dest i 0
) 0 ( d
=
otherwise 1
) 0 (
i
d
35
Example
C B
7
1
Example
A
E
D
7
8
10
2
2
Consider D as destination
2
A B C E D
d(0)
-1 -1 -1 -1 0
d(1)
6 0 0 2 0
d(2)
7 1 1 2 0
d(2)
7 1 1 2 0
d(3)
8 2 2 2 0
d(4)
9 3 3 2 0
d(5)
10 3 3 2 0
d(6)
10 3 3 2 0
36
Observation: d(0) s d(1) s d(2) s d(3) s d(4) s d(5) = d(6) = d*
Bellman Equation and
Correctness of SBF/ 1
)) ( ( min ) 1 (
) (
h d d h d
j ij i N j i
+ = +
e
Correctness of SBF/-1
SBF/-1 converges due to monotonicity SBF/ 1 converges due to monotonicity
At equilibrium, SBF/-1 satisfies the set of equations
called Bellman equations (BE) q ( )
) ( min
) ( j ij i N j i
d d d + =
e
where d
D
= 0.
Another solution is shortest path solution d*
Since there is a unique solution to the BE equations; Since there is a unique solution to the BE equations;
thus SBF/-1 converges to shortest path
Question: will SBF converge under other non-negative initial conditions?
37
Question: will SBF converge under other non negative initial conditions?
Problems of running synchronous BF?
Outline Outline
k Network overview
Control plane: routing overview p g
Distance vector protocols
o synchronous Bellman-Ford (SBF) o synchronous Bellman-Ford (SBF)
asynchronous Bellman-Ford (ABF)
38
Asynchronous Bellman-Ford (ABF) Asynchronous Bellman Ford (ABF)
f l b l No notion of global iterations
each node updates at its own pace
Asynchronously each node i computes
) ( i
i
d d d
using last received value d
i
j
from neighbor j.
) ( min
) (
i
j ij i N j i
d d d + =
e
g
j
f g j
Asyncrhonously node j sends its estimate to Asyncrhonously node j sends its estimate to
its neighbor i:
there is an upper bound on the delay of estimate there is an upper bound on the delay of estimate
packets (no worry for out of order)
Asynchronous Bellman-Ford (ABF) Asynchronous Bellman Ford (ABF)
l d d ff d In general, nodes are using different and
possibly inconsistent estimates
j
d
i
d
j
i
d
i
j
d
i
d
i
Distance Table: Example
C B
7
1
Distance Table: Example
A
E
D
7
8
10
2
Below is just one step! The protocol repeats forever!
E
D
2
d ()
distance tables
from neighbors
computation
Es
distance
t bl
distance
table E sends
A B D
A B D
d ()
A
E
table
to its neighbors
A: 10
10 15
A B D
0 7
A B D
A: 10
B
A: 10
B: 8 7 0
B: 8
17 8
C
C: 4 1 2 D: 4 9 4
D
D: 2 0
D: 2
2
E: 0 10 8 2
Asynchronous Bellman-Ford (ABF) Asynchronous Bellman Ford (ABF)
BF ll ll h h ABF will eventually converge to the shortest
path
links can go down and come up but if topology is
stabilized after some time t, ABF will eventually
t th sh t st th ! converge to the shortest path !
If h k i d h ABF If the network is connected, then ABF
converges in finite amount of time, if
di i conditions are met
ABF Convergence ABF Convergence
h d ff f BF There are too many different runs of ABF,
so need to use monotonicity
Consider two sequences: Consider two sequences
SBF/; call the sequence U()
SBF/-1; call the sequence L()
System State System State
j
i
where can distance estimate from node j appear?
System State System State
three types of three types of
distance estimates
from node j:
dj
from node j
- d
j
: current
distance estimate
d
i
d
i
j
d
i
j
at node j
- d
i
j
: last d
j
that
neighbor i received
d
i neighbor i received
- d
i
j
: those d
j
that
are still in transit are still in transit
to neighbor i
ABF Convergence ABF Convergence
d h h h l Consider the time when the topology is
stabilized as time 0
U(0) and L(0) provide upper and lower bound U(0) and L(0) provide upper and lower bound
at time 0 on all corresponding elements of
states states
L
j
(0) d
j
U
j
(0) for all d
j
state at node j
L
j
(0) d
i
j
U
j
(0) L
j
(0) d
j
U
j
(0)
L
j
(0) update messages d
i
j
U
j
(0)
ABF Convergence ABF Convergence
d d
j
after at least one
d d update at node j:
d
j
falls between
L (1) d U (1)
dj
L
j
(1) d
j
U
j
(1)
d
i
d
i
d
i
j
d
i
j
d
i
j
:
eventually all d
i
j
that
l b d d b are only bounded by
L
j
(0) and U
j
(0) are
replaced with in replaced with in
L
j
(1) and U
j
(1)
Asynchronous Bellman-Ford: Summary Asynchronous Bellman Ford: Summary
Distributed: each node Distributed: each node
communicates its routing table to
its directly attached neighbors its directly-attached neighbors
Iterative: continues periodically or p y
when link changes, e.g. detects a link
failure
Asynchronous: nodes need not
exchange info/iterate in lock step! exchange info/iterate in lock step!
Convergence in finite steps,
independent of initial condition if independent of initial condition if
network is connected
Properties of Distance-Vector Algorithms Properties of Distance Vector Algorithms
G d f Good news propagate fast
Properties of Distance-Vector Algorithms Properties of Distance Vector Algorithms
Bad news propagate slowly Bad news propagate slowly
This is called the counting-to-infinity
problem
Question: why does counting-to-infinity happen?
Backup Slides
51
Using Virtual Circuit to Implement
N t k S i Network Services
I d t id f ti liti In order to provide some functionalities, a
network may choose virtual circuit, e.g., Virtual
Private Network (VPN) ( )
52
Using Datagram to Implement the
M t B i N t k S i Most Basic Network Service
A datagram network generally provides simple
services: the forwarding of packets from src to
dest.
We will focus on datagram networks which provide
best effort service
extensions to provide more services will be discussed in
53
extensions to provide more services will be discussed in
the multimedia networking part of the course