Layer 3.
The Network layer
Unit : packet
What is Routing Algorithm?
Definition: The process which is used to establish the routes by following the data packets to
reach the destination. It is a set of step-by-step processes used for directing the traffic of the
Internet efficiently. Once a data packet leaves from the source, then several paths can supply
to its destination. This kind of algorithm mainly determines the best lane to take
mathematically.
Routing Algorithm Working
The routing algorithm mainly works to progress the network quality. By using this
algorithm, one can decide the best route suitable for the network. This algorithm works on
particular protocols. The route can be calculated using different methods of algorithms.
Based on the network type as well as its application, each algorithm can be applied. There
are numerous properties there for this algorithm like stability, correctness, efficiency,
simplicity, fairness, and robustness.
The routing algorithm plays a significant role in connecting different systems to
communicate over the network. The main responsibilities of the router are recognizing
every device, its structure, presence & transmit packets. By using these algorithms, the data
can be transmitted in a fraction of seconds over the network, data can be transferred
securely, and the quality of data can be maintained
1. Adaptive Routing algorithm :
Adaptive routing algorithm is also called as dynamic routing algorithm. In this algorithm,
the routing decisions are made based on network traffic and topology. The parameters
which are used in adaptive routing algorithms are distance, hop, estimated transit time
and count.
2. Non-Adaptive Routing algorithm :
Non-adaptive routing algorithm is also called as static routing algorithm. In a non-adaptive
routing algorithm, the routing decisions are not made based on network traffic and
topology. This algorithm is used by static routing. Non-adaptive routing algorithms are
simple as compared to Adaptive routing algorithm in terms of complexity.
Find the shortest
path from A to F?
Flooding is the static routing algorithm. In this algorithm, every incoming packet is
sent on all outgoing lines except the line on which it has arrived.
One major problem of this algorithm is that it generates a large number of duplicate
packets on the network.
Several measures are takes to stop the duplication of packets. These are:
1. One solution is to include a hop counter in the header of each packet. This counter
is decremented at each hop along the path. When this counter reaches zero the
packet is discarded. Ideally, the hop counter should become zero at the destination
hop, indicating that there are no more intermediate hops and destination is reached.
This requires the knowledge of exact number of hops from a source to destination.
2. Another technique is to keep the track of the packed that have been flooded, to
avoid sending them a second time. For this, the source router put a sequence
number in each packet it receives from its hosts. Each router then needs a list per
source router telling which sequence numbers originating at that source have already
been seen. If an incoming packet is on the list, it is not flooded.
3. Another solution is to use selective flooding. In selective flooding the routers do
not send every incoming packet out on every output line. Instead packet is sent only
on those lines which are approximately going in the right direction.
Fragmentation is done by the network layer when the maximum size of datagram is
greater than maximum size of data that can be held a frame i.e., its Maximum
Transmission Unit (MTU). The network layer divides the datagram received from
transport layer into fragments so that data flow is not disrupte