3.distance Vector Routing
3.distance Vector Routing
3.distance Vector Routing
Prepared by
Divya K S
Adi Shankara Institute of Engineering & Technology
Kalady
Dynamic routing algorithm
2
Distance Vector Routing (DVR)
• Algorithms operate by having each router maintain a table
(i.e, a vector) giving the best known distance to each
destination and which line to use to get there.
• These tables are updated by exchanging information with
the neighbors
• Other names:
• distributed Bellman-Ford routing algorithm
• Ford-Fulkerson algorithm
• original ARPANET routing algorithm used in Internet under
the name RIP (Routing Information Protocol)
3
Routing Algorithms - DVR
• In DVR, each router maintains a routing table containing one
entry for each router in the subnet.
• something similar 4
Distance vector Routing
• The starting assumption for distance vector routing is that each node
knows the cost of the link to each of its directly connected
neighbours.
• Distance to other nodes are assigned to an infinite cost
Steps
Step-01:
Each router prepares its routing table. By their local knowledge. each router knows about-
• All the routers present in the network
• Distance to its neighboring routers
Step-02:
•Each router exchanges its distance vector with its neighboring routers.
•Each router prepares a new routing table using the distance vectors it has obtained from its
•This step is repeated for (n-2) times if there are n routers in the network.
•After this, routing tables converge / become stable.
Distance Vector Routing Example-
• Consider-
• There is a network consisting of 4 routers.
• The weights are mentioned on the edges.
• Weights could be distances or costs or delays.
Step-01:
Each router prepares its routing table using its local knowledge.
• At Router A-
Step-02:
• Each router exchanges its distance vector obtained in Step-01 with its
neighbors.
• After exchanging the distance vectors, each router prepares a new routing
table by updating the distance based on the following equation
• Let dx(y) be the cost of the least-cost path from node x to node y.
• The least costs are related by Bellman-Ford equation,
• dx(y) = minv{c(x,v) + dv(y)}
• where,
• dx(y)= The least distance from x to y
c(x,v)= Node x's cost from each of its neighbour v
dv(y)= Distance from neighbor to node y
minv= selecting shortest distance.
• Cost of reaching destination B from router A = min { 2+0 , 1+7 } = 2 via
B.
• Cost of reaching destination C from router A = min { 2+3 , 1+11 } = 5
via B.
• Cost of reaching destination D from router A = min { 2+7 , 1+0 } = 1 via
D.
New routing table at router B is-
Step-03:
• Each router exchanges its distance vector obtained in Step-02 with its
neighboring routers.
• After exchanging the distance vectors, each router prepares a new
routing table.
•
Important Notes-