CN-Module3 Notes
CN-Module3 Notes
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.
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
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) 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.
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.