22-Distance Vector Routing Protocol-03!03!2025
22-Distance Vector Routing Protocol-03!03!2025
Internet
A B
03/16/25 2
Connectionless
Forwarding
Each router (switch) makes a
LOCAL decision to forward the
packet towards B
R1 R4
R7
R6
R2
A B
R8
R3
R5
03/16/25 3
Routing in Network Layer
Determining the feasible path for
packets to follow from each source to
destination.
◦ Best path.
Minimize the number of hops.
End to end delay.
Greatest bandwidth.
Goals
◦ Rapid and accurate delivery of packets.
◦ Adaptability to changes in Network Topology in failures
cases.
◦ Adaptability to varying load –heavy and light traffic periods.
◦ Ability route packets from temporarily congested links.
◦ Avoid routing loops.
03/16/25 4
Routing Metrics
Means for measuring desirability of a path
Path Length = sum of costs or distances
Possible metrics
◦ Hop count: rough measure of resources used
◦ Capacity: Send a packet through a path with
highest capacity.
◦ Congestion: Traffic load
◦ Reliability: link availability; BER
◦ Delay: sum of delays along path; complex &
dynamic
◦ Bandwidth: “available capacity” in a path
◦ Load: Link & router utilization along path
◦ Cost
03/16/25 5
Shortest Paths & Routing
Many possible paths connect any given
source and to any given destination
Routing involves the selection of the
path to be used to accomplish a given
transfer
Typically it is possible to attach a cost
or distance to a link connecting two
nodes
Routing can then be posed as a
shortest path problem
03/16/25 6
Routing
Routing algorithm based on variants
of shortest path.
Set of nodes-each node represents packet
switching
Set of links- each link represents
transmission line between two packet
switches.
◦ Shortest path between pair of nodes is
the path with
2 least 3cost.
1
Find the
5 path 2from node 1 to 6 with least cost.
1
4
3 1 3 6
2
2 5
4 03/16/25 7
Multiple paths in packet switching
Network---Datagram Network
1 3
6
2 Node
5
(switch or router)
Node 4
Destination Next node
1 1
2 2
Node 2 Node 5
3 3
Destination Next node Destination Next node
5 5
1 1 6 3 1 4
3 1 2 2
4 4 3 4
5 5 4 4
6 5 6 6
Shortest Path Aroaches
Distance Vector Protocols(Bellman-Ford
Alg.)
◦ Neighbors exchange list of distances to destinations
◦ Best next-hop determined for each destination
◦ Ford-Fulkerson (distributed) shortest path algorithm
◦ Process from destination to source node
4
3 1 3 6
2
2 5
4
03/16/25 12
Bellman-Ford Algorithm-Minimum
cost
To find the minimum cost from
each node to the destination
node (node 6 ).
◦ Each node ‘i’ maintains an entry
(n,Di),
where ‘n’ is the next node and
Di is the current minimum cost from node ‘i’
to the destination.
03/16/25 13
Steps involved
1. Initialization (destination node d
is distance ‘0’ from itself)
Di(d)= for all i d
Dd=0
2. Updating (find the minimum distance to
destination through neighbors ): For each i
d
Di=Minj { Cij + Dj } for all
ji
3. Repeat the steps until no more changes
occur in the iteration.
03/16/25 14
Iteration Node 1 Node 2 Node 3 Node 4 Node 5
2 3
1 1
5 2
4
3 1 3 6
2
2 5
4
03/16/25 15
Iteration Node 1 Node 2 Node 3 Node 4 Node 5
3 1
2 3
1 1
5 2
3 0
4 San
3 1 3 6
Jose
2 2
5
4
6 2
03/16/25 18
Iteration Node 1 Node 2 Node 3 Node 4 Node 5
1
3 2 3
1 1
5 2
3 0
4 San
3 1 3 6
Jose
2
2 5
4
6 4 2
03/16/25 19
Shortest path tree to node
6
2 3
1 1
2
4
1 6
2
2 5
03/16/25 20
Consider the network given below. Write the
Bellman-Ford algorithm and use it to find the set
of shortest paths from all nodes to destination
node T.
03/16/25 21
S,3 U,8 V,6 W,6 X,5
Y,8 Z,8
03/16/25 22
Exercise 1
4
3 1 3 6
2
2 5
4
03/16/25 23
Exercise 2
Consider the network shown below. Using the Bellman-
Ford algorithm, find the set of shortest paths from node
6 to all other nodes.
03/16/25 24