Networking Student Module
Networking Student Module
Define key terms such as data communication, network, protocol, and transmission
media.
Understand how data is represented and transmitted in different formats.
Identify network types and their appropriate applications.
Recognize the advantages, limitations, and uses of different transmission media.
In the modern digital world, computers are no longer isolated devices performing standalone
tasks. Instead, they are part of a vast, interconnected system that allows data to be exchanged
seamlessly across the globe. The backbone of this interconnectivity is data communication and
computer networking. Understanding these concepts is fundamental for computer science
students, as it forms the foundation for designing, implementing, and managing modern
communication systems and networks.
Data Communication refers to the process of transferring digital or analog data between devices
via transmission media such as wires, optical fibers, or wireless channels. It ensures that
information is shared efficiently, accurately, and securely. Meanwhile, a Computer Network is a
collection of interconnected devices that communicate with each other to share resources,
applications, and data. Networks can range from a small home setup to the vast infrastructure of
the internet.
This chapter lays the groundwork for understanding how data is transmitted and how networks
are structured. The content is divided into three major sections:
In computer systems, information rarely stays within a single device. Computers, mobile phones,
servers, and embedded devices continuously exchange information with each other. This
exchange of information is known as data communication. It is the fundamental concept on
which computer networks and the internet are built.
Without data communication, modern technologies such as email, cloud computing, online
banking, video conferencing, and social media would not exist.
To clearly understand data communication, we must first understand the two words separately.
Data
Data by itself may not be meaningful until it is processed, but it becomes useful when
transmitted and interpreted correctly.
Data Communication is the process of transferring data from one device (sender) to another
device (receiver) through a communication medium using a set of rules known as protocols.
Formal Definition:
Data communication is the exchange of data between two or more devices through a
transmission medium, ensuring that the data is delivered accurately, efficiently, and securely.
1. Information Sharing: Allows users and systems to share information quickly and
efficiently.
2. Resource Sharing: Enables sharing of hardware (printers, storage), software, and data.
3. Remote Access: Allows users to access systems and data from distant locations.
4. Collaboration: Supports teamwork through shared documents, emails, and conferencing
tools.
5. Automation and Control: Used in industrial systems, IoT, and real-time monitoring.
3. Timeliness: Data must be delivered within the required time. Data delivered late are useless.
Every networking protocol, network device, and communication system is designed based on
data communication principles.
Examples
Communication is the core concept behind data communication systems. Before understanding
how computers communicate, it is essential to understand what communication is, how it occurs,
and what components are involved. Communication basics explain the fundamental principles
that govern the transfer of information from one entity to another, whether the entities are
humans, computers, or electronic devices.
In data communication, communication must be precise, structured, and reliable, unlike casual
human communication, which can tolerate ambiguity.
Meaning of Communication
- Human to Human
- Human to Computer
- Computer to Computer
In computer systems:
Every communication system follows a basic model consisting of several essential components.
Human communication
Telephone communication
Computer and network communication
The communication process consists of a set of fundamental components that work together to
transfer information from one entity to another. The process begins with the sender, who
generates the message and encodes it into a suitable form for transmission. The message is the
actual information to be communicated, such as text, numbers, images, audio, or video. This
message is transmitted in the form of signals through a transmission medium, which may be a
physical channel like a cable or a wireless channel such as radio waves. The medium serves as
the pathway that carries the signal from the sender to the destination.
At the receiving end, the receiver accepts the incoming signal and decodes it to retrieve the
original message. To ensure that communication occurs correctly and reliably, both the sender
and receiver must follow a common set of rules known as a protocol. Protocols define how data
is formatted, transmitted, received, and acknowledged. Together, these components ensure
accurate, timely, and effective communication in both human and computer-based
communication systems.
Signals in Communication
What is a Signal?
1. Analog Signal
Continuous waveform
Values vary smoothly over time
Example: Human voice and Analog telephone signal
2. Digital Signal
Discrete values
Represented using binary digits (0 and 1)
Example: Computer data and Network signals
Data flow refers to the movement of data between sender and receiver.
(Full modes are explained later, but basics are introduced here.)
In computer communication:
Data representation ensures that data is stored, processed, and transmitted accurately and
efficiently. Standardized representation techniques allow different devices and systems to
communicate without ambiguity or data loss.
All data representation techniques are based on the binary number system. In this system:
Binary representation is reliable because electronic circuits can easily distinguish between two
voltage levels, making digital systems less sensitive to noise compared to analog systems.
Text Representation
Text data consists of characters such as alphabets, digits, and special symbols. Each character is
represented using a unique binary code.
ASCII (American Standard Code for Information Interchange): ASCII uses 7 bits to
represent characters, allowing 128 unique symbols. Extended ASCII uses 8 bits, enabling
256 characters. ASCII includes:
o Uppercase and lowercase letters
o Numbers
o Punctuation and control characters
Number Representation
Numbers in computer systems are represented in binary form. Depending on the type of number,
different techniques are used.
The most widely used standard for floating-point representation is IEEE 754, which ensures
consistency across systems.
Image Representation
Digital images are represented as a collection of small picture elements called pixels. Each pixel
represents a specific color or intensity.
Because image data can be very large, compression techniques are commonly applied. Popular
image formats include JPEG, PNG, and BMP.
Audio Representation
Audio signals are continuous in nature, but digital systems require discrete data. To represent
audio digitally, the analog sound signal is converted into digital form using the following steps:
The quality of digital audio depends on the sampling rate and the number of bits used. For
example, CD-quality audio uses a sampling rate of 44.1 kHz. Common digital audio formats
include WAV, MP3, and AAC.
Video Representation
Video data consists of a sequence of images called frames, displayed rapidly to create motion,
along with synchronized audio. Each frame is a digital image, and video quality depends on:
Due to the large size of video data, efficient compression is essential for transmission over
networks. Common video formats include MP4, AVI, and MKV.
Importance of Data Representation in Data Communication
Accurate data representation ensures reliable communication, reduces errors, and enables
interoperability between devices from different manufacturers.
In data communication systems, once data is represented in binary form, it must be transmitted
from the sender to the receiver. Digital data transmission refers to the method by which binary
data (0s and 1s) is sent over a communication channel. The way in which data is organized and
transmitted is known as the digital data transmission format.
Digital data transmission involves sending discrete signals that represent binary data. Each bit is
transmitted as a signal element over the communication medium. The transmission format
determines:
Digital transmission is widely used because it is more resistant to noise, easier to regenerate, and
more reliable than analog transmission.
Parallel and Serial Transmission
Based on how bits are transmitted, digital data transmission can be classified into parallel
transmission and serial transmission.
A. Parallel Transmission
In parallel transmission, multiple bits are transmitted simultaneously, each bit using a separate
communication line. For example, if 8 bits are transmitted at the same time, eight separate lines
are required.
Parallel transmission is fast because multiple bits are sent together. However, it requires more
hardware, making it expensive. It is also more susceptible to synchronization problems and
signal interference when used over long distances. Due to these limitations, parallel transmission
is generally used for short-distance communication, such as inside a computer system between
the CPU and memory. Example:-
B. Serial Transmission
In serial transmission, bits are transmitted one after another over a single communication line.
Although this method appears slower than parallel transmission, it is more reliable and cost-
effective, especially over long distances.
Serial transmission requires fewer hardware resources and avoids synchronization issues
between multiple lines. For this reason, most data communication systems and networks,
including the internet, use serial transmission. Example:-
o USB devices
o SATA hard drives
o Serial ports (RS-232)
o Network cables (Ethernet uses serialized transmission)
Digital data transmission can also be classified based on timing and synchronization between the
sender and receiver.
A. Asynchronous Transmission
In asynchronous transmission, data is sent one character at a time. Each character is framed with
special bits:
These bits help the receiver identify the start and end of each character. There is no continuous
clock signal shared between the sender and receiver.
Asynchronous transmission is simple and flexible, but it is inefficient due to the overhead of start
and stop bits. It is commonly used in low-speed communication such as keyboard input and
serial communication ports.
B. Synchronous Transmission
In synchronous transmission, data is sent as continuous blocks or frames without start and stop
bits for each character. The sender and receiver are synchronized using a common clock or
timing mechanism.
This method is more efficient and supports higher data rates because there is less overhead.
Synchronous transmission is widely used in high-speed networks, such as local area networks
(LANs) and wide area networks (WANs).
Two important terms related to digital data transmission are bit rate and baud rate.
Bit Rate refers to the number of bits transmitted per second and is measured in bits per
second (bps).
Baud Rate refers to the number of signal changes (symbols) per second.
In simple systems, one signal change represents one bit, so bit rate and baud rate are equal. In
advanced systems, one signal change may represent multiple bits.
Transmission speed
Error detection and correction
Hardware cost
Network performance
Efficient transmission formats improve data throughput and ensure reliable communication
across networks.
In a data communication system, data is transmitted from the sender to the receiver in the form
of signals. Ideally, the signal received should be an exact replica of the signal sent. However, in
practical communication systems, the transmitted signal is often affected by various factors
while traveling through the transmission medium. These unwanted effects that degrade the
quality of the signal are known as transmission impairments.
Transmission impairments can cause errors in data, loss of information, and reduction in
communication efficiency. Understanding these impairments is essential for designing reliable
and high-performance communication systems.
Causes of Transmission Impairments
The major types of transmission impairments are attenuation, noise, and distortion.
1. Attenuation
Attenuation refers to the gradual loss of signal strength as the signal travels over a distance
through a transmission medium. As the signal moves farther from the sender, its energy
decreases, making it difficult for the receiver to correctly interpret the data.
To overcome attenuation:
2. Noise
Noise is any unwanted signal that interferes with the original transmitted signal. Noise can alter
the signal and introduce errors in the received data.
Noise is one of the primary reasons for errors in data communication systems.
3. Distortion
Distortion occurs when the shape of the transmitted signal changes during transmission. This
happens because different frequency components of a signal travel at different speeds through
the transmission medium.
As a result:
Data corruption
Increased error rate
Retransmissions
Reduced throughput
Poor quality of audio and video communication
These effects degrade overall network performance and user experience.
In a data communication system, data must travel between devices in a specific direction. The
mode of data transmission defines the direction of data flow between the communicating
devices. Different applications require different transmission modes depending on whether
communication is one-way, two-way, or simultaneous.
Based on the direction of data flow, data transmission modes are classified into:
Simplex
Half-duplex
Full-duplex
Each mode has unique characteristics and is suited to specific real-world applications.
In simplex transmission, data flows in only one direction. One device acts strictly as the
sender, while the other acts strictly as the receiver. There is no capability for the receiver to send
data back to the sender.
Examples
In half-duplex transmission, data can flow in both directions, but not at the same time. At
any given moment, one device transmits while the other receives.
Examples
Walkie-talkies: Only one person can speak at a time; the other must wait.
Two-way radio communication: Used by police, security, and aviation ground control.
Older Ethernet networks (hub-based): Devices share the same medium and take turns
transmitting.
Push-to-talk communication systems: User must press a button to transmit.
In full-duplex transmission, data flows in both directions simultaneously. Both devices can
send and receive data at the same time without waiting.
Examples
Full-duplex transmission offers the best performance and user experience. However, it requires
more bandwidth and sophisticated hardware, increasing system complexity.
Network performance
Communication reliability
User interaction
Cost of implementation
For example, interactive applications such as video calls require full-duplex communication,
whereas data collection devices may operate efficiently in simplex mode.
A data communication system is not a single entity but a combination of several components that
work together to transfer data from one device to another. For communication to be successful,
each component must function correctly and in coordination with the others. These fundamental
components are known as the elements of data communication.
Understanding these elements helps in analyzing how data communication systems operate and
in identifying where communication failures may occur.
Sender
Receiver
Message
Transmission Medium
Protocol
Each element plays a specific role in ensuring reliable and accurate data transfer.
1. Sender
The sender is the device or entity that initiates the communication process. It is responsible for
creating the data and converting it into a form suitable for transmission.
Generating data
Encoding data into binary form
Converting data into signals
2. Receiver
The receiver is the device that receives the transmitted data. Its primary role is to accept the
signal from the transmission medium and convert it back into a usable form.
Examples of receivers include a computer receiving an email, a printer receiving print data, or a
server receiving client requests.
3. Message
The message is the actual information that is being communicated between the sender and the
receiver. It represents the content of communication.
In data communication systems, messages are transmitted in digital form, even if the original
data is analog.
4. Transmission Medium
The transmission medium is the physical or wireless path through which the data travels from
sender to receiver. It acts as the channel for signal propagation.
Guided media, such as twisted pair cables, coaxial cables, and optical fiber
Unguided media, such as radio waves, microwaves, and infrared
Transmission speed
Distance
Cost
Susceptibility to noise
For example, optical fiber is used for high-speed internet due to its high bandwidth and low
attenuation.
5. Protocol
A protocol is a set of rules that governs data communication between devices. Without
protocols, communication would be chaotic and unreliable.
Protocols define:
Failure in any one of these elements can disrupt the communication process.
This example illustrates how all elements work together to achieve successful communication.
In data communication, simply connecting two devices with a transmission medium is not
enough to enable communication. For meaningful and reliable data exchange, the
communicating devices must follow a common set of rules. These rules ensure that data is sent,
received, interpreted, and processed correctly. Such rules are known as protocols, and the
agreed-upon specifications that govern how systems are designed and implemented are called
standards.
Protocols and standards play a crucial role in enabling communication between devices
manufactured by different vendors and operating on different platforms.
Protocol
A protocol is a formal set of rules and conventions that governs how data is transmitted and
received in a communication system. Protocols define what is communicated, how it is
communicated, and when it is communicated.
In the absence of protocols, devices would be unable to understand each other, even if they are
physically connected.
Data formatting: Defines how data is structured and organized before transmission.
Addressing: Identifies the sender and receiver of the data.
Error detection and correction: Ensures that data is received accurately.
Flow control: Prevents the sender from overwhelming the receiver.
Sequencing: Ensures data is received in the correct order.
Connection control: Establishes, maintains, and terminates communication sessions.
Each protocol may perform one or more of these functions depending on its role in the
communication system.
Syntax: Defines the structure or format of the data, including how bits are arranged into
fields and frames.
Semantics: Specifies the meaning of each section of bits, including control information
such as error handling and acknowledgments.
Timing: Defines when data should be sent and how fast it can be transmitted.
User Datagram Protocol (UDP) is a connectionless transport layer protocol that focuses on fast
data transmission with minimal overhead. It does not guarantee delivery, ordering, or error
correction, making it suitable for time-sensitive applications such as video streaming, online
gaming, and voice communication, where speed is more important than reliability.
Internet Protocol (IP) is a network layer protocol responsible for logical addressing and routing
of data packets across interconnected networks. It breaks data into packets, assigns source and
destination IP addresses, and ensures packets are forwarded to the correct destination through
routers. IP forms the backbone of the internet.
Hypertext Transfer Protocol (HTTP) is an application layer protocol used for communication
between web browsers and web servers. It defines how requests and responses are exchanged
and supports the transfer of web pages, images, and multimedia content. HTTP operates on a
request-response model and is the foundation of the World Wide Web.
5. Hypertext Transfer Protocol Secure (HTTPS)
HTTPS is a secure version of HTTP that uses encryption to protect data transmitted over the
network. It employs Transport Layer Security (TLS) to ensure confidentiality, integrity, and
authentication. HTTPS is widely used in online banking, e-commerce, and secure web
applications.
File Transfer Protocol (FTP) is an application layer protocol used to transfer files between a
client and a server over a network. It supports file upload, download, and directory management.
FTP can operate in active or passive mode and is commonly used in website maintenance and
large file transfers.
Simple Mail Transfer Protocol (SMTP) is used for sending email messages between mail servers
and from email clients to mail servers. It defines how email messages are formatted, transmitted,
and relayed across networks. SMTP works in conjunction with other protocols to provide
complete email functionality.
Post Office Protocol version 3 (POP3) is an email retrieval protocol that allows users to
download messages from a mail server to a local device. Once downloaded, emails are typically
removed from the server. POP3 is suitable for users who access email from a single device.
Internet Message Access Protocol (IMAP) is an email retrieval protocol that allows users to
access and manage emails directly on the mail server. Unlike POP3, IMAP supports
synchronization across multiple devices and preserves emails on the server, making it suitable
for modern email services.
10. Domain Name System (DNS)
Domain Name System (DNS) is an application layer protocol that translates human-readable
domain names into numerical IP addresses. It enables users to access internet resources using
meaningful names instead of remembering IP addresses. DNS functions as a distributed and
hierarchical naming system.
Dynamic Host Configuration Protocol (DHCP) automatically assigns IP addresses and other
network configuration parameters to devices in a network. It simplifies network management by
eliminating manual IP configuration and helps prevent address conflicts.
Internet Control Message Protocol (ICMP) is used for error reporting and network diagnostics. It
helps detect problems such as unreachable hosts, packet loss, or routing failures. Tools like ping
and traceroute use ICMP to test network connectivity.
Simple Network Management Protocol (SNMP) is used for monitoring and managing network
devices such as routers, switches, and servers. It allows administrators to collect performance
data, detect faults, and configure network components remotely.
15. Secure Shell (SSH)
Secure Shell (SSH) is a protocol used for secure remote login and command execution over an
unsecured network. It provides encrypted communication and authentication, making it widely
used by network administrators for managing servers and network devices.
Each protocol serves a specific purpose and works in coordination with others.
Standards
The widespread success of the internet is largely due to adherence to common standards.
De facto standards: These standards emerge through widespread use rather than formal
approval. For example, early Ethernet implementations became de facto standards before
formal standardization.
De jure standards: These are officially approved by recognized standardization
organizations. Examples include ISO and IEEE standards.
Standardization Organizations
In the field of data communication, ISO is best known for developing the Open Systems
Interconnection (OSI) Reference Model. The OSI model provides a seven-layer framework
that explains how data is transmitted from one device to another over a network. Although
the OSI model is primarily conceptual and not directly implemented, it serves as a
fundamental teaching and design tool for understanding network architecture.
ISO has also developed standards related to data formats, character encoding, and security
management. For example, ISO/IEC 27001 defines standards for information security
management systems, which are widely adopted by organizations to protect network and data
security.
IEEE (Institute of Electrical and Electronics Engineers): Defines standards for LANs,
such as IEEE 802 (Ethernet and Wi-Fi).
One of the most important contributions of IEEE is the IEEE 802 family of standards,
which defines the physical and data link layer specifications for networking technologies. For
example, IEEE 802.3 defines the Ethernet standard used in wired LANs, specifying aspects
such as frame format, data rates, and transmission media. Similarly, IEEE 802.11 defines
wireless LAN standards, commonly known as Wi-Fi, which enable wireless connectivity in
homes, offices, and public spaces.
IEEE standards ensure that network interface cards, switches, routers, and wireless devices
from different manufacturers can operate together seamlessly.
ANSI plays a key role in representing U.S. interests in international standardization bodies
such as ISO and IEC. Many networking and communication standards used in the United
States are aligned with ANSI-approved specifications.
A protocol often becomes a standard after being formally approved by a standards organization.
This coordinated use of protocols and standards enables seamless internet communication.
They form the backbone of all modern data communication and networking systems.
The communication process in circuit switching occurs in three distinct phases. First, the circuit
establishment phase sets up a physical or logical connection between the two endpoints. Once
the circuit is established, the data transfer phase begins, during which data flows continuously
and in the same order. Finally, the circuit termination phase releases the reserved resources
after communication ends.
A classic real-world example of circuit switching is the traditional telephone network (PSTN).
When a call is made, a dedicated line is reserved between the caller and the receiver until the call
is disconnected. This guarantees consistent quality and low delay but results in inefficient use of
network resources.
Advantages of Circuit Switching
Circuit switching provides guaranteed bandwidth and constant data rate, making it suitable for
real-time voice communication. Since the path is fixed, there is minimal delay variation and no
packet loss during transmission.
The main drawback of circuit switching is inefficient resource utilization, as the dedicated path
remains idle when no data is sent. It also lacks flexibility and scalability, making it unsuitable for
modern data communication needs.
Packet switching is a communication technique in which data is divided into small units called
packets, which are transmitted independently over the network. Each packet contains both data
and control information, including source and destination addresses.
The most prominent example of packet switching is the Internet. Protocols such as IP, TCP,
and UDP operate in packet-switched environments. Packet switching makes efficient use of
network resources and supports multiple simultaneous communications.
Packet switching allows better utilization of network bandwidth by sharing resources among
multiple users. It is highly scalable, flexible, and resilient to failures, as packets can be rerouted
if a path becomes unavailable.
Limitations of Packet Switching
Packet-switched networks may experience delays, packet loss, and jitter due to congestion.
Quality of service is not guaranteed unless additional mechanisms are implemented.
Circuit switching is best suited for applications requiring continuous, real-time communication
with guaranteed quality, such as traditional voice calls. Packet switching, on the other hand, is
ideal for data communication, multimedia applications, and modern internet services where
efficient bandwidth usage and scalability are critical.
A computer network is a collection of two or more interconnected computers and devices that
are linked together through communication channels to share data, resources, and services. These
devices communicate using agreed-upon protocols and standards to ensure reliable and efficient
data transmission.
In a computer network, each connected device, known as a node, can send and receive data. The
interconnection may be achieved using wired media such as cables or wireless technologies such
as radio waves. The primary objective of a computer network is to enable communication,
collaboration, and resource sharing among users and systems.
These characteristics make networks essential for both small-scale and large-scale computing
environments.
Computer networks are used in almost every field of modern life. Their applications range from
personal communication to large industrial and scientific systems.
Communication and Collaboration
For example, applications like video meetings and collaborative document editing rely on
computer networks to support remote work and global teamwork.
Resource Sharing
Computer networks allow multiple users to share hardware and software resources. Printers,
scanners, storage devices, and specialized software can be shared over a network, reducing cost
and improving efficiency.
In an office environment, a single high-quality printer can be shared by many users through a
local area network, eliminating the need for individual printers.
Networks enable users to store, access, and transfer data efficiently. Files can be shared across
systems, databases can be accessed remotely, and large volumes of information can be
exchanged quickly.
Cloud storage services are a real-world example where users access and share data over a
network without needing local storage devices.
The internet is the largest example of a computer network. It provides access to web services
such as websites, online applications, search engines, and streaming platforms. Users can retrieve
information, conduct research, and access digital services from anywhere in the world.
Online banking, e-commerce, and digital learning platforms rely heavily on computer networks.
Business and Enterprise Applications
For example, multinational companies use networks to connect branch offices and data centers
across different locations.
Computer networks play a significant role in education and research by enabling online learning,
virtual classrooms, and access to digital libraries. Students and researchers can collaborate, share
resources, and access academic content remotely.
Learning management systems and virtual laboratories are common examples of network-based
educational applications.
Healthcare Systems
In healthcare, computer networks support electronic health records, telemedicine, and remote
patient monitoring. Medical professionals can access patient data securely and collaborate with
specialists in different locations.
Hospital information systems rely on networks to coordinate patient care and medical services.
Networks are used in industrial automation, monitoring systems, and scientific research. Sensors,
control systems, and data analysis tools communicate over networks to improve productivity and
accuracy.
Examples include smart factories, weather monitoring systems, and space research networks.
1.2.3 Network Types
Computer networks are classified based on various factors such as geographical area, network
architecture, and purpose. Understanding network types helps in designing networks suitable for
specific needs, whether it’s a small home setup or a large enterprise system.
Networks can be categorized according to the physical area they cover. The most common types
include:
A Personal Area Network (PAN) is the smallest type of network, designed to connect devices
within the range of a single person, typically within a few meters. It is used for personal device
connectivity.
PANs are usually short-range, low-cost, and private, primarily for individual use.
LANs are characterized by high data rates, low latency, and ownership by a single organization.
Common technologies include Ethernet and Wi-Fi.
A Metropolitan Area Network (MAN) covers a larger geographical area than a LAN,
typically a city or a town. MANs are designed to provide high-speed connectivity between
multiple LANs.
Examples and Applications:
City-wide networks
University or hospital campus networks spanning multiple buildings
Internet service providers connecting customers within a city
MANs are often owned by a single organization or a service provider and use technologies like
fiber optics and microwave links.
A Wide Area Network (WAN) spans large geographical areas, often connecting multiple
cities, countries, or continents. WANs enable communication over long distances and are
essential for global business operations.
Examples and Applications:
WANs typically use leased lines, satellite links, and public networks, and they require routing
protocols such as BGP (Border Gateway Protocol) to manage data transfer over long distances.
Network architecture defines how devices communicate and interact. The two primary
architectures are:-
In a Peer-to-Peer network, all devices (nodes) have equal status, and each device can act as
both a client and a server. There is no central server controlling access.
Figure 1.6. Peer-to-peer network architecture
P2P networks are simple to set up and cost-effective, but they are less secure and harder to
manage in large networks.
In a Client-Server network, one or more central servers provide services, and clients request
resources from these servers. The server manages data, security, and access.
Figure 1.7. Client-Server Architecture
Client-server networks are scalable, secure, and easier to manage, making them suitable for
medium to large organizations.
1. Network Interface Card (NIC): A Network Interface Card (NIC) is a hardware component
installed in a computer or device to connect it to a network. It converts data from the device into
signals suitable for transmission over the network medium. Modern NICs can support wired
(Ethernet) or wireless (Wi-Fi) connections.
Example: Office LAN networks use switches to connect computers, printers, and servers.
3. Hub: A hub is a simpler networking device that connects multiple devices in a LAN. Unlike a
switch, a hub broadcasts incoming data to all connected devices, regardless of the destination.
Hubs are rarely used today because they are inefficient and create network collisions.
4. Router: A router is a device that connects multiple networks, such as a LAN to a WAN or
the Internet. It determines the best path for data to reach its destination using routing tables and
protocols like RIP, OSPF, or BGP. Routers also provide security features like firewalls and
NAT (Network Address Translation).
6. Wireless Access Point (WAP): A Wireless Access Point (WAP) allows wireless devices to
connect to a wired network using Wi-Fi. It extends network coverage and supports multiple
simultaneous users.
Example: WAPs in offices, schools, or public hotspots like airports and cafes.
7. Transmission Media: Transmission media form the pathways through which data travels
between devices. They can be guided (wired) or unguided (wireless).
Guided Media Examples: Twisted pair cables, coaxial cables, optical fiber
Unguided Media Examples: Radio waves, microwaves, infrared, Wi-Fi
9. Firewall: A hardware firewall monitors and controls incoming and outgoing network traffic
based on security rules. It protects networks from unauthorized access, viruses, and cyberattacks.
Software components manage, control, and facilitate communication over the network. They
include operating systems, protocols, and network management tools.
1. Network Operating System (NOS): A Network Operating System (NOS) controls and
manages network resources, provides security, and enables file and printer sharing. Examples
include Windows Server, Linux (Ubuntu Server), and Novell NetWare.
Example: Windows Server manages user authentication, file sharing, and printer access in
corporate LANs.
2. Protocols: Protocols define rules and conventions for communication between devices. They
determine how data is formatted, transmitted, and interpreted.
Examples:
Examples:
4. Security Software: Security software protects networks from attacks, unauthorized access,
and malware. It may include antivirus programs, intrusion detection systems (IDS), and intrusion
prevention systems (IPS).
Conclusion
A computer network is built from both hardware and software components working together.
Hardware components like NICs, switches, routers, and transmission media provide the physical
pathways for data transfer, while software components such as protocols, NOS, and management
tools control communication, ensure reliability, and secure the network. Understanding these
components is essential for designing, implementing, and maintaining efficient and secure
networks.
Network topology refers to the layout or arrangement of devices and connections in a computer
network. It defines how nodes, devices, and communication links are organized, and how data
flows between them. Understanding topology is critical for designing networks that are efficient,
scalable, and reliable.
Physical topology describes how devices are physically connected in a network. The most
common physical topologies include:
1. Bus Topology
In a bus topology, all devices are connected to a single central cable called the backbone. Data
sent by a device travels along the bus until it reaches the intended recipient.
Advantages:
Limitations:
If the backbone fails, the entire network goes down
Limited cable length and number of devices
Data collisions are more frequent
2. Star Topology
In a star topology, all devices are connected to a central device such as a switch or hub. The
central device manages and controls data traffic.
Advantages:
Limitations:
Central device failure brings down the whole network
Requires more cabling compared to bus topology
Real-World Example: Most modern office LANs use Ethernet switches in star topology.
3. Ring Topology
In a ring topology, each device is connected to two neighboring devices, forming a closed loop.
Data travels in one or both directions around the ring until it reaches its destination.
Advantages:
Limitations:
4. Mesh Topology
In a mesh topology, each device is connected to every other device in the network, creating
multiple redundant paths for data.
Advantages:
Highly fault-tolerant
Supports high-speed and secure communication
Limitations:
5. Tree Topology
A tree topology is a hierarchical topology that combines characteristics of star and bus
topologies. Groups of devices (stars) are connected to a central backbone (bus).
Advantages:
Limitations:
6. Hybrid Topology
A hybrid topology combines two or more different topologies, taking advantage of their
strengths and minimizing weaknesses.
Advantages:
Limitations:
Logical topology refers to how data actually flows between devices, independent of the
physical layout. It defines the path that signals take, which may differ from the physical
connections.
Bus Logical Topology: Data is broadcast to all devices, similar to physical bus, even if
physical layout is star.
Ring Logical Topology: Data flows sequentially from one device to the next in a logical
ring, even if the physical layout is star.
Point-to-Point Logical Topology: Direct communication between two devices over a
dedicated channel.
Importance: Logical topology affects network performance, data transfer efficiency, and fault
tolerance. Many modern networks use star physical topology with bus or ring logical
topology, such as Ethernet LANs.
Computer networks are complex systems involving multiple devices, protocols, transmission
media, and applications working together to achieve communication. To manage this
complexity, networking functions are organized into structured frameworks known as network
models. A network model divides the communication process into logical layers, where each
layer is responsible for a specific set of tasks. This layered approach simplifies network design,
enables interoperability between vendors, and makes troubleshooting more systematic.
The two most widely recognized network models are the OSI Reference Model and the TCP/IP
Protocol Suite. While the OSI model provides a conceptual framework for understanding
networking, the TCP/IP model represents the practical architecture used in modern internet
communication.
In this lesson, we explain what the OSI model is in an easy and understandable language. It is
one of the most important concepts in networking, so we break it down into pieces to help you
understand exactly what its purpose is.
Data encapsulation
To understand the OSI or TCP/IP model, you must first understand what data encapsulation is.
Let's explore the following example. Imagine you want to send a letter to a friend who lives in
another city to invite him to your wedding. What if you send the letter without an envelope, with
any information, such as the senders and recipient's names, addresses, and postcodes? What if
you simply write the letter and drop it in the mailbox at the post office?
The envelope that encapsulates the letter contains the following information, which helps the
postal service deliver the letter correctly:
Stamp and postcard, Sender's name, Sender's address, Sender's postcode, Recipient's
name, Recipient's address and Recipient's postcode
Optionally, the envelope may include:
The main idea is that sending letters equals sending information by utilizing the postal service as
the medium. Sending emails is the same it’s still a process of sending information, but through a
computer network. The key point is that in both cases, you can’t send just the information alone;
you need to include extra details that tell the transporting medium how to deliver the
information.
Computer networks function similarly to the postal service. The difference is that they move
digital information instead of paper letters. However, you can’t just send raw data onto the
network and expect it to reach the destination, just like you can’t drop a plain letter into a
mailbox and expect it to be delivered. The data must be encapsulated with additional
information first, as shown in the diagram below.
The OSI model was created to ensure that different systems developed by different
manufacturers could communicate with one another. Although it is not directly implemented as a
protocol stack in modern networks, it remains an essential educational and conceptual
framework.
Layer 1: Physical Layer
The Physical layer is responsible for transmitting raw bits over a physical communication
medium. It defines the electrical, mechanical, and procedural specifications for activating and
maintaining the physical connection between devices. This layer determines how binary digits
are represented as electrical signals, light pulses, or radio waves.
Devices such as cables, connectors, network interface cards, and repeaters operate at this layer. It
does not interpret data; it simply ensures that bits move from one point to another.
The Data Link layer provides reliable communication between two directly connected nodes. It
converts raw bits into structured units called frames and manages error detection and correction.
This layer is also responsible for physical addressing using MAC addresses.
Switches operate primarily at this layer. Technologies such as Ethernet and Wi-Fi function here.
The Data Link layer ensures that data transmitted over the physical medium is free from
transmission errors.
The Network layer handles logical addressing and routing. It determines the best path for data to
travel from the source to the destination across multiple interconnected networks. This layer
introduces IP addresses, which uniquely identify devices in a network.
Routers operate at the Network layer. Protocols such as IP and ICMP function here. This layer
ensures that packets are delivered across different networks, not just within a single local
network.
The Transport layer provides end-to-end communication between source and destination devices.
It ensures reliable data delivery, segmentation of large messages into smaller units, error
recovery, and flow control.
Two important protocols at this layer are TCP and UDP. TCP provides reliable, connection-
oriented communication, while UDP provides faster but less reliable communication. This layer
guarantees that the entire message is correctly delivered to the receiving application.
Layer 5: Session Layer
For example, when a user logs into a remote system, the session layer manages that active
session.
The Presentation layer ensures that data is presented in a format that the receiving system can
understand. It handles data translation, compression, and encryption. For example, it converts
character encoding formats or encrypts data before transmission.
The Application layer is the closest layer to the end user. It provides network services directly to
applications and users. Services such as web browsing, file transfer, and email communication
operate at this layer.
Protocols such as HTTP, FTP, SMTP, and DNS belong to this layer. It serves as the interface
between network services and application software.
Figure 8. The 7 layers of the OSI model.
The following example shows how data moves through the OSI layers and gets wrapped at each
step before being sent over the network to the next device. Notice that each layer adds its own
specific header with relevant information for the network function.
The primary goal of the OSI model is to establish a standard and vendor-agnostic data
encapsulation framework. It helps different devices and systems work together by following the
same set of rules and standards.
Figure 7. What is the OSI model?
The TCP/IP model was developed by the United States Department of Defense as part of the
Advanced Research Projects Agency Network (ARPANET) project. Unlike the OSI model, it
was designed based on real-world implementation rather than theoretical abstraction. Today, it
forms the foundation of the Internet.
The TCP/IP model consists of four layers, each combining the functions of multiple OSI layers.
Network Access Layer
This layer corresponds to the Physical and Data Link layers of the OSI model. It handles
hardware addressing, framing, and physical transmission of data. Technologies such as Ethernet
and Wi-Fi operate at this level.
Internet Layer
The Internet layer is responsible for logical addressing and routing. It ensures that packets travel
across interconnected networks to reach their destination. The Internet Protocol (IP) is the core
protocol at this layer. Other supporting protocols such as ICMP and ARP also function here.
Transport Layer
The Transport layer provides end-to-end communication services. It includes TCP, which
guarantees reliable delivery, and UDP, which provides fast but connectionless communication.
This layer ensures proper data segmentation, error detection, and flow control.
Application Layer
The Application layer in TCP/IP combines the functions of the Application, Presentation, and
Session layers of the OSI model. It provides services directly to user applications. Protocols such
as HTTP, FTP, SMTP, DNS, and SSH operate at this layer.
Conclusion
Network models provide a systematic way to understand and implement data communication.
The OSI model offers a detailed conceptual understanding of layered communication, while the
TCP/IP model represents the practical architecture used in modern networks. A strong
understanding of both models is essential for students to analyze, design, and troubleshoot
networking systems effectively.
In any data communication system, information must travel from a sender to a receiver through a
communication channel. This channel is known as transmission media. Transmission media
provide the physical path through which signals are transmitted between devices in a network.
The choice of transmission medium affects several important network characteristics, including
data rate, transmission distance, cost, reliability, and resistance to interference. Transmission
media are broadly classified into two categories:
Guided transmission media provide a physical pathway through which signals are transmitted
from sender to receiver. In guided media, electromagnetic signals are confined within a solid
medium such as copper wire or optical fiber. Because the signal is directed through a physical
path, guided media generally offer greater security, stability, and predictable performance
compared to wireless transmission.
Twisted pair cable is the most widely used transmission medium in local area networks (LANs)
and telephone systems. It consists of two insulated copper conductors twisted around each other.
The twisting reduces electromagnetic interference (EMI) and crosstalk between adjacent pairs.
Twisted pair cables are inexpensive, flexible, easy to install, and widely available, making them
ideal for small to medium-sized network installations.
A twisted pair cable contains the following components:
In Ethernet cables, multiple twisted pairs (typically four pairs, totaling eight wires) are enclosed
in a single outer sheath.
When electrical current flows through a wire, it produces a magnetic field. If two wires are
placed close together without twisting, electromagnetic interference can occur. Twisting the
wires ensures that the interference affects both wires equally, canceling out noise.
UTP does not have additional shielding around the twisted wires. It relies solely on twisting to
reduce interference. UTP is lightweight, inexpensive, and easy to install.
Modern Ethernet networks use UTP cables such as Cat5e, Cat6, and Cat6a.
STP includes a metallic shield (foil or braided mesh) around the twisted pairs. The shielding
provides additional protection against electromagnetic interference.
STP is commonly used in:
Industrial environments
Areas with high electrical interference
Data centers requiring improved signal protection
Twisted pair cables are standardized into categories (Cat), which define performance levels:
Higher categories provide better shielding, higher bandwidth, and improved performance.
Transmission Characteristics
Twisted pair cables transmit data as electrical signals. Key characteristics include:
Because it uses electrical signals, twisted pair cables are more vulnerable to noise compared to
fiber optic cables.
Low cost
Easy installation and maintenance
Flexible and lightweight
Widely supported by networking equipment
These advantages make it the most common medium for LAN installations.
A connector is a hardware interface used to terminate a twisted pair cable and connect it to:
Connectors ensure:
RJ45 stands for Registered Jack 45 and is the most commonly used connector in wired networks.
The jacks are mainly used to connect to the Local Area Network (LAN). It was earlier devised
for telephones but is now widely used in Ethernet Networking. The 45 in RJ45 basically stands
for the listing number. The width of RJ45 is usually greater than that of the telephone cables or
other Registered Jacks. Compared to additional jacks the bandwidth provided by these is high
and the range is usually 10 Gbps. Because of speed and enhanced security, they are used to
connect personal computers to servers, routers etc. These jacks are mostly used in Star
Topology.
2. RJ11:- Telephone systems
RJ11 is a narrower connection which is mostly used in telephone interfaces. It is usually of four
or six pins while only two or four are commonly employed for connection to the telephone line.
RJ11 can be described as a type of connector which is installed in homes and offices to provide
connection for telephone to wall sockets.
Please be aware that modifying Ethernet cables improperly may cause loss of network connectivity. The
TIA/EIA 568-A standard which was ratified in 1995, was replaced by the TIA/EIA 568-B standard in
2002 and has been updated since. Both standards define the T-568A and T-568B pin-outs for using
Unshielded Twisted Pair cable and RJ-45 connectors for Ethernet connectivity. The standards and pin-out
specification appear to be related and interchangeable, but are not the same and should not be used
interchangeably.
Both the T-568A and the T-568B standard Straight-Through cables are used most often as patch cords for
your Ethernet connections. If you require a cable to connect two Ethernet devices directly together
without a hub or when you connect two hubs together, you will need to use a Crossover cable instead.
A good way of remembering how to wire a Crossover Ethernet cable is to wire one end using the T-568A
standard and the other end using the T-568B standard. Another way of remembering the color coding is
to simply switch the Green set of wires in place with the Orange set of wires. Specifically, switch the
solid Green (G) with the solid Orange, and switch the green/white with the orange/white.
Electrically:
No performance difference
No speed difference
Transmission Mapping
Pins Function
1 Transmit + (TX+)
2 Transmit − (TX−)
3 Receive + (RX+)
6 Receive − (RX−)
So:
All 4 pairs
All 8 pins
Transmission occurs:
Coaxial cable is a type of guided transmission medium used to carry high-frequency electrical
signals with minimal interference. It was widely used in early computer networks and continues
to play an important role in cable television, broadband internet, and surveillance systems.
The term coaxial means that the central conductor and the outer shielding layer share the same
geometric axis. This concentric structure provides strong protection against electromagnetic
interference and allows higher frequency transmission compared to twisted pair cables.
A coaxial cable consists of four main layers arranged concentrically:
1. Central Conductor
The innermost component is a solid or stranded copper wire that carries the electrical signal. This
is the primary path through which data is transmitted.
2. Dielectric Insulator
Surrounding the central conductor is a non-conductive insulating material, usually made of foam
or solid plastic. This layer prevents the central conductor from touching the outer shield and
maintains the spacing required for proper signal transmission.
3. Metallic Shield
This layer is typically made of braided copper or aluminum foil. The shield serves two major
purposes:
Because of this shielding, coaxial cables provide better noise immunity than twisted pair cables.
4. Outer Jacket
The outermost layer is made of plastic or PVC and protects the cable from physical damage,
moisture, and environmental conditions.
This layered design gives coaxial cable excellent signal protection and transmission stability.
Working Principle
Coaxial cable transmits data in the form of electrical signals. The signal travels through the
central conductor, while the outer metallic shield acts as a ground reference and protects against
interference.
The electromagnetic field carrying the signal is confined within the space between the central
conductor and the shield. This confinement reduces signal loss and minimizes external noise
effects.
Baseband coaxial cable is used for digital transmission where the entire bandwidth is used for a
single data channel. It was used in early Ethernet networks such as 10BASE2 and 10BASE5.
Characteristics:
Though largely obsolete in LAN environments, it played a crucial role in early network
development.
Broadband coaxial cable is used for analog transmission and can carry multiple channels
simultaneously using frequency division multiplexing (FDM).
Characteristics:
This type is still widely used by cable service providers for delivering television and internet to
homes.
Because of these features, it is preferred in environments where interference levels are moderate
to high.
When compared to twisted pair cable, coaxial provides better noise resistance and longer
transmission distances but at a higher cost and with more complex installation.
When compared to fiber optic cable, coaxial is less expensive and easier to install but offers
lower bandwidth and shorter maximum distance.
For example, when a home internet modem is connected to a service provider’s network through
a thick round cable from the wall outlet, that cable is typically a broadband coaxial cable.
A coaxial cable connector is used to terminate coaxial cables and connect them to devices while
preserving signal integrity. Coaxial cables are widely used for TV, internet, CCTV, and RF
communication.
Fiber optic cable is the most advanced and high-performance guided transmission medium used
in modern communication networks. Unlike copper cables that transmit electrical signals, fiber
optic cables transmit data in the form of light pulses. These light signals travel through extremely
thin strands of glass or plastic, enabling very high data rates and long-distance communication
with minimal signal loss.
Fiber optics form the backbone of today’s global communication systems, including internet
infrastructure, submarine communication cables, data centers, and telecommunication networks.
A fiber optic cable consists of several layers:
1. Core
The core is the innermost part of the fiber, made of glass or plastic. It carries the light signals.
The diameter of the core determines the type of fiber (single-mode or multi-mode).
2. Cladding
The cladding surrounds the core and is made of a material with a lower refractive index. Its
function is to reflect light back into the core using total internal reflection.
3. Buffer Coating
A protective plastic coating that shields the fiber from physical damage and moisture.
4. Strengthening Members
Materials such as Kevlar are added to protect against tension and stretching.
5. Outer Jacket
The outermost protective layer that shields the cable from environmental conditions such as heat,
moisture, and physical stress.
This layered structure ensures durability while maintaining high transmission efficiency.
Types of Fiber Optic Cable
Fiber optic cables are classified into two major types based on core size and light propagation
method:
Single-mode fiber has a very small core diameter (typically around 8–10 micrometers). It allows
only one light path (mode) to travel through the fiber.
Because only one mode propagates, there is minimal signal distortion and dispersion.
Characteristics:
Applications:
Multi-mode fiber has a larger core diameter (typically 50 or 62.5 micrometers). It allows
multiple light paths (modes) to travel simultaneously.
Because multiple paths are used, signals may arrive at slightly different times, causing modal
dispersion.
Characteristics:
Applications:
Multi-mode fiber is suitable for shorter distances with moderate bandwidth requirements.
Because fiber uses light instead of electricity, it is not affected by lightning, electrical noise, or
magnetic fields.
For backbone and high-speed networks, fiber optic cable is the preferred medium.
For example, global internet traffic between countries travels primarily through undersea fiber
optic cables.
Role in Modern Networking
Many countries are replacing traditional copper infrastructure with fiber-to-the-home (FTTH)
networks to support gigabit internet speeds.
Comparison Table
Unguided transmission media, also known as wireless or unbounded media, transmit data
through free space using electromagnetic waves. Unlike guided media, no physical conductor
such as copper or fiber is used. The signals propagate through air, vacuum, or water.
In unguided communication, antennas are required at both the transmitting and receiving ends to
radiate and capture electromagnetic waves.
1. Radio Waves
2. Microwaves
3. Infrared Waves
4. Satellite Communication (Microwave-based)
Wireless LAN technology allows devices to connect to a local network without physical cables.
It operates using radio waves in frequency bands such as 2.4 GHz, 5 GHz, and 6 GHz.
Wireless LANs are based on standards developed by the IEEE under the IEEE 802.11 family.
Wi-Fi provides:
Mobility
Easy installation
Flexible network expansion
Applications include home networks, campus networks, airports, offices, and public hotspots.
Radio waves are electromagnetic waves with frequencies ranging from approximately 3 kHz to 1
GHz. They are widely used for long-distance communication and can travel through the
atmosphere without requiring a physical path.
Because radio waves can penetrate walls and obstacles, they are suitable for indoor and outdoor
communication.
Characteristics
Radio communication is cost-effective and covers wide areas but is more susceptible to
interference.
Because of their high frequency, microwaves can carry large amounts of data at high speeds.
Types of Microwave Communication
1. Terrestrial Microwave Communication
In this system, microwave antennas are mounted on towers or buildings. The transmitter and
receiver must be in direct line of sight. Key features:
High bandwidth
Used for long-distance telephone and data transmission
Requires repeater stations every 30–50 km
Applications:
Cellular networks
Point-to-point communication links
Television signal transmission
Satellite communication uses microwaves transmitted between Earth stations and satellites
orbiting the Earth.
Process:
Applications:
Satellite television
GPS systems
Weather forecasting
Global internet services
Characteristics of Microwaves
Highly directional
Require line-of-sight
High data rates
Sensitive to weather conditions (rain attenuation)
Limited by Earth’s curvature (for terrestrial systems)
Infrared (IR) waves operate at frequencies higher than microwaves. Infrared communication is
typically used for short-range communication and requires direct line-of-sight.
Infrared signals cannot penetrate walls, making them suitable for secure, short-distance
communication.
Characteristics
TV remote controls
Wireless keyboards and mice
Short-range device communication
Infrared data transfer systems
Applications include:
Wireless headphones
Smartwatches
Mobile phone connectivity
Comparison Table
This chapter 2 focuses on the top three layers of the OSI model:
These layers are collectively known as the upper layers because they deal directly with user-level
applications and process-to-process communication.
While the lower layers (Physical, Data Link, Network, and Transport) are responsible for data
transmission, routing, and delivery, the upper layers ensure that communication between
applications is meaningful, organized, secure, and properly formatted.
In simple terms:
Together, these layers make network communication usable for real-world applications such as
web browsing, email, file transfer, and remote login.
In modern networks such as the Internet, most user interactions occur at the Application Layer.
Protocols such as HTTP, FTP, SMTP, and DNS operate at this layer, enabling services like web
browsing, email communication, and domain name resolution.
The Session and Presentation layer functions are sometimes integrated into the Application
Layer in practical implementations such as the TCP/IP model. However, conceptually separating
them helps us understand how:
The Application Layer is the topmost layer (Layer 7) of the OSI (Open Systems Interconnection)
model, developed by the International Organization for Standardization. It serves as the interface
between network services and user applications. This layer provides the necessary protocols and
services that allow software applications to communicate over a network.
It is important to understand that the Application Layer does not refer to the application software
itself (such as a web browser or email client). Instead, it provides the communication
mechanisms and protocols that enable these applications to access network resources.
For example, when a user opens a web browser to visit a website, the browser uses the HTTP
protocol at the Application Layer to communicate with a web server.
Consider the following example. The Web is a client-server application that allows users to
request documents from Web servers. The Web application is made up of several components,
including a document format standard (HTML), Web browsers (such as Firefox and Microsoft
Internet Explorer), Web servers (such as Apache and Microsoft servers), and an application-layer
protocol.
HTTP, the Web’s Application Layer Protocol, specifies the format and sequence of messages
sent between a browser and a Web server. As a consequence, HTTP is only one component
(albeit an important component) of the Web application.
The Application Layer performs functions that directly support end-user processes. It provides
standardized protocols that allow different systems and applications to communicate, even if
they are running on different hardware or operating systems.
This layer ensures that software applications can request and receive network services
efficiently.
Key Functions of the Application Layer
1. Network Virtual Terminal: The Application Layer allows users to log into remote systems
as if they were physically present at the remote machine. This is known as a network virtual
terminal service.
2. File Transfer, Access, and Management: It enables users to transfer files between systems,
access remote files, and manage file operations.
3. Electronic Mail Services: The Application Layer supports email communication between
users.
Example: Sending emails using SMTP and retrieving them using POP3 or IMAP.
4. Directory Services: Directory services help translate domain names into IP addresses and
manage network resources.
5. Web Services and Resource Sharing: The Application Layer enables web browsing and access
to distributed resources over the internet.
In the OSI model, the Application Layer is separate from the Session and Presentation layers.
However, in the TCP/IP model, these three layers are combined into a single Application Layer.
This means that in practical internet implementations, Application Layer protocols often perform
session management and data formatting functions as well.
Understanding this distinction helps in comparing theoretical and real-world networking models.
These protocols define rules for communication between client and server applications.
For example:
Process-to-process communication
High-level protocols
User-oriented services
Dependency on lower layers for transport and delivery
It does not concern itself with routing or physical transmission; those responsibilities are handled
by lower layers such as the Transport and Network layers.
Without the Application Layer, network communication would not be meaningful to end users.
The Client–Server Model is a distributed application architecture in which tasks and services
are divided between two types of entities: clients, which request services, and servers, which
provide services. This model forms the foundation of most modern network applications,
including web services, email systems, database systems, and cloud computing platforms.
In a network environment, client and server systems communicate using Application Layer
protocols. The client initiates the communication by sending a request, and the server processes
the request and sends back a response.
A client is a device or software application that requests services or resources from another
system. Examples include web browsers, email clients, and mobile apps.
A server is a powerful system or software application that provides services, resources, or data
to clients over a network. Servers are typically designed to handle multiple client requests
simultaneously.
The client–server architecture can be classified into different types depending on how processing
responsibilities are distributed.
1. Two-Tier Architecture
In this architecture:
Example: A database application where the client application directly interacts with a database
server.
2. Three-Tier Architecture
It consists of:
Browser = Client
Web server = Application server
Database server = Data storage
3. Multi-Tier Architecture
In large enterprise systems, multiple intermediate servers are used, such as authentication
servers, caching servers, and load balancers. This enhances performance and reliability.
However, modern systems reduce these issues using redundancy and distributed servers.
When a mobile app fetches data from an online service, it acts as a client communicating with
remote servers.
Unlike the Client–Server Model, the Peer-to-Peer (P2P) model allows each device to act as both
client and server. However, the Client–Server Model is more structured and secure for enterprise
environments.
Internet architecture
Enterprise networks
Distributed computing
Cloud-based services
E-commerce platforms
They specify:
Message format
Request and response structure
Error handling mechanisms
Communication procedures
Authentication and security rules
Without application protocols, different systems and applications would not be able to
understand each other, even if they were physically connected.
For example, when a web browser communicates with a web server, it uses a standardized
protocol to request and receive web pages. That protocol defines how the request should look
and how the server should respond.
HTTP is the protocol used for transferring web pages and related resources over the internet. It
operates on a request–response model.
HTTP is stateless, meaning each request is independent and does not automatically retain session
information.
2. FTP (File Transfer Protocol)
It supports:
However, traditional FTP does not provide encryption, so secure alternatives such as SFTP are
often used.
1. The email client sends the message to the outgoing mail server.
2. The server forwards the email to the recipient’s mail server using SMTP.
SMTP typically operates on TCP port 25. It is used only for sending emails, not retrieving them.
POP3 is used for retrieving emails from a mail server. It allows the client to download emails
from the server to the local device. Once downloaded, emails are often deleted from the server
(depending on settings). POP3 typically operates on TCP port 110.
IMAP is also used for retrieving emails but provides more advanced features than POP3.
It allows:
DNS translates domain names into IP addresses. When a user enters a website name:
DNS typically operates on UDP port 53 (and sometimes TCP). Without DNS, users would need
to remember numerical IP addresses instead of domain names.
DNS Components
Component Function
DNS Resolver Finds the IP address
Root Server Directs to TLD server
TLD Server Handles domain extensions
Authoritative Server Contains real DNS records
Structure of DNS
DNS operates through a hierarchical structure, ensuring scalability and reliability across the
global internet infrastructure. Here's how it’s organized:
Root DNS Servers: These are the highest-level DNS servers and know where to find the
TLD servers. They are crucial for directing DNS queries to the correct locations.
TLD Servers: These servers manage domain extensions like .com, .org, .net, .edu, .gov and
others. They help route queries to the authoritative DNS servers for specific domains.
Authoritative DNS Servers: These are the servers that store the actual DNS records for
domain names. They are responsible for providing the correct IP addresses that allow users to
reach websites.
DNS Caching and TTL (Time-to-Live)
DNS caching is a mechanism that stores DNS records locally to avoid querying external
DNS servers repeatedly for the same information. This speeds up the browsing experience
and reduces network traffic.
TTL (Time-to-Live) is the amount of time that a DNS record is cached before it expires.
When the TTL expires, the cache is cleared and a fresh DNS query must be made.
The TTL is defined by the authoritative DNS server, which can adjust this based on the
nature of the domain.
Example: If the TTL for [Link] is 3600 seconds, the record is cached for 1
hour before a fresh lookup is needed.
7. Telnet
Telet is used for remote login into another computer over a network. It provides a virtual
terminal connection but does not encrypt data, making it insecure for modern use. Telnet
typically operates on TCP port 23.
SSH typically operates on TCP port 22. It is widely used by system administrators to manage
remote servers securely.
For example:
The Transport Layer ensures reliability, while the Application Layer ensures meaningful
communication.
Without these protocols, modern services like web browsing, online banking, email, and cloud
computing would not function.
The Presentation Layer (Layer 6 of the OSI Model) is responsible for the representation,
translation, encryption, and compression of data exchanged between systems.
If the Application Layer is concerned with what data is being sent, the Presentation Layer is
concerned with how that data is formatted and interpreted. It acts as a translator between the
application and the network.
Why the Presentation Layer Is Necessary?
If two systems communicate without a common representation standard, the received data may
become meaningless.
The Presentation Layer ensures that the sender’s data format can be correctly interpreted by the
receiver.
1. Data Translation
If a 32-bit integer is transmitted without agreement on byte order, the receiver may interpret a
completely different value.
The Presentation Layer converts data into a common standard format before transmission and
reconverts it at the receiving end. This ensures:
Internally, characters are represented using encoding schemes such as ASCII or Unicode. If the
sender uses ASCII and the receiver expects Unicode, conversion must happen to preserve
meaning.
Organizations such as the Unicode Consortium define universal character standards that allow
consistent text representation worldwide. Without presentation-level translation, multilingual
communication on the internet would not function properly.
2. Encryption and Decryption
Security is another major responsibility of the Presentation Layer. When sensitive data is
transmitted across a network, it must be protected from unauthorized access.
This encryption process is handled using protocols such as TLS, which operate conceptually at
the Presentation Layer. Consider accessing a secure website in a browser such as Google
Chrome.
Without this layer, sensitive information such as passwords, credit card numbers, and personal
data would travel as readable text.
Networks have limited bandwidth. Large files consume time and resources. To improve
efficiency, data can be compressed before transmission.
Before transmission:
This reduces:
Transmission time
Bandwidth consumption
Network congestion
There are two main types of compression used in data communication (like in the OSI
Presentation Layer):
1. Lossless Compression
Example Process
Original file: 20 MB
Compressed: 2.5 MB
After decompression: 20 MB (same as original)
2. Lossy Compression
Example
Original image: 20 MB
Compressed image: 2 MB
Decompressed: looks similar but not identical
Another important function of the Presentation Layer is ensuring structured data formatting.
Modern web services often exchange data using standardized formats such as JSON and XML.
When a web API sends structured information, the Presentation Layer ensures that both sender
and receiver interpret the data structure consistently.
For example, when a mobile app communicates with a cloud server hosted on platforms such as
Amazon Web Services, data is formatted in a standardized structure so that both systems
understand the meaning of each field.
Although users simply press “Play,” the Presentation Layer ensures compatibility, efficiency,
and security.
Thus, the Application Layer handles meaning and functionality, while the Presentation Layer
handles representation and protection.
Serialization and Deserialization
The Presentation Layer (Layer 6) of the OSI model is responsible for how data is formatted,
represented, and prepared for communication between systems. Among its key responsibilities
are serialization and deserialization, which ensure that data created in one system can be
correctly understood by another, even if they use different internal formats.
2. Serialization
Serialization is the process of converting data from its original structure (such as objects, records,
or complex data types) into a standardized format or byte stream suitable for transmission or
storage.
Instead of sending data in its original in-memory form, which may differ between systems,
serialization transforms it into a common format like JSON or XML. This makes the data
portable and platform-independent.
For example, a student record in a program might be internally represented as an object. Before
sending it over the network, it is converted into a JSON string:
From:
To:
"Name": "Abel",
"ID": 123
3. Deserialization
Deserialization is the reverse process. It takes the received byte stream or formatted data and
reconstructs it into its original structure so that the application can use it.
When the JSON data arrives at the receiver, it is converted back into an object or usable format
within that system. This allows the receiving application to process the data just as if it had been
created locally.
In simple terms, serialization prepares data for sending, while deserialization prepares it for use.
The Presentation Layer ensures that both sender and receiver agree on a common data format.
It handles:
Because of this layer, two systems with different architectures or programming languages can
still communicate effectively.
In real-world networks, serialization uses several standard formats. The most common ones
include JSON and XML, which are human-readable, and binary formats such as Protocol
Buffers, which are more efficient but not readable.
6. Practical Scenario
Consider a mobile application sending login information to a server. The application first
serializes the user data into JSON format. This serialized data travels through the network. When
it reaches the server, the server deserializes it back into a usable structure and processes the
request. The response is again serialized before being sent back.
The Session Layer (Layer 5 of the OSI model) is responsible for establishing, maintaining, and
terminating logical communication sessions between applications running on different devices.
While the lower layers ensure that bits travel reliably across the network, the Session Layer
ensures that the conversation between applications is properly organized and controlled.
A session is a structured exchange of messages between two application processes that continues
for a certain period of time. It is not just a single request and response; it is an ongoing
interaction with context. For example, when a user logs into a remote server, participates in a
video conference, or performs a banking transaction online, they are operating within a session.
The key idea is that communication in real systems is rarely a single message. It is usually a
sequence of interactions that must be coordinated. The Session Layer provides the mechanisms
for this coordination.
The Session Layer sits above the Transport Layer and below the Presentation Layer. The
Transport Layer (such as TCP) ensures reliable delivery of data segments between hosts.
However, it does not manage higher-level conversational structure. It does not know whether a
message is part of a login process, a file transfer, or a transaction.
The Session Layer builds on the reliability provided by the Transport Layer and adds logical
organization to communication. If we think of communication as a phone call, the Transport
Layer ensures that sound signals are transmitted clearly, while the Session Layer ensures that the
call is initiated, maintained, and properly ended.
Session Establishment
Before meaningful communication can begin, a session must be established. This involves
negotiation between the two communicating parties.
Consider the example of a remote login using SSH. When the user attempts to connect, the
server verifies credentials. Once authentication succeeds, a session context is created. This
context includes security parameters, encryption keys, and user-specific permissions. All
subsequent commands belong to that session until it is terminated.
Once established, the session must be maintained. This involves managing how data flows
between the two parties.
Communication may occur in different forms. In some cases, only one side sends data at a time.
In others, both sides communicate simultaneously. The Session Layer provides dialog control
mechanisms that regulate whose turn it is to transmit, especially in systems where strict
coordination is required.
For example, in a video conferencing system such as Zoom, multiple participants exchange
audio and video streams in real time. Behind the scenes, session management ensures that
streams remain synchronized, that participants remain authenticated, and that the session persists
for the duration of the meeting.
In more controlled environments, token management may be used. A token grants permission to
transmit data. Only the system holding the token can send information at a given moment. After
finishing, the token is passed to the other side. This prevents confusion and maintains orderly
communication.
Synchronization and Checkpointing
One of the most important features of the Session Layer is synchronization. In long data transfers
or complex transactions, it is inefficient to restart the entire process if a failure occurs. To
prevent this, synchronization points also called checkpoints are inserted at intervals during
communication.
Imagine transferring a very large file across a network. If the transfer is interrupted near
completion, restarting from the beginning would waste time and bandwidth. With checkpointing,
the transfer can resume from the last successful synchronization point.
Similarly, in database systems, synchronization ensures that transactions can either be fully
completed or rolled back safely in case of failure. This helps maintain consistency and reliability
in distributed systems.
Session Termination
Eventually, communication must end. The Session Layer handles orderly termination of
sessions. Proper termination involves releasing allocated resources, clearing session identifiers,
and closing any associated security contexts. If sessions are not terminated correctly, systems
may suffer from resource leaks, security vulnerabilities, or stalled connections.
For instance, when a user logs out of a secure system, the session should immediately become
invalid. If the session ID remains active, it could potentially be exploited by an attacker.
It is important to clarify an academic point for students. In the TCP/IP model, there is no distinct
Session Layer as defined in the OSI model. Instead, session-related functions are implemented at
the application level.
For example, web applications maintain user sessions by generating session IDs and storing them
in cookies. Although HTTP itself is stateless, developers build session mechanisms on top of it
to create stateful interactions such as shopping carts, login persistence, and personalized
dashboards.
Security protocols like TLS also manage session parameters, including encryption keys and
session resumption mechanisms. These responsibilities align closely with the conceptual role of
the Session Layer. Thus, even if modern architectures do not physically separate Layer 5, the
concepts remain highly relevant.
Security Considerations
Session management introduces security challenges. One of the most common threats is session
hijacking. If an attacker obtains a valid session identifier, they may impersonate the legitimate
user.
The session layer leverages a range of protocols to facilitate session establishment, management,
and termination.
RPC empowers applications to request services from remote applications seamlessly. The session
layer deftly establishes a session between the client and server applications, enabling the client to
invoke procedures on the server as if they were local. By abstracting the complexities of network
communication, RPC provides a unified interface for distributed computing.
This abstraction allows developers to focus on application logic rather than network intricacies.
RPC systems typically handle parameter marshaling, network transmission, and result
unmarshaling, ensuring data consistency across different architectures. Popular implementations
like gRPC and XML-RPC have further extended RPC’s capabilities, offering features like
streaming and bidirectional communication.
SIP, a signaling protocol, plays a crucial role in initiating, modifying, and terminating multimedia
sessions over IP networks. The session layer harnesses SIP to establish sessions between
endpoints, negotiate session parameters, and manage the lifecycle of multimedia sessions. SIP
finds extensive application in Voice over IP (VoIP) and video conferencing domains. Its
flexibility allows it to support a wide range of communication scenarios, from simple two-party
calls to complex multi-party conferences.
SIP’s modular design enables easy integration with other protocols and services, making it a
cornerstone of modern communication systems. Additionally, SIP’s text-based nature facilitates
debugging and interoperability across different implementations.
Microsoft’s proprietary RDP allows users to connect to remote computers over a network. The
session layer establishes an RDP session between the client and the remote computer, enabling
the client to interact with the remote desktop seamlessly. RDP offers a comprehensive feature set,
including remote display, keyboard and mouse input, and file transfer, facilitating efficient remote
administration and resource access. The protocol employs various compression and caching
techniques to optimize performance over different network conditions.
RDP also supports features like multi-monitor setups, audio redirection, and printer redirection,
enhancing the user experience. Recent versions have introduced improvements in security, such
as Network Level Authentication (NLA) and Transport Layer Security (TLS) encryption, to
protect against unauthorized access and data interception.
Chapter 3: Transport Layer
The Transport Layer is the fourth layer of the OSI model and serves as the bridge between the
upper layers (Application, Presentation, and Session) and the lower layers (Network, Data Link,
and Physical). While the Network Layer ensures that packets travel from one host to another
across interconnected networks, the Transport Layer ensures that data is delivered correctly,
efficiently, and in the proper order from one process to another.
The Network Layer provides host-to-host communication. The Transport Layer provides
process-to-process communication.
For example, when a user opens a web browser and accesses a website, the Network Layer
ensures that packets reach the correct destination machine. However, the destination machine
may be running multiple applications at the same time a web server, a mail server, an FTP
service, and more. The Transport Layer ensures that the incoming data is delivered to the correct
application process within that machine.
Why the Transport Layer?
Imagine a large company server that is: Hosting a website, handling email, managing database
services and supporting remote login.
All these services operate simultaneously. If data simply arrived at the host without internal
delivery control, the system would not know which application should receive which data.
Without the Transport Layer, communication would be unreliable, unordered, and chaotic.
The Transport Layer is responsible for transforming application messages into structured
segments suitable for network transmission. Its main functions include:
These protocols were standardized by the Internet Engineering Task Force and form the
backbone of internet communication.
The Transport Layer can provide two fundamentally different types of services:
1. Connection-Oriented Service
2. Connectionless Service
Different applications choose different services based on their needs. For example:
The Transport Layer introduces the concept of end-to-end communication. Lower layers
operate hop-by-hop (from one router to the next). The Transport Layer operates from the source
process directly to the destination process.
Even if data passes through dozens of routers, the Transport Layer sees communication as
occurring between only two endpoints. This abstraction is essential for building scalable internet
applications.
3.2. Segmentation
Segmentation is the process of dividing a large message from the Application Layer into smaller,
manageable units called segments before transmission across the network.
This is one of the most fundamental responsibilities of the Transport Layer, and understanding it
properly makes the rest of the chapter much easier.
However, the lower layers of the network cannot transmit extremely large blocks of data in a
single unit. There are limitations imposed by:
If we attempted to send a 100 MB file as a single block and an error occurred near the end, the
entire file would need retransmission. That would be highly inefficient. Segmentation solves this
problem by retransmitting the single failed block.
Thus, segmentation at the sender and reassembly at the receiver are complementary processes.
Example: File Download
Suppose a user downloads a 3 MB PDF file using a web browser such as Google Chrome.
Divides the file into segments (for example, 1460 bytes each if using Ethernet MTU
constraints).
Assigns sequence numbers to each segment.
Sends them one by one.
The size of each segment is influenced by the Maximum Transmission Unit (MTU) of the
network.
For example:
Therefore:
1500 − 20 − 20 = 1460 bytes of actual application data per segment. This is why TCP commonly
uses 1460 bytes as a standard payload size over Ethernet networks.
Advantages of Segmentation
First, it improves reliability. If errors occur, only the affected segments need
retransmission.
Second, it improves fairness. Smaller segments allow multiple devices to share the
network efficiently instead of one large transmission monopolizing it.
Third, it improves buffer management. Routers and switches handle smaller units more
easily.
Fourth, it enables pipelining. Multiple segments can be in transit simultaneously,
increasing throughput.
Segmentation exists in both TCP and UDP, but the way it is handled differs.
In TCP:
In UDP:
Thus, segmentation in TCP supports reliability, while segmentation in UDP supports speed and
simplicity.
Segmentation and End-to-End Principle
3.3. Addressing
Addressing in the Transport Layer is essential to ensure that data is delivered not just to the
correct device (host) on a network, but also to the correct application process running on that
device. While the Network Layer (Layer 3) handles host-to-host addressing using IP addresses,
the Transport Layer provides process-to-process communication using port numbers.
Socket
Key idea:
IP addresses deliver data to the host, while port numbers deliver it to the specific application on
that host.
2. Port Numbers
Port numbers are 16-bit numbers that range from 0 to 65535. They are divided into categories:
Transport Layer ensures the web page data reaches the browser process, not another
application.
In the Transport Layer, multiplexing and de-multiplexing are essential for managing data from
multiple applications simultaneously. They ensure that data streams from different
applications can share a single network connection and that incoming data is delivered to the
correct application on the receiving host.
Multiplexing
Multiplexing occurs at the sender side. The Transport Layer collects data from different
applications running on the host and encapsulates it into segments. Each segment contains source
and destination port numbers, which identify the sending and receiving applications. This allows
multiple applications to send data over the network at the same time without interference.
Example: When a user is browsing a website while downloading a file, the browser and
download manager both send data. TCP assigns different source ports to each application and
combines their data streams for transmission.
Key point: Multiplexing allows efficient use of the network by sending multiple
application streams over the same connection.
For sending data from an application on the sender side to an application at the destination
side, the sender must know the IP address of the destination and port number of the application
(at the destination side) to which he wants to transfer the data. Block diagram is shown below:
De-multiplexing occurs at the receiver side. The Transport Layer reads the destination port
numbers in incoming segments and forwards each segment to the correct application process.
By matching the combination of IP address and port number, the Transport Layer ensures
each segment reaches its intended application.
Example: A server receiving a web page request and a file download request uses de-
multiplexing to deliver the web page segments to the web server process and the file segments to
the file transfer process.
Let us consider two messaging apps that are widely used nowadays viz. Hike and WhatsApp.
Suppose A is the sender and B is the receiver. Both sender and receiver have these applications
installed in their system (say smartphone). Suppose A wants to send messages to B in WhatsApp
and hike both. In order to do so, A must mention the IP address of B and destination port number
of the WhatsApp while sending the message through the WhatsApp application. Similarly, for
the latter case, A must mention the IP address of B and the destination port number of the hike
while sending the message.
Now the messages from both the apps will be wrapped up along with appropriate headers (viz.
source IP address, destination IP address, source port no, destination port number) and sent as a
single message to the receiver. This process is called multiplexing. At the destination, the
received message is unwrapped and constituent messages (viz messages from a hike and
WhatsApp application) are sent to the appropriate application by looking to the destination the
port number. This process is called demultiplexing. Similarly, B can also transfer the messages
to A.
Figure Message transfer using WhatsApp and hike messaging application
3.5. Connectionless/Connection-Oriented
In the Transport Layer, communication between devices can occur in two different ways:
connection-oriented communication and connectionless communication. These two
approaches define how data is transmitted between the sender and receiver and determine the
level of reliability and control provided during communication.
Connection-Oriented Communication
The most common protocol that provides connection-oriented communication at the Transport
Layer is Transmission Control Protocol.
In this method, several mechanisms ensure reliable communication. Before sending data, the
sender and receiver perform a connection establishment process, commonly known as the
three-way handshake. During data transmission, the protocol ensures that segments are
delivered correctly and in the proper order. If any segment is lost or corrupted, it is retransmitted.
Example: When a user opens a website through Hypertext Transfer Protocol over
Transmission Control Protocol, the browser establishes a connection with the web server
before the web page data is transmitted. This ensures that the entire webpage is delivered
correctly.
Connectionless Communication
The primary protocol used for connectionless communication is User Datagram Protocol.
Since UDP does not establish a connection or perform extensive error checking, it is much
faster and has lower overhead compared to TCP. However, it sacrifices reliability for speed.
Example: Applications such as online video streaming, voice calls, and online gaming often
use User Datagram Protocol because they require fast transmission rather than perfect
reliability. If a small packet is lost during a video stream, the system simply continues sending
the next packets instead of retransmitting the lost one.
In the Transport Layer, data transmission between devices can be classified as reliable
communication or unreliable communication. These terms describe whether the protocol
guarantees that data is delivered correctly and in the proper order to the destination application.
Reliable communication ensures that the data sent from the source arrives at the destination
without loss, duplication, or corruption. Unreliable communication, on the other hand, does
not provide such guarantees and sends data without confirming successful delivery.
Reliable Communication
Reliable communication means that the Transport Layer ensures that all data segments reach
the destination correctly and in the correct sequence. If an error occurs during transmission,
the protocol detects the error and retransmits the lost or corrupted segments.
The main protocol that provides reliable communication in the Transport Layer is Transmission
Control Protocol.
Example: When downloading a file from the internet using Transmission Control Protocol,
the protocol ensures that the entire file arrives correctly. If some segments are lost during
transmission, TCP retransmits them until the complete file is received.
Unreliable Communication
Unreliable communication does not guarantee that the transmitted data will reach the destination.
In this method, the sender sends data without waiting for acknowledgments or retransmitting lost
packets.
The protocol commonly used for unreliable communication is User Datagram Protocol.
Because there is no connection setup or extensive error handling, unreliable communication has
less overhead and faster data transmission. However, some packets may be lost or arrive out
of order.
No acknowledgment mechanism
No retransmission of lost packets
No guarantee of packet order
Faster transmission with minimal delay
The Transport Layer of the OSI model provides end-to-end communication between applications
running on different hosts. It ensures that data from the sending application reaches the correct
receiving application using mechanisms such as segmentation, port addressing, flow control, and
error handling.
To perform these functions, the Transport Layer uses specific communication protocols. The two
main protocols used at this layer are Transmission Control Protocol and User Datagram Protocol.
These protocols define how data is transmitted between devices and determine whether
communication will be reliable or fast.
3.7.1. UDP
User Datagram Protocol is a connectionless protocol that provides fast but unreliable data
transmission. Unlike TCP, UDP does not establish a connection before sending data and does not
guarantee delivery or order of packets.
UDP sends data in units called datagrams without waiting for acknowledgments from the
receiver. Because it does not perform retransmissions or extensive error checking, UDP has
lower overhead and faster transmission speed.
UDP is commonly used in applications where speed is more important than reliability, and small
data losses are acceptable.
Connectionless communication
Faster data transmission
Minimal overhead
No guarantee of delivery or order
Example: Real-time applications such as video streaming, online gaming, and voice over IP
(VoIP) often use User Datagram Protocol, since delays caused by retransmissions would
negatively affect performance.
3.7.2. TCP
Flow control is an important mechanism in Transmission Control Protocol that ensures the
sender does not transmit data faster than the receiver can process it. In network communication,
different devices may have different processing speeds and buffer capacities. If a sender sends
data too quickly, the receiver’s buffer may become full, leading to data loss. Flow control
prevents this problem by regulating the rate of data transmission between the sender and
receiver.
TCP implements flow control using a mechanism called the sliding window. This mechanism
allows the receiver to inform the sender about the amount of data it can accept at a given time.
When a TCP connection is established, the receiving device allocates a buffer to temporarily
store incoming data segments. The receiver then informs the sender about the available buffer
space using a value called the window size. This value is included in the TCP header of
acknowledgment messages sent to the sender.
The sender is allowed to transmit only the amount of data that fits within this window size. As
the receiver processes the received data and frees buffer space, it sends updated
acknowledgments with a new window size. This process allows the sender to adjust its
transmission rate according to the receiver’s capacity.
For example, if the receiver announces a window size of 4000 bytes, the sender can transmit up
to 4000 bytes of data before waiting for an acknowledgment. Once the receiver processes part of
the data and sends an acknowledgment indicating additional available space, the sender can
continue transmitting more data.
Sliding Window Mechanism
The sliding window mechanism allows multiple segments to be sent before waiting for
acknowledgment, which improves network efficiency. As acknowledgments are received, the
transmission window moves forward, allowing the sender to transmit additional segments.
Example: Consider a situation where a server is sending a large file to a client computer. If the
client device has a small buffer and limited processing power, it may not be able to handle a
large amount of incoming data at once. Using flow control, the client informs the server about
the maximum amount of data it can receive. The server then sends data at a controlled rate based
on this information, ensuring that the client is not overwhelmed.
Error control is an essential mechanism in Transmission Control Protocol that ensures data is
delivered accurately and reliably from the sender to the receiver. During data transmission over
a network, segments may be lost, duplicated, delayed, or corrupted due to noise, congestion,
or transmission failures. Error control mechanisms detect these problems and ensure that the
correct data is eventually delivered to the receiving application.
Error Detection
TCP detects errors using a checksum field included in each TCP segment. The sender calculates
the checksum value based on the contents of the segment and places it in the TCP header before
transmission. When the segment reaches the receiver, the receiver performs the same calculation
and compares the result with the received checksum value.
If the values match, the segment is considered correct. If the values differ, the receiver assumes
that the segment has been corrupted during transmission and discards it.
Acknowledgment Mechanism
After receiving a correct segment, the receiver sends an acknowledgment (ACK) back to the
sender. The acknowledgment confirms that the segment has been successfully received. Each
acknowledgment includes a number that indicates the next expected sequence number,
informing the sender that all previous segments were received correctly.
For example, if segments with sequence numbers 1, 2, and 3 are received correctly, the receiver
sends an acknowledgment indicating that it expects segment 4 next.
If the sender does not receive an acknowledgment within a certain time period, it assumes that
the segment was lost or damaged. The sender then retransmits the segment to ensure that the
receiver eventually receives it correctly.
This retransmission mechanism guarantees that lost data is sent again until it is successfully
delivered.
Sequence Numbers
Each TCP segment is assigned a sequence number. These numbers help the receiver arrange
segments in the correct order and identify missing segments. If a segment arrives out of order,
the receiver temporarily stores it until the missing segment is received. Sequence numbers
therefore allow TCP to maintain correct data ordering and completeness.
Example: Suppose a computer is downloading a file from a server. The server sends several TCP
segments containing parts of the file. If one segment is lost during transmission, the receiver will
not send an acknowledgment for that segment. After the timeout period expires, the sender
retransmits the missing segment. Once the receiver gets it, the file can be correctly reconstructed.
Unlike flow control, which manages the rate of data transmission based on the receiver’s
capacity, congestion control focuses on the overall capacity of the network. TCP dynamically
adjusts the amount of data sent depending on the level of congestion detected in the network.
TCP manages congestion using a parameter called the congestion window (cwnd), which
determines how many segments the sender can transmit before receiving acknowledgments. The
sender increases or decreases this window depending on network conditions.
Slow Start
At the beginning of a connection, TCP does not know the available network capacity. Therefore,
it starts by sending a small amount of data and gradually increases the transmission rate. This
phase is known as slow start.
During slow start, the congestion window increases rapidly each time an acknowledgment is
received. This allows TCP to quickly reach an efficient transmission rate without overwhelming
the network.
Congestion Avoidance
After the congestion window reaches a certain threshold, TCP enters the congestion avoidance
phase. In this stage, the growth of the congestion window becomes slower and more controlled.
Instead of increasing rapidly, the window size increases gradually. This approach helps prevent
network congestion while still improving transmission efficiency.
TCP assumes that packet loss or delayed acknowledgments indicate congestion in the network.
When congestion is detected, TCP reduces the transmission rate by decreasing the congestion
window. This reduction allows the network to recover from the overload condition.
The sender then slowly increases the transmission rate again once the network stabilizes.
Example: Consider a situation where a server is sending data to multiple clients through the same
router. If too many packets are sent at once, the router’s buffer may become full, causing packets
to be dropped. TCP detects this packet loss and reduces its sending rate. After the congestion
decreases, TCP gradually increases the transmission rate again to maintain efficient
communication.
Over time, several versions (variants) of Transmission Control Protocol have been developed
to improve network performance, especially in environments with high bandwidth, long
distances, or heavy congestion. These variants mainly differ in the way they handle congestion
control, packet loss recovery, and transmission efficiency.
As network technologies evolved, the original TCP mechanisms became insufficient for modern
high-speed networks. Therefore, researchers and developers introduced improved TCP variants
to optimize data transmission and reduce congestion-related problems.
TCP Tahoe
TCP Tahoe is one of the earliest implementations of TCP congestion control. It introduced
important mechanisms such as slow start, congestion avoidance, and fast retransmission.
When packet loss is detected, TCP Tahoe assumes that congestion has occurred. It reduces the
congestion window to a very small size and restarts the transmission process using the slow start
mechanism. While this approach helps stabilize the network, it may reduce performance because
the transmission rate must build up again from a very low level.
TCP Reno
TCP Reno improved the performance of TCP Tahoe by introducing an additional mechanism
called fast recovery. Instead of returning completely to slow start after detecting packet loss,
TCP Reno reduces the congestion window but continues data transmission more efficiently.
This improvement allows the connection to recover from packet loss more quickly and maintain
better throughput in moderately congested networks.
TCP New Reno is an enhancement of TCP Reno that improves the handling of multiple packet
losses within a single transmission window. While TCP Reno performs well when only one
packet is lost, it becomes less efficient when multiple packets are lost.
TCP New Reno modifies the fast recovery mechanism so that multiple lost segments can be
recovered without returning to slow start too quickly, improving overall performance.
TCP Vegas
TCP Vegas takes a different approach to congestion control. Instead of waiting for packet loss to
occur, it attempts to detect congestion early by monitoring changes in network delay. By
observing variations in round-trip time (RTT), TCP Vegas adjusts the transmission rate before
packet loss happens.
This proactive approach helps reduce congestion and improve network efficiency, especially in
stable network environments.
1. Source Port / Destination Port (16 bits each): Identify sending and receiving applications.
2. Sequence Number (32 bits): Position of the first byte in this segment, used for ordering.
3. Acknowledgement Number (32 bits): Next byte expected by the receiver (confirms data
received).
4. Header Length (HLEN): Size of the header (5–15 words, i.e., 20–60 bytes).
5. Control Flags (1 bit each): are control bits in the TCP header that regulate how
communication is established, maintained, and terminated between devices. Each flag serves a
specific role in ensuring reliable data transmission.
URG: Urgent data
ACK: Acknowledgement valid
PSH: Push data immediately
RST: Reset connection
SYN: Synchronize sequence numbers
FIN: Terminate connection
6. Window Size: Receiver’s buffer size (for flow control).
7. Checksum: Error detection (mandatory).
8. Urgent Pointer: Position of urgent data (if URG flag is set).
TCP 3-way Handshake Process
Communication over the internet follows the TCP/IP model. Applications like web browsers use
the Application Layer, and their data is passed to the Transport Layer, where TCP and UDP
work.
Here, to terminate an established TCP connection, the following 4 TCP packets are needed to be
exchanged. Which you can understand with the statements below:
Now the question is, why termination cannot send ACK and FIN packets at once? By which one
step can be reduced. And why the four-way handshake is necessary here?
Well, by looking at it carefully, it can be seen that the four-way Handshake is actually a set of
two-way handshakes. However, it is not completely false that in some cases, the 2 and 3 can be
set at the same packet.
The four-way handshake works as a pair of two-way Handshakes. Where, the first phase is, when
the client sends the FIN flag to the server, and in return, the server sends the ACK flag as
acknowledgment.
This can be understood by the statement below:
At this point, the client is in the waiting state, it is waiting for the FIN flag from the server. So,
that the connection can be terminated. This state can be mentioned as FIN_WAIT_2.
Now as we know that it works as the full-duplex mode, so if the one-side connection is broken
down, then no more data can be sent from that side of the connection. But it can still receive the
data from another side.
Here, the server can send more data when the Client is in the FIN_WAIT_2 state. And once the
server is done sending data, then the server will send the FIN flag to the client as the termination
request, and then the client sends the ACK flag as the confirmation to terminate the connection.
So, as explained, in this case, steps 2 and 3 cannot be sent as one package, since they belong to
two different states.
Here four-way handshake is necessary in this case, as the first FIN flag that is sent to the server
by the client is a request for termination. And the first ACK, received by the client is just a
response to FIN 1. Now here only the connection from the client is disconnected, but the server
is still in a working position. This means it may still have some data to send. So, in this
condition, the connection cannot be cut down suddenly. Here, the other two steps are needed to
be performed by the server.
Now the other reason is that it can become difficult for both sides to define why the peer does
not respond. Also, not only the offline state can cause a packet lost. Alongside, the other
exceptions in the server’s processing can also lead to it. And there is another problem with this
idea is that in this condition, the client will have to wait for a long time until the time is out.
Here, the four-way handshake looks like a better and easier option to address these problems.
Chapter 4: Network Layer Addressing and Routing
In computer networks, communication between devices does not only depend on the physical
connection of cables and hardware. It also requires a logical system that allows devices to
identify each other and determine the best path for delivering information across interconnected
networks. This responsibility is handled by the Network Layer, which is the third layer of the
OSI Model.
The Network Layer plays a critical role in enabling communication between devices located on
different networks. While the lower layers such as the Data Link Layer handle communication
within the same local network, the Network Layer ensures that data can travel from one network
to another, possibly across long distances and through multiple intermediate devices. The main
functions of this layer include logical addressing, routing, packet forwarding, and congestion
handling.
One of the most important tasks of the Network Layer is logical addressing. Every device
connected to a network must have a unique identifier so that data can be delivered to the correct
destination. Logical addressing is primarily implemented through the Internet Protocol (IP),
which assigns numerical addresses to devices connected to the internet or any IP-based network.
These addresses allow routers and other networking devices to determine where data should be
sent.
Another major function of the Network Layer is routing. When a data packet travels from a
source device to a destination device on another network, it usually passes through several
intermediate routers. These routers analyze the destination IP address and use routing algorithms
to determine the most efficient path for the packet to follow. The process of deciding the path is
known as routing, while the actual movement of packets along that path is called forwarding.
The Network Layer also handles packetizing, which is the process of dividing large data
messages into smaller units called packets. Each packet contains addressing information so that it
can be independently routed through the network. Even if packets travel through different paths,
they can be reassembled correctly at the destination.
In modern networking, the most widely used addressing system is IPv4, which uses 32-bit
addresses to identify devices. However, due to the rapid growth of the internet and the increasing
number of connected devices, IPv4 addresses have become limited. To solve this problem, a
newer addressing system called IPv6 was introduced. IPv6 uses 128-bit addresses, providing a
significantly larger address space and improved features for modern networks.
This chapter focuses on how the Network Layer performs addressing and routing in computer
networks. It explains how devices are identified through MAC and IP addresses, how packets
are formed and transmitted, how IP addressing works, and how networks are divided using
subnetting techniques. The chapter also discusses important protocols used at this layer,
including the Internet Control Message Protocol (ICMP), which helps in error reporting and
network diagnostics, and the Internet Group Management Protocol (IGMP), which manages
multicast group communication.
Understanding Network Layer addressing and routing is essential for designing, managing, and
troubleshooting modern computer networks. It enables network administrators and engineers to
organize large networks efficiently, ensure reliable communication between devices, and
optimize data transmission across the internet.
In computer networks, every device that connects to a network must have a unique identifier so
that other devices can recognize and communicate with it. At the hardware level, this
identification is provided by the Network Interface Card (NIC). A Network Interface Card is a
hardware component installed in a computer or networking device that enables it to connect to a
network. Each NIC contains a unique physical address known as the MAC address.
A NIC address, commonly called a MAC address (Media Access Control address), is a unique
identifier assigned to a network interface by the manufacturer. This address operates at the Data
Link Layer of the OSI Model and is used for communication within the same local network.
The NIC address is permanent and is stored in the hardware of the network interface. Because it
is assigned by the manufacturer, no two network interface cards should have the same address.
This uniqueness allows devices within a local network to identify each other reliably.
A MAC address is typically 48 bits long and is represented as 12 hexadecimal digits. For easier
reading, these digits are usually grouped into six pairs separated by colons or hyphens.
In this address:
The first 24 bits represent the manufacturer identifier called the Organizationally Unique
Identifier (OUI).
The last 24 bits are assigned by the manufacturer to uniquely identify the specific device.
For example, if a computer has a network interface manufactured by Intel, the first part of the
MAC address may correspond to Intel’s assigned OUI.
Role of NIC Address in Communication
When devices communicate within the same Local Area Network (LAN), they use MAC
addresses to send and receive frames. The Data Link Layer encapsulates the data into frames and
includes both the source MAC address and the destination MAC address.
Consider a simple example. Suppose a computer wants to send data to a printer within the same
network. The computer already knows the printer’s MAC address or obtains it using the Address
Resolution Protocol. The data frame will then include:
The network switch reads the destination MAC address and forwards the frame to the correct
device.
If Computer A sends a file to the printer, the Ethernet frame will contain:
The switch reads the destination address and delivers the frame to the printer.
Types of MAC Address
1. Unicast: A Unicast-addressed frame is only sent out to the interface leading to a specific NIC.
If the LSB (least significant bit) of the first octet of an address is set to zero, the frame is meant
to reach only one receiving NIC. The MAC Address of the source machine is always Unicast.
2. Multicast: The multicast address allows the source to send a frame to a group of devices. In
Layer-2 (Ethernet) Multicast address, the LSB (least significant bit) of the first octet of an
address is set to one. IEEE has allocated the address block 01-80-C2-xx-xx-xx (01-80-C2-00-00-
00 to 01-80-C2-FF-FF-FF) for group addresses for use by standard protocols.
3. Broadcast: Similar to Network Layer, Broadcast is also possible on the underlying layer
(Data Link Layer). Ethernet frames with ones in all bits of the destination address (FF-FF-FF-
FF-FF-FF) are referred to as the broadcast addresses. Frames that are destined with MAC
address FF-FF-FF-FF-FF-FF will reach every computer belonging to that LAN segment.
Characteristics of NIC Addressing
NIC addressing has several important characteristics that make it suitable for local
communication. First, it is globally unique, meaning each device has a distinct hardware
identifier. Second, it operates only within the local network segment, which means MAC
addresses are generally not used for routing data across different networks. For communication
between networks, logical addressing such as IP addresses is used.
Another important feature is that MAC addresses remain the same even if a device moves to a
different network. For example, if a laptop connects to a different Wi-Fi network, its MAC
address remains unchanged because it is embedded in the hardware.
Relationship Between NIC Address and IP Address
Although MAC addresses identify devices at the Data Link Layer, modern networks primarily
rely on IP addresses for communication across networks. Therefore, both addressing systems
work together. When a device wants to send data to another device, it first determines the
destination IP address and then translates it into a MAC address using the Address Resolution
Protocol.
This cooperation between logical addressing and physical addressing allows networks to
function efficiently at both local and global levels.
4.2. Packetizing
In a computer network, large amounts of data are usually transmitted between devices. However,
sending the entire data as one large unit would be inefficient and unreliable. If an error occurs
during transmission, the whole data would have to be retransmitted. To solve this problem,
networks divide large data messages into smaller units called packets. The process of breaking a
large message into smaller manageable pieces is known as packetizing.
Packetizing is mainly performed at the Network Layer using the Internet Protocol (IP). Each
packet contains a portion of the original data along with important control information such as
the source address, destination address, and sequence information. These packets can travel
independently through the network and may follow different paths to reach the destination.
When the packets arrive at the destination device, they are reassembled in the correct order to
reconstruct the original message. This process ensures reliable communication even if some
packets are delayed or lost during transmission.
A. Header: The header contains control information required for routing and delivery. The
header of an IP packet contains essential control information required for the correct
delivery of data across a network. It includes the source IP address, which identifies the
sender of the packet, and the destination IP address, which specifies the intended receiver,
allowing routers to forward the packet along the correct path. The header also contains the
packet length (total length), which indicates the complete size of the packet, including both
header and data, helping the receiver understand how much information to process. Another
important field is the Time To Live (TTL), which limits the lifetime of a packet by
decreasing at each router; when it reaches zero, the packet is discarded to prevent infinite
looping in the network. Additionally, the protocol field identifies the type of data being
carried, such as TCP, UDP, or ICMP, ensuring the packet is delivered to the appropriate
process at the destination. Finally, the header includes fragmentation information, such as
identification, flags, and fragment offset, which are used when a large packet is divided into
smaller fragments so that it can pass through networks with smaller MTU sizes and later be
correctly reassembled at the destination.
B. Payload (Data): The payload is the actual data being transmitted. It contains a segment of
the original message generated by the sending application. Therefore, a packet can be
understood as:
The header helps network devices such as routers determine how the packet should be forwarded
to the destination.
How Network Layer Works
Each device is assigned a unique logical address (IP address).
Data from the transport layer is encapsulated into packets, with source and destination IPs
attached.
Routers analyze the destination address and determine the best available path.
Packets traverse the network hop-by-hop, moving across routers until reaching the
destination.
If the packet size exceeds the MTU, it is fragmented into smaller units.
At the destination, the fragments are reassembled into the original data.
If errors occur (e.g., unreachable destination), protocols like ICMP send error messages back
to the source.
Example of Packetizing
Suppose a user wants to send a 3000-byte file from one computer to another through a network.
If the network protocol allows a maximum packet size of 1000 bytes, the data must be divided
into smaller packets.
Each packet will contain its own header information including the source and destination IP
addresses. These packets are then transmitted through the network one by one.
At the receiving computer, the packets are collected and reassembled in the correct order to
reconstruct the original 3000-byte file.
Advantages of Packetizing
Another advantage is error control. Since packets are smaller units, detecting and correcting
errors becomes easier compared to handling large blocks of data.
Packet Switching
Packetizing is closely related to the concept of packet switching, which is the method used by
modern networks to transmit data. In packet switching, each packet is treated as an independent
unit and is routed separately through the network.
The global internet operates using packet switching through the Internet Protocol. Routers
examine the destination address of each packet and decide the best path for forwarding it.
When a user sends an email or loads a web page, the data is automatically divided into hundreds
or thousands of packets. These packets travel through several routers across the internet before
reaching the destination. At the destination device, the packets are reassembled to display the
complete message or web page.
This process happens very quickly, usually within milliseconds, allowing users to experience
smooth and efficient communication over networks.
4.3. IP addressing
In modern computer networks, devices must be uniquely identified so that data can be delivered
from a source to the correct destination. While the NIC address (MAC address) identifies devices
within a local network, communication across different networks requires a logical addressing
system. This logical addressing system is known as IP addressing, which is implemented using
the Internet Protocol.
An IP address is a numerical label assigned to every device connected to a network that uses
Internet Protocol for communication. It allows routers and other networking devices to determine
where data packets should be sent. Unlike MAC addresses, which are permanent hardware
identifiers, IP addresses can be assigned dynamically and may change when a device connects to
a different network.
IP addressing is essential for the operation of the internet because it enables communication
between devices located in different geographic locations and connected through many
intermediate networks.
Purpose of IP Addressing
The main purpose of IP addressing is to uniquely identify devices and ensure that data packets
reach the correct destination. When a device sends data, the packet includes both the source IP
address and the destination IP address. Routers examine the destination address and determine
the best route for forwarding the packet.
For example, when a user sends a request to open a website, the computer sends packets
containing its own IP address and the IP address of the web server hosting the website. These
packets travel through multiple routers until they reach the destination server.
Structure of an IP Address
Network Portion: This part identifies the network to which the device belongs.
Host Portion: This part identifies the specific device within that network.
This structure allows routers to efficiently forward packets by first identifying the network and
then locating the host within that network.
Example of IP Addressing
In this example:
Routers are networking devices that operate mainly at the Network Layer of the OSI Model.
Their main responsibility is to examine the destination IP address in each packet and determine
the best path for forwarding the packet toward its destination.
If the destination device is located in another network, the router forwards the packet to the next
router along the route. This process continues until the packet reaches the network where the
destination device is located.
There are two major versions of Internet Protocol used in networking today:
The first and most widely used version is IPv4. It uses 32-bit addresses and supports
approximately 4.3 billion unique addresses.
The newer version is IPv6. It uses 128-bit addresses, providing a much larger address
space and additional improvements in efficiency and security.
Because the number of devices connected to the internet continues to grow rapidly, IPv6 was
introduced to overcome the limitations of IPv4 address availability.
Example: Assume a computer with IP address [Link] wants to communicate with a server
having IP address [Link].
1. The computer creates a packet containing its source IP address and the destination IP
address.
2. The packet is sent to the local router.
3. The router checks the destination address and forwards the packet to the next appropriate
network.
4. After passing through several routers, the packet eventually reaches the destination
server.
This process demonstrates how IP addressing enables communication across multiple networks.
Importance of IP Addressing
IP addressing is fundamental to the operation of the internet and modern networks. It allows
billions of devices such as computers, smartphones, servers, and IoT devices to communicate
with each other efficiently. Without logical addressing, routers would not be able to determine
where data should be delivered.
4.3.1. IPv4
One of the most widely used addressing systems in computer networks is IPv4, which stands for
Internet Protocol version 4. It is the fourth version of the Internet Protocol and has been the
primary protocol used for identifying devices on the internet for several decades. IPv4 provides a
logical addressing scheme that enables devices located in different networks to communicate
with each other through routers.
The IPv4 addressing system uses a 32-bit address, which means every address consists of 32
binary digits. These bits are usually divided into four sections called octets, where each octet
contains 8 bits. For easier understanding and readability, IPv4 addresses are commonly written
in decimal format separated by periods. This format is known as dotted decimal notation.
Each of the four numbers in the dotted decimal format can range from 0 to 255, because 8 bits
can represent values from 0 to 255.
Since IPv4 uses 32 bits, the total number of possible addresses can be calculated as: 2³² =
4,294,967,296 addresses
This means IPv4 can theoretically support about 4.3 billion unique IP addresses. However, not
all of these addresses are available for public use because some are reserved for special purposes
such as private networks and network testing.
Due to the rapid growth of the internet and the increasing number of connected devices, the
available IPv4 addresses have gradually become insufficient. This limitation led to the
development of IPv6, which provides a much larger address space.
Network ID: This part identifies the specific network to which a device belongs.
Host ID: This part identifies the specific device within that network.
The division between the network portion and the host portion depends on the network
configuration and the subnet mask used.
In this example, the first part identifies the network, while the last part identifies the specific
device on that network.
Network ID → 192.168.10
Host ID → 25
This means the device is the 25th host in the network 192.168.10.
When data is transmitted across a network, IPv4 packets contain a header that includes important
information required for routing and delivery. The header contains fields such as:
Source IP Address
Destination IP Address
Version number
Packet length
Time to Live (TTL)
Protocol type
Routers examine this header information to determine where the packet should be forwarded.
For example, if a computer sends a packet to a server, the IPv4 header may contain:
The routers along the path read the destination address and forward the packet until it reaches the
correct network.
When a user visits a website such as a search engine, the computer sends a request to a server
using an IPv4 address. For instance, the request might be sent to a server belonging to Google
using an IPv4 address like [Link]. The request travels across the internet through multiple
routers until it reaches the server hosting the service.
The server then sends a response back to the user's device using the source IP address contained
in the original packet.
Limitations of IPv4
Although IPv4 has been highly successful in enabling global internet communication, it has
several limitations. The most significant limitation is the limited address space, which cannot
accommodate the growing number of internet-connected devices such as smartphones,
computers, smart appliances, and IoT devices.
To address this limitation, techniques such as Network Address Translation (NAT) and
subnetting have been widely used to conserve IP addresses. Eventually, a new protocol, IPv6,
was introduced to provide a much larger address space and improved network capabilities.
4.4. Sub-netting
As computer networks grow larger, managing them as a single network becomes inefficient and
difficult. A large network may experience heavy traffic, poor performance, and complicated
administration. To solve this problem, networks are often divided into smaller logical segments
known as subnets. The process of dividing a large network into smaller networks is called
subnetting.
Subnetting works by borrowing bits from the host portion of an IP address and using them to
create additional network segments. These segments are called subnets, and each subnet can
contain a group of devices that communicate with each other within that smaller network.
Subnetting is commonly implemented in networks that use the IPv4 addressing system. It relies
on the use of a subnet mask, which helps determine how many bits of the IP address represent
the network and how many represent the host.
Purpose of Subnetting
Subnetting serves several important purposes in network design and management. One of the
primary purposes is efficient use of IP addresses. Without subnetting, many IP addresses would
remain unused within large networks. Subnetting allows administrators to allocate address ranges
more effectively.
Another purpose is improved network performance. When a network is divided into smaller
subnets, broadcast traffic is limited to each subnet rather than spreading across the entire
network. This reduces unnecessary network traffic and improves communication efficiency.
Each octet in an IPv4 address consists of 8 bits. The value of each bit position is:
128 64 32 16 8 4 2 1
For example, let us convert the decimal number 192 into binary:
192 = 128 + 64
So binary = 11000000
Another example: 10 = 8 + 2
Binary = 00001010
becomes: 11000000.10101000.00000001.00001010
What Subnetting Actually Does
Subnetting takes bits from the host portion and uses them to create subnetworks.
This means:
Before the introduction of modern subnetting techniques, IPv4 addressing followed a fixed
structure known as Classful Addressing. In this system, IP addresses were divided into
predefined classes, and each class had a fixed boundary between the network portion and the
host portion.
Classful addressing was widely used in early networks based on the IPv4 system. Although it is
now considered inefficient and largely replaced by CIDR, understanding it is essential because it
forms the foundation of subnetting and IP addressing.
In classful addressing:
Class A
Class B
Class C
Class D (Multicast)
Class E (Experimental)
First bit = 0
Network bits = 8
Host bits = 24
Range
But:
0 is reserved
127 is reserved for loopback
Example
IP Address: [Link]
Binary: 00001010.00000000.00000000.00000001
Network ID → 10
Host ID → [Link]
Class B Addressing
Structure
Binary: [Link]
Range
Example
IP Address: [Link]
Binary: 10101100.00010000.00000101.00001010
Network ID → 172.16
Host ID → 5.10
Use Case
Binary: [Link]
Range
Example
IP Address: [Link]
Binary: 11000000.10101000.00000001.00001010
Network ID → 192.168.1
Host ID → 10
Use Case
These addresses are not assigned to individual hosts. They are used for multicast
communication, where one sender transmits data to multiple receivers.
These addresses are reserved for experimental purposes and are not used in normal networking.
You can determine the class of an IP address by looking at the first few bits:
IP: [Link]
Binary: 10010110
IP: [Link]
These masks define how the network and host portions are divided.
Internet routers use only the network prefix of the destination address to route traffic to a
subnetted environment. Routers within the subnetted environment use the extended network
prefix to route traffic between the individual subnets. The extended network prefix is composed
of the classful network prefix and the subnet number.
The extended network prefix has traditionally been identified by the subnet mask. For example,
if an administrator has the /16 address of [Link] and wants to use the entire third octet to
represent the subnet number, the administrator must specify a subnet mask of [Link]. The
bits in the subnet mask and the Internet address have a one to one correspondence. The bits of
the subnet mask are set to 1 (one) if the system examining the address should treat the
corresponding bit in the IP address as part of the extended network prefix. The bits in the mask
are set to 0 (zero) if the system should treat the bit as part of the host number. This numbering is
illustrated in Figure 3.10.
The standards describing modern routing protocols often refer to the extended network prefix
length rather than the subnet mask. The prefix length is equal to the number of contiguous
onebits in the traditional subnet mask. This means that specifying the network address [Link]
with a subnet mask of [Link] can also be expressed as [Link]/24. The / notation is
more compact and easier to understand than writing out the mask in its traditional dotteddecimal
format. This is illustrated in Figure 3.11.
Note that modern routing protocols still carry the subnet mask. None of the Internet standard
routing protocols have a 1-byte field in the header that contains the number of bits in the
extended network prefix. Each routing protocol is still required to carry the complete four-octet
subnet mask.
Subneting Example 1:
Suppose a company has a block of 256 public IP addresses provided by the local service
provider.
The IP address block is [Link] [Link], written in slash notation as [Link]/24. Using
the technique shown in our previous lesson, we can easily calculate that the boundaries of this
network are Network ID [Link] and Broadcast address [Link], as shown in figure 1 above.
The company has four offices with 50 users each. As a network engineer, you are tasked to
divide the company's public IP address block [Link]/24 into four subnets with at least 50 usable
IP addresses and assign a subnet to each office. Figure 2 illustrates the requirements.
If we do not subnet the [Link]/24 address block into multiple smaller blocks, we can only use it
in one office. For example, we can assign the entire [Link]/24 to office 1. However, the
company will then need to buy additional IP address blocks for the other offices. (the company's
management won't be happy about that).
It's an important aspect of network management and is commonly used by administrators to
optimize their IP address usage.
Figure 3 illustrates the purpose of IP subnetting - we divide a network into smaller subnets so
that we can use the IP address space more efficiently, which is crucial given the limited number
of available IPv4 addresses. For example, instead of assigning the entire [Link]/24 to office-1
and telling the management to buy more addresses, we divide the network [Link]/24 into four
smaller subnets and assign a subnet to each office.
In this lesson's example, we have the network [Link]/24. Therefore, the mask is 24 bits long,
which means that the first 24 bits of the IP address [Link] identify the network, as shown in
figure 4 below. The last 8 bits identify the host portion. When doing subnetting, we work with
the host portion of the original network given to us. We do not touch the original network
portion.
To divide the network into subnets, we convert some of the leftmost host bits into network
bits. We call these bits - subnet bits. When doing this, we create multiple sub-networks smaller
than the original network. The question is - how do we decide how many host bits to convert to
subnet bits?
Here is how we calculate the number of subnets created and the number of hosts per subnet.
For example, with a single subnet bit, we can create 2 1 or 2 subnets. With 2 bits, 22 or 4 subnets,
with 3 bits, 23 or 8 subnets, and so forth. The number of subnet bits must be sufficient to create
as many sub-networks as required. At the same time, the remaining host bits must also be
sufficient to ensure that we have as host IP addresses as needed.
Ok, so we have 8 original host bits. For subnets with at least 50 usable host addresses, we need 6
host bits. Therefore, we are left with 2 bits that we can convert to subnet bits.
To calculate the new subnet mask of the sub-networks, we add the subnet bits to the original
mask - 24+2 = /26. Figure 5 illustrates this example.
Now, to calculate the boundaries of each subnet, we convert the binary representation to decimal.
For example, the first subnet's Network ID is 00100101.0000001.00000001.00000000 ([Link]),
and the Broadcast address is 00100101.0000001.00000001.00111111 ([Link]). Notice that the
network bits are in blue and the host bits are in red. The network bits are 26 - the 24 original
network bits plus the 2 subnet bits. Therefore, for Subnet 1:
Now we can assign each of the four /26 subnets to the four offices, providing enough IP
addresses for 50 users per office, as shown in figure 6 below.
Limitations of Classful Addressing
First, it causes wastage of IP addresses. For example, if an organization needs 1000 hosts, Class
C (254 hosts) is too small, while Class B (65,534 hosts) is too large.
Second, it lacks flexibility. The fixed boundaries do not allow efficient allocation of IP
addresses.
Third, it does not support modern routing efficiency, which led to the development of Classless
Inter-Domain Routing (CIDR).
Summary
Classful addressing divides IP addresses into fixed classes based on leading bits. While simple, it
is inefficient and has been replaced by more flexible methods. However, it remains important for
understanding:
IP structure
Subnetting basics
Network design concepts
The first step in defining the subnet mask is to determine the number of bits required to define
the six subnets. Since a network address can only be subnetted along binary boundaries, subnets
must be created in blocks of powers of two (2¹, 2², 2³, 2⁴, and so on).
Thus, it is impossible to create exactly six subnets. Instead, the network administrator must
create 8 subnets (2³), which allows for six required subnets and two extra subnets reserved for
future use.
Since 8 = 2³, three bits are required to represent the subnet numbers.
The original network has a /24 prefix, so adding 3 subnet bits gives: New prefix = /27
2⁵ = 32 total addresses
Usable hosts = 32 − 2 = 30
(The subtraction accounts for the all-0s and all-1s host addresses.)
Subnet Example 2
An organization is assigned the network number [Link]/24, and it needs to define six subnets.
The largest subnet is required to support 25 hosts.
Defining the Subnet Numbers: The eight subnets are numbered from 0 to 7.
0 → 000
1 → 001
2 → 010
3 → 011
4 → 100
5 → 101
6 → 110
7 → 111
To define Subnet #N, the administrator places the binary value of N into the 3 subnet bits.
Subnet List
Subnets:
An easy way to verify correctness is to check that each subnet increases by 32: 0, 32, 64, 96, 128,
160, 192, and 224
Originally (RFC 950), the use of the all-0s and all-1s subnets was not allowed to avoid confusion
in classful routing.
For example, in protocols like RIP v1, subnet masks are not included in routing updates.
Therefore:
[Link]/24 (network)
[Link]/27 (subnet)
Example: Subnet #2
Subnet #2:
11000001.00000001.00000001.010 00000 = [Link]/27
Hosts:
Host #1 → [Link]
Host #2 → [Link]
Host #3 → [Link]
…
Host #15 → [Link]
Host #16 → [Link]
…
Host #30 → [Link]
Example: Subnet #6
Subnet #6:
11000001.00000001.00000001.110 00000 = [Link]/27
Hosts:
Host #1 → [Link]
Host #2 → [Link]
Host #3 → [Link]
…
Host #15 → [Link]
Host #16 → [Link]
…
Host #30 → [Link]
Subnet #2:
Broadcast: [Link]
Subnet #6:
Broadcast: [Link]
A key observation:
The broadcast address of Subnet n is always one less than the network address of Subnet (n+1).
Example:
Example3
IP Address: [Link]
Prefix: /24 → means 24 bits are network bits
Remaining bits = 32 − 24 = 8 host bits
So originally:
Network bits = 24
Host bits = 8
We need 4 subnets.
Find n: 2² = 4
192 = 11000000
Subnet 1 → [Link]
Subnet 2 → [Link]
Subnet 3 → [Link]
Subnet 4 → [Link]
Subnet 1: [Link]/26
Range:
Subnet 2: [Link]/26
Range:
Network → [Link]
First Host → [Link]
Last Host → [Link]
Broadcast → [Link]
Subnet 3: [Link]/26
Network → [Link]
First Host → [Link]
Last Host → [Link]
Broadcast → [Link]
Subnet 4: [Link]/26
Network → [Link]
First Host → [Link]
Last Host → [Link]
Broadcast → [Link]
Important Formulas
Original: [Link]
Subnets:
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]
As networks expanded and the limitations of classful addressing became clear, a more flexible
and efficient method of IP address allocation was introduced. This method is known as Classless
Inter-Domain Routing (CIDR). CIDR removes the rigid class boundaries of Class A, B, and C
and allows networks to be divided based on actual need rather than fixed sizes.
CIDR is widely used in modern networking and is a key feature of the IPv4 addressing system. It
enables efficient utilization of IP addresses and supports scalable routing on the internet.
Basic Concept of CIDR
In CIDR, IP addresses are written using a format called CIDR notation, which looks like this:
Example: [Link]/26
The number after the slash (/) indicates how many bits are used for the network portion. The
remaining bits are used for the host portion.
This means:
Understanding CIDR
192 → 11000000
168 → 10101000
1 → 00000001
0 → 00000000
So: 11000000.10101000.00000001.00000000
/26 means:
Decimal: [Link]
Host bits = 6
32 − 27 = 5 host bits
/27 → [Link]
Binary: 11111111.11111111.11111111.11100000
256 − 224 = 32
Step 4: Subnets
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]
Network → [Link]
First Host → [Link]
Last Host → [Link]
Broadcast → [Link]
CIDR also supports combining multiple networks into one larger network. This is called route
aggregation or supernetting.
Example
Combine:
[Link]/24
[Link]/24
Result: [Link]/23
Binary Explanation
[Link] → 11000000.10101000.00000000
[Link] → 11000000.10101000.00000001
Common bits = 23
Advantages of CIDR
In classful addressing, network sizes are fixed and inefficient. In CIDR, network sizes are
flexible and based on actual needs.
For example:
You need:
50 hosts
25 hosts
10 hosts
Step 1: Allocate Largest First
For 50 hosts:
2⁶ = 64 → /26
Subnet: [Link]/26
2⁵ = 32 → /27
Subnet: [Link]/27
2⁴ = 16 → /28
Subnet: [Link]/28
In IP networking, not all IP addresses are used in the same way. Some addresses are meant for
use within local networks, while others are used for communication over the global internet.
Based on this, IP addresses are divided into two main categories: Private IP addresses and
Public IP addresses.
This classification is important in networks that use the IPv4 addressing system, especially
because of the limited number of available public IP addresses.
Private IP Addresses
Private IP addresses are used within internal networks such as homes, schools, offices, and
organizations. These addresses are not accessible directly from the internet and are not globally
unique. Instead, they are reused in different private networks around the world.
Private IP addresses are defined by standard ranges reserved specifically for internal use. These
ranges are:
These ranges are reserved and cannot be used on the public internet.
[Link]
[Link]
[Link]
All these devices can communicate within the local network, but they cannot be accessed
directly from outside the network.
Public IP Addresses
Public IP addresses are globally unique addresses assigned to devices that communicate over
the internet. These addresses are assigned by Internet Service Providers (ISPs) and must be
unique across the entire internet.
For example: [Link] (used by Google DNS server). This address can be reached from anywhere
in the world.
Access websites
Send and receive data over the internet
Communicate globally
The difference between private and public IP addresses is mainly based on accessibility and
uniqueness.
Private IP addresses are used only inside local networks and can be reused in different networks.
Public IP addresses, on the other hand, are globally unique and used for communication over the
internet.
Private IPs provide security, since devices are not directly exposed to the internet. Public IPs
provide connectivity, enabling communication between networks.
In real networks, most devices use private IP addresses internally, while a single public IP
address is used to communicate with the internet. This is achieved using a technique called
Network Address Translation (NAT), which we will study in the next section.
Example Scenario
Laptop → [Link]
Phone → [Link]
Router (public IP) → [Link]
Without this system, the available IPv4 addresses would have been exhausted much earlier.
In the same way, when a device wants to communicate using IP communication, it sends the data
to the remote end's IP address. The communication is established between IP
addresses. Every mobile phone has a telephone number. In the same way, every device needs an
IP address to send and receive data over an IP network.
IPv4 addresses are limited number. A key point here is that, by standar d, an IPv4 address is
32 bits long, meaning there are only 4,294,967,296 possible unique IP addresses (and they were
officially exhausted in April 2017). That's it; new addresses could never be produced. The IPv4
address space is a finite resource.
The original idea when the Internet protocol was first introduced was that every organization
would ask for and be given an IP address range, and IP addresses would be unique and not
reused. People thought we had so many IPv4 addresses (4 billion) that everybody would have a
unique IP that nobody else uses anywhere on the planet.
So, the Internet governing body was giving big, classful blocks of IP addresses (/8, /16, or /24) to
every organization that asked for it. This model worked for a while. However, in the mid-1990s,
it became extremely evident that the Internet was growing so fast that we would run out of
addresses in a few years.
Then, people realized we needed a new IP protocol that supported more addresses, so IPv6 was
introduced. This protocol uses 128-bit addresses instead of 32-bit, allowing for 2 128 addresses.
However, most organizations had already invested a lot of money in the adoption of IPv4. They
were unwilling to reinvest time and money to migrate to IPv6, so they were looking for another
solution.
The solution came through combining two network standards that worked together to save IPv4
address space: Private IPv4 addresses (RFC1918) and Network Address Translation (NAT).
It is evident that, at some point, there will not be enough IPv4 addresses for every device on the
planet. To overcome this problem, people came up with a brilliant idea:
Can't we reuse some portion of the IPv4 address space wherever required?
And that's how the private IPv4 address space was born. A small portion of each class of usable
IPv4 addresses was dedicated to addressing inside private networks (highlighted in yellow in the
diagram below). These addresses were called private IP addresses and can be used anywhere by
anyone without permission. They are not subject to IANA allocation.
As discussed in the previous section, private IP addresses cannot be used directly on the internet.
However, devices inside a local network still need to communicate with external networks. This
is made possible by a technique called Network Address Translation (NAT).
NAT is a method used in networking to convert private IP addresses into public IP addresses
so that devices in a local network can access the internet. It is commonly implemented in routers
or firewalls and operates at the Network Layer using the Internet Protocol.
Every home network in the diagram below uses the same private network [Link]/24. For
example, every device inside Home-1 has a private IPv4 address. However, when a device
communicates with a host on the Internet, its address is translated into a public address assigned
to the Internet router ([Link]). All devices in Home-1 share this public IPv4 address when
talking to the Internet.
The idea is that anyone can use these addresses or re-use them for as many hosts as they like on
their internal network. NAT can then translate the multitude of hosts using Private addresses into
a much smaller set of Public addresses – thereby curbing the rate at which IPv4 addresses are
being utilized.
NAT works by modifying the IP address information in packet headers as they pass through a
router. When a device inside a private network sends a packet to the internet, the router replaces
the source private IP address with its own public IP address. When the response returns, the
router translates the address back to the original private IP and forwards it to the correct device.
For example, let's look at the diagram shown below. PC2 is configured with the private IPv4
address [Link]. This address is not routable on the Internet. However, PC2 can access the
Internet because the router does Network Address Translation (NAT). When PC2's packets reach
the router, the router changes the source IP address in the IP header from [Link] to
[Link], as shown in the diagram. Hence, all devices on the Internet see PC2's traffic as coming
from the public IP address [Link].
NAT is most commonly used to enable multiple devices on a private network to access the
internet using a single public IP address, which helps conserve the limited number of IPv4
addresses available. For example, all devices inside Home-1, as shown in the diagram below, use
private IPv4 addresses from subnet [Link]/24. The router translates all internal IP addresses
to the public IPv4 address assigned to the interface that connects to the Internet. Devices on the
Internet see all traffic from Home-1 as coming from the public IP address [Link].
Network Setup
Private Network:
PC1 → [Link]
PC2 → [Link]
Router:
Destination Server:
Source IP → [Link]
Destination IP → [Link]
Step 2: Packet Reaches Router
The router receives the packet and checks its NAT table. Since the source IP is private, it cannot
be sent directly to the internet.
Source IP → [Link]
Destination IP → [Link]
The modified packet is sent across the internet to the destination server.
Source IP → [Link]
Destination IP → [Link]
When the router receives the response, it checks its NAT table and finds:
[Link] → [Link]
Private IP Public IP
[Link] [Link]
[Link] [Link]
Types of NAT
There are different types of NAT depending on how addresses are mapped.
Static NAT
This is used for servers that must always be reachable from outside.
Dynamic NAT
In dynamic NAT, a pool of public IP addresses is used. Private IPs are assigned a public IP
temporarily from the pool.
Example:
[Link] → [Link]
[Link] → [Link]
This is the most commonly used form of NAT, where many devices share a single public IP
using different port numbers. This will be discussed in detail in the next section.
First, it helps conserve public IP addresses, which are limited in number. Instead of
assigning a public IP to every device, only one or a few are used.
Second, NAT improves security, because internal devices are hidden from the outside
world. External users cannot directly access private IP addresses.
Third, it allows organizations to use private IP addressing schemes internally without
worrying about global uniqueness.
Limitations of NAT
Despite its advantages, NAT also has some limitations. It can introduce processing delay,
because the router must modify each packet. It may also cause issues with certain applications
that require direct end-to-end communication, such as some online games or VoIP services.
Port Address Translation (PAT), also known as NAT overload, is a type of Network Address
Translation (NAT) that allows multiple devices on a local network (with private IP addresses) to
share a single public IP address to access external networks, such as the internet.
However, to really understand how PAT works, you must know how TCP/UDP connections are
established in the context of IP addresses and ports. Let's quickly refresh our knowledge of
sockets and TCP sessions.
IP_Address:Port_Number
When two applications communicate, they each create a socket. A connection between them is
established by pairing the client socket with the server socket, forming a TCP or UDP session.
A TCP session is always between two sockets. For example, on Windows, you can see the
established sessions between the host and remote hosts using the netstat command, as shown in
the output below.
Notice that a pair of one local and one remote socket uniquely describes a TCP/UDP
connection. For example, one unique TCP session is ([Link]:43000-[Link]:443). If host
[Link] wants to establish a new TCP connection to the same server, it must use another TCP
port like this: ([Link]:43001-[Link]:443). The logic is visualized in the diagram below.
Notice that PC has established three TCP sessions with the same server. Pay attention to the IP
addresses and ports (sockets).
Notice another important aspect. In client-server communications, the server socket is always the
same. The server's web hosting service always listens on the same socket (IP:Port), typically on
port 80(http) or 443(https). Therefore, the client-side socket distinguishes the different TCP
connections to the server.
Every TCP session is between a pair of sockets. The combination of local and remote sockets is
unique because the host uses a different TCP port for each connection. Let's see a slightly
different example - three different hosts establishing a single connection to the same server.
Notice that each host uses the same TCP port. So, how does the server differentiate between the
three sessions? Each host's IP address is different, which makes the three TCP sessions unique
from the server's point of view.
Now, let's compare the two scenarios from the webserver's perspective. Do you see any
difference in the context of sockets and TCP sessions?
No, from the server's point of view, there is no difference. In client-server communications, the
clients choose a random port and initiate the connection. The server always listens for connection
on the same socket. The server does not differentiate between three TCP sessions to one host and
three TCP sessions to three different hosts. For the server, these are just three TCP sessions.
For example, the three TCP sessions from PC1, PC2, and PC3 look like three TCP sessions
coming from the same host, [Link], at the server end, as shown in the diagram below.
Of all Network Address Translation types, PAT is by far the most popular and widely adopted
one. Every home WiFi router and every small, medium, and large enterprise uses PAT. It can
translate up to 65000 private IPv4 addresses to a single public IPv4 address. It reduces the need
for multiple public IP addresses, which can be costly for organizations with many devices.
On the other hand, PAT has some disadvantages as well. It only works for clients in client-server
communication (which accounts for 99% of the Internet traffic). It complicates the inbound
traffic from outside to inside. For example, generally, with PAT, you cannot have a server on the
inside that must be reachable by clients on the outside. In such scenarios, organizations use static
one-to-one NAT for the server address, which allows clients on the outside to initiate a
connection to the server inside.
In computer networks, communication involves both logical addresses (IP addresses) and
physical addresses (MAC addresses). While IP addresses are used for routing packets across
different networks, MAC addresses are used for delivering frames within a local network. For
successful communication, there must be a way to map between these two types of addresses.
This process is known as address mapping.
Address mapping ensures that when a device knows the destination IP address, it can find the
corresponding MAC address required for local delivery. Similarly, in some cases, a device may
need to determine its IP address using its MAC address. These functions are handled by specific
protocols working alongside the Internet Protocol.
Address mapping plays a critical role in network communication because actual data
transmission within a local network always uses MAC addresses, even though the
communication is initiated using IP addresses.
The Address Resolution Protocol (ARP) is used to map a logical IP address to a physical
MAC address. Whenever a device wants to send data to another device within the same
network, it must know the destination MAC address. If it only knows the IP address, ARP is
used to find the corresponding MAC address.
When a device needs to resolve an address, it sends an ARP request to all devices in the local
network. This request is a broadcast message asking, “Who has this IP address?” The device
with the matching IP address responds with its MAC address in an ARP reply.
Example
Suppose a computer with IP address [Link] wants to send data to another device with IP
address [Link], but it does not know the MAC address.
The Reverse Address Resolution Protocol (RARP) performs the opposite function of ARP. It is
used to map a physical MAC address to a logical IP address. This protocol was mainly used by
devices that did not have a preconfigured IP address, such as diskless workstations.
In RARP, a device sends a request containing its MAC address and asks for its corresponding IP
address. A RARP server on the network responds with the appropriate IP address.
Example
The device sends a RARP request: “This is my MAC address. What is my IP address?”
The RARP server replies: “Your IP address is [Link]”
The device then uses this IP address to communicate on the network.
In computer networking, simply sending data from one device to another is not enough to
guarantee successful communication. There must also be a mechanism to monitor the network,
detect errors, and provide feedback when something goes wrong. This is where the Internet
Control Message Protocol (ICMP) becomes important.
ICMP is a control protocol that works together with the Internet Protocol at the Network Layer
of the OSI Model. Unlike protocols such as TCP or UDP, ICMP does not carry actual user data.
Instead, it is used to send control messages that provide information about the status of the
network and the delivery of packets.
Whenever a problem occurs during data transmission such as a packet not reaching its
destination, a router being unreachable, or a packet taking too long ICMP is used to report these
issues back to the sender. This helps devices understand what went wrong and assists network
administrators in troubleshooting problems.
ICMP is also widely used for network diagnostics and testing. For example, common tools like
the ping command rely on ICMP messages to check whether a device is reachable and how long
it takes for data to travel between two points.
Overall, ICMP acts as a messenger of network conditions, ensuring that devices are informed
about errors and network status, which is essential for efficient communication.
Error reporting messages are generated when a problem occurs during the transmission of a
packet. These messages are sent back to the source device to inform it about the issue. They do
not fix the problem but help identify and understand it.
• Destination Unreachable: This message is sent when a packet cannot reach its intended
destination. This may happen if the network is down, the host is unreachable, or the service is not
available. Example: If a computer tries to access a server that is offline, a router sends this
message back.
• Time Exceeded: Each IP packet has a value called Time to Live (TTL). If this value becomes
zero before reaching the destination, the packet is discarded, and this message is sent. Example:
This commonly occurs when there is a routing loop in the network.
• Parameter Problem: This message indicates that there is an error in the packet header, such as
an incorrect field value. Example: If a router cannot understand the packet due to a corrupted
header, it sends this message.
• Redirect Message: This message is sent by a router to inform a host that there is a better route
available for a particular destination. Example: A router may redirect traffic to another router
that provides a shorter or more efficient path.
Query Messages
Query messages are used for testing, diagnostics, and gathering information about the network.
They help determine whether devices are reachable and how well the network is performing.
• Echo Request and Echo Reply: These are the most commonly used ICMP messages. They are
used to check connectivity between devices. Example: The ping command sends an Echo
Request, and the destination replies with an Echo Reply if it is reachable.
• Timestamp Request and Reply: These messages are used to measure the time taken for a
packet to travel from source to destination and back. Example: Used in performance analysis to
calculate network delay.
• Address Mask Request and Reply: These messages allow a device to request subnet mask
information from another device. Example: A host may use this to learn about the network
configuration.
ICMP messages follow a specific structure that allows network devices to understand and
process them correctly. Although the content of the message may vary depending on its type
(error or query), all ICMP messages share a common basic format. This format ensures that
routers and hosts can interpret the message and take appropriate action.
ICMP operates along with the Internet Protocol, and every ICMP message is encapsulated inside
an IP packet before being transmitted across the network.
General Structure of an ICMP Message
• Header
• Data (Payload)
1. Header Fields
The ICMP header contains important control information. The main fields are:
• Type (8 bits)
This field specifies the type of ICMP message. It indicates whether the message is an error
message or a query message.
Example:
Type 8 → Echo Request
Type 0 → Echo Reply
• Code (8 bits)
This field provides additional details about the message type. It further explains the reason for
the message.
Example:
In a Destination Unreachable message, the code indicates whether the network is unreachable,
host unreachable, or port unreachable.
The data section varies depending on the type of ICMP message. It may contain:
• Part of the original IP packet (for error messages)
• Sequence numbers and identifiers (for Echo Request/Reply)
• Additional diagnostic information
For example, in an Echo Request message, the data field contains a small piece of data that must
be returned unchanged in the Echo Reply.
Structure:
When the destination receives this request, it sends back an Echo Reply with:
• Type → 0
• Same identifier and sequence number
• Same data
• Type → 3
• Code → Indicates reason (e.g., network unreachable)
• Data → Contains part of the original packet that caused the error
This helps the sender identify which packet failed and why.
ICMP plays a very important role in network communication by providing feedback about what
is happening during data transmission. It does not carry user data and it does not correct errors by
itself, but it helps devices understand problems and react accordingly. This is achieved through
two main functions: error reporting and query operations.
Error Reporting
Error reporting is one of the primary responsibilities of ICMP. Whenever a problem occurs in the
network, such as failure in packet delivery or routing issues, ICMP generates an error message
and sends it back to the source device. This allows the sender to know that something went
wrong during transmission.
For example, consider a situation where a computer sends a packet to a destination server, but
the server is unreachable. A router along the path detects this issue and sends an ICMP
Destination Unreachable message back to the sender. The sender then understands that the
destination cannot be reached and may stop trying or attempt a different action.
Another common situation involves the Time to Live (TTL) field in an IP packet. Each packet
is assigned a TTL value, which decreases by one every time it passes through a router. If the
TTL reaches zero before the packet reaches its destination, the packet is discarded. In this case,
the router sends an ICMP Time Exceeded message back to the sender. This mechanism prevents
packets from circulating indefinitely in the network, especially in cases of routing loops.
It is important to note that ICMP error messages are generally sent only for problems involving
unicast packets and are not generated for every possible failure. Also, ICMP does not report
errors for other ICMP messages to avoid excessive message generation.
Query Function
In addition to reporting errors, ICMP is also used for querying and testing network conditions.
Query messages allow devices to check connectivity, measure delay, and gather information
about other devices in the network.
A very common example is the use of the ping command. When a user runs ping, the system
sends an ICMP Echo Request message to a destination device. If the destination is reachable and
functioning properly, it responds with an Echo Reply. By measuring the time between the request
and reply, the system can determine the round-trip time (RTT), which indicates the delay in
communication.
For instance, if a user wants to check whether a server is active, they can send a ping request. If a
reply is received, it confirms that the server is reachable. If no reply is received, it may indicate a
network problem, a firewall restriction, or that the server is down.
ICMP query messages are also useful for network administrators when diagnosing issues. They
can test connectivity between different parts of a network, identify delays, and verify that routing
paths are working correctly.
4.1.2. ICMPv6
With the introduction of IPv6, ICMP was extended into a new version called ICMPv6. It
performs similar functions as ICMP in IPv4 but with additional responsibilities that are essential
for IPv6 networks. ICMPv6 is used for error reporting and network diagnostics, just like in IPv4.
It sends messages when a packet cannot be delivered, when a route is unreachable, or when a
problem occurs during transmission.
In addition, ICMPv6 plays a much bigger role compared to IPv4. It is responsible for neighbor
discovery, which replaces the function of ARP. Through this, devices can discover other devices
on the network and obtain their link-layer (MAC) addresses. ICMPv6 is also used for auto-
configuration, allowing devices to automatically obtain IP addresses without requiring manual
configuration or external servers.
4.7. IGMP
IGMP is a network layer protocol that works together with the Internet Protocol to manage
multicast group membership in IPv4 networks. It allows devices (hosts) to join or leave multicast
groups and informs routers about which devices are interested in receiving specific multicast
data.
For example, in applications such as live video streaming, online lectures, or IPTV, the same
data needs to be delivered to many users at once. Instead of sending multiple copies of the same
data to each user, multicast allows a single stream to be shared among all group members. IGMP
is responsible for managing these group memberships.
IGMP operates between hosts and routers. Hosts use IGMP to inform routers that they want to
join or leave a multicast group, while routers use this information to forward multicast traffic
only to the relevant network segments.
Group management is the core function of IGMP, which is responsible for controlling how
devices join and leave multicast groups in a network. In multicast communication, a group
represents a set of devices that are interested in receiving the same data stream. IGMP ensures
that only those devices that want the data become members of the group.
IGMP works together with the Internet Protocol to manage these memberships efficiently. It
operates between hosts (devices) and routers, allowing communication about which devices
want to receive multicast traffic.
When a device wants to receive multicast data, it must first join a multicast group. This is done
by sending an IGMP message to the router. The router then records this information and ensures
that multicast data for that group is forwarded to the network where the device is located.
Similarly, when a device no longer wants to receive the data, it leaves the group. This helps the
network avoid sending unnecessary traffic to devices that are not interested.
The process of group management involves three main actions: joining, maintaining, and leaving
a group.
• Joining a Group: When a host wants to receive multicast data (for example, a live video
stream), it sends an IGMP join message to the router. The router then adds that host to the
multicast group.
• Maintaining Membership: Routers periodically send queries to check if hosts are still
interested in receiving multicast data. Hosts respond with IGMP reports to confirm their
membership. If no response is received, the router assumes that the host is no longer part of the
group.
• Leaving a Group: When a host no longer needs the multicast service, it sends a leave message.
The router updates its records and may stop forwarding multicast traffic to that network if no
other members remain.
Example
Consider a classroom where multiple students are watching an online lecture through multicast
streaming.
Students’ devices join a multicast group for the lecture
The router receives join requests and forwards the video stream
If a student closes the lecture, their device leaves the group
If no students remain, the router stops sending the stream
This process ensures efficient use of network bandwidth because the data is only sent where it is
needed.
IGMP uses a small number of message types to manage communication between hosts and
routers in multicast networks. These messages help devices join groups, confirm membership,
and leave groups efficiently. IGMP works along with the Internet Protocol to ensure multicast
data is delivered only where needed.
• Membership Query: This message is sent by routers to check whether there are any hosts
interested in a particular multicast group. It is usually broadcast to all devices in the network.
Hosts that still want to receive the multicast data must respond to this query.
• Membership Report (Join Message): This message is sent by a host to inform the router that
it wants to join a multicast group. When the router receives this message, it starts forwarding
multicast traffic for that group to the host’s network.
• Leave Group Message: This message is sent by a host when it no longer wants to receive
multicast data. The router then updates its records and may stop forwarding traffic if no other
hosts are part of that group.
IGMP messages have a simple structure that allows hosts and routers to communicate efficiently
for multicast group management. Although the format may slightly vary depending on the
message type (query, report, or leave), the general structure remains similar.
IGMP messages are encapsulated inside IP packets and work along with the Internet Protocol at
the Network Layer.
• Type: This field identifies the type of IGMP message. It indicates whether the message is a
membership query, membership report, or leave message.
• Maximum Response Time: This field specifies how long a host can wait before responding to
a query. It helps control network traffic by preventing all hosts from responding at the same time.
• Checksum: This is used for error detection. It ensures that the IGMP message has not been
corrupted during transmission.
• Group Address: This field contains the multicast group address to which the message refers.
– In a query, it may be a general address (for all groups) or a specific group
– In a report or leave message, it specifies the exact multicast group
IGMP operation describes how hosts and routers interact step by step to manage multicast
communication in a network. It ensures that multicast data is delivered only to devices that are
interested, improving efficiency and reducing unnecessary traffic. This process works together
with the Internet Protocol.
The operation of IGMP mainly involves three stages: joining a group, maintaining membership,
and leaving a group.
Joining a Multicast Group
When a host wants to receive multicast data, it sends a membership report to the router.
For example, when a user starts watching a live stream, their device joins a multicast group
associated with that stream.
Routers periodically check whether hosts are still interested in receiving multicast data.
When a host no longer wants to receive multicast data, it sends a leave message.
4.7.5. Encapsulation
When a host or router generates an IGMP message, it is not sent directly over the network.
Instead, it is placed inside an IP packet. The IP packet provides the necessary addressing
information so the message can reach its destination.
4.7.6. Netstat
Although Netstat is not a protocol itself, it helps in observing how protocols like IGMP are
functioning in a system by showing which multicast groups a device has joined and what
network connections are active.
Purpose of Netstat
Netstat provides visibility into the internal state of a networked device. It helps users understand:
In computer networks, once data is packetized and addressed, it must be delivered from the
source device to the correct destination device. This process is handled through routing and
forwarding, which are key functions of the Network Layer.
Forwarding refers to the action performed by a network device (usually a router or switch) to
move a packet from its incoming interface to the appropriate outgoing interface based on the
destination address. It is essentially the “local” decision of where to send the packet next.
Routing, on the other hand, is the process of determining the best path for a packet to travel
across networks to reach its final destination. Routing involves the creation and maintenance of
routing tables, which contain information about network paths and how to reach different IP
addresses.
Routers rely on routing algorithms to make these decisions. These algorithms can be classified
into different types depending on how paths are calculated, whether they adapt dynamically to
network changes, and how much information they require about the network.
Routing and forwarding together ensure that data moves efficiently and reliably through
networks, whether in small local networks or across the vast internet. They are critical for
enabling communication between devices that are not directly connected.
One of the earliest protocols developed is the inner gateway protocol, or RIP. we can use it with
local area networks (LANs), that are linked computers in a short range, or wide area networks
(WANs), which are telecom networks that cover a big range. Hop counts are used by the Routing
Information Protocol (RIP) to calculate the shortest path between networks.
IGRP was developed by the multinational technology corporation Cisco. It makes use of many of
the core features of RIP but raises the maximum number of supported hops to 100. It might
therefore function better on larger networks. IGRPs are elegant and distance-vector protocols. In
order to work, IGRP requires comparisons across indicators such as load, reliability, and network
capacity. Additionally, this kind updates automatically when things change, such as the route.
This aids in the prevention of routing loops, which are mistakes that result in an unending data
transfer cycle.
Exterior gateway protocols, such as EGP, are helpful for transferring data or information
between several gateway hosts in autonomous systems. In particular, it aids in giving routers the
room they need to exchange data between domains, such as the internet.
This kind is categorised as a classless protocol, inner gateway, and distance vector routing. In
order to maximise efficiency, it makes use of the diffusing update method and the dependable
transport protocol. A router can use the tables of other routers to obtain information and store it
for later use. Every router communicates with its neighbour when something changes so that
everyone is aware of which data paths are active. It stops routers from miscommunicating with
one another. The only external gateway protocol is called Border Gateway Protocol (BGP).
5. Open shortest path first (OSPF)
OSPF is an inner gateway, link state, and classless protocol that makes use of the shortest path
first (SPF) algorithm to guarantee effective data transfer. Multiple databases containing topology
tables and details about the network as a whole are maintained by it. The ads, which resemble
reports, provide thorough explanations of the path's length and potential resource requirements.
When topology changes, OSPF recalculates paths using the Dijkstra algorithm. In order to
guarantee that its data is safe from modifications or network intrusions, it also employs
authentication procedures. Using OSPF can be advantageous for both large and small network
organisations because to its scalability features.
Another kind of outer gateway protocol that was first created to take the role of EGP is called
BGP. It is also a distance vector protocol since it performs data package transfers using the best
path selection technique. BGP defines communication over the internet. The internet is a vast
network of interconnected autonomous systems. Every autonomous system has autonomous
system number (ASN) that it receives by registering with the Internet Assigned Numbers
Authority.
Routing in the Internet involves connecting millions of networks and ensuring that data can
travel from a source device to a destination device anywhere in the world. Unlike small
networks, Internet routing must handle a large scale, dynamically changing network topology,
and multiple possible paths.
This hierarchy reduces the size of routing tables and limits the number of routes a router must
process, making Internet routing scalable.
4.9. IPv6
With the rapid growth of the Internet, the older IPv4 addressing system became insufficient due
to its limited address space (about 4.3 billion addresses). To overcome this limitation, IPv6
(Internet Protocol version 6) was introduced. IPv6 provides a much larger address space,
improved routing, and additional features to support modern networking needs.
Larger Address Space: Uses 128-bit addresses compared to 32-bit in IPv4, allowing
trillions of unique IP addresses.
Simplified Header: The IPv6 header is streamlined for faster packet processing.
Built-in Security: IPv6 was designed with IPsec support for secure communications.
Better Support for Multicasting: Improved multicast and anycast features compared to
IPv4.
Auto-configuration: Devices can configure their own IPv6 addresses automatically
using stateless or stateful configuration.
IPv6 also eliminates the need for techniques like NAT (Network Address Translation) used in
IPv4 to conserve addresses, because the address space is abundant.
4.9.1. Structure
An IPv6 address is 128 bits long, usually written as eight groups of four hexadecimal digits,
separated by colons. For example:
2001:0db8:85a3:0000:0000:8a2e:0370:7334
2001:db8:85a3:0:0:8a2e:370:7334
Consecutive blocks of zeros can be compressed using :: (only once per address):
2001:db8:85a3::8a2e:370:7334
Address Example:
The Data Link Layer is responsible for transferring data between two directly connected nodes.
It ensures that data frames are delivered accurately and efficiently over a physical link. This layer
handles tasks such as framing, error detection and correction, and medium access control.
The Physical Layer, on the other hand, is concerned with the actual transmission of raw bits
over a communication medium. It defines the electrical, mechanical, and procedural
specifications for activating, maintaining, and deactivating the physical connection between
devices.
The Physical Layer deals with how bits are transmitted (signals, voltages, cables,
wireless transmission).
The Data Link Layer deals with how data is organized and controlled over the physical
medium.
The Data Link Layer relies on the Physical Layer to send and receive data. While the Physical
Layer transmits individual bits, the Data Link Layer groups these bits into structured units called
frames, and ensures reliable delivery.
For example:
The Physical Layer sends a stream of bits (0s and 1s).
The Data Link Layer organizes these bits into frames, detects errors, and manages
retransmissions if necessary.
1. They enable communication between devices within the same network (LAN).
2. They ensure reliable data transfer despite noise and interference.
3. They manage how multiple devices share the same communication medium.
4. They provide addressing mechanisms for identifying devices on a network.
The Data Link Layer is responsible for providing reliable communication between two directly
connected devices over a physical medium. It serves as a bridge between the Network Layer and
the Physical Layer, ensuring that data received from the upper layer is properly prepared for
transmission and delivered accurately to the destination.
At this layer, packets from the Network Layer are converted into frames, which are structured
units of data suitable for transmission over the physical link. At the receiving end, the Data Link
Layer processes these frames, checks for errors, and passes the extracted data upward.
The Data Link Layer provides different types of services depending on the required level of
reliability. These services can be summarized as follows:
One of its primary responsibilities is framing, where the continuous stream of bits from the
Physical Layer is divided into manageable units. Each frame typically contains a header,
payload, and trailer, which help in synchronization and error detection.
Another important function is physical addressing. Each device on a network has a unique
physical address, commonly known as a MAC address. The Data Link Layer includes this
address in each frame so that the data can be delivered to the correct device within the local
network.
The layer also provides error detection and correction mechanisms. During transmission, data
may become corrupted due to noise or interference. To handle this, the Data Link Layer uses
techniques such as parity bits, checksums, and cyclic redundancy check (CRC). If errors are
detected, the system may request retransmission of the affected frames.
Flow control is another key service. It ensures that the sender does not transmit data faster than
the receiver can process it. Without flow control, a fast sender could overwhelm a slower
receiver, leading to data loss.
Finally, the Data Link Layer handles medium access control, which determines how multiple
devices share a common communication channel. In networks where many devices are
connected to the same medium, rules must be established to avoid collisions and ensure fair
access.
The main responsibilities of the Data Link Layer can be summarized as:
Let's see an example and make an analogy with the postal service, as shown in the section above.
Suppose the user [Link] sends data to Google. It first encapsulates the data into a packet. This
packet includes the destination IP address of [Link]. That IP packet is then placed inside a
Layer 2 frame, for example, an 802.11 wireless frame, so that it can travel across the local
network to the local wireless router.
The wireless router receives the frame, removes the Layer 2 header and trailer, and keeps the IP
packet inside. It then checks the destination IP address and decides where to send the packet
next. To do that, it wraps the same IP packet in a new Layer 2 frame. This new frame is built for
the next link it uses the router's MAC address as the source and the MAC address of R2 as the
destination.
At the next router, the same thing happens again. The frame is removed, the IP packet is
checked, and then it’s placed in a new frame for the next hop. This continues until the packet
reaches the final destination, which is PC2.
When Google's server receives the frame, it removes the Layer 2 information and sees that the IP
packet is meant for it. Then it passes the data up the stack to the correct application.
Key Note: The IP packet stays the same from start to finish, but the Layer 2 frame that wraps
the packet is replaced at every router to match the link between devices.
Framing Techniques
Different methods are used to mark the boundaries of frames. The choice of technique depends
on the type of network and protocol used.
In this method, a field in the header specifies the total number of bytes in the frame. The receiver
reads this value to determine where the frame ends.
Although simple, this method has a limitation: if the length field is corrupted, the receiver may
lose synchronization and misinterpret the frame boundaries.
In byte-oriented framing, special flag bytes are used to mark the beginning and end of a frame.
For example, a specific byte pattern may indicate the start and end.
However, a problem arises if the same pattern appears in the data. To solve this, a technique
called byte stuffing is used. In byte stuffing:
An extra escape byte is inserted before any occurrence of the flag byte in the data
The receiver removes the extra byte during processing
This ensures that the flag byte is not confused with actual data.
3. Bit-Oriented Framing
In bit-oriented framing, frames are defined using a specific bit pattern (flag), such as 01111110,
to indicate the start and end.
To prevent this pattern from appearing in the data, a method called bit stuffing is used:
This method is widely used because it is efficient and works well with different types of data.
In some systems, special signal patterns that do not occur in normal data transmission are used to
indicate frame boundaries. These are known as coding violations. This method depends on the
encoding scheme used at the Physical Layer and is less commonly applied than the other
techniques.
In many network environments, multiple devices share a common communication medium such
as a cable or wireless channel. If all devices attempt to transmit data at the same time, collisions
may occur, leading to data loss and reduced network efficiency. To address this problem, the
Data Link Layer uses Multiple Access Protocols.
Multiple access protocols define rules that determine how devices share the communication
medium in a fair and efficient manner. These protocols help coordinate transmissions, minimize
collisions, and ensure that all devices get an opportunity to send data.
Multiple access protocols can generally be classified into three broad categories:
Channel Partitioning Protocols: Divide the channel into smaller pieces and allocate
them to devices (e.g., Time Division Multiple Access – TDMA, Frequency Division
Multiple Access – FDMA).
Random Access Protocols: Allow devices to transmit at any time but include
mechanisms to handle collisions (e.g., CSMA/CD, CSMA/CA).
Controlled Access Protocols: Control access through scheduling or permission (e.g.,
polling, token passing).
Among these, random access protocols are widely used in modern networks such as Ethernet and
wireless LANs.
When a device has data to send, it must first determine whether the communication medium is
free or busy. Depending on the protocol used, the device may:
These strategies help improve network performance and reduce unnecessary retransmissions.
Multiple access protocols are designed to solve several important problems:
Without proper access control, networks would experience frequent collisions, leading to poor
performance and unreliable communication.
Example
Consider a classroom where multiple students want to speak. If everyone talks at the same time,
no one can be understood. A rule must be established such as raising hands or speaking in turns.
Multiple access protocols work in a similar way by organizing how devices "take turns" using
the communication channel.
Among the random access protocols, Carrier Sense Multiple Access (CSMA) techniques are
widely used to control how devices share a communication medium. These protocols are
designed to reduce collisions by allowing devices to check the status of the channel before
transmitting.
Two important variations of CSMA are CSMA/CD (Collision Detection) and CSMA/CA
(Collision Avoidance). They are used in different types of networks and operate in slightly
different ways.
This process helps minimize the impact of collisions and ensures that the network remains
efficient.
CSMA/CA is mainly used in wireless networks such as Wi-Fi. Unlike CSMA/CD, it is difficult
for wireless devices to detect collisions while transmitting. Therefore, CSMA/CA focuses on
avoiding collisions before they happen.
Although both protocols are based on the idea of sensing the channel before transmission, they
differ in their approach:
CSMA/CD detects collisions after they occur, while CSMA/CA tries to prevent them
CSMA/CD is used in wired networks, whereas CSMA/CA is used in wireless networks
CSMA/CA introduces additional control mechanisms to reduce collision probability
For communication to occur successfully within a network, each device must be uniquely
identifiable. At the Data Link Layer, this identification is achieved through physical
addressing, commonly known as Data Link Layer addressing.
Unlike logical addressing used at the Network Layer (such as IP addresses), Data Link Layer
addressing is used for node-to-node communication within the same local network. It ensures
that frames are delivered to the correct device on a shared medium.
Every device connected to a network interface is assigned a unique identifier called a physical
address. This address is embedded in the network interface hardware and is used by the Data
Link Layer to identify devices on the same network segment.
The receiving device checks the destination address in the frame and processes the data only if
the address matches its own or is a broadcast/multicast address.
Although the Data Link Layer uses physical addresses, it often works together with the Network
Layer, which uses logical addresses. Before sending a frame, a device may need to map a logical
address (IP address) to a physical address. This mapping is typically done using protocols such
as ARP (Address Resolution Protocol).
These addressing modes allow flexibility in how data is transmitted across the network.
A MAC (Media Access Control) address is a unique physical address assigned to a network
interface card (NIC) at the Data Link Layer. It is used to identify devices within a local network
and plays a critical role in frame delivery.
The MAC address is typically assigned by the manufacturer and is stored in the hardware of the
network interface. Because of this, it is often referred to as a hardware address or physical
address.
00:1A:2B:3C:4D:5E
Organizationally Unique Identifier (OUI): The first 24 bits identify the manufacturer
of the network device. This portion is assigned by international standards organizations.
Device Identifier: The remaining 24 bits are assigned by the manufacturer and uniquely
identify the specific device.
This structure ensures that no two devices have the same MAC address globally.
Although MAC addresses are generally fixed, modern systems allow software-based
modification (MAC spoofing) for testing or privacy purposes.
Types of MAC Addresses
This process ensures that data is delivered accurately within the local network.
MAC Address:
o Physical, hardware-based
o Used for local communication
o Operates at the Data Link Layer
IP Address:
o Logical, software-based
o Used for communication across networks
o Operates at the Network Layer
The Data Link Layer is a critical component of the network architecture, responsible for
ensuring reliable node-to-node communication over a physical link. To effectively perform its
functions, this layer is organized into sublayers and supported by a set of well-defined
responsibilities and protocols.
The division into sublayers namely Logical Link Control (LLC) and Media Access/Data Link
Control helps separate logical communication functions from the physical transmission aspects.
This separation improves flexibility, allowing different network technologies to operate
efficiently while maintaining compatibility with higher layers.
In addition to its structural organization, the Data Link Layer has several key responsibilities that
ensure data is transmitted accurately and efficiently. These include controlling the link, detecting
and correcting errors, and managing communication protocols that govern data exchange
between devices.
The study of this section will therefore focus on three main aspects:
The internal structure of the Data Link Layer through its sublayers
The functional responsibilities that guarantee reliable communication
The protocols that implement these functions in real-world networks
5.2.1. Bits
5.2.2. Ethernet