Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
96 views

11 Routing Algorithms

The document summarizes several routing algorithms used at the network layer: - Shortest path algorithm finds the shortest path between routers on a graph of the network. Flooding sends every packet on every outgoing link except the incoming one. - Distance vector routing uses routing tables exchanged between neighbors to determine best routes. Link state routing similarly uses topology information. - Hierarchical routing divides routers into regions, with each knowing full details within but only general routes between regions.

Uploaded by

Rahul Aryan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views

11 Routing Algorithms

The document summarizes several routing algorithms used at the network layer: - Shortest path algorithm finds the shortest path between routers on a graph of the network. Flooding sends every packet on every outgoing link except the incoming one. - Distance vector routing uses routing tables exchanged between neighbors to determine best routes. Link state routing similarly uses topology information. - Hierarchical routing divides routers into regions, with each knowing full details within but only general routes between regions.

Uploaded by

Rahul Aryan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Routing

MCA 2nd Semester - 2021


Vidyasagar University
Routing Algorithms
• One of the main functions of the network layer is routing packets
from the source machine to the destination machine.
• The routing algorithm is that part of the network layer software
responsible for deciding which output line an incoming packet
should be transmitted on.
• Routing algorithms can be grouped into two classes: nonadaptive
and adaptive.
• Nonadaptive algorithms do not base their routing decisions on any
measurements or estimates of the current topology and traffic.
– Examples: Shortest path algorithm, Flooding.
• Adaptive algorithms, in contrast, change their routing decisions to
reflect changes in the topology, and sometimes changes in the
traffic as well.
– Examples: Distance vector routing, Link state routing,
Hierarchical Routing
Shortest Path Algorithm
• In this algorithm, a graph of the network is
built, with each node representing a router
and each edge representing a link.
• To choose a route between a given pair of
routers, the algorithm finds the shortest path
between them on the graph.
Example to find the Shortest Path
Flooding
• In flooding, every incoming packet is sent out on every
outgoing line except the one it arrived on.
• Flooding generates vast numbers of duplicate packets.
So some measures are taken to reduce the duplicate
packets.
• One such measure is to have a hop counter contained
in the header of each packet that is decremented at
each hop, with the packet being discarded when the
counter reaches zero.
• A better technique for damming the flood is to have
routers keep track of which packets have been flooded,
to avoid sending them out a second time.
Distance Vector Routing
• A distance vector routing algorithm operates by having each router
maintain a table (known as a vector) giving the best known distance
to each destination and which link to use to get there.
• These tables are updated by exchanging information with the
neighbors. Eventually, every router knows the best link to reach
each destination.
• The vector contains one entry for each router in the network. This
entry has two parts: the preferred outgoing line to use for that
destination and an estimate of the distance to that destination.
• The distance might be measured as the number of hops or using
another metric.
• The router is assumed to know the 'distance' to each of its
neighbors.
• If the metric is hops, the distance is just one hop. If the metric is
propagation delay, the router can measure it directly with special
ECHO packets.
Distance Vector Routing Example
Hierarchical Routing
• As networks grow in size, the router routing
tables grow proportionally. At a certain point, the
network may grow to the point where it is no
longer feasible for every router to have an entry
for every other router, so the routing will have to
be done hierarchically.
• In this technique, the routers are divided into
regions. Each router knows all the details about
how to route packets to destinations within its
own region but knows nothing about the internal
structure of other regions.
Hierarchical Routing Example
Congestion Control Algorithms
• Too many packets present in (a part of) the network causes
packet delay and loss that degrades performance. This
situation is called congestion. The network and transport
layers share the responsibility for handling congestion.
Leaky Bucket Algorithm
• Consider a bucket with a small hole in the bottom. No
matter the rate at which water enters the bucket, the
outflow is at a constant rate, R, when there is any
water in the bucket and zero when the bucket is empty.
• Also, once the bucket is full to capacity B, any
additional water entering it spills over the sides and is
lost.
• This bucket can be used to shape packets entering the
network. Conceptually, each host is connected to the
network by an interface containing a leaky bucket.
• This technique was proposed by Turner (1986) and is
called the leaky bucket algorithm.
Token Bucket Algorithm
• A different but equivalent formulation is to consider
the network interface as a bucket that is being filled at
rate R and the bucket has a capacity of B, as before.
• Now, to send a packet we must be able to take tokens.
No more than a fixed number of tokens can
accumulate in the bucket, and if the bucket is empty of
tokens, we must wait until more tokens arrive before
we can send another packet.
• A token is generated in every ΔT seconds. Thus we can
control the number of packets entering in the network
by increasing or deceasing ΔT, thus making the
algorithm dynamic in nature.

You might also like