LePic
🔥Computer Networks🔥
BCS603
One Shot
Unit-01+02+03+04+05
Unit-01
Introductory Concepts
Ques-Describe the OSI reference model in detail. How is it different from the
TCP/IP model? ([Link])
Ans:-
OSI Reference Model (Open Systems Interconnection)
➤ OSI stands for Open Systems Interconnection.
➤ It is a standard model that describes how data moves across a network.
➤ Developed by ISO (International Organization for Standardization).
➤ It has 7 layers, each with specific roles.
➤ Helps different devices and systems communicate effectively.
➤ Used as a reference model to understand network operations.
➤ Ensures interoperability between hardware and software from different vendors.
Layers of the OSI Model
There are 7 layers in the OSI Model and each layer has its specific role in handling data.
Physical Layer
Data Link Layer
Network Layer
Transport Layer
Session Layer
LePic
Presentation Layer
Application Layer
Layer 1: Physical Layer
➤ Lowest layer of OSI Model
➤ Transmits raw bits (0s and 1s) over the medium
➤ Devices: Hubs, Repeaters, Cables, Modems
➤ Bit Synchronization using clocks
➤ Controls bit rate (speed of transmission)
➤ Defines physical topologies (Bus, Star, Mesh)
➤ Supports transmission modes: Simplex, Half-duplex, Full-duplex
LePic
Layer 2: Data Link Layer (DLL)
➤ Ensures error-free delivery between nodes
➤ Converts bits to frames
➤ Adds MAC addresses (sender/receiver)
➤ Divided into LLC and MAC sublayers
➤ Performs framing, error control, flow control
➤ Controls access to shared media
➤ Devices: Switches, Bridges
Layer 3: Network Layer
➤ Transfers data between different networks
➤ Adds logical IP addresses (source/destination)
➤ Handles routing of packets
➤ Chooses the best path for data
➤ Devices: Routers
LePic
Layer 4: Transport Layer
➤ Ensures end-to-end delivery of data
➤ Segments and reassembles messages
➤ Adds port numbers for applications
➤ Provides error detection and recovery
➤ Supports TCP (reliable) & UDP (fast, unreliable)
➤ Controls flow and retransmissions
Layer 5: Session Layer
➤ Establishes, manages, and terminates sessions
➤ Supports authentication and authorization
➤ Manages dialog control (half/full duplex)
➤ Adds synchronization checkpoints
LePic
Layer 6: Presentation Layer
➤ Translates data formats (e.g., ASCII to EBCDIC)
➤ Encrypts and decrypts data for security
➤ Compresses data to reduce size
➤ Handles media formats like JPEG, MPEG, GIF
Layer 7: Application Layer
➤ Closest to the user
➤ Provides network services to applications (e.g., browser, email)
➤ Protocols: HTTP, FTP, SMTP, DNS
➤ Handles file transfers, emails, directory services
➤ Provides interface for users to access network resources
Data flows through the OSI model in a step-by-step process:
Application Layer: Applications create the data.
Presentation Layer: Data is formatted and encrypted.
Session Layer: Connections are established and managed.
Transport Layer: Data is broken into segments for reliable delivery.
Network Layer: Segments are packaged into packets and routed.
Data Link Layer: Packets are framed and sent to the next device.
LePic
Physical Layer: Frames are converted into bits and transmitted physically.
OSI Model vs TCP/IP Model
Feature OSI Model TCP/IP Model
Full Form Open Systems Transmission Control
Interconnection Protocol / Internet
Protocol
Developed By ISO (International Standards DARPA (U.S.
Organization) Department of
Defense)
Number of Layers 7 Layers 4 Layers
Layer Names Application, Presentation, Application, Transport,
Session, Transport, Network, Internet, Network
Data Link, Physical Access
Function Conceptual reference model Practical
implementation
model
Usage Mostly used for learning and Used in real-world
reference networking (Internet)
Protocol Dependency Protocol independent Protocol specific (uses
TCP/IP)
Communication Vertical approach (each layer Horizontal approach
depends on the layer below) (more direct
communication)
Model Type Theoretical, generalized Protocol-based model
model
Error Handling Handled at Data Link and Mainly handled at the
Transport Layers Transport Layer
Ques-Differentiate between connection-oriented and connectionless
services. In which layers are these used and why?
Ans:-
LePic
Feature Connection-Oriented Connectionless Service
Service
Setup Connection is established No connection setup
before data transfer needed
Data Delivery Reliable and guaranteed Not guaranteed
Order of Delivery Data arrives in correct Data may arrive out of
order order
Acknowledgment Acknowledgment is sent No acknowledgment
Overhead Higher (due to Lower (no setup or
connection acknowledgment)
management)
Speed Slower (more checks) Faster (less overhead)
Error Checking & Yes, built-in Minimal or none
Recovery
Protocol Example TCP (Transmission UDP (User Datagram
Control Protocol) Protocol)
Used In Transport Layer Transport & Network
Layer
Typical Use Cases File transfer, email, web Video streaming, VoIP,
browsing gaming
Used in Which Layers and Why?
LePic
Layer Connection- Connectionless Why?
Oriented
Transport Layer TCP is used for UDP is used for This layer
reliable services fast services like manages end-to-
like web browsing, video streaming, end
emails gaming communication,
so it decides
reliability vs
speed
Network Layer Rare, but IP is a IP just sends
protocols like X.25 connectionless packets
used it protocol regardless of
connection, for
flexibility and
speed
Ques-What are the goals and applications of computer networks in
different domains? Explain with examples. (IMP)
Ans:-
Goals of Computer Networks
LePic
Goal Description
Resource Sharing Share hardware (e.g., printers, scanners) and software (e.g.,
files, applications) among users.
Reliability Provide alternate data paths during failures to ensure
uninterrupted service.
Cost Efficiency Reduce hardware and software costs by centralized sharing
of resources.
Scalability Easily add more devices/users without disrupting existing
network.
Communication Enable users to communicate via email, chat, VoIP, video
calls, etc.
Data Security & Allow secure data transfer with encryption and access
Integrity controls.
Centralized Easy to monitor, update, and manage systems and software
Management remotely.
Applications of Computer Networks in Different Domains:
1. Business and Enterprise
Companies use computer networks to share files, manage customer data,
conduct video meetings, and run business applications.
Example: Employees in different branches use Google Drive or Microsoft Teams to
collaborate in real-time.
2. Education
Schools and universities use networks for online learning, digital libraries, and
virtual classrooms.
Example: Platforms like Google Classroom, Coursera, and Zoom are widely used
for delivering lectures and assignments.
3. Healthcare
Hospitals and clinics use networks to share patient data, conduct remote
consultations (telemedicine), and manage appointments.
Example: A doctor can access patient records from another hospital using a
secure hospital network.
4. Government
Governments use computer networks to provide online services like digital identity,
tax filing, voting, and document storage.
Example: Services like Aadhaar, GST portal, and DigiLocker use networks to serve
citizens efficiently.
5. Home and Personal Use
Individuals use computer networks for internet browsing, online games, video
streaming, and controlling smart home devices.
LePic
Example: Watching Netflix or controlling lights using Alexa is possible because of
home networks.
6. E-commerce
Online shopping platforms rely on networks for order processing, payment
systems, customer service, and inventory updates.
Example: Websites like Amazon and Flipkart use computer networks to run their
operations smoothly.
7. Banking and Finance
Banks use networks for ATM services, online banking, fund transfers, and fraud
detection systems.
Example: Apps like Paytm, PhonePe, and SBI YONO enable secure and fast banking
via the internet.
8. Transportation
Networks help in GPS navigation, real-time traffic updates, toll collection, and fleet
tracking.
Example: Google Maps uses network data to provide live traffic info and suggest
best routes.
9. Industry and Manufacturing
Industrial systems use computer networks for automation, machine monitoring,
and predictive maintenance.
Example: Smart factories connect sensors and machines using networks to
optimize production.
Ques-Discuss the different types of network topologies. Compare their
advantages and disadvantages. ([Link])
Ans:-
Different Types of Network Topologies
Bus Topology
➤ All devices are connected to a single central cable (backbone).
➤ Supports bi-directional communication.
➤ It's a multi-point connection; not robust — if backbone fails, whole network fails.
➤ Uses MAC protocols like TDMA, CDMA, Pure Aloha, Slotted Aloha, CSMA.
Advantages of Bus Topology
➤ Requires only 1 backbone cable and N drop lines for N devices.
➤ Uses coaxial or twisted pair cables, supports up to 10 Mbps.
➤ Cost-effective — fewer cables than other topologies.
LePic
➤ Easy to install and troubleshoot.
➤ Efficient for small networks, supports CSMA method.
Disadvantages of Bus Topology
➤ If backbone fails, the entire network goes down.
➤ High network traffic can cause data collisions.
➤ Adding new devices slows down performance.
➤ Low security — data is shared across the network.
➤ Still requires considerable cabling, especially in large setups.
Ring Topology
➤ Devices are connected in the shape of a ring, each connected to two neighbors.
➤ Unidirectional data flow by default (can be made bidirectional using dual ring).
➤ Token Passing Protocol is used for communication.
➤ Uses repeaters for long rings to avoid data loss.
Advantages of Ring Topology
➤ High-speed data transmission.
➤ Minimum data collisions.
➤ Cheap to install and expand.
➤ Less costly than star topology.
Disadvantages of Ring Topology
➤ Failure of one node can crash the entire network.
➤ Troubleshooting is difficult.
➤ Adding/removing nodes can disturb the network.
➤ Lower security.
Tree Topology
➤ It is a variation of Star topology with a hierarchical structure.
➤ Combines characteristics of bus and star topologies.
➤ Data flows top-down or bottom-up, from central hub to secondary hubs and then to
devices.
➤ Uses protocols like DHCP and SAC (Standard Automatic Configuration).
➤ Central hub contains a repeater to boost signals.
LePic
Advantages of Tree Topology
➤ Scalable – allows more devices via secondary hubs.
➤ Hierarchical management – helps organize and prioritize nodes.
➤ Easy to add new devices.
➤ Error detection and correction is simpler.
Disadvantages of Tree Topology
➤ Central hub failure brings down the entire network.
➤ High cabling cost.
➤ Reconfiguration is difficult when adding new devices.
Example
➤ Like a company hierarchy:
➤ CEO (central hub)
➤ Departments (secondary hubs)
➤ Managers & teams (nodes and leaves)
Hybrid Topology
➤ It is a combination of two or more different types of network topologies (e.g., Star +
Ring, Bus + Tree, etc.).
➤ Used when network nodes are free to adopt any topology structure.
➤ Each part of the network follows its own protocols (like Token Ring, CSMA/CD, etc.).
Advantages of Hybrid Topology
LePic
➤ Highly flexible – can be customized to fit organizational needs.
➤ Easily scalable – new devices or segments can be added without affecting the existing
structure.
Disadvantages of Hybrid Topology
➤ Complex to design and manage – integrating multiple topologies requires careful
planning.
➤ Expensive hubs and infrastructure – due to use of various network devices and
extensive cabling.
➤ High setup cost compared to simpler topologies.
Example
➤ Used in large enterprises, universities, or data centers, where different departments use
different topologies interconnected through a hybrid layout.
Mesh Topology
➤ Every device is connected to every other device via dedicated links (channels).
➤ Used in networks where high reliability, speed, and security are essential.
➤ Protocols used: AHCP, DHCP, etc.
Advantages of Mesh Topology
➤ High speed communication due to direct dedicated links.
➤ Robust and reliable – a single failure doesn't affect the network.
➤ Easy fault detection – issues are isolated quickly.
➤ Ensures security and privacy – data travels on unique paths.
Disadvantages of Mesh Topology
➤ Complex installation and configuration – especially as the number of devices
increases.
➤ High cost due to extensive cabling and ports.
➤ Maintenance is expensive – difficult to manage many connections.
Example
LePic
➤ Used in the internet backbone, military communications, and aircraft systems, where
redundancy and data integrity are critical.
Star Topology
➤ All devices are connected to a central hub (active or passive).
➤ Commonly used cables: Coaxial or RJ-45.
➤ Common protocols: CSMA, Collision Detection (CD).
Advantages of Star Topology
➤ Easy to set up and manage – only N cables for N devices.
➤ Each device uses only 1 port to connect to the hub.
➤ Robust – a single link failure doesn't affect others.
➤ Easy to identify and isolate faults.
➤ Cost-effective – uses affordable coaxial cables.
Disadvantages of Star Topology
➤ If the central hub fails, the entire network goes down.
➤ High installation cost due to cabling and hub.
➤ Performance depends entirely on the hub’s capacity.
Example
➤ Common in office LANs where all computers connect to a central hub.
➤ Used in wireless networks where devices connect to a Wi-Fi access point.
Ques-Discuss the concept of switching techniques. Compare circuit
switching, packet switching, and message switching. (imp)
Ans:- Switching is the process of transferring data packets from one device to another
in a network or from one network to another, using specific devices called switches. There
are three types of switching methods:
Message Switching
Circuit Switching
Packet Switching
Circuit Switching
LePic
➤ Definition: Establishes a dedicated communication path between sender and receiver
before data transfer begins.
➤ Example: Traditional telephone networks.
Advantages:
➤ Guaranteed bandwidth – Fixed resources for each connection.
➤ Low latency – No routing delay once the circuit is set.
➤ Predictable performance – Stable connection with no external traffic interference.
➤ Real-time suitability – Perfect for voice and video calls.
Disadvantages:
➤ Inefficient bandwidth use – Path remains reserved even when no data is sent.
➤ Limited scalability – Finite number of circuits limits concurrent connections.
➤ High cost – Requires continuous allocation of dedicated resources.
Packet Switching
➤ Definition: Data is divided into packets, sent independently across the network.
Packets may take different routes.
➤ Example: Internet (email, web, file downloads).
Advantages:
➤ Efficient bandwidth usage – Shared resources, used only when needed.
➤ Flexible and scalable – Handles different data types and high traffic volumes.
➤ Lower cost – No dedicated circuit; infrastructure is shared.
Disadvantages:
➤ Higher latency – Packets can be delayed or arrive out of order.
➤ Limited QoS – No guaranteed delivery time or sequence.
➤ Packet loss – Congestion and errors can lead to lost packets.
➤ Not ideal for real-time apps – Voice/video may suffer delays and jitter.
Message Switching
➤The entire message is sent to the switching center, stored temporarily (store-and-
forward), and then forwarded to the next switch.
➤Example: Telegraph networks.
Comparison Table
LePic
Aspect Circuit Switching Packet Switching Message
Switching
Path Pre-established No dedicated No pre-defined
Establishment before path; dynamic path; store and
communication route per packet forward
starts
Data Handling Continuous data Data split into Entire message
flow packets sent as one unit
Delay Minimal once Variable delay due High delay due to
circuit is to routing store-and-forward
established
Bandwidth Usage Fixed and reserved Efficient; used only Inefficient; requires
when needed storage
Reliability High (but failure in Moderate (packets Moderate;
line drops the may be message may be
connection) lost/reordered) delayed or
dropped
Example Telephone Internet (IP, Email (historically),
systems TCP/UDP) Telegraph systems
Suitability Real-time Data applications Non-real-time
applications (web browsing, file communications
(voice/video calls) transfer)
Ques-What are transmission impairments in physical communication?
Explain attenuation, noise, and distortion ([Link])
Ans:-
Transmission impairments refer to the factors that degrade the quality of a signal as it
travels through a communication channel. These impairments can cause errors, reduce
signal strength, and affect the overall performance of data transmission.
The three main types of transmission impairments are:
LePic
1. Attenuation
➤ Definition: It means loss of energy. Attenuation is the gradual loss of signal strength as
it travels through a transmission medium.
➤ Cause: It happens because of the energy dissipation due to the resistance of the
medium, spreading of the signal, or absorption by the medium.
➤ Effect: The signal becomes weaker and harder to detect at the receiver, possibly
causing data loss.
➤ Example: The farther an electrical signal travels on a copper wire, the weaker it
becomes.
2. Noise
➤ Definition: Noise is any unwanted electrical or electromagnetic energy that interferes
with the original signal.
➤ Types:
Thermal Noise: Caused by random motion of electrons (present in all electronic
devices).
Intermodulation Noise: Occurs when signals at different frequencies mix.
Crosstalk: Occurs when signals from one channel interfere with another.
Impulse Noise: Sudden spikes caused by external disturbances (like lightning).
➤ Effect: Noise distorts the signal, causing errors in the received data.
LePic
3. Distortion
➤ Definition: Distortion occurs when the shape or form of the signal changes during
transmission.
➤ Cause: This is caused by the medium affecting different frequencies in the signal
unevenly (frequency-dependent delay or phase shifts).
➤ Effect: The output signal differs from the input signal, leading to errors, especially in
analog signals.
Unit-02
Link Layer
Ques-What are the major causes of errors in data communication? Explain
Error Detection and Correction techniques used at the data link layer.
([Link])
Ans:-Major Causes of Errors in Data Communication
Errors in data communication occur due to various factors that affect the integrity of the
transmitted data. The major causes include:
➤ Noise: Unwanted electrical signals (thermal noise, crosstalk, impulse noise) that
interfere with the original data signal.
➤ Attenuation: Weakening of signal strength, making it difficult for the receiver to
interpret data correctly.
➤ Distortion: Changes in signal shape or timing during transmission, causing
misinterpretation.
➤ Interference: External electromagnetic signals overlapping with the data signal.
➤ Synchronization Errors: Timing mismatches between sender and receiver clocks.
➤ Hardware Faults: Malfunctioning network devices or cables.
Error Detection Techniques at the Data Link Layer
To detect errors, a common technique is to introduce redundancy bits that provide
additional information. Various techniques for error detection include:
Simple Parity Check
Two-Dimensional Parity Check
Checksum
Cyclic Redundancy Check (CRC)
Simple Parity Check
LePic
A Simple Parity Check is an error detection technique where a parity bit is added to a
data unit to make the total number of 1s either even (even parity) or odd (odd parity).
Even Parity Rule:
If the number of 1s is odd, add 1→ makes it even.
If the number of 1s is even, add 0→ keeps it even.
Example (Even Parity):
Data: 101010→ 3 ones (odd) → Add 1→ Transmit: 1010101
Two-Dimensional Parity Check
This method adds parity bits to both rows and columns of a block of data (usually
arranged in a matrix).
Each row has a parity bit (like in simple parity check).
Each column also has a parity bit.
At the receiver end, row and column parity bits are used to detect and sometimes
correct errors.
Checksum:
( )
LePic
Data is divided into segments, and their binary sum (checksum) is calculated and
sent along with the data.
Receiver recalculates checksum to verify data integrity.
Used in protocols like UDP.
Cyclic Redundancy Check (CRC):
Data bits are treated as a polynomial and divided by a predefined generator
polynomial.
The remainder (CRC bits) is appended to the data.
Receiver performs the same division and checks the remainder to detect errors.
Highly effective for detecting burst errors.
Error Correction Techniques at the Data Link Layer
Error correction methods ensure not only the detection but also the correction of errors.
These are especially important in data communication to maintain reliability.
➤ Automatic Repeat Request (ARQ)
This is a feedback-based error control technique. The receiver detects errors and
requests the sender to retransmit the corrupted data.
Types of ARQ:
➤ Stop-and-Wait ARQ
The sender transmits one frame and waits for an acknowledgment before sending the
next.
➤ Go-Back-N ARQ
The sender can send multiple frames before needing an acknowledgment. If an error is
detected in one frame, it goes back and retransmits all frames from that point onward.
➤ Selective Repeat ARQ
Only the specific frames that were received in error are retransmitted, increasing
efficiency.
Advantages:
Reliable error control
Ensures complete data delivery
Disadvantages:
May cause delay due to retransmissions
➤ Forward Error Correction (FEC)
In this technique, the sender adds redundant bits using error-correcting codes. These bits
help the receiver to detect and correct errors without requesting retransmission.
Common FEC Methods:
➤ Hamming Code
➤ Reed-Solomon Code
➤ Convolutional Codes
LePic
Advantages:
No need for retransmission
Useful for real-time communication (e.g., streaming, satellite communication)
Disadvantages:
More complex encoding/decoding
Adds overhead due to redundant bits
Ques-Compare and contrast Stop-and-Wait ARQ, Go-Back-N ARQ, and
Selective Repeat ARQ([Link])
Ans:-
1. Stop-and-Wait ARQ
Working:
The sender sends one frame at a time and waits for an acknowledgment (ACK) before
sending the next.
Features:
Simple and easy to implement
Uses a 1-bit sequence number (0 or 1)
Pros:
Low memory usage
Easy error detection and retransmission
Cons:
Low efficiency (idle time between frames)
Wastes bandwidth for long-distance or high-latency networks
LePic
2. Go-Back-N ARQ
Working:
The sender can transmit N frames (window size) without waiting for an ACK. If any frame
is lost or damaged, all frames from that point onward are retransmitted.
Features:
Uses a sliding window protocol
Receiver only accepts frames in order
Pros:
Better utilization of bandwidth than Stop-and-Wait
Simple receiver logic
Cons:
Can lead to redundant retransmission of error-free frames
More memory required for buffering at sender side
Working:
The sender sends multiple frames, but only retransmits those frames which are actually
received with errors.
Features:
Uses sliding window protocol
Receiver stores out-of-order frames and acknowledges each valid frame individually
Pros:
Efficient use of bandwidth
LePic
Reduces unnecessary retransmissions
Cons:
Complex receiver logic (needs buffering for out-of-order frames)
More memory required at both sender and receiver
Comparison Table
LePic
Feature Stop-and-Wait Go-Back-N ARQ Selective Repeat
ARQ ARQ
Transmission One frame at a Multiple frames Multiple frames
time (window size N) (window size N)
Error Handling Retransmit single Retransmit from Retransmit only
frame error frame the error frames
onward
Efficiency Low Moderate High
Receiver Low Low High
Complexity
Sender Buffering Minimal Moderate High
Receiver Buffering Minimal Minimal High
Use Case Simple, short links Medium traffic High-performance,
networks high-latency links
Ques-What are the functions and responsibilities of the Medium Access
Control (MAC) sublayer? Explain any two MAC protocols.(imp)
Ans:- The MAC sublayer is a part of the Data Link Layer (Layer 2) in the OSI model. It
plays a crucial role in managing how data is transmitted over a shared communication
medium.
Key Functions of MAC Sublayer
1. Framing
➤ Encapsulates data into frames before transmission and adds headers/trailers.
2. Addressing
➤ Uses MAC addresses (physical addresses) to identify devices on a network.
3. Medium Access Control
➤ Controls how devices take turns to access the shared medium (prevents
collisions).
4. Error Detection
➤ Detects errors in frames using CRC or checksum (but not correction).
5. Flow Control
➤ Ensures sender does not overwhelm the receiver with too much data.
6. Collision Handling
➤ Detects or avoids collisions in shared mediums (e.g., Ethernet or Wi-Fi).
Two Common MAC Protocols
1. Carrier Sense Multiple Access with Collision Detection (CSMA/CD)
LePic
Used in: Wired networks like Ethernet (legacy systems)
Working Principle:
Devices listen to the channel (Carrier Sense).
If the channel is idle, they transmit.
If two devices transmit at the same time, a collision occurs.
The collision is detected (Collision Detection).
Devices stop, wait for a random time (backoff), and retransmit.
Pros:
Simple and efficient for low traffic.
Reduces chances of collision through sensing.
Cons:
Not effective in high traffic.
Only suitable for wired networks where collision detection is possible.
LePic
LePic
2. Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA)
Used in: Wireless networks like Wi-Fi (IEEE 802.11)
Working Principle:
Devices listen to the channel (Carrier Sense).
If the channel is idle, they wait a random time (backoff) before sending.
Uses ACKs to confirm successful reception.
Often includes RTS/CTS (Request to Send/Clear to Send) to avoid hidden node
problems.
Pros:
Minimizes collisions in wireless networks where collision detection is not possible.
Improves efficiency in congested wireless environments.
Cons:
Overhead due to RTS/CTS and ACK messages.
Less efficient than CSMA/CD in low traffic.
LePic
Ques-What are LAN Standards? Explain any two LAN standards in detail.
([Link])
Ans:- LAN Standards refer to technical specifications that define the functioning of Local
Area Networks (LANs). These standards are primarily developed by IEEE (Institute of
Electrical and Electronics Engineers) under the IEEE 802 family. They define how data is
formatted, transmitted, and managed over a network, ensuring interoperability among
different devices and manufacturers.
Two Important LAN Standards:
1. IEEE 802.3 (Ethernet)
Overview:
LePic
Defines standards for wired LANs using CSMA/CD (Carrier Sense Multiple Access
with Collision Detection).
Most commonly used LAN technology.
Key Features:
Uses twisted pair, coaxial cable, or fiber optic.
Data transmission speeds: 10 Mbps to 100 Gbps.
Frame size: Minimum 64 bytes, Maximum 1518 bytes.
Working:
Devices listen to the medium before sending data.
If a collision occurs, devices wait (backoff) and retry transmission.
Applications:
Office LANs, schools, data centers.
2. IEEE 802.11 (Wi-Fi)
Overview:
Standard for wireless LAN (WLAN) communication.
Uses CSMA/CA (Collision Avoidance) instead of CSMA/CD.
Key Features:
Works over radio frequencies: 2.4 GHz and 5 GHz.
Data rates: Up to several Gbps (depends on version: 802.11a/b/g/n/ac/ax).
Supports mobile and portable devices.
Working:
Devices send an RTS (Request to Send) and receive CTS (Clear to Send) before
transmitting data to avoid collisions.
Includes encryption (WPA, WPA2) for security.
Applications:
Home networks, cafes, airports, mobile devices.
Ques-Explain Framing in the Data Link Layer. Describe any two framing
methods with examples.([Link])
Ans:-
Framing in the Data Link Layer
What is Framing?
LePic
Framing is the process of dividing a continuous stream of data into smaller,
manageable units called frames at Data Link Layer before transmission over the
physical medium. These frames ensure the receiver can identify and extract each
message accurately, even if the data is transmitted in a stream.
Each frame typically contains:
Header: Control information (like addresses, frame number)
Payload: The actual data to be transmitted
Trailer: Error-detection bits (e.g., CRC)
Why is Framing Necessary?
1. Synchronization: Helps the receiver recognize the start and end of each frame.
2. Error Control: Allows detection and retransmission of corrupted data.
3. Flow Control: Prevents overwhelming a slower receiver with too much data at once.
4. Addressing: Allows communication between specific sender and receiver.
Framing Methods
1. Character Count Method
Description:
The first field of the frame indicates the number of characters (bytes) in the entire
frame.
The receiver reads that number of characters to extract the full frame.
Example:
Suppose the frame data is: HELLO (5 characters)
Then the frame becomes:
[06][H][E][L][L][O] → 6 = count of total characters (including the count byte)
LePic
Advantages:
Simple and efficient when data is clean.
Compact: no need for special start/end symbols.
Disadvantages:
Vulnerable to corruption: If the count field is damaged, the receiver can't determine
frame boundaries.
Difficult to resynchronize without retransmission.
2 Byte Stuffing (Character-Oriented Framing)
Description:
Special characters are used to mark the start and end of a frame. Commonly:
FLAG: Used to indicate frame boundaries (e.g., ~)
ESC: Escape character used to stuff data if it contains FLAG
If the data itself contains a FLAG or ESC, an extra ESC character is inserted before it —
this is called stuffing.
Example:
Original data: HELLO~WORLD
Since ~ is the flag, we add an ESC before it.
Framed Data:
~HELLO\~WORLD~
Where:
~: Start/End of frame
\~: Stuffed FLAG inside data
Advantages:
LePic
Easy to identify frame boundaries.
Resynchronization is easy if frames are lost.
Works well for character-oriented systems like older terminal interfaces.
Disadvantages:
Overhead: More characters may be added due to stuffing.
Inefficient if data contains many special characters (requires more ESC insertions).
Unit-03
Network Layer
Ques-Explain Logical Addressing in the Network Layer. How is it different
from physical addressing?
What is Logical Addressing?
→ Logical addressing is a type of addressing used at the Network Layer of the OSI model.
→ It helps in identifying devices across different networks.
→ The most common example of a logical address is the IP address (e.g., [Link]).
→ Logical addresses are:
Assigned by software (like DHCP or configured manually)
Changeable (can be updated if the device moves to a different network)
Used for routing packets across networks
Why is Logical Addressing Needed?
→ In a large network like the Internet, computers are connected through many routers.
→ Physical addresses (like MAC addresses) only work within a local network.
→ So, logical addresses are required to uniquely identify and locate devices across
multiple networks.
Format of a Logical Address (IPv4 Example)
→ IPv4 address is a 32-bit number, usually written as 4 decimal numbers separated by
dots (called dotted decimal notation).
→ Example: [Link]
→ It has two parts:
Network ID (identifies the network)
Host ID (identifies the specific device in that network)
What is Physical Addressing?
→ Physical addressing is used at the Data Link Layer.
→ It refers to the MAC address (Media Access Control), which is hard-coded into the
network interface card (NIC) of a device.
LePic
→ MAC addresses are:
Fixed and unique for each device
Used for communication within the same local network
Usually written in hexadecimal form (e.g., 00:A0:C9:14:C8:29)
Key Differences Between Logical and Physical Addressing
Feature Logical Address (IP) Physical Address (MAC)
Layer Network Layer Data Link Layer
Scope Global (across networks) Local (within a LAN)
Changeable Yes (can be reassigned) No (fixed in hardware)
Assigned by Software (manual/DHCP) Manufacturer (NIC card)
Used by Routers for forwarding Switches for local delivery
Ques-What is CIDR (Classless Inter-Domain Routing)? How does it differ
from classful addressing?
Ans:-
What is CIDR (Classless Inter-Domain Routing)?
CIDR is a method for allocating IP addresses and IP routing that replaces the traditional
classful IP addressing system. It was introduced in 1993 to improve IP address allocation
efficiency and reduce routing table size.
CIDR Basics
CIDR Notation:
An IP address followed by a slash and the number of bits in the network prefix.
Example: [Link]/24 means the first 24 bits are the network part.
Flexible Subnetting:
CIDR allows subnets of arbitrary sizes, not limited to Class A, B, or C.
Why CIDR was introduced?
LePic
Classful Addressing Issue CIDR Solution
Wastage of IP addresses CIDR allows subnetting of any size,
minimizing wastage.
Rigid class boundaries (A, B, C) CIDR removes fixed classes.
Large routing tables CIDR enables route aggregation
(supernetting).
Difference Between CIDR and Classful Addressing
Feature Classful Addressing CIDR
IP Address Structure Divided into fixed classes Uses variable-length
(A, B, C) subnet mask (VLSM)
Subnet Flexibility Fixed subnet sizes per Allows any number of
class subnet bits (e.g., /19)
Address Utilization Often wasteful More efficient IP usage
Routing Table Size Larger due to many Smaller due to
specific routes aggregation
Example [Link] (Class C) = /24 [Link]/22 covers 4
Class C networks
Example
Classful Addressing:
[Link] (Class C) → 256 addresses (/24 by default)
CIDR Addressing:
[Link]/22 → Includes:
[Link]
[Link]
[Link]
[Link]
Total: 1024 IP addresses
Advantages of CIDR
LePic
More efficient use of IP address space.
Simplifies routing through route aggregation.
Supports Variable-Length Subnet Masking (VLSM).
Ques-Explain the functions and working of ARP and RARP protocols ([Link])
=> What is ARP (Address Resolution Protocol)?
→ ARP is a protocol used to map a known IP address to its corresponding MAC
(physical) address.
→ It is used when a device wants to send data in a local network (LAN) but only knows
the destination’s IP address.
→ ARP works at the Network Layer (for IP) and interacts with the Data Link Layer (for
MAC address).
=>Function of ARP
→ To find the MAC address of a device when the IP address is known.
→ Helps in enabling communication between devices in the same LAN.
=> Working of ARP
→ Suppose a computer wants to send data to IP [Link] but doesn't know its MAC
address.
→ Step 1: It sends a broadcast ARP Request on the LAN asking,
“Who has IP address [Link]? Tell me your MAC address.”
→ Step 2: The device with that IP address replies with its MAC address in an ARP Reply.
→ Step 3: The sender stores the MAC address in its ARP cache and uses it to send data.
=> What is RARP (Reverse Address Resolution Protocol)?
→ RARP is the opposite of ARP.
→ It is used to find the IP address when the MAC address is known.
→ It is useful for devices like diskless computers that don’t have a pre-configured IP
address.
=>Function of RARP
LePic
→ To assign an IP address to a device that only knows its hardware (MAC) address.
→ Used during booting of diskless systems.
=>Working of RARP (Step-by-Step)
→ Step 1: The device sends a RARP Request to the network:
“This is my MAC address. Can someone tell me my IP address?”
→ Step 2: A RARP Server on the network checks its table and sends a RARP Reply with the
matching IP address.
→ Step 3: The device uses this IP address to start communication.
=>Differences Between ARP and RARP
Feature ARP RARP
Purpose Get MAC from known IP Get IP from known MAC
Direction IP → MAC MAC → IP
Used by Any device sending data Diskless computers during
booting
Type of protocol Request-response Request-response
(broadcast/unicast) (unicast to server)
Ques-Describe the working of ICMP protocol. How does it help in error and
control message delivery? ([Link])
Ans:- ICMP Protocol: Internet Control Message Protocol
The Internet Control Message Protocol (ICMP) is a network layer protocol used by
network devices (like routers) to send error messages and operational information. It is
defined in RFC 792 and works closely with the IP protocol.
Purpose of ICMP
ICMP is primarily used for:
Reporting errors in packet delivery
Providing diagnostic tools (e.g., ping, traceroute)
Communicating network congestion and routing issues
How ICMP Works
ICMP messages are encapsulated within IP packets.
LePic
It does not carry application data but sends control messages related to network
operation.
It helps in error reporting, not correction (unlike TCP).
Structure of ICMP Packet:
(ICMP PACKET FORMAT)
Type: Specifies the type of message (e.g., 0 for Echo Reply, 8 for Echo Request)
Code: Provides more detail about the type
Checksum: For error checking
Types of ICMP Messages
LePic
Type Message Purpose
0 Echo Reply Reply to a ping request
3 Destination Unreachable Packet couldn’t reach the
destination
4 Source Quench Congestion control
(deprecated)
5 Redirect Suggest a better route
8 Echo Request Ping to test if the host is
reachable
11 Time Exceeded TTL expired (used in
traceroute)
Error Reporting by ICMP
ICMP reports the following errors:
1. Destination unreachable (e.g., no route, port unreachable)
2. Time exceeded (TTL expired)
3. Parameter problems in headers
4. Fragmentation required but not allowed
These errors help the sender understand why a packet failed and adjust the behavior
accordingly.
Control Messaging by ICMP
ICMP also provides control information, such as:
Redirect messages: Router advises host to send traffic via a better route.
Echo Request/Reply: Used by utilities like ping to test connectivity.
Common ICMP Tools
1. Ping:
Uses Echo Request and Echo Reply.
Checks if a host is reachable and measures delay.
2. Traceroute:
Uses ICMP Time Exceeded messages.
Tracks the path a packet takes to a destination.
LePic
Ques-What is the role of DHCP in IP communication? Describe how DHCP
assigns IP addresses. (IMP)
Ans:- Role of DHCP in IP Communication
DHCP (Dynamic Host Configuration Protocol) is a network management protocol used
to automatically assign IP addresses and other network configuration parameters (like
gateway, DNS) to devices on a network. It helps simplify IP address management and
avoids manual configuration.
Key Functions of DHCP
Dynamic IP Address Assignment (temporary lease)
Static IP Allocation (based on MAC address)
Reusing IP addresses from the available pool
Providing network information such as:
Default Gateway
Subnet Mask
DNS Server
Lease Duration
How DHCP Works
DHCP operates using a 4-step process often called DORA:
LePic
Step Message Purpose
Discover DHCPDISCOVER Client broadcasts to
locate a DHCP server
Offer DHCPOFFER Server replies with
available IP configuration
Request DHCPREQUEST Client requests to lease
the offered IP
Acknowledge DHCPACK Server confirms and
assigns the IP to the client
Detailed DHCP Exchange Process
1. DHCP Discover
Sent by client (broadcast)
Destination: [Link]
"Is there any DHCP server out there?"
2. DHCP Offer
Sent by server (unicast or broadcast)
Contains: offered IP, subnet, gateway, DNS, lease time
3. DHCP Request
Client selects one offer (if multiple) and requests to use that IP
4. DHCP Acknowledge
Server confirms assignment
Client now uses that IP for the lease duration
Example of DHCP Assignment
LePic
Suppose a new laptop joins a Wi-Fi network:
1. Sends DHCP Discover.
2. Router responds with DHCPOffer of IP [Link].
3. Laptop replies with DHCP Request for [Link].
4. Router sends DHCP ACK →IP [Link] is now assigned.
DHCP Packet Format
The DHCP protocol uses a specific packet structure to send and receive messages
between client and server.
(DHCP PACKET FORMAT)
LePic
Explanation of Key Fields:
Operation Code: Indicates if the packet is a request (1) or reply (2).
Hardware Type/Length: Type of hardware used (e.g., Ethernet).
Transaction ID: Unique number for matching responses to requests.
Client IP / Your IP: IPs involved in the assignment process.
Gateway, Server IP: Used during forwarding or relays.
Options: Contains key parameters like subnet mask, lease time, etc.
Ques-What is the need for IPv6? Explain the structure and features of IPv6
addressing. (IMP)
Ans:-
What is the Need for IPv6?
IPv6 (Internet Protocol version 6) was developed to address several limitations of IPv4
(Internet Protocol version 4). The primary need arose due to the exhaustion of IPv4
addresses and increasing demands for:
More devices connected to the Internet,
Improved security,
Better support for mobile devices and multimedia traffic.
Reasons for the Transition from IPv4 to IPv6
1. Address Exhaustion:
IPv4 supports only 4.3 billion addresses (32-bit), which are insufficient for today's
global connectivity demands (IoT, mobile phones, etc.).
2. Growing Internet Usage:
Rapid increase in users, devices, and services globally.
3. Lack of Security in IPv4:
IPv4 was not designed with security in mind. IPv6 includes IPSec support by default.
4. Better Routing and Efficiency:
IPv6 offers hierarchical addressing and simplified packet headers, improving routing
performance.
5. No Need for NAT:
Due to vast address space, Network Address Translation (NAT) is not needed,
making end-to-end communication easier.
LePic
Structure of IPv6 Address
IPv6 uses a 128-bit address format, written in 8 groups of 4 hexadecimal digits,
separated by colons :.
Example:
2001:0db8:0000:0000:0000:ff00:0042:8329
Rules:
Leading zeros in a block can be omitted.
Consecutive blocks of zeros can be replaced by :: (once per address).
Simplified version:
2001:db8::ff00:42:8329
LePic
Features of IPv6 Addressing
1. Huge Address Space:
IPv6 provides 2¹²⁸ addresses, which is approximately 340 undecillion (a vast number
compared to IPv4).
2. Simplified Header Format:
Fewer fields in the IPv6 header improve processing speed and efficiency.
3. Auto-configuration (Stateless & Stateful):
IPv6 supports automatic IP configuration using SLAAC (Stateless Address
Autoconfiguration).
4. Integrated Security:
IPSec is mandatory for IPv6, providing confidentiality, authentication, and data
integrity.
5. No Need for NAT:
Eliminates the need for address translation, supporting true end-to-end
communication.
6. Efficient Routing:
Aggregation of prefixes reduces the size of routing tables.
7. Multicast Support:
IPv6 supports multicast (one-to-many) instead of broadcast, improving network
efficiency.
8. Better Mobility Support:
Mobile IPv6 allows devices to move across networks while maintaining the same IP
address.
Types of IPv6 Addresses
1. Unicast – One-to-one communication.
2. Multicast – One-to-many communication.
3. Anycast – One-to-nearest communication (delivers to the closest node).
Unit-04
Transport Layer
Ques-Compare and contrast TCP and UDP protocols with respect to
reliability, connection, and speed. (IMP)
Ans:-
LePic
Feature TCP (Transmission Control UDP (User Datagram
Protocol) Protocol)
1. Connection Type Connection-oriented protocol. Connectionless protocol.
A connection is established No need to establish a
before data is sent. connection.
2. Reliability Reliable – ensures delivery using Unreliable – no guarantee
acknowledgments (ACK), of delivery, order, or
sequencing, and duplication control.
retransmissions.
3. Speed Slower due to error checking, Faster as it sends data
flow control, and connection without waiting for
setup overhead. acknowledgments or
establishing connections.
4. Error Control Has built-in error checking, Only has basic error
correction, and retransmission checking using checksum;
of lost packets. no retransmission.
5. Flow Control Uses flow control mechanisms No flow control
like sliding window to avoid mechanism. Packets may
congestion. be dropped if the receiver
is overwhelmed.
6. Ordering Ensures in-order delivery of data No guarantee of order;
packets. packets may arrive out of
sequence.
7. Use Cases Ideal for applications requiring Ideal for applications
reliability: email, web browsing needing speed: video
(HTTP/HTTPS), file transfer (FTP). streaming, online gaming,
VoIP, DNS.
Ques-Describe the TCP three-way handshake mechanism for connection
establishment. (IMP)
Ans:- The TCP three-way handshake is a method used in the Transport Layer to
establish a reliable connection between a client and a server before data transmission
begins. It ensures that both sides are synchronized and ready for communication.
Steps of the Three-Way Handshake
1. SYN (Synchronize) – Client → Server
The client initiates the connection by sending a SYN (synchronize) packet to the
server.
( )
LePic
This packet includes an initial sequence number (ISN) chosen by the client.
It tells the server: “I want to start communication and here’s my sequence number.”
2. SYN-ACK (Synchronize-Acknowledge) – Server → Client
The server receives the SYN packet.
It responds with a SYN-ACK packet.
SYN: with its own initial sequence number.
ACK: acknowledging the client’s sequence number by adding 1 (ACK = ISN_client +
1).
3. ACK (Acknowledge) – Client → Server
The client receives the SYN-ACK packet.
It sends an ACK packet back to the server.
Acknowledges the server’s ISN by sending (ACK = ISN_server + 1).
After this, the connection is established, and data can begin to flow.
Ques-What is Quality of Service (QoS) in Transport Layer? Explain its
parameters and importance. (IMP)
Ans:- Quality of Service (QoS) in the Transport Layer refers to the set of technologies and
mechanisms used to ensure the reliable and efficient delivery of data by managing
network resources and prioritizing traffic. QoS is especially important for applications
that require consistent performance, such as video conferencing, VoIP, and online
gaming.
Importance of QoS:
LePic
QoS helps in:
Ensuring minimum delay for time-sensitive data
Providing prioritization for critical applications
Managing bandwidth efficiently
Reducing packet loss, jitter, and latency
QoS Parameters in Transport Layer:
Parameter Description
Bandwidth The maximum rate of data transfer across a network path
(measured in Mbps or Gbps). High-bandwidth networks can carry
more data at once.
Latency The delay between sending and receiving data. Lower latency is
crucial for real-time apps like online gaming and VoIP.
Jitter The variation in packet arrival time. High jitter causes poor
audio/video quality in real-time apps.
Packet Loss Occurs when data packets are lost in transmission. A high packet
loss rate affects communication quality.
Error Rate The rate at which data packets are corrupted due to noise or
interference.
Throughput The actual rate at which useful data is transferred. It's affected by
bandwidth, latency, and packet loss.
Reliability Assurance that data is delivered accurately and completely, often
achieved using acknowledgment and retransmission mechanisms.
How Transport Layer Supports QoS:
TCP (Transmission Control Protocol) uses:
Flow control (to prevent congestion)
Error detection and correction
Retransmissions
UDP (User Datagram Protocol) offers low-latency communication but without
guaranteed delivery — suitable for media streaming where speed is prioritized over
accuracy.
Ques-Explain the basic responsibilities of the Transport Layer in the OSI
model.(IMP)
LePic
Ans:- The Transport Layer is the 4th layer of the OSI (Open Systems Interconnection)
model. Its main responsibility is to provide reliable data transfer between two devices
over a network. It serves as a bridge between the Application Layer and the Network
Layer.
Basic Responsibilities of the Transport Layer:
1. Segmentation and Reassembly
Breaks large data from the application layer into smaller segments.
At the receiving end, it reassembles the segments into the original message.
Adds headers to each segment to manage order and delivery.
Example: A video file is split into smaller chunks before transmission.
2. End-to-End Communication
Ensures that the data is delivered from the source process to the destination process
(not just host to host).
Uses port numbers to direct data to the correct application.
Example: HTTP uses port 80, and HTTPS uses port 443.
3. Error Detection and Correction
Detects errors using checksums in the transport header.
Some protocols (like TCP) can also correct errors by requesting retransmission.
4. Flow Control
Prevents the sender from overwhelming the receiver.
Uses mechanisms like sliding window protocols to control data flow.
5. Connection Establishment and Termination
TCP (Transmission Control Protocol) provides connection-oriented communication.
Uses a 3-way handshake to establish a connection and a 4-step process to
terminate it.
6. Reliable or Unreliable Delivery
TCP offers reliable, connection-oriented delivery with acknowledgment and
retransmission.
UDP (User Datagram Protocol) offers unreliable, connectionless delivery, faster but no
guarantees.
LePic
Ques-What is Congestion Control in TCP? Explain any two congestion
control techniques used in TCP. ([Link])
Ans:- Congestion Control in TCP is a network mechanism that prevents too much data
from being sent into the network too quickly, which could overwhelm routers and links,
leading to elays,packet loss, and network collapse.
When multiple devices transmit data simultaneously over a shared network, the limited
bandwidth and buffer capacities of intermediate routers may get exhausted. This results
in congestion, which causes:
Increased delays
Dropped packets
Reduced throughput
TCP (Transmission Control Protocol) uses congestion control algorithms to dynamically
adjust the rate of data transmission, ensuring fair usage of the network and maintaining
reliable data delivery
Two Congestion Control Techniques in TCP
1. Slow Start
Purpose: To prevent congestion when a TCP connection starts or after a timeout.
Mechanism:
TCP starts with a small congestion window (cwnd), usually 1 MSS (Maximum
Segment Size).
For every ACK received, the cwnd is increased by 1 MSS.
This causes exponential growth: cwnd = 1 → → → →
2 4 8 ...
This growth continues until either:
The ssthresh (slow start threshold) is reached→ then enters congestion
avoidance.
A packet loss is detected → enters fast retransmit and fast recovery.
Example:
Let’s say the initial cwnd = 1 MSS. After one RTT and successful ACKs:
RTT 1→cwnd = 1 MSS
RTT 2→ cwnd = 2 MSS
RTT 3→ cwnd = 4 MSS
And so on, doubling each time until ssthresh.
LePic
2. Congestion Avoidance (AIMD - Additive Increase Multiplicative
Decrease)
Once ssthresh is reached, TCP enters congestion avoidance phase.
Now, the cwnd increases linearly, not exponentially.
For every RTT where ACKs are received:
cwnd += 1 MSS → Additive Increase
If packet loss is detected (indicating congestion):
ssthresh = cwnd / 2
cwnd is reset to 1 MSS or halved→ Multiplicative Decrease
This AIMD behavior helps in probing the network capacity gently and backing off quickly
when congestion occurs.
Example:
If cwnd = 16 MSS and packet loss is detected:
ssthresh = 8 MSS
cwnd = 1 MSS (if timeout) or 8 MSS (if fast retransmit)
LePic
Then TCP resumes either with slow start or congestion avoidance.
Unit-05
Application Layer
Ques-What is the Domain Name System (DNS)? Explain its architecture
and working with an example. ([Link])
1. From user computer do a DNS query to ISP's recursive DNS server:
→ When a user enters a domain name (e.g., [Link]) into a web browser, their
computer sends a DNS query to their Internet Service Provider's (ISP) recursive DNS server.
The recursive DNS server is responsible for handling DNS queries on behalf of the user and
tries to resolve the domain name.
2. Do a DNS query to Root DNS server:
→ If the recursive DNS server doesn't have the IP address for the requested domain in its
cache, it starts the resolution process by querying the root DNS [Link] root DNS server
is the top-level server in the DNS hierarchy, and it contains information about the
authoritative DNS servers for top-level domains (TLDs), such as ".com," ".org," ".net," etc.
3. Ask .com server to ISP's recursive DNS server:
→ The root DNS server responds to the recursive DNS server's query with a referral to the
authoritative DNS server for the ".com" [Link] recursive DNS server then queries the ".com"
TLD DNS server for the IP address of the domain in question.
4. DNS query to Top Level domain DNS server ".com":
→ The ".com" TLD DNS server, in response to the query from the recursive DNS server,
provides a referral to the authoritative DNS server responsible for the specific domain, in
LePic
this case, "[Link]."
5. Ask DYN server to ISP's recursive DNS server:
→ The recursive DNS server queries the authoritative DNS server for "[Link]." The
authoritative DNS server for "[Link]" is often a Dynamic DNS (DYN) server that
contains the specific DNS records for the domain, such as A records (for IP addresses), MX
records (for mail servers), etc.
6. DNS query to Authoritative DYN DNS Server:
→ The authoritative DYN DNS server receives the query and looks up the requested DNS
record, such as the A record for "[Link]."
7. Authoritative response to ISP's recursive DNS server:
→ The authoritative DYN DNS server responds to the recursive DNS server with the
requested DNS record, which includes the IP address associated with "[Link]."
8. Response to user computer:
→ Finally, the recursive DNS server sends the IP address it received from the authoritative
DYN DNS server back to the user's computer. The user's computer can then use this IP
address to establish a connection to the web server hosting "[Link]."
DNS
→ DNS stands for Domain Name System.
→ It is used to translate human-readable domain names (like [Link]) into IP
addresses (like [Link]) that computers use to identify each other on the network.
→ Without DNS, users would have to remember long numeric IP addresses to access
websites.
DNS Architecture
→ DNS uses a hierarchical and distributed database system.
→ The main components are:
Domain Name Space:
→ It is a tree-like structure where each node is a domain.
→ The top is the root domain (.), followed by Top Level Domains (TLDs) like .com, .org,
.in, etc.
→ Below TLDs are second-level domains (like google in [Link]) and then
subdomains.
DNS Servers:
→ There are different types of DNS servers:
→ Root DNS Server:
→ Located at the top of the DNS hierarchy.
→ Directs queries to the correct TLD server.
→ TLD DNS Server:
→ Stores information about second-level domains under a specific TLD (like .com,
.net, etc.).
LePic
→ Authoritative DNS Server:
→ Contains actual IP address records for a specific domain.
→ Final source of truth in the DNS query process.
→ Local/Resolver DNS Server:
→ Usually maintained by ISPs.
→ Handles user queries and communicates with other DNS servers on behalf of the
user.
Ques-Describe the File Transfer Protocol (FTP). How does it establish and
manage connections for file transfer? ([Link])
=>What is FTP?
→ FTP stands for File Transfer Protocol.
→ It is a standard network protocol used to transfer files between a client and a server
over the internet or a local network.
LePic
→ FTP works at the Application Layer of the OSI model.
→ It uses TCP as the transport protocol to ensure reliable data transfer.
=>Ports Used by FTP
→ FTP uses two separate connections and two different ports:
→ Port 21: Used for control connection (commands and responses).
→ Port 20: Used for data connection (actual file transfer).
=>FTP Components
→ FTP Client: The user-side software used to request files (e.g., FileZilla).
→ FTP Server: The host machine that stores files and responds to client requests.
=> How FTP Establishes and Manages Connections
FTP uses two types of connections:
→ 1. Control Connection
→ This is established first over TCP port 21.
→ It remains open throughout the session.
→ It is used to send commands (like login, change directory) and receive responses.
→ Commands include: USER, PASS, LIST, CWD, QUIT, etc.
→ 2. Data Connection
→ This is created separately for each file transfer.
→ It is used to send or receive files, or directory listings.
→ Once the file is transferred, this connection is closed.
=>FTP Modes of Data Transfer
→ Active Mode
→ Server opens port 20 and connects back to the client to send data.
→ Requires the client to accept incoming connections.
→ Passive Mode
→ Server opens a random port for data transfer.
→ Client initiates both control and data connections.
→ Useful when the client is behind a firewall.
Ques-Explain the working of the Simple Mail Transfer Protocol (SMTP)
([Link])
LePic
=>What is SMTP?
→ SMTP stands for Simple Mail Transfer Protocol.
→ It is a standard protocol used to send emails from one computer to another over a
network.
→ SMTP works at the Application Layer of the OSI and TCP/IP models.
→ It uses TCP as the transport protocol, typically over port 25.
=> Role of SMTP
→ SMTP is responsible for:
→ Sending email from a client to a mail server.
→ Transferring email between mail servers.
→ It is only used for sending and not for retrieving emails (retrieving is done by POP3 or
IMAP).
=> SMTP Components
→ User Agent (UA): The email client (like Outlook, Thunderbird, or webmail).
→ Mail Transfer Agent (MTA): Software that transfers the message (like Sendmail or
Postfix).
→ Mail Server: Stores and forwards the emails.
=> SMTP Working
Example: User A sends an email to User B.
→ Step 1: User A composes and sends an email using a client (like Gmail or Outlook).
→ Step 2: The email client connects to the SMTP server using TCP port 25.
→ Step 3: SMTP establishes a connection and performs a handshake using the HELO
command.
LePic
→ Step 4: SMTP sends the email in steps:
→ MAIL FROM: specifies the sender’s email address.
→ RCPT TO: specifies the receiver’s email address.
→ DATA: sends the body/content of the message.
→ Step 5: After sending the message, SMTP ends the connection using the QUIT
command.
→ Step 6: The message is stored on the recipient’s mail server.
→ Step 7: User B retrieves the email using POP3 or IMAP.
=> SMTP Commands (Basic)
→ HELO <hostname> → Starts the communication.
→ MAIL FROM:<sender> → Specifies the sender’s email.
→ RCPT TO:<recipient> → Specifies the recipient’s email.
→ DATA → Starts the message body section.
→ QUIT → Ends the session.
Ques-What is SNMP (Simple Network Management Protocol)? Describe its
components and working model.([Link])
LePic
=> What is SNMP?
→ SNMP stands for Simple Network Management Protocol.
→ It is used for monitoring and managing devices on a network (like routers, switches,
servers, printers).
→ SNMP operates at the Application Layer of the OSI model.
→ It uses UDP as its transport protocol (typically port 161 for requests and port 162 for
traps).
=> Purpose of SNMP
→ SNMP helps network administrators to:
→ Monitor network performance.
→ Detect and solve network problems.
→ Manage configurations and device status remotely.
=> Components of SNMP
→ SNMP has three main components:
→ 1. SNMP Manager (NMS - Network Management Station)
→ This is a software application used by administrators.
→ It sends requests to network devices and receives responses or alerts.
→ Example: A central server in a data center.
→ 2. SNMP Agent
→ A program running on each network device (like routers or switches).
→ It collects device data and responds to SNMP manager’s requests.
→ Can also send trap messages (alerts) to the manager.
→ 3. Management Information Base (MIB)
→ A database that stores information about the device.
→ It defines what can be monitored or controlled.
→ Each piece of data is identified by a unique Object Identifier (OID).
=> Working Model of SNMP
→ SNMP works in a manager-agent model:
→ Step 1: The SNMP Manager sends a request to the Agent for information (e.g., CPU
usage, memory, uptime).
→ Step 2: The Agent checks the required data from the MIB.
LePic
→ Step 3: The Agent sends a response back to the Manager.
→ Step 4: If something unusual happens (e.g., device failure), the Agent sends a "Trap"
(alert) to the Manager automatically.
=> SNMP Basic Operations
→ GET → Request data from the agent.
→ SET → Modify a value in the agent (e.g., reset a device).
→ GETNEXT → Retrieve the next data item in the MIB.
→ TRAP → Unsolicited alert sent from agent to manager.
Ques-Discuss the need for data compression in networking. Explain any
two compression techniques.([Link])
=> What is Data Compression?
→ Data compression is the process of reducing the size of data for faster transmission
over a network.
→ It helps in sending more data using less bandwidth and reduces transmission time.
→ Compression can be applied to text, audio, video, or any digital content.
=> Need for Data Compression in Networking
→ Saves Bandwidth
→ Smaller files use less network space, allowing more users to share the network.
→ Faster Transmission
→ Less data means quicker transfer, improving performance and user experience.
→ Reduced Storage Requirements
→ Compressed data takes up less space on servers and devices.
→ Cost Efficiency
→ Lower bandwidth usage can reduce internet or data transfer costs.
→ Improves Performance in Low-Speed Networks
→ Compression is especially useful in slow or congested network conditions.
=> Types of Data Compression Techniques
1. Huffman Coding (Lossless Compression)
→ It is a lossless method (no data is lost during compression and decompression).
→ Frequently occurring characters are assigned shorter binary codes, while rare
characters get longer codes.
LePic
→ Example:
→ In the word "MISSISSIPPI", the letter 'S' appears more often than 'M', so 'S' gets a shorter
code.
→ Huffman coding creates a binary tree based on frequency and assigns codes
accordingly.
→ Used in: Text compression, ZIP files, etc.
2. Run Length Encoding (RLE)
→ Also a lossless compression method.
→ It replaces consecutive repeating characters or numbers with a single value and
count.
→ Example:
→ The string "AAABBBCC" becomes "3A3B2C" using RLE.
→ Best used in data with lots of repetition, like black-and-white images or simple
graphics.
→ Used in: Image compression formats like BMP, TIFF, etc.
Ques-What is Cryptography? Explain basic concepts and differences
between Symmetric and Asymmetric Encryption.([Link])
=> What is Cryptography?
→ Cryptography is the science of protecting information by converting it into an
unreadable format.
→ The main goal is to ensure data confidentiality, integrity, authenticity, and security
during communication.
→ It protects data from unauthorized access, especially during transmission over
insecure networks.
=> Basic Concepts of Cryptography
→ Plaintext:
→ The original readable message or data.
→ Ciphertext:
→ The scrambled (encrypted) version of the plaintext.
→ Encryption:
→ The process of converting plaintext into ciphertext using a key and algorithm.
→ Decryption:
→ The process of converting ciphertext back to plaintext using a key.
LePic
→ Key:
→ A secret value used in encryption and decryption. It can be shared or kept private.
=> Types of Encryption
Cryptography is mainly divided into two types:
A. Symmetric Encryption (Secret-Key Encryption)
→ Same single key is used for both encryption and decryption.
→ Both sender and receiver must share the same secret key in advance.
→ It is fast and efficient, suitable for encrypting large amounts of data.
→ Example Algorithms:
→ AES (Advanced Encryption Standard)
→ DES (Data Encryption Standard)
→ Example:
→ Sender encrypts message with a secret key → Sends ciphertext
→ Receiver uses the same key to decrypt the message.
B. Asymmetric Encryption (Public-Key Encryption)
→ Uses two different keys:
→ A public key (shared with everyone) and
→ A private key (kept secret by the owner).
→ One key is used for encryption, and the other for decryption.
→ It is slower but more secure, especially for sharing data over public networks.
→ Example Algorithms:
→ RSA (Rivest–Shamir–Adleman)
→ ECC (Elliptic Curve Cryptography)
→ Example:
→ Sender encrypts message using receiver’s public key
→ Receiver decrypts it using their private key
=> Difference Between Symmetric and Asymmetric Encryption
LePic
Feature Symmetric Encryption Asymmetric Encryption
Keys used One secret key (same for Two keys (public and
both) private)
Speed Faster Slower
Security Less secure if key is leaked More secure for public
communication
Key sharing Must be shared in No need to share private
advance key
Example Algorithms AES, DES RSA, ECC
Thankyou for Watching!!!!!
For notes visit-> [Link]