0% found this document useful (0 votes)
18 views24 pages

22-Distance Vector Routing Protocol-03!03!2025

The document discusses shortest path routing in networks, focusing on how packets travel from source to destination through routers. It outlines the principles of routing, including connectionless forwarding, routing metrics, and algorithms like Bellman-Ford and Dijkstra for determining optimal paths. The document also provides examples and exercises to apply the Bellman-Ford algorithm for finding minimum distances in network topologies.

Uploaded by

meghdave27
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views24 pages

22-Distance Vector Routing Protocol-03!03!2025

The document discusses shortest path routing in networks, focusing on how packets travel from source to destination through routers. It outlines the principles of routing, including connectionless forwarding, routing metrics, and algorithms like Bellman-Ford and Dijkstra for determining optimal paths. The document also provides examples and exercises to apply the Bellman-Ford algorithm for finding minimum distances in network topologies.

Uploaded by

meghdave27
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 24

Shortest Path Routing

School of Electronics Engineering


VIT University
Routing
How do packets get from A to B
in the Internet?

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)

Three possible (loop free) routes from 1 to 6:


◦ 1-3-6, 1-4-5-6, 1-2-5-6
Datagram Network uses minimum hop
routing.
 Packet destined to node 6 arrive at node1.
 1-3-6,
Routing Tables in Datagram Packet
Networks-Route from 1 to 5
Node 3

Node 1 Destination Next node Node 6


Destination Next node 1 1 Destination Next node
2 2 2 4 1 3
3 3 4 4 2 5
4 4 5 6 3 3
5 2 6 6 4 3
6 3 5 5

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

Link State Protocols (Dijkstra)


◦ Link state information flooded to all routers
◦ Routers have complete topology information
◦ Shortest path (& hence next hop) calculated
◦ Dijkstra (centralized) shortest path algorithm
◦ Process from Source node to destination node
03/16/25 10
Bellman-Ford Algorithm
 Initialization
◦ Each node has 1 row for each destination d
◦ Distance of node d to itself is zero: Dd(d)=0
◦ Distance of other node j to d is infinite: Dj(d)=  , for j
d
◦ Next node nj = -1 since not yet defined
 Send Step
◦ Send new distance vector to immediate neighbors
across local link
 Receive Step
◦ For each destination d, find the next hop that gives
the minimum distance to d,
 Di=Minj { Cij + Dj }
 Replace old (nj, Di(d)) by new (nj*, Dj*(d)) if new next
node or distance found
◦ Go to send step
03/16/25 11
Problem-Distance Vector –Bellman-
Ford algorithm

Aly Bellman-Ford algorithm to find


the minimum distance from each
node to destination (node 6) and the
next node along the shortest path.
2 3
1 1
5 2

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
ji
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

Initial (-1, ) (-1, ) (-1, ) (-1, ) (-1, )


1
2
3

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

Initial (-1, ) (-1, ) (-1, ) (-1, ) (-1, )


1 (-1, ) (-1, ) (6,1) (-1, ) (6,2)
2
3
D3=D6+1
n3=6
D6=0
2 3 1
1 1
5 2
0
4 San
3 1 3 6
Jose
2 5 2
4
2
D5=D6+2 D6=0
n5=6
03/16/25 16
03/16/25 17
Iteration Node 1 Node 2 Node 3 Node 4 Node 5

Initial (-1, ) (-1, ) (-1, ) (-1, ) (-1, )


1 (-1, ) (-1, ) (6, 1) (-1, ) (6,2)
2 (3,3) (5,6) (6, 1) (3,3) (6,2)
3

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

Initial (-1, ) (-1, ) (-1, ) (-1, ) (-1, )


1 (-1, ) (-1, ) (6, 1) (-1, ) (6,2)
2 (3,3) (5,6) (6, 1) (3,3) (6,2)
3 (3,3) (4,4) (6, 1) (3,3) (6,2)

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

Apply Bellman-Ford algorithm to find


the minimum distance from each
node to destination (node 5) and the
next node along the shortest path.
2 3
1 1
5 2

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

You might also like