0% found this document useful (0 votes)
11 views32 pages

Unit 3

The document provides an overview of the Network Layer in computer networks, detailing its functions, design issues, and various routing algorithms. It discusses concepts such as store-and-forward packet switching, connection-oriented and connectionless services, and different routing techniques including shortest path routing, flooding, and hierarchical routing. Additionally, it covers the mechanisms for broadcast and multicast routing, emphasizing their importance in efficient data distribution across networks.

Uploaded by

saideepak2222244
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views32 pages

Unit 3

The document provides an overview of the Network Layer in computer networks, detailing its functions, design issues, and various routing algorithms. It discusses concepts such as store-and-forward packet switching, connection-oriented and connectionless services, and different routing techniques including shortest path routing, flooding, and hierarchical routing. Additionally, it covers the mechanisms for broadcast and multicast routing, emphasizing their importance in efficient data distribution across networks.

Uploaded by

saideepak2222244
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

COMPUTER NETWORKS

(III-CSE SEMESTER-1, R-22)


PREPARED BY-MAGANTI APPARAO
HEAD OF THE DEPARTMENT
ST. MARY’S ENGINEERING COLLEGE

UNIT – III
NETWORK LAYER
Design issues
ROUTING ALGORITHMS
• shortest path routing
• Flooding
• Hierarchical routing
• Broadcast Multicast
• distance vector routing
• Congestion Control Algorithms
• Quality of Service
• Internetworking
• The Network layer in the internet
INTRODUCTION
The network Layer is the third layer in the OSI model of
computer networks. Its main function is to transfer network
packets from the source to the destination. It is involved both
the source host and the destination host. Thus, 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 network (i.e., the set of all routers and links)
and choose appropriate paths through it, even for large
networks.
It must also take care when choosing routes to avoid
overloading some of the communication lines and routers while
leaving others idle.
Features of Network Layer
If the packets are too large for delivery, they are fragmented i.e.,
broken down into smaller packets.
It decides the route to be taken by the packets to travel from the
source to the destination among the multiple routes available in
a network (also called routing).
The source and destination addresses are added to the data
packets inside the network layer.
NETWORK LAYER DESIGN ISSUES
1. Store-and-forward packet switching
2. Services provided to transport layer
3. Implementation of connectionless service
4. Implementation of connection-oriented service
5. Comparison of virtual-circuit and datagram networks
1.Store-and-forward packet switching

A host with a packet to send transmits it to the nearest router,


either on its own LAN or over a point-to-point link to the ISP.
The packet is stored there until it has fully arrived and the link
has finished its processing by verifying the checksum. Then it
is forwarded to the next router along the path until it reaches
the destination host, where it is delivered. This mechanism is
store-and-forward packet switching.
2.Services provided to transport layer
The network layer provides services to the transport layer at the
network layer/transport layer interface. The services need to be
carefully designed with the following goals in mind:
• Services independent of router technology.
• Transport layer shielded from number, type, topology of
routers.
• Network addresses available to transport layer use
uniform numbering plan–even across LANs and WANs
3.Implementation of connectionless service
If connectionless service is offered, packets are injected into the
network individually and routed independently of each other.
No advance setup is needed. In this context, the packets are
frequently called datagrams (in analogy with telegrams) and
the network is called a datagram network.
A’s table (initially) A’s table (later) C’s Table E’s Table

Let us assume for this example that the message is four times
longer than the maximum packet size, so the network layer has
to break it into four packets, 1, 2, 3, and 4, and send each of
them in turn to router A.
Every router has an internal table telling it where to send
packets for each of the possible destinations. Each table entry
is a pair (destination and the outgoing line). Only directly
connected lines can be used.
A’s initial routing table is shown in the figure under the label
‘‘initially.’’
At A, packets 1, 2, and 3 are stored briefly, having arrived on
the incoming link. Then each packet is forwarded according to
A’s table, onto the outgoing link to C within a new frame.
Packet 1 is then forwarded to E and then to F.
However, something different happens to packet 4. When it gets
to A it is sent to router B, even though it is also destined for F.
For some reason (traffic jam along ACE path), A decided to
send packet 4 via a different route than that of the first three
packets. Router A updated its routing table, as shown under the
label ‘‘later.’’
The algorithm that manages the tables and makes the routing
decisions is called the routing algorithm.
4.Implementation of connection-oriented service

A’s table C’s Table E’s Table


If connection-oriented service is used, a path from the source
router all the way to the destination router must be established
before any data packets can be sent. This connection is called a
VC (virtual circuit), and the network is called a virtualcircuit
network.

When a connection is established, a route from the source


machine to the destination machine is chosen as part of the
connection setup and stored in tables inside the routers. That
route is used for all traffic flowing over the connection, exactly
the same way that the telephone system works.
When the connection is released, the virtual circuit is also
terminated. With connection-oriented service, each packet
carries an identifier telling which virtual circuit it belongs to.
As an example, consider the situation shown in Figure. Here,
host H1 has established connection 1 with host H2. This
connection is remembered as the first entry in each of the
routing tables.
The first line of A’s table says that if a packet bearing
connection identifier 1 comes in from H1, it is to be sent to
router C and given connection identifier 1. Similarly the first
entry at C routes the packet to E, also with connection identifier
1.
Now let us consider what happens if H3 also wants to establish
a connection to H2. It chooses connection identifier 1 (because
it is initiating the connection and this is its only connection) and
tells the network to establish the virtual circuit.
This leads to the second row in the tables. Note that we have a
conflict here because although A can easily distinguish
connection 1 packets from H1 from connection 1 packets from
H3, C cannot do this.
For this reason, A assigns a different connection identifier to the
outgoing traffic for the second connection. Avoiding conflicts
of this kind is why routers need the ability to replace connection
identifiers in outgoing packets.
In some contexts, this process is called label switching. An
example of a connection-oriented network service is MPLS
(Multi-Protocol Label Switching).
5.Comparison of virtual-circuit and datagram networks
ROUTING ALGORITHMS
The main function of NL (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.
If the network uses datagrams internally, this decision must be
made anew for every arriving data packet since the best route
may have changed since last time.
If the network uses virtual circuits internally, routing decisions
are made only when a new virtual circuit is being set up.
Thereafter, data packets just follow the already established
route.
The latter case is sometimes called session routing because a
route remains in force for an entire session (e.g., while logged
in over a VPN).
There are two processes inside router:
• One of them handles each packet as it arrives, looking up
the outgoing line to use for it in the routing table. This
process is forwarding.
• The other process is responsible for filling in and updating
the routing tables. That is where the routing algorithm
comes into play. This process is routing.
Regardless of whether routes are chosen independently for each
packet or only when new connections are established, certain
properties are desirable in a routing algorithm correctness,
simplicity, robustness, stability, fairness, optimality Routing
algorithms can be grouped into two major classes:
• nonadaptive (Static Routing)
• adaptive. (Dynamic Routing)
Nonadaptive algorithm 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, off line, and downloaded to the routers
when the network is booted. This procedure is sometimes called
static routing.
Adaptive algorithm in contrast, change their routing decisions
to reflect changes in the topology, and usually the traffic as
well. Adaptive algorithms differ in
• Where they get their information (e.g., locally, from
adjacent routers, or from all routers),
• When they change the routes (e.g., every ∆T sec, when the
load changes or when the topology changes), and
• What metric is used for optimization (e.g., distance,
number of hops, or estimated transit time). This procedure
is called dynamic routing

DIFFERENT ROUTING ALGORITHMS


1. Optimality principle
2. Shortest path algorithm 3. Flooding
4. Distance vector routing
5. Link state routing
6. Hierarchical Routing
THE OPTIMALITY PRINCIPLE
One can make a general statement about optimal routes without
regard to network topology or traffic. This statement is known
as the optimality principle.
It states that if router J is on the optimal path from router I to
router K, then the optimal path from J to K also falls along the
same
As a direct consequence of the optimality principle, we can see
that the set of optimal routes from all sources to a given
destination form a tree rooted at the destination. Such a tree is
called a sink tree. The goal of all routing algorithms is to
discover and use the sink trees for all routers

(a) A network. (b) A sink tree for router B.


SHORTEST PATH ROUTING (DIJKSTRA’S)
The idea is to build a graph of the subnet, with each node of the
graph representing a router and each arc of the graph
representing a communication line or link.
To choose a route between a given pair of routers, the algorithm
just finds the shortest path between them on the graph
1. Start with the local node (router) as the root of the tree.
Assign a cost of 0 to this node and make it the first
permanent node.
2. Examine each neighbor of the node that was the last
permanent node.
3. Assign a cumulative cost to each node and make it
tentative
4. Among the list of tentative nodes
• Find the node with the smallest cost and make it
Permanent
• If a node can be reached from more than one route, then
select the route with the shortest cumulative cost.
5. Repeat steps 2 to 4 until every node becomes permanent
FLOODING
Flooding is a non-adaptive routing technique following this
simple method: when a data packet arrives at a router, it is sent
to all the outgoing links except the one it has arrived on.
Flooding obviously generates vast numbers of duplicate
packets, in fact, an infinite number unless some measures are
taken to damp the process.
A variation of flooding that is slightly more practical is
selective flooding. In this algorithm the routers do not send
every incoming packet out on every line, only on those lines
that are going approximately in the right direction. Flooding is
not practical in most applications.
For example, let us consider the network in the figure, having
six routers that are connected through transmission lines.

Using flooding technique −


• An incoming packet to A, will be sent to B, C and D.
• B will send the packet to C and E.
• C will send the packet to B, D and F.
• D will send the packet to C and F.
• E will send the packet to F.
• F will send the packet to C and E.
TYPES OF FLOODING
Uncontrolled flooding − Here, each router unconditionally
transmits the incoming data packets to all its neighbours.
Controlled flooding − They use some methods to control the
transmission of packets to the neighbouring nodes. The two
popular algorithms for controlled flooding are Sequence
Number Controlled Flooding (SNCF) and Reverse Path
Forwarding (RPF).
Selective flooding − Here, the routers don't transmit the
incoming packets only along those paths which are heading
towards approximately in the right direction, instead of every
available paths.
Advantages of Flooding
It is very simple to setup and implement, since a router may
know only its neighbours.
It is extremely robust. Even in case of malfunctioning of a large
number router, the packets find a way to reach the destination.
The shortest path is always chosen by flooding.
HIERARCHICAL ROUTING
As networks grow in size, the router routing tables grow
proportionally. Not only is router memory consumed by
everincreasing tables, but more CPU time is needed to scan
them and more bandwidth is needed to send status reports about
them.
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,
as it is in the telephone network.
When hierarchical routing is used, the routers are divided into
what we will call 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.
For huge networks, a two-level hierarchy may be insufficient;
it may be necessary to group the regions into clusters, the
clusters into zones, the zones into groups, and so on, until we
run out of names for aggregations
When a single network becomes very large, an interesting
question is ‘‘how many levels should the hierarchy have?’’ For
example, consider a network with 720 routers. If there is no
hierarchy, each router needs 720 routing table entries.
If the network is partitioned into 24 regions of 30 routers each,
each router needs 30 local entries plus 23 remote entries for a
total of 53 entries.
If a three-level hierarchy is chosen, with 8 clusters each
containing 9 regions of 10 routers, each router needs 10 entries
for local routers, 8 entries for routing to other regions within its
own cluster, and 7 entries for distant clusters, for a total of 25
entries Kamoun and Kleinrock (1979) discovered that the
optimal number of levels for an N router network is ln N,
requiring a total of e ln N entries per router
BROADCAST ROUTING
Broadcast routing plays a role, in computer networking and
telecommunications. It involves transmitting data, messages, or
signals from one source to destinations within a network.
Unlike routing (one-to-one communication) or multicast
routing (one-to-many communication) broadcast routing
ensures that information reaches all devices or nodes within the
network.
In broadcast routing, the network layer provides a service of
delivering a packet sent from a source node to all other nodes
in the network; multicast routing enables a single source node
to send a copy of a packet to a subset of the other network
nodes.

Mechanisms for Broadcast Routing


The mechanisms and protocols are employed to efficiently
distribute data to multiple recipients through broadcast routing.
Here are some important methods:
Flooding: Flooding is an approach to broadcast routing. In this
method, the sender broadcasts the message to all connected
devices, which then forwards it to their connected devices and
so on. This continues until the message reaches all intended
recipients or a predefined maximum number of hops is reached.
However, flooding can lead to network congestion and
inefficiency.
Spanning Tree Protocol (STP): STP is utilized in Ethernet
networks to prevent loops and ensure broadcast routing. It
establishes a tree structure that connects all devices, in the
network while avoiding paths. Reducing network congestion
and avoiding broadcast messages are the benefits of
implementing this approach.
The Internet Group Management Protocol (IGMP): It is a
communication protocol utilized in IP networks to facilitate the
management of group memberships. Its purpose is to enable
hosts to join or leave groups ensuring that only interested
recipients receive the multicast traffic. This not enhances
network efficiency. Also prevents unnecessary data
transmission.

MULTICAST ROUTING
Multicast routing is a networking method for efficient
distribution of one-to-many traffic. A multicast source, such as
a live video conference, sends traffic in one stream to a
multicast group. The multicast group contains receivers such as
computers, devices, and IP phones.
Multicasting is a type of one-to-many and many-to-many
communication as it allows sender or senders to send data
packets to multiple receivers at once across LANs or WANs.
This process helps in minimizing the data frame of the network
because at once the data can be received by multiple nodes.
Multicasting is considered as the special case of broadcasting
as.it works in similar to Broadcasting, but in Multicasting, the
information is sent to the targeted or specific members of the
network.

Applications: Multicasting is used in many areas like:


Internet protocol (IP)
Streaming Media
It also supports video conferencing applications and webcasts.

DISTANCE VECTOR ROUTING


The distance vector routing algorithm is one of the most
commonly used routing algorithms. It is a distributed
algorithm, meaning that it is run on each router in the network.
The algorithm works by each router sending updates to its
neighbours about the best path to each destination.
A distance-vector routing (DVR) protocol requires that a
router inform its neighbors of topology changes periodically.
Historically known as the old ARPANET routing algorithm (or
known as Bellman-Ford algorithm).
Bellman Ford Basics – Each router maintains a Distance
Vector table containing the distance between itself and ALL
possible destination nodes. Distances based on a chosen metric,
are computed using information from the neighbors’ distance
vectors.
Distance Vector Algorithm
A router transmits its distance vector to each of its neighbours
in a routing packet.
Each router receives and saves the most recently received
distance vector from each of its neighbours. A router
recalculates its distance vector when
It receives a distance vector from a neighbour containing
different information than before.
It discovers that a link to a neighbour has gone down.

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. Since congestion occurs within the
network, it is the network layer that directly experiences it and
must ultimately determine what to do with the excess packets.
However, the most effective way to control congestion is to
reduce the load that the transport layer is placing on the
network. This requires the network and transport layers to work
together. In this chapter we will look at the network aspects of
congestion.

When too much traffic is offered, congestion sets in and


performance degrades sharply
Above Figure depicts the onset of congestion. When the
number of packets hosts send into the network is well within its
carrying capacity, the number delivered is proportional to the
number sent. If twice as many are sent, twice as many are
delivered.
However, as the offered load approaches the carrying capacity,
bursts of traffic occasionally fill up the buffers inside routers
and some packets are lost. These lost packets consume some of
the capacity, so the number of delivered packets falls below the
ideal curve. The network is now congested. Unless the network
is well designed, it may experience a congestion collapse The
presence of congestion means that the load is (temporarily)
greater than the resources (in a part of the network) can handle.
Two solutions come to mind: increase the resources or decrease
the load.
Congestion control algorithms
Congestion Control is a mechanism that controls the entry of
data packets into the network, enabling a better use of a shared
network infrastructure and avoiding congestive collapse.
Congestive-Avoidance Algorithms (CAA) are implemented at
the TCP layer as the mechanism to avoid congestive collapse in
a network.

QUALITY OF SERVICE
Quality-of-Service (QoS) refers to traffic control mechanisms
that seek to either differentiate performance based on
application or network-operator requirements or provide
predictable or guaranteed performance to applications,
sessions, or traffic aggregates. Basic phenomenon for QoS
means in terms of packet delay and losses of various kinds.
Need for QoS
Video and audio conferencing require bounded delay and loss
rate.
Video and audio streaming requires bounded packet loss rate it
may not be so sensitive to delay.
Time-critical applications (real-time control) in which bounded
delay is considered to be an important factor.
Valuable applications should be provided better services than
less valuable applications.
QoS Specification
QoS requirements can be specified as:
Delay
Delay Variation(Jitter)
Throughput
Error Rate
QOS PARAMETERS
Packet loss. This happens when network links become
congested and routers and switches start dropping packets.
When packets are dropped during real-time communication,
such as in voice or video calls, these sessions can experience
jitter and gaps in speech. Packets can be dropped when a queue,
or line of packets waiting to be sent, overflows.
Jitter. This is the result of network congestion, timing drift and
route changes. Too much jitter can degrade the quality of voice
and video communication.
Latency. This is the time it takes a packet to travel from its
source to its destination. Latency should be as close to zero as
possible. If a voice over IP call has a high amount of latency,
users can experience echo and overlapping audio.
Bandwidth. This is the capacity of a network communications
link to transmit the maximum amount of data from one point to
another in a given amount of time. QoS optimizes the network
performance by managing bandwidth and giving high priority
applications with stricter performance requirements more
resources than others.

INTERNETWORKING
Internetworking is combined of 2 words, inter and networking
which implies an association between totally different nodes or
segments. This connection area unit is established through
intercessor devices akin to routers or gateway. The first term for
associate degree internetwork was catenet.
This interconnection is often among or between public, private,
commercial, industrial, or governmental networks. Thus,
associate degree internetwork could be an assortment of
individual networks, connected by intermediate networking
devices, that function as one giant network.
Internetworking refers to the trade, products, and procedures
that meet the challenge of making and administering internet
works.
To enable communication, every individual network node or
phase is designed with a similar protocol or communication
logic, that is Transfer Control Protocol (TCP) or Internet
Protocol (IP).
Once a network communicates with another network having
constant communication procedures, it’s called
Internetworking. Internetworking was designed to resolve the
matter of delivering a packet of information through many
links.
There is a minute difference between extending the network
and Internetworking. Merely exploitation of either a switch or
a hub to attach 2 local area networks is an extension of LAN
whereas connecting them via the router is an associate degree
example of Internetworking.
Internetworking is enforced in Layer three (Network Layer) of
the OSI-ISO model. The foremost notable example of
internetworking is the Internet.
There is chiefly 3 units of Internetworking:
Extranet
Intranet
Internet
Intranets and extranets might or might not have connections to
the net. If there is a connection to the net, the computer network
or extranet area unit is usually shielded from being accessed
from the net if it is not authorized.
The net isn’t thought-about to be a section of the computer
network or extranet, though it should function as a portal for
access to parts of the associate degree extranet.
Extranet: It’s a network of the internetwork that’s restricted in
scope to one organization or entity however that additionally
has restricted connections to the networks of one or a lot of
different sometimes, however not essential.
It’s the very lowest level of Internetworking, usually enforced
in an exceedingly personal area. Associate degree extranet may
additionally be classified as a Man, WAN, or different form of
network however it cannot encompass one local area network
i.e. it should have a minimum of one reference to associate
degree external network.
Intranet – This associate degree computer network could be a
set of interconnected networks, which exploits the Internet
Protocol and uses IP-based tools akin to web browsers and FTP
tools, that are underneath the management of one body entity.
Internet – A selected Internetworking, consisting of a
worldwide interconnection of governmental, academic, public,
and personal networks based mostly upon the Advanced
analysis comes Agency Network (ARPANET) developed by
ARPA of the U.S. Department of Defence additionally home to
the World Wide Web (WWW) and cited as the ‘Internet’ to
differentiate from all different generic Internetworks.

THE NETWORK LAYER IN THE INTERNET


The "network layer" is the part of the Internet communications
process where these connections occur, by sending packets of
data back and forth between different networks. In the 7-layer
OSI model the network layer is layer 3.
The main functions performed by the network layer are:
Routing: When a packet reaches the router's input link, the
router will move the packets to the router's output link. For
example, a packet from S1 to R1 must be forwarded to the next
router on the path to S2.
Logical Addressing: The data link layer implements the
physical addressing and network layer implements the logical
addressing. Logical addressing is also used to distinguish
between source and destination system. The network layer adds
a header to the packet which includes the logical addresses of
both the sender and the receiver.
Internetworking: This is the main role of the network layer
that it provides the logical connection between different types
of networks.
Fragmentation: The fragmentation is a process of breaking the
packets into the smallest individual data units that travel
through different networks.

You might also like