Upload
md-saidur-rahman-kohinoor
View
218
Download
0
Embed Size (px)
Citation preview
7/25/2019 Distance Vector: Step By Step
1/12
Distance-vector Algorithms
CSE 313: Computer Networks
G
7/25/2019 Distance Vector: Step By Step
2/12
Distance vector: Each node sends list of its shortest distance to reach
each of its directly connected neighbors.
Algorithm:
o Bellman-Ford algorithm
Distributed route computation using only neighbors
information.
o Iterative, asynchronous: eachlocal iteration caused by:
Local link cost change Distance vector update message from neighbor
o Distributed:Each node notifies neighbors only when its DV changes
Neighbors then notify their neighbors if necessary.
7/25/2019 Distance Vector: Step By Step
3/12
Bellman-Ford Algorithm:
Define distances at each node X dx(y) = cost of least-cost pathfrom Xto Y
Update distances based on neighbors
dx(y) = min {c(x,v) + dv(y)} over all neighbors V
3
V 2 y
1 x 4U
2 1
5
w 4 3
s
1
z
t
du(z) = min{c(u,v) + dv(z), c(u,w) + dw(z)}
7/25/2019 Distance Vector: Step By Step
4/12
Step-by-Step:
c(x,v)=cost for direct link fromxtov Node x maintains costs of direct links c(x,v)
Dx(y)=estimate of least cost fromxtoy
Node xmaintains distance vector Dx= [Dx(y): yN ]
Node xmaintains its neighborsdistance vectors
For each neighbor v, xmaintains Dv= [Dv(y): yN ]
Each node vperiodically sends Dvto its neighbors
And neighbors update their own distance vectors
Dx(y) minv{c(x,v) + Dv(y)}for each nodeyN
7/25/2019 Distance Vector: Step By Step
5/12
Example: Initial State
7
B 1 C
A 8 2
1
E 2 D
Info atDistance to Node
A B C D Enode
A 0 7 1
B 7 0 1 8
C 1 0 2
D 2 0 2
E 1 8 2 0
18
7/25/2019 Distance Vector: Step By Step
6/12
D sends vector toE
Im 2 from C, 0 from
D and 2 from E
7
B 1 C
A 8 2
1
E2
D
D is 2 away, 2+2< ,
so best path to C is 4
Info atDistance to Node
A B C D Enode
A 0 7 1
B 7 0 1 8
C 1 0 2
D 2 0 2
E 1 8 4 2 0
19
7/25/2019 Distance Vector: Step By Step
7/12
B sends vector toA
7
A
1
Im 7 from A, 0
from B, 1 from C
& 8 from E
B 1 C
8 2
E 2 D
B is 7 away, 1+7< so
best path to C is 8
Info atDistance to Node
A B C D Enode
A 0 7 8 1
B 7 0 1 8
C 1 0 2
D 2 0 2
E 1 8 4 2 0
20
7/25/2019 Distance Vector: Step By Step
8/12
E sends vector toA
E is 1 away, 4+1
7/25/2019 Distance Vector: Step By Step
9/12
until Convergence
7
B 1 C
A 8 2
1
E2
D
Info atDistance to Node
A B C D Enode
A 0 6 5 3 1
B 6 0 1 3 5
C
5
1
0
2
4
D 3 3 2 0 2
E 1 5 4 2 0
22
7/25/2019 Distance Vector: Step By Step
10/12
Node Bs distance vectors
7
B 1 C
A 8 2
1
E2
D
Next hop
Dest A E C
A 7 9 6
C 12 12 1
D 10 10 3
E 8 8 5
23
7/25/2019 Distance Vector: Step By Step
11/12
Handling Link Failure
A marks distance to E as , and tells B
E marks distance to A as , and tells B and D
B and D recompute routes and tell C, E and E etc until converge
Info Distance to Node
B 1 C at
A B C D E7 node
A 8 2A 0 7 8 10 12
B 7 0 1 3 5
E 2 D C
8
1
0 2 4
D 10 3 2 0 2
E 12 5 4 2 0
7/25/2019 Distance Vector: Step By Step
12/12
THANK YOU