Routing Algorithm
Routing Algorithm
o 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.
o 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.
o 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.
Flooding: In case of flooding, every incoming packet is sent to all the outgoing links except the one from
it has been reached. The disadvantage of flooding is that node may contain several copies of a particular
packet.
Random walks: In case of random walks, a packet sent by the node to one of its neighbors randomly. An
advantage of using random walks is that it uses the alternative routes very efficiently.
It updates tables with information about It has the information of the whole
its neighbors. So, it works based on local network. So, it works based on global
information information
Persistent looping problem i.e, loop will No persistent loops, only transient
be there forever. loops.
Conclusion
Both Distance Vector Routing and Link State Routing are used to find the
best paths for data packets on a network, Routing decides the best path for
transmission of packets between different networks.
Distance vector routing protocol is a protocol that chooses the best path for the destination based
on the parameter distance.
NET ID, Cost, and Next hop are the components of the routing table in distance vector routing.
Link State protocols are also known as the Shortest-path-first protocols and they choose the
path based on the cost of the path.
Routing is the process of choosing the path in the network. Distance vector routing is the
routing protocol that selects the path based on parameter distance. Link State routing
protocol is the protocol that chooses the best path based on the cost of the path.
Link State Routing
All the routers receive the information related to their directly connected links by the link state
protocols. Examples IS-IS (Intermediate System to Intermediate System) and OSPF (Open
Shortest Path First). It is also one of the dynamic routing algorithms in which information about
neighboring routers is shared by the router with all other routers of the network. The router
transmits the information of its neighbor routers to all the routers with the help of flooding.
Information is shared at the time of update only.
In this, Dijkstra’s algorithm is used for creating the routing tables.
Operation
The following steps are executed in the operation of link State routing:
Discovery: A HELLO message is sent to every link of the router on a regular interval by link
state for enabling the router.
Link Cost: To find the cost of every neighbor of the router, each router needs to be subjected to
a series of tests. For determining the cost of its neighbors, end-to-end delay, throughput, or a
combination of both can be used. It is necessary for all the routers that are enabled by link state
to have a cost estimate for all its links.
Link State Packets: Packet is created by every router and this packet contains its neighbors
and also contains the information on the link cost of these neighbors.
Shortest Path: After this, a Dijkstra algorithm can be used by the router to find the shortest
path for reaching the given destination with the help of all the information stored in its link state
table.
Distance vector routing protocol is a protocol that chooses the best path for the destination
based on the parameter distance. Generally, the number of hops is the criteria for measuring
distance metric. Some other factors like packet loss, delay, etc. are also considered for
measuring distance metrics. If the hop is used for the metric distance when the packet passes
through the router then the hop is travelled every time The route in the network having the least
number of hops is considered as the best route for that network.e.g RIP (Routing Information
Protocol) and IGRP (Internal Gateway Routing Protocol) are some examples of distance
vector routing algorithms.
It is one of the dynamic algorithms and in this algorithm, every router calculates the difference
between itself and every potential destination router or we can say its immediate neighbors of
the router. The routing table is updated when the entire network knowledge is shared by the
router with its neighbors.
Information is shared between the routers on a regular basis.
In this routing tables are created by using the bellman ford algorithm.