Module-3
Network-Layer Services
The network layer is responsible for moving packets from the source to
the destination across multiple networks. It provides several key services:
1. Packetizing: This involves encapsulating data from the upper
layers into packets at the source and decapsulating them at the
destination. Routers in the path only forward these packets without
changing their content.
2. Routing and Forwarding:
o Routing: Determines the best path for packets to travel from
the source to the destination. This is done using routing
protocols that help routers build and maintain routing tables.
o Forwarding: The actual process of sending the packet to the
next router or the final destination based on the routing table.
3. Other Services:
o Error Control: Ensures that packets are delivered without
errors. The network layer in the Internet uses a checksum to
detect errors in the packet header.
o Flow Control: Regulates the rate of data transmission to
prevent overwhelming the receiver. However, the network
layer in the Internet does not directly provide flow control.
o Congestion Control: Manages network congestion by
controlling the amount of data entering the network. This is
not implemented in the Internet's network layer.
o Quality of Service (QoS): Ensures that certain types of
traffic, like real-time audio and video, get the necessary
bandwidth and low latency.
o Security: Protects data from unauthorized access and
ensures data integrity. The network layer uses protocols like
IPSec for security.
In essence, the network layer is like a postal service that ensures your
data packets are delivered efficiently and securely from one place to
another across the internet.
Packet Switching
Packet switching is a method used in the network layer to send data in
small packets. Each packet is sent independently and can take different
paths to reach the destination. There are two main approaches to packet
switching:
1. Datagram Approach (Connectionless Service):
o Each packet is treated independently.
o Packets may take different paths to reach the destination.
o Routers use the destination address in the packet header to
forward it.
2. Virtual-Circuit Approach (Connection-Oriented Service):
o A virtual connection is established before sending packets.
o All packets follow the same path.
o Packets carry a flow label or virtual circuit identifier.
Setup Phase
In the setup phase, a virtual circuit is established between the source and
destination. This involves:
1. Request Packet: The source sends a request packet to the
destination through intermediate routers.
2. Acknowledgment Packet: The destination responds with an
acknowledgment packet, completing the entries in the routers'
tables.
Data Transfer Phase
Once the virtual circuit is established, packets are sent along the
predefined path. Each packet carries the virtual circuit identifier, ensuring
it follows the same route.
This method ensures efficient use of network resources and allows for
flexible routing of data packets.
IPv4 Addresses
IPv4 addresses are 32-bit numerical labels used to identify devices on a
network. They are essential for routing data packets across the internet.
1. Address Space: IPv4 uses a 32-bit address space, allowing for over
4 billion unique addresses. However, due to inefficient allocation,
not all of these addresses are usable.
2. Notation: IPv4 addresses can be represented in three formats:
o Binary: A sequence of 32 bits.
o Dotted-Decimal: Four decimal numbers separated by dots
(e.g., [Link]).
o Hexadecimal: Eight hexadecimal digits.
3. Hierarchy: IPv4 addresses are hierarchical, divided into two parts:
o Prefix: Identifies the network.
o Suffix: Identifies the specific device within the network.
4. Classful Addressing: Initially, IPv4 addresses were divided into
five classes (A, B, C, D, E) based on the prefix length. This method is
now obsolete due to inefficiencies and address depletion.
5. Classless Addressing (CIDR): To address the limitations of
classful addressing, Classless Inter-Domain Routing (CIDR) was
introduced. CIDR allows for variable-length prefixes, enabling more
efficient allocation of IP addresses.
6. Subnetting and Supernetting:
o Subnetting: Divides a large network into smaller sub-
networks.
o Supernetting: Combines multiple small networks into a
larger one.
7. Special Addresses: Certain IPv4 addresses have special purposes:
o This-Host Address: [Link], used when a device does not
know its own IP address.
o Limited-Broadcast Address: [Link], used to send
a message to all devices on a local network.
o Loopback Address: [Link], used for testing on the local
device.
o Private Addresses: Reserved for use within private networks
(e.g., [Link]/16).
o Multicast Addresses: Used for one-to-many communication
(e.g., [Link]/4).
8. Dynamic Host Configuration Protocol (DHCP): DHCP automates
the assignment of IP addresses within a network, making it easier to
manage large numbers of devices.
9. Network Address Translation (NAT): NAT allows multiple devices
on a local network to share a single public IP address, conserving
the number of public addresses needed.
This section provides a comprehensive overview of IPv4 addressing,
highlighting the evolution from classful to classless addressing and the
mechanisms in place to manage and optimize IP address allocation