You are on page 1of 17

 A Routing is a process of selecting path along

which the data can be transferred from


source to the destination. Routing is
performed by a special device known as a
router.
 A Router works at the network layer in the
OSI model and internet layer in TCP/IP model
 A router is a networking device that forwards
the packet based on the information available
in the packet header and forwarding table.

Source : https://www.javatpoint.com/computer-network-routing
 The routing algorithms are used for routing the
packets. The routing algorithm is nothing but a
software responsible for deciding the optimal
path through which packet can be transmitted.
 The routing protocols use the metric to
determine the best path for the packet delivery.
The metric is the standard of measurement such
as hop count, bandwidth, delay, current load on
the path, etc. used by the routing algorithm to
determine the optimal path to the destination.
 The routing algorithm initializes and maintains
the routing table for the process of path
determination.

Source : https://www.javatpoint.com/computer-network-routing
 In order to transfer the packets from source to the
destination, the network layer must determine the best
route through which packets can be transmitted.
 Whether the network layer provides datagram service or
virtual circuit service, the main job of the network layer
is to provide the best route. The routing protocol
provides this job.
 The routing protocol is a routing algorithm that
provides the best path from the source to the
destination. The best path is the path that has the
"least-cost path" from source to the destination.
 Routing is the process of forwarding the packets from
source to the destination but the best route to send the
packets is determined by the routing algorithm.

Source : https://www.javatpoint.com/computer-network-routing-algorithm
 Classification of a Routing algorithm

Source : https://www.javatpoint.com/computer-network-routing-algorithm
Adaptive Routing algorithm (Dynamic Routing) Non-Adaptive Routing algorithm (Static
Routing)

Adaptive Routing algorithm is an algorithm that The Non-Adaptive Routing algorithm


constructs the routing table based on the network is an algorithm that constructs the
conditions. static table to determine which node to
send the packet.
Adaptive routing algorithm is used by dynamic The Non-Adaptive Routing algorithm
routing. is used by static routing.
Routing decisions are made based on topology Routing decisions are the static tables.
and network traffic.
The types of adaptive routing algorithm, are The types of Non Adaptive routing
Centralized, isolation and distributed algorithm. algorithm are flooding and random
walks.

Adaptive Routing algorithms are more complex. Non-Adaptive Routing algorithms are
simple.

Source : https://www.differencebetween.com/difference-between-adaptive-and-non-adaptive-routing-algorithms/
 When a packet arrives at a Router, it examines
destination IP address of a received packet and
make routing decisions accordingly.
 Routers use Routing Tables to determine out which
interface the packet will be sent.
 A routing table lists all networks for which routes
are known. Each router’s routing table is unique
and stored in the RAM of the device.

https://www.geeksforgeeks.org/routing-tables-in-
computer-network/
https://www.youtube.com/watch?v=J7XK2W_4e1E
[I] create the weight matrix table
(i) Set 0 to the source vertex and infinite to the remaining vertices.
For all vertices, repeat (ii) and (iii)
(ii) Mark the smallest unmarked value and mark that vertex.
(iii) Find those vertices which are directly connected with marked
vertex and update all.
Update value formula:
New Destination value = minimum (Old Destination value, Marked
value+ Edge Weight)
[II]: Find the shortest path from source to destination using
backtracking.
Put destination vertex in ‘shortest path’
(i) Set pointer to the last marked value and put that vertex to
the ‘shortest path’ list.
(ii) Move the pointer up until marked value is change.
(iii) If the last marked value has been changed then move the
pointer to the marked value in that row and put that vertex
to the ‘shortest path’ list.
Repeat (ii) to (iii) until the pointer will move to source vertex.
https://www.scribd.com/document/396643544/Dijkstra-
Notes
 Find the shortest path from A to F. Show the
intermediate steps also.

https://www.scribd.com/document/396643544/Dijkstra-
Notes
shortest path : F -> E -> A
Minimum cost from A to F is: 2 + 3 = 5

https://www.scribd.com/document/396643544/Dijkstra-
Notes
New Destination value = minimum
(Old Destination value, Marked
B
2 value+ Edge Weight)
A 3
D  A->B -> min(∞, 0+2)=2
2
Minimum
 A->D ->min(∞, 0+3)=3
E A(0)
 A->E ->min(∞, 0+2)=2

C  B->C -> min(∞, 2+2)=4


2 Minimum
B  B->D ->min(3, 2+4)=3 B(2)

4 D

3
 E->F -> min(∞, 2+3)=5 Minimum
E F E(2)

2 C
 D->C -> min(4, 3+2)=4 Minimum
D 4
F
 D->F ->min(5, 3+4)=5 D(3)

https://www.scribd.com/document/396643544/Dijkstra-
Notes
New Destination value = minimum
(Old Destination value, Marked
value+ Edge Weight)

Minimum
C
2
F
 C->F -> min(5, 4+2)=5 C(4)

shortest path : F -> E -> A


Minimum cost from A to F is: 2 + 3 = 5

https://www.scribd.com/document/396643544/Dijkstra-
Notes
 Dynamic Programming
 Single Source shortest Path
 Negative and Non-Non Negative Weights
 Negative edges are not allowed
 Shortest path can have at most n-1 edges
 Flooding is a simple computer network routing
algorithm in which every incoming packet is sent
through every outgoing link except the one it
arrived on
 It requires no network information like topology,
load condition ,cost of diff. Paths
 All possible routes between Source and
Destination is tried. A packet will always get
through if path exists
 As all routes are tried, there will be at-least one
route which is the shortest
 All nodes directly or indirectly connected are
visited

https://www.geeksforgeeks.org/fixed-and-flooding-routing-algorithms/
Limitations
 Flooding generates vast
number of duplicate
packets.
 Flooding can be costly in
terms of wasted
bandwidth. While a
message may only have
one destination it has to
be sent to every host.

https://en.wikipedia.org/wiki/Flooding_(computer_networking)
https://www.geeksforgeeks.org/fixed-and-flooding-routing-algorithms/

You might also like