Layered architecture in computer networks is a way of
organizing work into different layers. Each layer does a
specific job, and every layer works step-by-step to send
and receive data.
Need for Layered Architecture
Networks are complex, so dividing work into layers
makes it easier.
Each layer focuses on one function only.
It becomes easier to design new systems.
Different companies can build parts that still work
together.
How It Works
Data moves from the top layer to the bottom layer at
the sender side.
Each layer adds its own information and performs its
task.
At the receiver side, layers remove that information
in reverse order.
Advantages
1. Simple to understand
Complex work becomes easier because it is divided
into parts.
2. Easy to design and develop
Engineers can work on one layer without touching
others.
3. Easy to find errors
Problems can be checked layer by layer.
4. Flexibility
One layer can be changed or upgraded without
changing the whole system.
5. Standardization
Devices and software from different companies can
work together.
6. Reuse of layers
Many applications can use the same lower layers.
Examples
OSI Model (7 layers)
TCP/IP Model (4 layers)
Both follow the layered idea: hardware at the bottom,
applications at the top.
OSI (Open Systems Interconnection) Reference Model
It is a model that explains how data moves from one
computer to another using 7 layers. Each layer has a
specific job.
1. Physical Layer
Deals with hardware and wires.
Sends raw bits (0s and 1s).
Defines cables, voltage, connectors, signals, etc.
Examples: Ethernet cable, Wi-Fi signals, hubs, repeaters.
2. Data Link Layer
Makes sure data is sent safely over the physical link.
Detects and corrects errors.
Uses MAC address for communication inside the
same network.
Examples: Switch, NIC (Network Interface Card), Ethernet.
3. Network Layer
Decides the best path for data.
Uses IP address.
Handles routing between different networks.
Examples: Router, IP (Internet Protocol).
4. Transport Layer
Delivers data from one process to another.
Breaks data into segments.
Provides reliable delivery and error checking.
Protocols: TCP, UDP.
5. Session Layer
Manages sessions (connections) between devices.
Opens, maintains, and closes communication.
Handles login sessions and synchronization.
Examples: video calls, remote logins.
6. Presentation Layer
Converts data into a proper format.
Handles encryption, compression, and translation.
Makes sure sender and receiver understand data.
Examples: encryption (SSL), file formats, data
compression.
7. Application Layer
Closest to the user.
Provides network services to applications.
Handles browsing, email, file sharing, etc.
Examples: HTTP, FTP, DNS, Email services.
TCP/IP Architecture
TCP/IP model is a network model used on the internet.
It has 4 layers.
1. Application Layer
Used by users and applications.
Provides services like browsing, email, chatting, file
sharing.
Combines the work of OSI Application, Presentation,
and Session layers.
Examples:
HTTP (web)
FTP (file transfer)
SMTP (email)
DNS (domain names)
2. Transport Layer
Sends data from one process to another process.
Breaks large data into small segments.
Checks for errors and controls flow.
Main protocols:
TCP – reliable, makes sure data reaches correctly.
UDP – faster, but no guarantee.
Examples:
Online games often use UDP
Web and email use TCP
3. Internet Layer
Decides the route for data.
Moves packets between different networks.
Uses logical addressing (IP address).
Main protocol:
IP (Internet Protocol)
Other protocols:
ICMP (error messages, ping)
ARP (find MAC address)
Devices:
Routers work here.
4. Network Access Layer (Link Layer)
Deals with physical connection.
Sends data as frames over cables or wireless.
Uses MAC address.
Examples:
Ethernet
Wi-Fi
Switches, NIC
Data Communication System
A data communication system is used to send data from
one place to another. It allows two devices to share
information like text, audio, video, images, or files. For
communication to work correctly, five main components
are needed.
1. Message
The message is the actual data that is being sent. It can be
anything meaningful for the user.
Examples: a WhatsApp text, a photo, a PDF file, a video
clip, an email, or sensor readings.
Without a message, there is nothing to communicate.
2. Sender
The sender is the device that creates and sends the
message.
It prepares data in a form that can be transmitted.
Examples: computer, mobile phone, laptop, CCTV camera,
or a server.
The sender converts the message into signals so it can
travel across the network.
3. Receiver
The receiver is the device that gets the message.
It accepts the incoming signals and converts them back
into original data so the user can read, watch, or hear it.
Examples: another computer, mobile phone, printer,
smart TV, or IoT device.
Sender and receiver may be near or very far from each
other.
4. Transmission Medium (Channel)
This is the path through which the message travels from
sender to receiver.
It can be wired or wireless.
Examples: twisted-pair cable, coaxial cable, fiber optic
cable, radio waves, Wi-Fi, Bluetooth, satellite signals.
The quality of the medium affects speed and accuracy.
5. Protocol
Protocols are rules that control communication.
They define how data is sent, received, checked, and
interpreted.
Protocols make sure both devices “understand” each
other and follow the same format.
Examples: TCP/IP, HTTP, FTP, SMTP.
Without protocols, devices cannot communicate properly
because there would be no common rules.
Basis LAN MAN WAN
Metropolitan Area Wide Area
1. Full form Local Area Network
Network Network
Very small (room, City or large
2. Area covered Country or world
building) campus
Single Service provider Multiple service
3. Ownership
person/organization or government providers
Lower than LAN
4. Speed Very high Medium
and MAN
5. Cost Low Medium High
6. Transmission Fiber optics, Satellite, long-
Ethernet, Wi-Fi
medium microwave distance fiber
7. Setup
Simple Moderate Complex
complexity
Higher (long
8. Error rate Very low Moderate
distance)
Internet,
School lab, office
9. Example City cable network multinational bank
network
network
10. Maintenance Easy Moderate Difficult
Wired Networks
Advantages
Faster speed
More stable connection
Less interference
More secure (hard to hack without physical access)
Better for heavy work like gaming, servers, large
downloads
Disadvantages
Need cables everywhere
Difficult to move devices
Installation cost is higher
Looks messy if many wires
Hard to expand to new rooms/places
Wireless Networks (Wi-Fi)
Advantages
No cables needed
Easy to move anywhere within range
Easy to install
Good for phones, laptops, tablets
Can connect many devices easily
Disadvantages
Slower than wired
Can disconnect due to interference
Less secure (can be hacked if not protected)
Signal range is limited
Speed reduces when many users connect
1. Bus Topology
All computers are connected to a single main cable.
Advantages
Easy to install
Requires less cable
Low cost
Good for small networks
2. Star Topology
All computers connect to a central device (switch/hub).
Advantages
Easy to manage and control
If one computer fails, network still works
Easy to add or remove devices
Faster than bus in most cases
3. Ring Topology
Each computer is connected in a circular way.
Advantages
Data flows in one direction, reducing collisions
Equal access for all devices
Good performance under light load
Easy to predict network behavior
4. Mesh Topology
Every device is connected to every other device.
Advantages
Very reliable
No single point of failure
High security
Data can take multiple paths
5. Tree (Hierarchical) Topology
Combination of star networks arranged like a tree.
Advantages
Easy to expand
Good for large organizations
Easy to manage in groups
Fault in one branch doesn’t affect others much
6. Hybrid Topology
Combination of two or more topologies (like star + bus).
Advantages
Flexible design
Can be built based on needs
Easy to expand large networks
Can use strengths of multiple topologies
Basis Circuit Switching Packet Switching
No fixed path,
1. Fixed path is set before
packets take
Connection communication
different routes
2. Setup Needs setup before
No setup needed
time data transfer
Sent in packets
3. Data flow Continuous
(small pieces)
4. Path Reserved only for two Shared by many
usage users users
Less efficient (unused
5. Efficiency Highly efficient
time is wasted)
Variable delay (can
6. Delay Low and constant
change)
7. Failure Packets can be
If path fails, call drops
effect rerouted
8. Cost Usually higher Usually cheaper
9. Example Internet, email,
Telephone networks
use browsing
Basis Circuit Switching Packet Switching
10. Storage No need to store data Routers store and
need in network forward packets
Advantages of Packet Switching over Circuit Switching
No fixed path required
Network bandwidth is shared, not reserved
More efficient use of the channel
Less wastage when users are silent
Packets can take alternate paths if one path fails
More reliable (packets can be re-sent if lost)
Supports many users at the same time
Cheaper to operate
Better suited for data traffic (bursty data)
Works well for internet services like email, web, and
file transfer
Transmission Impairments at the Physical Layer
Transmission impairment means anything that damages
or changes the signal while it is traveling through the
medium.
These are the main types:
1. Attenuation
Signal becomes weak as it travels.
Longer distance = more loss.
Receiver may not read the signal properly.
Boosted using amplifiers or repeaters.
Example: voice becoming faint over a long telephone wire.
2. Distortion
Shape of the signal changes.
Different frequencies travel at different speeds.
Signal at the receiver looks different from original.
Example: music played through long cables sounds
different.
3. Noise
Unwanted signals that mix with original signal.
Types:
a) Thermal Noise
Caused by heat in electronic devices.
Present everywhere.
b) Induced Noise
Caused by nearby electrical or magnetic fields.
Comes from motors, power lines, lightning.
c) Crosstalk
One signal leaks into another cable.
Like hearing another conversation on a phone line.
d) Impulse Noise
Sudden spikes of noise.
Very harmful for digital data.
Examples: lightning strike, switching machines.
4. Delay Distortion
Different parts of signal arrive at different times.
Common in optical fiber and long cables.
Causes overlapping of signals.
5. Echo
Reflected signal returns back after some delay.
Confuses the receiver and affects clarity.
6. Jitter
Variation in signal timing.
Affects audio, video, and real-time communication.
7. Interference
Signals from other networks or devices interrupt.
Common in wireless communication.
Transmission Media
Transmission media are the paths through which data
travels from one device to another.
They are mainly of two types:
1. Guided (Wired) media
2. Unguided (Wireless) media
A. Guided / Wired Transmission Media
1. Twisted Pair Cable
Two copper wires twisted together.
Types
Unshielded (UTP)
Shielded (STP)
Advantages
Cheap and easily available
Simple to install
Works well for short distances
Used in LAN, telephones, home internet
2. Coaxial Cable
Has a solid copper wire inside, surrounded by insulation
and metal shielding.
Advantages
Less noise and interference than twisted pair
Better speed and reliability
Good for TV networks, CCTV, broadband connections
Longer distance than twisted pair
3. Optical Fibre Cable
Uses light signals instead of electricity.
Advantages
Very high speed
Very long distance communication
No electromagnetic interference
Highly secure
Very low signal loss
Used in backbone internet, telecom, undersea cables
B. Unguided / Wireless Transmission Media
1. Radio Waves
Used for broadcasting and wide-area communication.
Advantages
Can travel through walls and buildings
Good for long distance
Cheap to use for broadcasting
Used in FM radio, Bluetooth, Wi-Fi, walkie-talkies
2. Microwaves
Used for point-to-point wireless links.
Advantages
Higher frequency than radio waves
Supports high data rate
Useful for long distance line-of-sight links
Used for satellite communication, mobile towers, TV
signals
3. Infrared
Short-range wireless communication using light waves.
Advantages
Very cheap
Secure over short distance (cannot pass through
walls)
No interference with radio systems
Used in TV remotes, short-range device
communication
4. Satellite Communication
Signals sent from earth station → satellite → back to
earth.
Advantages
Covers very large geographical area
Useful for remote and rural regions
Good for TV broadcasting, GPS, weather monitoring
Reliable when no wired network is possible
C. Comparison Advantages Across Media
Wired Media (General Advantages)
More secure
Less interference
Better reliability
Suitable for stable networks like offices and data
centers
Wireless Media (General Advantages)
No physical cables
Easy installation
Supports mobility
Ideal for outdoor, large, and moving networks
Where Each is Best Used
Twisted pair → home/office networks
Coaxial → TV networks and broadband
Optical fibre → high-speed internet backbone
Radio → mobile and Wi-Fi
Microwave → tower-to-tower communication
Infrared → remotes and short devices
Satellite → global coverage and remote areas
Feature Twisted Pair Coaxial Cable Optical Fibre
Copper core +
Material Copper wires Glass/plastic
shield
Speed Low to medium Medium to high Very high
Distance Short Medium Very long
Noise/Interference High Medium Very low
High
Cost Low Medium
(installation)
Security Low Medium Very high
Installation Very easy Moderate Difficult
Bandwidth Low Medium Very high
Internet
LAN, TV, CCTV,
Typical use backbone,
telephones broadband
telecom
Low after
Maintenance Easy Moderate
installation
Error Detection and Correction in Digital Transmission
In digital communication, information is transmitted from a sender to a
receiver in the form of binary data (0s and 1s). During transmission, the signal
may be affected by noise, interference, or other disturbances in the
communication channel. Because of these disturbances, some bits of data
may change from 0 to 1 or from 1 to 0, resulting in errors. To ensure reliable
communication, systems use error detection and error correction techniques.
Types of Errors
Errors that occur during data transmission are mainly of two types:
1. Single Bit Error
A single bit error occurs when only one bit in the data unit is changed during
transmission. For example, if the data sent is 101010, it may be received as
101000. Only one bit has changed.
2. Burst Error
A burst error occurs when two or more bits are changed in a data unit. For
example, if 101010 is sent, it may be received as 100110. Burst errors are
more common in communication systems because noise often affects several
bits at the same time.
Error Detection Techniques
Error detection methods help the receiver identify whether the received data
contains errors or not.
1. Parity Check
Parity check is one of the simplest error detection techniques. In this method,
an extra bit called a parity bit is added to the data before transmission.
There are two types of parity:
Even Parity – The total number of 1s in the data (including the parity bit)
is even.
Odd Parity – The total number of 1s in the data (including the parity bit)
is odd.
Example:
Data = 1011
Number of 1s = 3
For even parity, one parity bit 1 is added so the total number of 1s becomes 4
(even).
Transmitted data becomes 10111.
At the receiver side, the parity is checked. If the parity rule is violated, an error
is detected.
2. Checksum
Checksum is commonly used in network protocols. In this method, the sender
divides the data into several segments and adds them together. The result is
called the checksum.
The checksum is sent along with the data. At the receiver side, the same
calculation is performed again. If the result does not match the received
checksum, it means an error has occurred during transmission.
3. Cyclic Redundancy Check (CRC)
CRC is a more reliable error detection technique widely used in data
communication networks.
In CRC:
1. The data is treated as a binary number.
2. It is divided by a predefined generator polynomial.
3. The remainder obtained from the division is called the CRC code.
4. This remainder is appended to the data before transmission.
At the receiver side, the same division is performed again. If the remainder is
zero, the data is considered correct. Otherwise, an error is detected.
CRC is very effective in detecting burst errors.
Error Correction Techniques
Error correction methods allow the receiver not only to detect errors but also
to identify and correct the incorrect bits.
1. Forward Error Correction (FEC)
In forward error correction, the sender adds extra redundant bits to the data
before transmission. These extra bits help the receiver detect and correct
errors without asking for retransmission.
This method is useful in situations where retransmission is difficult, such as
satellite communication and wireless networks.
2. Hamming Code
Hamming Code is a widely used error correction technique. In this method,
several parity bits are added at specific positions in the data.
These parity bits help the receiver:
Detect if an error has occurred
Identify the exact position of the incorrect bit
Correct the error automatically
For example, if a bit is received incorrectly, the system can locate the faulty bit
and change it back to the correct value.
Importance of Error Detection and Correction
Error detection and correction techniques are important because they:
Ensure reliable communication
Prevent loss or corruption of data
Improve data transmission accuracy
Maintain data integrity in communication networks
Framing in Data Communication
Framing is a process used in the Data Link Layer of the OSI model. In this
process, the continuous stream of bits received from the Network Layer is
divided into smaller units called frames before transmission over the
communication channel.
Each frame contains not only the data but also some control information such
as the source address, destination address, and error detection bits. These
frames help the receiver understand where a message starts and where it
ends.
In simple words, framing organizes data into manageable blocks for
transmission.
Importance of Framing
Framing is important in digital communication for several reasons:
1. Data Organization
Framing divides large data into smaller frames, making transmission
easier and more efficient.
2. Error Detection
Frames include error detection information such as parity bits or CRC,
which help detect errors during transmission.
3. Flow Control
Framing helps manage the rate of data transmission between sender and
receiver.
4. Addressing
Each frame can contain source and destination addresses, which helps
deliver the data to the correct device.
5. Synchronization
Framing helps the receiver identify the start and end of each frame,
ensuring correct interpretation of data.
Framing Techniques
There are several methods used to create frames in data communication. Two
important techniques are Character Stuffing and Bit Stuffing.
1. Character Stuffing
Character stuffing is used in byte-oriented protocols. In this method, special
characters are used to indicate the start and end of a frame.
For example:
DLE STX indicates the start of a frame
DLE ETX indicates the end of a frame
Sometimes the data itself may contain the same characters used for framing.
To avoid confusion, an extra character called DLE (Data Link Escape) is
inserted before the special character inside the data. This process is called
character stuffing.
Example:
Original Data
A B DLE C
After Character Stuffing
A B DLE DLE C
The receiver removes the extra DLE during decoding and retrieves the original
data.
2. Bit Stuffing
Bit stuffing is used in bit-oriented protocols such as HDLC. In this method, a
specific bit pattern is used to mark the beginning and end of a frame.
The standard flag pattern used is:
01111110
During transmission, if the sender finds five consecutive 1s in the data, it
automatically inserts a 0 bit after them. This prevents the data from
accidentally forming the flag pattern.
Example:
Original Data
01111110
After Bit Stuffing
011111010
At the receiver side, whenever five consecutive 1s are detected followed by a
0, the 0 is removed. This restores the original data.
Services Provided by the Data Link Layer
The Data Link Layer is the second layer of the OSI (Open Systems
Interconnection) model. It is responsible for the reliable transfer of data
between two directly connected nodes. This layer receives data from the
network layer, converts it into frames, and sends it to the physical layer for
transmission.
The Data Link Layer provides several important services to ensure efficient
and error-free communication.
1. Framing
Framing is the process of dividing the continuous stream of data received from
the network layer into smaller units called frames.
Each frame contains:
Data (payload)
Header
Trailer
The header and trailer contain important information such as source address,
destination address, and error detection bits. Framing helps the receiver
identify the beginning and end of each frame.
2. Physical Addressing
The Data Link Layer adds the physical address (MAC address) of the sender
and receiver to the frame header.
The MAC (Media Access Control) address uniquely identifies devices on a
network. This allows frames to be delivered to the correct device on the same
network.
3. Flow Control
Flow control ensures that the sender does not send data faster than the
receiver can process it.
If the sender transmits data too quickly, the receiver’s buffer may overflow.
Flow control mechanisms regulate the speed of transmission so that both
sender and receiver operate at a manageable rate.
Examples of flow control techniques include:
Stop and Wait
Sliding Window Protocol
4. Error Control
During transmission, data may become corrupted due to noise or interference
in the communication channel. The Data Link Layer detects and sometimes
corrects these errors.
Error control involves:
Error detection techniques such as parity check, checksum, and CRC.
Retransmission of frames when an error is detected.
Protocols such as ARQ (Automatic Repeat Request) are used to resend
corrupted frames.
5. Access Control
When multiple devices share the same communication channel, the Data Link
Layer controls which device can transmit data at a particular time.
This prevents collisions and ensures fair use of the communication medium.
Examples of access control protocols include:
ALOHA
CSMA/CD
Token passing
6. Synchronization
The Data Link Layer maintains synchronization between sender and receiver
so that frames are transmitted and received correctly. It ensures that both
sides are properly coordinated during communication.
7. Reliable Delivery
In some communication systems, the Data Link Layer provides reliable
delivery of frames. It ensures that frames reach the receiver without loss,
duplication, or errors by using acknowledgements and retransmissions.
Switch
A switch is a networking device used to connect multiple devices within the
same local area network (LAN). It forwards data from one device to another
using MAC (Media Access Control) addresses.
Functions of a Switch
1. Forwarding Data Frames
A switch receives data frames from one device and forwards them to the
correct destination device.
2. MAC Address Learning
The switch stores MAC addresses of connected devices in a MAC address
table. This helps it send frames only to the correct port.
3. Reducing Network Traffic
Unlike hubs, switches send data only to the intended device instead of
broadcasting it to all devices. This reduces unnecessary traffic.
4. Collision Reduction
Each port of a switch acts as a separate collision domain, which reduces
collisions in the network.
5. Improving Network Performance
By sending data only to the required device, switches improve the overall
efficiency and speed of the network.
OSI Layer of Switch
A switch operates at the Data Link Layer (Layer 2) of the OSI model because it
uses MAC addresses to forward frames.
Router
A router is a networking device used to connect different networks together
and direct data packets from one network to another.
Functions of a Router
1. Packet Forwarding
The router receives data packets and forwards them to the correct
destination network.
2. Path Determination
Routers determine the best path for data to travel from source to
destination using routing algorithms.
3. Connecting Different Networks
Routers connect multiple networks such as LANs, WANs, or the internet.
4. Traffic Management
Routers control and manage network traffic to prevent congestion.
5. Network Address Translation (NAT)
Many routers translate private IP addresses into public IP addresses to
allow devices to access the internet.
OSI Layer of Router
A router operates at the Network Layer (Layer 3) of the OSI model because it
uses IP addresses to route packets between networks.
No. OSI Model TCP/IP Model
OSI stands for Open Systems TCP/IP stands for Transmission Control
1
Interconnection. Protocol / Internet Protocol.
Developed by ISO (International Developed by DARPA (U.S. Department
2
Organization for Standardization). of Defense).
3 OSI model has 7 layers. TCP/IP model has 4 layers.
Layers are: Physical, Data Link,
Layers are: Network Interface,
4 Network, Transport, Session,
Internet, Transport, Application.
Presentation, Application.
It is a theoretical reference model
It is a practical model used in real
5 used mainly for understanding
networks and the Internet.
networking concepts.
OSI clearly separates services, TCP/IP does not clearly separate
6
interfaces, and protocols. services, interfaces, and protocols.
OSI model was developed before the TCP/IP model was developed after
7
protocols were implemented. protocols were already in use.
TCP/IP does not have separate Session
OSI has separate Session and
8 and Presentation layers; they are
Presentation layers.
included in the Application layer.
Network layer in OSI supports both Internet layer in TCP/IP mainly
9 connection-oriented and supports connectionless
connectionless communication. communication (IP).
OSI protocol suite is less commonly TCP/IP protocol suite is widely used in
10
used in real networks. the Internet.