Module-3-The Network Layer
Module-3-The Network Layer
Module III
The network layer is concerned with
getting packets from the source all the
way to the destination.
Getting to the destination may require
making many hops at intermediate
routers along the way.
The network layer is the lowest layer
that deals with end-to-end
transmission.
To achieve its goals, the network layer
must know about the topology of the
communication subnet i.e., the set of
all routers and choose appropriate
paths through it.
It must also take care to choose routes
to avoid overloading some of the
communication lines and routers while
leaving others idle.
When the source and destination are
in different networks, new problems
occur. It is up to the network layer to
deal with them.
Design Issues
The design issues include the service provided
to the transport layer and the internal design of
the subnet.
The network layer is responsible for the source
to destination delivery of a packet across
multiple networks.
The logical addressing of the packets is done by
the network layer with the help Internet
Protocol.
The routing of packets, error reporting and
congestion control are the duties of the
network layer.
Hence the network layer is designed to
accomplish the following goals.
Services Provided to the Transport Layer
Correctness
Simplicity
Robustness: ability to handle
failures
Stability: converge to fixed set of path
Fairness
Optimality
Fairness and Optimality
Non Adaptive & Adaptive
Non adp algo do not base their
routing decisions on measurements
or estimates of the current traffic
and topology.
Instead the choice of the route to
use to get from I to J is computed in
advance, offline and downloaded to
the routers when the network
activated.
Adaptive
Change their routing decisions to
reflect changes in the topology and
usually the traffic as well.
This algorithm differ in where they
get their information (locally, nearby
routers)
Routing Algorithms
• Shortest path algorithm
• Flooding algorithm
Hierarchical Routing Algorithm
The Optimality Principle
The first five steps used in computing the shortest path from A to D. The
arrows indicate the working node
Shortest Path Algorithm
Assign to every node a tentative distance value:
set it to zero for our initial node and to infinity for
all other nodes.
2. Mark all nodes unvisited. Set the initial node as
current. Create a set of the unvisited nodes called
the unvisited set consisting of all the nodes except
the initial node.
3. For the current node, consider all of its
unvisited neighbors and calculate their tentative
distances. For example, if the current node A is
marked with a tentative distance of 6, and the
edge connecting it with a neighbor B has length 2,
then the distance to B (through A) will be 6+2=8.
Shortest Path Algorithm
If this distance is less than the previously
recorded tentative distance of B, then overwrite
that distance. Even though a neighbor has
been examined, it is not marked as "visited" at
this time, and it remains in the unvisited set.
4. When we are done considering all of the
neighbors of the current node, mark the
current node as visited and remove it from the
unvisited set. A visited node will never be
checked again; its distance recorded now is
final and minimal.
Shortest Path Algorithm
5.if the destination node has been
marked visited (when planning a route
between two specific nodes) or if the
smallest tentative distance among the
nodes in the unvisited set is infinity
(when planning a complete traversal),
then stop. The algorithm has finished.
6. Set the unvisited node marked with
the smallest tentative distance as the
next "current
Shortest Path Algorithm
Cont…
Figure 2.1(a) Token bucket holding two tokens, before packets are send out, (b) Token bucket after two packets are send, o
ne packet still remains as no token is left
Cont…
Figure 2.1 shows the two scenarios before
and after the tokens present in the bucket
have been consumed. In Fig. 2.1(a) the
bucket holds two tokens, and three packets
are waiting to be sent out of the interface, in
Fig. 2.1(b) two packets have been sent out by
consuming two tokens, and 1 packet is still
left.
The token bucket algorithm is less restrictive
than the leaky bucket algorithm, in a sense
that it allows bursty traffic. However, the
limit of burst is restricted by the number of
tokens available in the bucket at a particular
instant of time.
The implementation of basic token
bucket algorithm is simple; a
variable is used just to count the
tokens. This counter is incremented
every t seconds and is decremented
whenever a packet is sent. Whenever
this counter reaches zero, no further
packet is sent out as shown in Fig.
1.2
Cont…