0% found this document useful (0 votes)
17 views

CN-Module3 Notes

Uploaded by

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

CN-Module3 Notes

Uploaded by

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

Module-3

The Network Layer


NETWORK-LAYER SERVICES
The network layer in the TCP/IP protocol suite is responsible for the host-
to-host
delivery of datagrams. It provides services to the transport layer and
receives services
from the data-link layer

The figure shows that the Internet is made of many networks (or links)
connected
through the connecting devices.The Internet is an internetwork, a
combination of LANs and WANs. To better understand the role of the
network layer (or the internetwork layer), we need to think about the
connecting devices (routers or switches) that connect the LANs and WANs.
The network layer is involved at the source host, destination host, and all
routers in the path (R2, R4, R5, and R7). At the source host (Alice), the
network layer accepts a packet from a transport layer, encapsulates the
packet in a datagram, and delivers the packet to the data-link layer. At
the destination host (Bob), the datagram is decapsulated, and the packet
is extracted and delivered to the corresponding transport layer. Although
the source and destination hosts are involved in all five layers of the
TCP/IP suite, the routers use three layers if they are routing packets only;
however, they may need the transport and application layers for control
purposes.
A router in the path is normally shown with two data-link layers and two
physical layers,
because it receives a packet from one network and delivers it to another
network.

Packetizing
 The first duty of the network layer is definitely packetizing which is encapsulating
the payload (data received from upper layer) in a network-layer packet at the source
and decapsulating the payload from the network-layer packet at the destination.

 The duty of the network layer is to carry a payload from the source to the destination
without changing it or using it.

 The source host receives the payload from an upper-layer protocol, adds a header
that contains the source and destination addresses and some other information that is
required by the network-layer protocol and delivers the packet to the data-link layer.
The source is not allowed to change the content of the payload unless it is too large
for delivery and needs to be fragmented.

 The destination host receives the network-layer packet from its data-link
layer,decapsulates the packet, and delivers the payload to the corresponding upper-
layer protocol.
 If the packet is fragmented at the source or at routers along the path, the network layer
is responsible for waiting until all fragments arrive, reassembling them, and delivering
them to the upper-layer protocol.

 The routers in the path are not allowed to decapsulate the packets they received unless
the packets need to be fragmented. The routers are not allowed to change source and
destination addresses either. They just inspect the addresses for the purpose of
forwarding the packet to the next network on the path.

 If a packet is fragmented, the header needs to be copied to all fragments and some
changes are needed.

Routing and Forwarding


The duties of the network layer are routing and forwarding, which are
directly related to each other.
Routing
 The network layer is responsible for routing the packet from its
source to the destination.
 A physical network is a combination of networks (LANs and WANs)
and routers that connect them.
 There is more than one route from the source to the destination.
 The network layer is responsible for finding the best one among
these possible routes.
 The network layer needs to have some specific strategies for
defining the best route, which is done by running some routing
protocols which help the routers coordinate their knowledge about
the neighborhood and build consistent routing tables to be used
when a packet arrives.

Forwarding
 Forwarding can be defined as the action applied by each router when a packet arrives
at one of its interfaces.
 The decision-making table a router normally uses for applying this action is
sometimes called the forwarding table and sometimes the routing table.
 When a router receives a packet from one of its attached networks, it needs to forward
the packet to another attached network
 To make this decision, the router uses a piece of information in the packet header,
which can be the destination address or a label, to find the corresponding output
interface number in the
 forwarding table.
Figure shows the idea of the forwarding process in a router

Other Network Layer Services


The other services expected from the network layer.

Error Control
 The designers of the network layer in the Internet ignored error
control for the data being carried by the network layer.
 One reason for this decision is the fact that the packet in the
network layer may be fragmented at each router, which makes error
checking at this layer inefficient.
 The network layer uses a checksum field in the datagram to control
any corruption in the header, but not in the whole datagram.which
prevent any changes or corruptions in the header of the datagram.
 The network layer in the Internet does not directly provide error
control, but uses an auxiliary protocol, ICMP, that provides some
kind of error control if the datagram is discarded or has some
unknown information in the header.

Flow Control

Flow control manages the rate at which data is sent from a source to prevent overwhelming
the receiver. The network layer typically lacks flow control, as it is often managed by upper-
layer protocols.

Congestion Control

Congestion control prevents network overload by managing excessive datagrams. Without it,
routers may drop packets, leading to data loss and potential network collapse. It is usually
handled outside the network layer in the Internet.

Quality of Service (QoS)

Quality of Service (QoS) ensures reliable data transmission for applications requiring high-
quality, real-time performance, such as video and audio streaming. QoS features are often
managed by upper layers in the Internet.

Security

Security at the network layer, initially minimal, has become essential as the Internet
expanded. To secure a connectionless network, a virtual level enabling connection-oriented
services is often implemented at higher layers

PACKET SWITCHING.

Datagram Packet Switching

In Datagram Packet Switching, each packet is treated independently and is routed


separately through the network. Each packet, or datagram, carries the full destination address
and may take different paths to reach the destination. Due to this, packets may arrive out of
order or even experience varying delivery times, which requires reassembly at the
destination. This method is often used in connectionless services like the Internet Protocol
(IP), making it more flexible and robust in handling network failures. If a route becomes
congested or fails, packets can take alternative paths, allowing communication to continue
without a dedicated path.
The primary advantage of datagram switching is its flexibility and adaptability to network
conditions, allowing for efficient use of network resources. However, since each packet
travels independently, the network cannot guarantee delivery order or timing consistency,
which can impact applications requiring sequential data delivery.

Virtual Circuit Packet Switching

Virtual Circuit Packet Switching establishes a predetermined path between the source and
destination before sending any packets. This path, or virtual circuit, behaves similarly to a
physical circuit, maintaining a logical connection during the session. Each packet in this
method carries a virtual circuit identifier (VCI) instead of the full destination address,
allowing for faster packet switching as packets follow the same pre-established path. Virtual
circuit switching is often used in connection-oriented protocols like Frame Relay and
Asynchronous Transfer Mode (ATM).

This approach offers the advantage of reliable, in-sequence delivery since packets follow
the same route, reducing the need for reordering at the destination. However, if a network
failure occurs along the path, the connection is disrupted until a new virtual circuit is
established. This method is beneficial for applications needing consistent data delivery rates,
such as real-time audio or video streaming.

You might also like