Unit 8

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 14

Unit-8:

Routing Algorithm
Routing Algorithm
 Fixed Path Routing
 Shortest Path Routing
 Flooding
 Distance Vector Routing
 Link State Routing
Routing algorithm
 Routing is the process of establishing the routes that data packets must follow
to reach the destination.
 For this, a routing table is created that contains information regarding routes
which data packets must follow to transmit the packets from sender to the
receiver.
 The network layer is responsible for determining the best route through which
packets can be transmitted.
 Whether network layer provides datagram service or virtual circuit service, the
main job of network layer is to determine the best rout. For this, routing
algorithm is used.
 Routing algorithm is a routing protocol that provides best path from source to
destination. Here best path means the path with least cost while transmitting
packet from source to destination.
Types of routing algorithm
 Routing algorithm can be categorized into two types:
 Adaptive routing algorithm
 Non-adaptive routing algorithm.
 Adapting routing algorithm is dynamic routing algorithm which makes the
routing decision based on the topology and network traffic.
 Adaptive routing algorithm constructs the routing table based on the network
condition.
 The main parameters related to this algorithm are hop count, distance and
estimated transmit time.
 Adapting routing algorithm can be classified into following types:
 Isolated
 Centralized
 Distributed
Types of routing algorithm
 Isolated: In this, it obtains the routing information by using local
information rather than collecting information from other nodes. The
sending nodes doesn’t have information about status of particular link. Due
to this packet may sent through a congested network which may result in
delay.
 Centralized: It is also known as global routing algorithm as it computes the
least cost path between source and destination by using complete and
global information about the network. In this a centralized node has entire
information about the network and makes all the routing decisions.
Advantage of this is only one node is required to keep the information of
entire network and disadvantage is that if central node goes down the
entire network is down. Link state algorithm is referred to as centralized
algorithm as it is aware of cost of each link in the network.
Types of routing algorithm
 Distributed: In this, node receives information from its neighbor and then
takes the decision about routing the packets. It is also called as
decentralized algorithm as it computes the least cost path between source
and destination in an iterative and distributed manner. In this, no node has
the knowledge about the cost of all network links. At starting, a node
contains information only about its own directly attached links and through
an iterative process of calculation computes the least cost path to the
destination. Distance vector algorithm is distributed algorithm as it never
knows the complete path from source to destination but knows the
direction through which packet is forwarded along with least cost path.
Types of routing algorithm
Non-adaptive routing algorithm:
 These are the algorithms which do not change their routing decisions once they have been
selected.
 It is also known as static routing as route to be taken is computed in advance and installed
to the routers when router is booted.
 There are two types of non-adaptive routing algorithm:
 Flooding: In this, every incoming packets is sent to all outgoing links except the one
from where it has been arrived. It requires no network information like topology, load
condition, cost of different paths. As all routes are tried there will be at least one route
which is shorted. All nodes are directly or indirectly connected are visited. One of the
problem is that packets may go in loop and as a result of which a node may receive
duplicate packets. In order to solve this problem sequence numbers, hop count and
spanning tree method can be used. The main disadvantages of this is that mode may
contain several copies of a particular packet.
 Random walks: In this, a packet is sent by the node to one of its neighbors randomly.
This method can uses the alternative routes very efficiently so there is least queue.
Types of routing algorithm
Differentiate between Routing and Flooding:
Types of routing algorithm
Fixed path routing
 The route is fixed, changes only if the topology of the network changes.
 This term is also known as static routing or non-adaptive routing.
 Fixed routing is not used for real time processing.
 A central routing matrix is created on the least cost path which is stored in the
network control center.
 It shows for each source-destination of the route, the identity of next node on
the route.
 But when network control center fails then everything will collapse. So it is not
reliable.
Types of routing algorithm
Shortest path algorithm
 Shortest path can be calculated only for the weighted graphs. The edges
connecting two vertices can be assigned a non-negative real number called the
weight of the edge. A graph with such weighted edges is called a weighted
graph.
 In an weighted edge graph, the weight of an edge measures the cost of
traveling that edge.
 The weight could represent distance, cost or time.
 Such graph could be used to answer any of the following:
 What is the fastest way to get from A to B?
 Which route from A to B is the least expensive?
 What is the shortest possible distance from A to B?
 Shortest path algorithms can be divided into two types: single source shortest
path (Dijkstra algorithm) and all pair shortest path (Floyd Warshall’s algorithm)
Types of routing algorithm
Dijkstra Algorithm
 The Dijkstra algorithm creates a shortest path tree from a graph. It is also
called as single source shortest path. Dijkstra algorithm gives a procedure for
getting a optimal solution that is minimum result that is shortest path.
 Dijkstra algorithm can work on a directed graph and non-directed graph.
 Dijkstra algorithm is used to find the cost of shortest path from a source vertex
‘u’ to a diestination ‘v’.
 The algorithm divides the two nodes into two sets: tentative and permanent.
 It finds the neighbors of a current node, makes them tentative, examines them
and if they pass the criteria, makes them permanent.
Types of routing algorithm
Dijkstra Algorithm: Steps
Let distance of start vertex from start vertex = 0
Let distance of all other vertex from start = 

Repeat
Visit the unvisited vertex with smallest known distance from the start vertex
For the current vertex, examine its unvisited neighbors
For the current vertex, calculate distance of each neighbor from start vertex.
If the calculated distance of a vertex is less than the known distance, update
the shortest distance
Update the previous vertex for each of the updated distances
Add the current vertex to the list of visited vertices
Until all vertices visited
Types of routing algorithm
Distance vector routing protocols
 It is a dynamic routing algorithm in which each router computes distance
between itself and each possible destination i.e. its immediate neighbors.
 The router shares its knowledge about the whole network to its neighbors and
accordingly updates table based on its neighbors.
 The sharing of information with the neighbors takes place at regular intervals.
It makes use of Bellman Ford algorithm for making routing tables.
 The vector shows the direction to that specific network. Distance vector
protocols send their entire routing table to directly connected neighbors. Some
of the protocols used for distance vector routing protocols are:
 Routing information Protocol (RIP)
 Interior Gateway Routing Protocol (IGRP)
Types of routing algorithm
Link state routing protocols
 It is a dynamic routing algorithm in which each router shares knowledge of its
neighbors with every other router in the network.
 A router sends its information about its neighbors only to all the routers
through flooding.
 Information sharing takes place only whenever there is a change.
 It makes use of Dijkstra Algorithm for making routing tables.
 Link state protocols are also called shortest path first protocols. Link state
routing protocols have a complete picture of the network topology.
 Three separate tables are created on each link state routing enabled router.
 One table hold details about directly connected neighbors one is used to hold
the topology of the entire internetwork and last one is used to hold the actual
routing table.

You might also like