0% found this document useful (0 votes)
3 views78 pages

Computer Network Pyq

The document provides a comprehensive overview of the OSI and TCP/IP models, detailing the functions and services of each layer in the OSI model, which consists of seven layers, and the four-layer structure of the TCP/IP model. It also discusses various network devices, their roles, and the types of transmission media used in networking. Key differences between the OSI and TCP/IP models are highlighted, along with a summary of network devices and their functions.

Uploaded by

medhavib05
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views78 pages

Computer Network Pyq

The document provides a comprehensive overview of the OSI and TCP/IP models, detailing the functions and services of each layer in the OSI model, which consists of seven layers, and the four-layer structure of the TCP/IP model. It also discusses various network devices, their roles, and the types of transmission media used in networking. Key differences between the OSI and TCP/IP models are highlighted, along with a summary of network devices and their functions.

Uploaded by

medhavib05
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 78

COMPUTER NETWORK

PREVIOUS YEAR TOPICS

UNIT 1
OSI Reference Model: Layers, Functions, and Services
The OSI (Open Systems Interconnection) Reference Model is a conceptual framework that
standardizes the functions of a communication system into seven distinct layers. Each layer serves
the layer above it and is served by the layer below, enabling interoperability between different
systems and protocols268.

Overview of the 7 Layers


Layer Number Name Primary Function

7 Application User interface, network services for applications

6 Presentation Data translation, encryption, compression

5 Session Session management, synchronization

4 Transport Reliable delivery, segmentation, flow control

3 Network Logical addressing, routing

2 Data Link Framing, physical addressing, error detection

1 Physical Transmission of raw bits over physical medium

Detailed Layer-wise Functions and Services


1. Physical Layer (Layer 1)
• Function: Transmits raw bit streams over a physical medium (cables, radio, fiber optics)45.
• Services: Defines hardware specifications, transmission rates, network topologies (star, bus,
mesh), and transmission modes (simplex, half-duplex, full-duplex).
• Devices: Cables, hubs, repeaters, switches.
• Example Protocols: Ethernet physical standards, USB, Bluetooth.
2. Data Link Layer (Layer 2)
• Function: Converts raw transmission into structured frames, provides node-to-node data
transfer, and handles error detection/correction45.
• Services: Framing, physical addressing (MAC), error control, flow control, and access control.
• Devices: Switches, bridges.
• Example Protocols: Ethernet, PPP, HDLC.
3. Network Layer (Layer 3)
• Function: Handles routing of data (packets) across multiple networks using logical
addressing45.
• Services: Logical addressing (IP), routing, packet forwarding, fragmentation, and reassembly.
• Devices: Routers.
• Example Protocols: IP, ICMP, ARP.
4. Transport Layer (Layer 4)
• Function: Ensures reliable data transfer between end systems, provides segmentation and
reassembly, error and flow control46.
• Services: Service-point addressing (port numbers), segmentation, flow control, error control,
connection management, multiplexing.
• Example Protocols: TCP (reliable), UDP (unreliable).
5. Session Layer (Layer 5)
• Function: Establishes, manages, and terminates sessions between applications456.
• Services: Session establishment, maintenance, and termination; synchronization
(checkpoints); dialog control (half/full duplex).
• Example Protocols: NetBIOS, RPC.
6. Presentation Layer (Layer 6)
• Function: Translates, encrypts, and compresses data for the application layer456.
• Services: Data translation (syntax/semantics), encryption/decryption, compression.
• Example Protocols: SSL/TLS, JPEG, MPEG.
7. Application Layer (Layer 7)
• Function: Closest to the user; provides network services directly to applications456.
• Services: File transfers, email, network management, web browsing, and other end-user
services.
• Example Protocols: HTTP, FTP, SMTP, DNS, SNMP.

How the Layers Interact


• Encapsulation: Data is passed from the application down through each layer, with each layer
adding its own header (and sometimes trailer), forming a protocol data unit (PDU).
• Decapsulation: On the receiving side, each layer removes its corresponding header and
processes the data before passing it up to the next layer6.

Diagram of the OSI Model


A typical OSI model diagram is structured as follows:
text
+-------------------+
| 7. Application |
+-------------------+
| 6. Presentation |
+-------------------+
| 5. Session |
+-------------------+
| 4. Transport |
+-------------------+
| 3. Network |
+-------------------+
| 2. Data Link |
+-------------------+
| 1. Physical |
+-------------------+
Diagram Reference:
OSI Model Diagram - Hero Vired
OSI Model Diagram - Imperva

Key Points and Services


• Layer Independence: Each layer performs a specific function and communicates only with its
adjacent layers.
• Interoperability: The OSI model allows diverse systems and protocols to communicate by
standardizing network functions26.
• Protocol Examples: Each layer can use various protocols, as listed above, to implement its
functions.

Summary Table: OSI Layers, Functions, and Examples


Layer Function/Service Example Protocols/Devices

Application Network services to applications HTTP, FTP, SMTP, DNS

Presentation Data translation, encryption, compression SSL, JPEG, MPEG

Session Session management, synchronization NetBIOS, RPC

Transport Reliable delivery, segmentation, flow/error control TCP, UDP

Network Routing, logical addressing IP, ICMP, ARP, Routers

Data Link Framing, MAC addressing, error detection Ethernet, PPP, Switches

Physical Bit transmission, hardware interface Cables, Hubs, Repeaters

References
• Hero Vired: 7 Layers of OSI Model1
• Imperva: OSI Model Layers2
• BYJU'S: OSI Model5
• TechTarget: OSI Model Explained6

TCP/IP Model: Structure and Comparison with OSI Model


TCP/IP Model Structure
The TCP/IP model (also called the Internet Protocol Suite) is a four-layer framework that standardizes
network communication for the internet and most modern networks. Its layers are:
1. Network Access Layer (Link Layer):
• Handles the physical transmission of data over network hardware.
• Combines the functionalities of OSI’s Physical and Data Link layers.
• Examples: Ethernet, Wi-Fi, ARP.
2. Internet Layer:
• Responsible for logical addressing, routing, and packet forwarding.
• Equivalent to OSI’s Network layer.
• Examples: IP, ICMP, ARP.
3. Transport Layer:
• Ensures reliable or unreliable delivery of data between hosts.
• Equivalent to OSI’s Transport layer.
• Examples: TCP, UDP.
4. Application Layer:
• Provides network services directly to user applications.
• Combines OSI’s Application, Presentation, and Session layers.
• Examples: HTTP, FTP, SMTP, DNS12456.

Comparison: TCP/IP Model vs. OSI Model


Aspect OSI Model (7 Layers) TCP/IP Model (4 Layers)

Layer 7 Application Application

Layer 6 Presentation Application

Layer 5 Session Application

Layer 4 Transport Transport

Layer 3 Network Internet

Layer 2 Data Link Network Access (Link)

Layer 1 Physical Network Access (Link)

Developed by DARPA for the US


Development Developed by ISO for standardization Department of Defense

Protocol Protocol-independent, theoretical Protocol-oriented, based on real-world


Dependency reference model protocols

Each layer has distinct, well-defined Some OSI layers merged (e.g., Application,
Layer Functions functions Presentation, Session)

Mostly used for teaching and Used as the practical model for real-world
Usage conceptual understanding networking

HTTP (App), SSL (Pres), TCP (Trans), IP HTTP, FTP (App); TCP, UDP (Trans); IP
Examples (Net), etc. (Internet); Ethernet (Link)
Aspect OSI Model (7 Layers) TCP/IP Model (4 Layers)

Data encapsulated at each layer, but with


Encapsulation Data encapsulated at each layer fewer layers

Key Differences (Summary Table)


Criteria OSI Model (7 Layers) TCP/IP Model (4 Layers)

Number of Layers 7 4

Application, Presentation, Session,


Transport, Network, Data Link, Application, Transport, Internet, Network
Layer Names Physical Access

Application = Application + Presentation +


Session; Network Access = Data Link +
Layer Merging All layers separate Physical

Protocol
Specification Model first, then protocols Protocols first, then model

Standardization ISO/OSI DoD/ARPA (Internet)

Usage Conceptual, academic Practical, real-world implementation

Example
Protocols FTP, SMTP, TCP, IP, Ethernet HTTP, FTP, TCP, UDP, IP, Ethernet

Approach Theoretical, generic Protocol-specific, practical

Diagram Reference
• OSI vs TCP/IP Model Diagram (Simplilearn)
• TCP/IP Model Layers (A1 Digital)

In summary:
• The OSI model is a 7-layer theoretical framework for network communication, emphasizing
modularity and standardization.
• The TCP/IP model is a practical, 4-layer protocol suite used in real-world networking, with
some OSI layers merged for efficiency and simplicity12456.

Network Devices: Identification and Roles


Network devices are hardware components that connect computers and other electronic devices
together, enabling communication and resource sharing within and between networks. Below are
the most common network devices, their identification, and their specific roles:
1. Hub
• Identification: Simple, multi-port device operating at the Physical Layer (Layer 1) of the OSI
model.
• Role: Broadcasts incoming data to all connected devices, regardless of destination. Does not
filter or manage traffic.
• Types: Active (amplifies signals), Passive (does not amplify), Intelligent (offers basic
management).
• Usage: Rare in modern networks due to inefficiency and security risks; replaced by
switches358.

2. Switch
• Identification: Multi-port device operating at the Data Link Layer (Layer 2), sometimes at
Layer 3 (multilayer switch).
• Role: Forwards data only to the device with the destination MAC address, reducing
unnecessary traffic and collisions. Supports VLANs and network segmentation.
• Usage: Core device in LANs, enhances network efficiency and security145.

3. Bridge
• Identification: Device operating at the Data Link Layer (Layer 2).
• Role: Connects and filters traffic between two or more network segments, forwarding data
based on MAC addresses. Reduces collisions and divides large networks into manageable
sections.
• Usage: Used for segmenting networks and managing broadcast domains135.

4. Router
• Identification: Device operating at the Network Layer (Layer 3).
• Role: Connects different networks (e.g., LAN to WAN), routes data packets based on IP
addresses, manages broadcast domains, and can act as a firewall or VPN endpoint.
• Usage: Essential for internet connectivity and inter-network communication1345.

5. Gateway
• Identification: Operates across multiple OSI layers, often implemented in software or as a
combined device.
• Role: Translates data between different network protocols or architectures (e.g., TCP/IP to
ATM). Enables communication between networks using different technologies.
• Usage: Used for protocol conversion, security (firewall/proxy), and connecting dissimilar
networks135.

6. Network Interface Card (NIC)


• Identification: Hardware card installed in computers and devices.
• Role: Provides physical connection to the network, converts digital data to signals for
transmission, and has a unique MAC address.
• Types: Ethernet NIC (wired), Wi-Fi NIC (wireless).
• Usage: Required for any device to join a network3.
7. Repeater
• Identification: Device operating at the Physical Layer (Layer 1).
• Role: Regenerates and amplifies signals to extend network range, especially over long
distances.
• Usage: Used in large or extended network topologies to prevent signal loss58.

8. Modem
• Identification: Device that modulates and demodulates digital data over analog lines.
• Role: Converts digital signals from a computer to analog for transmission over telephone or
cable lines, and vice versa.
• Types: Cable, DSL, Optical, Dial-up, Satellite.
• Usage: Provides internet access over various media58.

9. Access Point
• Identification: Wireless device operating at the Data Link Layer (Layer 2).
• Role: Allows wireless devices to connect to a wired network using Wi-Fi.
• Usage: Central hub for wireless LANs in homes, offices, and public spaces8.

10. Firewall
• Identification: Hardware or software device.
• Role: Monitors and controls incoming and outgoing network traffic based on security rules.
Protects networks from unauthorized access.
• Usage: Essential for network security246.

11. Other Devices


• Proxy Server: Acts as an intermediary for requests from clients seeking resources from other
servers.
• Load Balancer: Distributes network or application traffic across multiple servers.

Summary Table: Network Devices and Their Roles


Device OSI Layer(s) Main Role/Function

Hub 1 (Physical) Broadcasts data to all devices

Switch 2 (Data Link) Forwards data to specific MAC addresses, reduces collisions

Bridge 2 (Data Link) Connects and filters between network segments

Router 3 (Network) Routes data between networks using IP addresses

Gateway Multiple Protocol conversion, connects dissimilar networks

NIC 1/2 (Physical/DL) Provides network interface for devices


Device OSI Layer(s) Main Role/Function

Repeater 1 (Physical) Regenerates signals to extend network range

Modem 1 (Physical) Converts digital/analog signals for internet access

Access Point 2 (Data Link) Enables wireless connectivity

Firewall Multiple Monitors and filters network traffic for security

Diagram Reference
For a visual overview of these devices and their placement in a network:
• Network Devices Diagram (Shiksha)
• Network Devices Diagram (Motadata)

In summary:
Network devices each have specialized roles in enabling, managing, securing, and optimizing data
flow within and between networks. Mastery of their functions and identification is fundamental for
understanding computer networks.

Transmission Media: Types and Characteristics


Transmission media are the physical pathways that connect computers, other devices, and people on
a network. They are responsible for carrying data signals from one point to another and can be
broadly classified into Guided (Wired) and Unguided (Wireless) media457.

A. Guided (Wired) Transmission Media


Guided media use physical conductors to guide the transmission of data signals. The main types are:
1. Twisted Pair Cable
• Structure: Two insulated copper wires twisted together.
• Types:
• Unshielded Twisted Pair (UTP): No additional shielding; commonly used in LANs and
telephone networks.
• Shielded Twisted Pair (STP): Includes a foil or braided shield for extra protection
against interference.
• Characteristics:
• Bandwidth: Moderate (up to 1 Gbps for Cat 5e/6).
• Distance: Short to medium (up to 100 meters without amplification).
• Cost: Low; easy to install45.
• Susceptibility: UTP is more prone to electromagnetic interference (EMI) than STP.
• Applications: LANs, telephone lines, DSL connections.
2. Coaxial Cable
• Structure: Central copper conductor, insulating layer, metallic shield, and outer jacket25.
• Types: Hardline, RG-6, Triaxial.
• Characteristics:
• Bandwidth: Higher than twisted pair (up to 10 Gbps).
• Distance: Longer than twisted pair; suitable for cable TV and broadband.
• Cost: Moderate; more expensive and bulkier than twisted pair.
• EMI Resistance: Good, due to shielding25.
• Applications: Cable TV, broadband internet, CCTV.
3. Optical Fiber Cable
• Structure: Core (glass/plastic), cladding, protective jacket25.
• Types: Single-mode (long distance), Multi-mode (shorter distance).
• Characteristics:
• Bandwidth: Very high (up to several Tbps).
• Distance: Very long (tens of kilometers without repeaters).
• Cost: Higher initial cost, but low maintenance.
• EMI Resistance: Immune to electromagnetic interference.
• Fragility: More fragile than copper cables25.
• Applications: Backbone of the internet, WANs, high-speed data transmission.
4. Stripline and Microstripline
• Structure: Used in printed circuit boards for high-frequency signals.
• Characteristics: Excellent EMI shielding (stripline), used in RF circuits and microwave
components4.

B. Unguided (Wireless) Transmission Media


Unguided media transmit data through the air or space without physical conductors. The main types
are:
1. Radio Waves
• Frequency: 3 kHz to 1 GHz.
• Characteristics: Omni-directional, can penetrate walls, suitable for long distances.
• Applications: AM/FM radio, cordless phones, Wi-Fi4.
2. Microwaves
• Frequency: 1 GHz to 300 GHz.
• Characteristics: Unidirectional, requires line-of-sight, high bandwidth.
• Applications: Satellite communication, cellular networks, microwave links4.
3. Infrared
• Frequency: 300 GHz to 400 THz.
• Characteristics: Short-range, cannot penetrate walls, no government licensing required.
• Applications: Remote controls, short-range communication (e.g., IrDA)4.
4. Satellite Communication
• Characteristics: Very long-distance coverage, high latency, expensive.
• Applications: Global broadcasting, GPS, remote area connectivity4.

Key Characteristics to Consider


• Bandwidth: Maximum data rate supported (higher is better for faster communication)3.
• Transmission Speed: How quickly data can be sent.
• Noise/Interference: Susceptibility to external electromagnetic signals.
• Distance: Maximum range before signal degradation.
• Cost: Installation, maintenance, and upgrade expenses.
• Installation Complexity: Ease or difficulty of deploying the medium.
• Security: Risk of unauthorized access or eavesdropping.

Comparison Table: Guided vs. Unguided Media


Media Type Bandwidth Distance EMI Cost Typical Use
Resistance

Twisted Pair Up to
(UTP) Moderate 100m Low Low LAN, Telephone

Twisted Pair Up to
(STP) Moderate 100m Moderate Moderate LAN, Industrial

Up to
Coaxial Cable High 500m High Moderate Cable TV, Broadband

Optical Fiber Very High >10 km Very High High Backbone, WAN, Data Centers

Radio Waves Moderate Long Low Low Wi-Fi, Radio, Broadcasting

Microwaves High Long (LOS) Moderate High Satellite, Cellular, Backbone

Remote Controls, Short-range


Infrared Low Short High Low Comm.

Diagram Reference
For visuals of each transmission medium and their structure:
• Transmission Media Diagram – PyNetLabs
• Types of Transmission Media – Shiksha

Summary:
Transmission media are the foundation of data communication. Guided media (twisted pair, coaxial,
fiber optic) are used for wired connections, each with unique characteristics in terms of bandwidth,
cost, and EMI resistance. Unguided media (radio, microwave, infrared, satellite) enable wireless
communication, each suitable for specific applications and environments.

Basic Network Concepts: Goals, Categories, Architecture, Protocols

1. Goals of Computer Networks


Computer networks are designed with several core objectives in mind:
• Resource Sharing: Enable multiple users to share hardware (printers, storage), software, and
data efficiently235.
• Reliability: Provide backup paths and redundancy to ensure continuous operation in case of
failures2.
• Scalability: Allow easy addition of new devices and users without major changes to the
network5.
• Cost Efficiency: Reduce costs by sharing resources instead of duplicating them2.
• Communication: Facilitate fast and reliable data exchange between users, applications, and
devices34.
• Centralized Management: Allow centralized control, monitoring, and security of resources
and data5.
• Security: Protect data and resources through access control, encryption, and monitoring5.

2. Categories of Computer Networks


Networks can be classified based on their size, range, and purpose42:
Category Full Form Coverage Area Example Use Case

PAN Personal Area Net. Few meters Bluetooth between phone & headset

LAN Local Area Net. Room/building/campus Office, school, home

MAN Metropolitan Area City/metropolitan City-wide Wi-Fi, cable TV

WAN Wide Area Net. Country/worldwide Internet, multinational companies

• Other Categories: CAN (Campus Area Network), SAN (Storage Area Network), WLAN
(Wireless LAN).

3. Network Architecture
Network architecture refers to the design and structure of a computer network, including its physical
and logical layout, protocols, and operational procedures5.
Key Components:
• Nodes: Devices like computers, printers, servers, routers, switches25.
• Links: Physical (cables, fiber) or wireless connections between nodes5.
• Topology: The arrangement of nodes and links (e.g., bus, star, ring, mesh).
• Addressing: Numeric (IP address) or mnemonic (domain names) identifiers for nodes6.
• Interconnections: Network interface cards (NICs), connectors, and media2.
Types of Architecture:
• Peer-to-Peer (P2P): All nodes act as both clients and servers; suitable for small networks.
• Client-Server: Dedicated servers provide services to client devices; scalable and secure.

4. Network Protocols
Protocols are standardized rules that define how data is transmitted and received across a
network345.
Key Protocols by Layer:
Layer Protocols & Examples Function

Application HTTP, FTP, SMTP, DNS Web, file transfer, email, name resolution
Layer Protocols & Examples Function

Transport TCP, UDP Reliable/unreliable data delivery

Network IP, ICMP, ARP, RIP, OSPF Addressing, routing, diagnostics

Data Link Ethernet, PPP, HDLC Framing, MAC addressing, error detection

Physical IEEE 802.3 (Ethernet), USB Transmission of raw bits

Protocol Functions:
• Addressing: Assigns unique identifiers to devices (IP, MAC).
• Routing: Determines best path for data (RIP, OSPF).
• Error Handling: Detects and corrects errors (TCP, Ethernet CRC).
• Flow Control: Manages data rate between sender and receiver (TCP).
• Security: Ensures data confidentiality and integrity (SSL/TLS).

Summary Table: Basic Network Concepts


Aspect Description/Examples

Goals Resource sharing, reliability, scalability, cost efficiency, communication

Categories PAN, LAN, MAN, WAN

Architecture Nodes, links, topology, addressing, peer-to-peer, client-server

Protocols HTTP, TCP/IP, Ethernet, DNS, SMTP, ARP, OSPF, etc.

Diagram Reference
For a visual overview of network categories and architectures:
• Cisco Networking Basics Diagram
• BYJU’S Network Types Diagram

In summary:
Computer networks are structured systems designed to share resources, ensure reliable
communication, and support scalability and security. They are categorized by size and purpose,
architected through nodes and links, and operate using standardized protocols at every layer to
ensure interoperability and efficiency23456.

Physical Layer: Topologies, Encoding, and Impairments

1. Network Topologies
Network topology refers to the physical or logical arrangement of devices (nodes) and cables in a
network. The physical layer defines how devices are physically connected.
Major Physical Topologies
Topology Description Advantages Disadvantages

All devices share a single backbone Collisions, difficult


cable. Data sent by any device is Simple, low cost, easy troubleshooting, single point
Bus available to all. to extend of failure356

All devices connect to a central Easy to manage,


hub/switch. Communication passes scalable, failure Hub failure disables network,
Star through the hub. isolation more cabling needed35

Each device connects to two others, Predictable


forming a closed loop. Data travels performance, easy Failure in any device breaks
Ring in one direction. fault isolation the ring, hard to expand5

Every device connects to every High reliability, robust, Expensive, complex cabling,
Mesh other device (full or partial mesh). no single point failure difficult management235

Scalable, easy to
Hierarchical, combining manage, supports Root failure affects entire
Tree characteristics of star and bus. future growth network, complex5

Flexible, scalable,
Combination of two or more customized for Complex design and
Hybrid topologies (e.g., star-bus, star-ring). requirements management57

Point-to- Not scalable, only two


Point Direct link between two devices. Simple, fast, secure devices5

Daisy Devices connected in series (linear Simple, easy to add Failure splits network, not
Chain fashion). devices robust5

Diagram Reference:
• Types of Network Topologies – Shiksha
• UniNets Topology Diagrams

2. Encoding Techniques
Encoding is the process of converting digital data into signals suitable for transmission over the
physical medium.
Common Encoding Methods
• NRZ (Non-Return to Zero): 1 = High voltage, 0 = Low voltage; no transition for same bits.
• Manchester Encoding: Each bit has a transition in the middle; 1 = low to high, 0 = high to
low. Used in Ethernet.
• Differential Manchester Encoding: Transition at the start of a bit period represents 0 or 1.
• 4B/5B Encoding: Groups of 4 bits mapped to 5-bit codes to ensure enough transitions.
• AMI (Alternate Mark Inversion): 0 = no voltage, 1 = alternating positive/negative voltage.
Purpose of Encoding:
• Synchronization between sender and receiver.
• Error detection.
• Efficient use of bandwidth.
Diagram Reference:
• Manchester Encoding Diagram (GeeksforGeeks)

3. Transmission Impairments
Impairments are physical phenomena that degrade the quality of the transmitted signal.
Types of Impairments
• Attenuation: Loss of signal strength as it travels through the medium.
Solution: Use amplifiers or repeaters.
• Noise: Unwanted electrical signals that mix with the original signal.
• Types: Thermal noise, crosstalk, impulse noise.
Solution: Shielded cables, error detection/correction.
• Distortion: Change in signal shape due to different propagation speeds for different
frequencies.
Solution: Use equalizers, proper cable types.
• Delay: Time taken for a signal to travel from sender to receiver.
Solution: Use faster transmission media.
• Collision: When two devices send signals simultaneously on the same medium, causing data
corruption (common in bus topology).
Solution: Use collision detection (CSMA/CD), switches.

Summary Table: Topologies, Encoding, and Impairments


Aspect Key Points

Topologies Bus, Star, Ring, Mesh, Tree, Hybrid, Point-to-Point, Daisy Chain

Encoding NRZ, Manchester, Differential Manchester, 4B/5B, AMI

Impairments Attenuation, Noise, Distortion, Delay, Collision

In summary:
The physical layer defines how devices are physically connected (topology), how data is encoded for
transmission, and must address impairments that can degrade signal quality. Understanding these
aspects is essential for designing robust and efficient networks.

Layer Responsibilities: Physical, Data Link, Network, and Transport Layers


The OSI model divides network communication into seven layers, each with well-defined
responsibilities. Here’s an in-depth look at the four foundational layers, focusing on their specific
functions and roles:

1. Physical Layer (Layer 1)


Responsibilities:
• Transmission and Reception of Raw Bits: Converts digital data into electrical, optical, or
radio signals for transmission over the physical medium and vice versa.
• Hardware Specifications: Defines characteristics of cables, connectors, voltage levels, timing,
and data rates.
• Topology and Physical Network Design: Determines physical layout (bus, star, ring, etc.) and
how devices are physically connected.
• Data Encoding and Signaling: Specifies how bits are represented (e.g., voltage levels,
modulation).
• Bit Synchronization: Ensures sender and receiver are synchronized at the bit level.
• Transmission Mode: Supports simplex, half-duplex, or full-duplex communication.
• Physical Medium: Works with copper wires, fiber optics, wireless, etc.
Summary:
The physical layer is responsible for the actual movement of bits across a physical medium, defining
all mechanical and electrical specifications5236.

2. Data Link Layer (Layer 2)


Responsibilities:
• Framing: Packages raw bits from the physical layer into structured frames.
• Physical Addressing: Adds MAC addresses to frames for node-to-node delivery within the
same network segment.
• Error Detection and Correction: Detects and may correct errors that occur in the physical
layer.
• Flow Control: Prevents fast senders from overwhelming slow receivers.
• Access Control: Determines which device has control over the shared medium (important in
LANs).
• Link Management: Establishes and terminates logical links between nodes.
• Sub-layers:
• MAC (Media Access Control): Controls how devices gain access to the medium.
• LLC (Logical Link Control): Manages frame synchronization, flow, and error checking.
Summary:
The data link layer ensures reliable transmission of frames between two directly connected nodes
and handles errors and flow control536.

3. Network Layer (Layer 3)


Responsibilities:
• Logical Addressing: Assigns and manages logical addresses (IP addresses) for devices.
• Routing: Determines the best path for data to travel from source to destination across
multiple networks.
• Packet Forwarding: Forwards packets based on logical addresses.
• Fragmentation and Reassembly: Splits large packets into smaller ones for transmission and
reassembles them at the destination.
• Congestion Control: Manages traffic to prevent overload on network paths (in some
protocols).
• Inter-networking: Connects and manages multiple networks.
Summary:
The network layer is responsible for moving packets between any two networks using logical
addressing and routing5372.

4. Transport Layer (Layer 4)


Responsibilities:
• Segmentation and Reassembly: Breaks down large messages into smaller segments and
reassembles them at the destination.
• End-to-End Communication: Ensures complete data transfer between source and
destination processes.
• Connection Management: Establishes, maintains, and terminates logical connections
(sessions) between hosts.
• Flow Control: Manages the rate of data transmission to prevent buffer overflow.
• Error Detection and Recovery: Detects lost or corrupted segments and requests
retransmission if necessary.
• Multiplexing: Allows multiple applications to use the network simultaneously by assigning
port numbers.
• Reliable/Unreliable Delivery: Provides reliable (TCP) or unreliable (UDP) data delivery.
Summary:
The transport layer ensures reliable, orderly, and error-checked delivery of data between end
systems, managing segmentation, flow, and error control5372.

Summary Table: Layer Responsibilities


Layer Key Responsibilities

Physical Transmits raw bits, hardware specs, encoding, topology, synchronization

Data Link Framing, MAC addressing, error detection/correction, flow control, access control

Logical addressing, routing, packet forwarding, fragmentation, congestion control, inter-


Network networking

Transport Segmentation, end-to-end delivery, connection management, flow/error control, multiplexing

References:
• [Imperva OSI Model]1
• [Hero Vired OSI Layers]2
• [Corero OSI Model]5
• [AWS OSI Model]7
These four layers form the foundation of reliable, efficient, and scalable network communication.
UNIT 2
Framing Techniques: Character Count, Byte Stuffing, Bit Stuffing
Framing is a key function of the Data Link Layer, which encapsulates network layer packets into
frames for reliable and organized transmission over the physical medium. The main challenge in
framing is to distinguish the start and end of each frame within a continuous stream of bits125.

1. Character Count (Length Field) Method


Concept:
• The frame begins with a field specifying the number of characters (bytes) in the frame.
• The receiver reads the count to determine the frame boundary.
How It Works:
• The first field in the frame header indicates the total length of the frame.
• The receiver reads as many bytes as specified by the length field to extract the frame.
Advantages:
• Simple to implement.
• No need for special delimiter characters.
Disadvantages:
• If the length field is corrupted, frame boundaries are lost, leading to synchronization errors.
Usage:
• Used in protocols like Ethernet (IEEE 802.3) where a length field is included in the header12.

2. Byte Stuffing (Character-Oriented Framing)


Concept:
• Special characters (flag bytes) are used to mark the start and end of a frame.
• If the flag character appears in the data, an escape character is inserted before it (stuffing).
How It Works:
• A unique flag byte (e.g., 01111110 or ASCII DLE STX/DLE ETX) marks frame boundaries.
• If the flag or escape character appears in the payload, an extra escape byte is inserted before
it.
• The receiver removes the escape character during extraction (de-stuffing).
Advantages:
• Simple to implement for character-based data.
Disadvantages:
• Inefficient for binary data.
• Increases frame size if many escape sequences are needed.
Usage:
• Used in character-oriented protocols like PPP, SLIP12.

3. Bit Stuffing (Bit-Oriented Framing)


Concept:
• A special bit pattern (flag, e.g., 01111110) marks the start and end of a frame.
• If the flag pattern appears in the data, an extra bit is inserted to prevent confusion.
How It Works:
• Whenever the sender's data contains five consecutive 1s, a 0 is inserted after them.
• The receiver removes the stuffed 0 after five consecutive 1s.
• This ensures the flag pattern never appears in the data, only as a delimiter.
Advantages:
• Efficient for binary data.
• No restriction on data content.
Disadvantages:
• Slight increase in data size due to stuffing bits.
Usage:
• Used in bit-oriented protocols like HDLC, SDLC125.

Summary Table: Framing Techniques


Technique Delimiter Stuffing Typical Use Pros Cons
Type Mechanism

Character Ethernet, Corruption loses


Count Length field None ATM Simple sync

Insert escape Easy for text Inefficient for binary


Byte Stuffing Special byte character PPP, SLIP data data

Insert 0 after five Works for any Slightly increases


Bit Stuffing Bit pattern 1s HDLC, SDLC data frame size

Diagram References
• Framing Techniques Diagrams – Tutorialspoint
• Framing Techniques Video Explanation – YouTube

In summary:
• Character count uses a length field to define frame boundaries.
• Byte stuffing inserts escape characters to distinguish data from delimiters.
• Bit stuffing inserts extra bits to prevent confusion with frame flags.
These techniques ensure frames are correctly identified and extracted, enabling reliable data
transfer at the Data Link Layer12.
Error Detection Methods: Parity, CRC, Checksum
Error detection is essential in computer networks to ensure data integrity during transmission. It
involves adding redundant information to data so that the receiver can detect (and sometimes
correct) errors introduced by noise, interference, or other impairments. The most common methods
are Parity Check, Cyclic Redundancy Check (CRC), and Checksum.

1. Parity Check
Principle:
A parity bit is added to a data unit to make the total number of 1s either even (even parity) or odd
(odd parity).
Types:
• Even Parity: The parity bit is set so the total number of 1s is even.
• Odd Parity: The parity bit is set so the total number of 1s is odd.
How it works:
• Sender: Counts the number of 1s in the data. Sets the parity bit to ensure the total is even
(for even parity) or odd (for odd parity).
• Receiver: Counts the number of 1s (including the parity bit). If the count does not match the
expected parity, an error is detected.
Strengths:
• Simple and fast.
• Detects all single-bit errors.
Limitations:
• Cannot detect all burst errors (multiple bits flipped).
• Not suitable for high-reliability requirements.
Example:
Data: 1011001 (four 1s, even parity) → Parity bit = 0 → Transmitted: 10110010
If a single bit changes, the parity will not match and the error is detected34.

2. Cyclic Redundancy Check (CRC)


Principle:
Treats the data as a polynomial and divides it by a generator polynomial. The remainder (CRC bits) is
appended to the data. The receiver repeats the division to check for errors.
How it works:
• Sender:
• Chooses a generator polynomial (e.g., 1001).
• Performs binary division of the data by the generator.
• Appends the remainder (CRC) to the data (forming a codeword).
• Receiver:
• Divides the received codeword by the same generator.
• If the remainder is zero, no error is detected; otherwise, an error is present.
Strengths:
• Very effective at detecting burst errors.
• Used in protocols like Ethernet, HDLC.
Limitations:
• Does not correct errors, only detects.
• Slightly more complex to implement than parity or checksum.
Example:
Data: 1101011011, Generator: 10011
• Sender divides data by generator, appends remainder.
• Receiver checks if received data (including CRC) is divisible by generator with zero
remainder34.

3. Checksum
Principle:
The data is divided into equal-sized segments. All segments are added using one’s complement
arithmetic. The sum is complemented and sent as the checksum.
How it works:
• Sender:
• Divides data into segments (e.g., 16 bits each).
• Adds all segments using one’s complement addition.
• Takes the one’s complement of the result (checksum) and appends it to the data.
• Receiver:
• Adds all received segments (including checksum).
• If the sum (with one’s complement) is all 1s (zero after complement), data is
considered error-free.
Strengths:
• Simple to implement.
• Detects most common errors, especially in software (e.g., TCP/IP).
Limitations:
• Less robust than CRC for burst errors.
• Does not correct errors.
Example:
Data segments: 10101010, 11001100
• Sum: 10101010 + 11001100 = 101011110 (carry wrapped around)
• One’s complement: 01010001 (checksum)
• Transmitted data: 10101010 11001100 01010001
• Receiver adds all three and checks for all 1s4.

Summary Table: Error Detection Methods


Method Principle Detects Strengths Limitations

Single-bit
Parity Adds parity bit errors Simple, fast Not for burst errors

Highly robust, used in More complex, no


CRC Polynomial division Burst errors HW correction

Segment sum + Simple, used in


Checksum complement Most errors software Less robust than CRC

References
• [Tutorialspoint: Error Detection and Correction]3
• [RF Wireless World: Error Detection Methods]4
• [Wikipedia: Error Detection and Correction]5
• [CCBP: Error Detection and Correction]1

In summary:
• Parity is best for simple, single-bit error detection.
• CRC is highly effective for burst errors and widely used in hardware protocols.
• Checksum is simple and effective for detecting errors in software-based transmissions like
TCP/IP.
For diagrams and more examples:
• Tutorialspoint Error Detection Diagrams
• YouTube: Methods of Error Detection
Error Correction Methods: Hamming Code and Forward Error Correction

**1. Hamming Code


Definition:
Hamming code is a block error-correcting code that can detect up to two simultaneous bit errors and
correct single-bit errors in transmitted or stored data12457.
How It Works:
• Redundant (Parity) Bits: Extra bits are inserted at specific positions (powers of 2) within the
original data to enable error detection and correction237.
• Redundancy Calculation: The number of redundant bits, rr, for mm data bits is determined
by:
2r≥m+r+12r≥m+r+1
• Encoding:
• Data and parity bits are interleaved.
• Each parity bit covers a unique combination of data bits.
• Transmission:
• The sender transmits the codeword (data + parity bits).
• Decoding and Correction:
• The receiver recalculates parity bits and compares them with received parity bits.
• If a single-bit error is detected, the exact position is identified by the "syndrome"
(binary value from parity checks)56.
• The erroneous bit is flipped to correct the error.
Example (Hamming(7,4)):
• 4 data bits, 3 parity bits → 7 total bits.
• Can correct all single-bit errors and detect all double-bit errors.
SECDED (Single Error Correction, Double Error Detection):
• Adding one more overall parity bit allows detection of double-bit errors in addition to single-
bit correction16.
Applications:
• Used in ECC RAM, digital communications, and storage systems.
Diagram Reference:
• Hamming Code Error Correction Flowchart (Number Analytics)

**2. Forward Error Correction (FEC)


Definition:
Forward Error Correction is a technique where the sender adds redundant data (error-correcting
codes) so the receiver can detect and correct errors without needing retransmission1.
How It Works:
• Redundant Information: Extra bits are systematically added to the message using algorithms
(e.g., Hamming, Reed-Solomon, Convolutional codes)12.
• Receiver Correction: The receiver uses this redundancy to automatically detect and correct
errors, improving reliability over noisy channels.
• No Retransmission Needed: Unlike error detection methods that require retransmission, FEC
allows for real-time correction.
Types of FEC Codes:
• Block Codes: Data is divided into fixed-size blocks, and redundancy is added (e.g., Hamming
code, Reed-Solomon)2.
• Convolutional Codes: Redundant bits are generated by applying a sliding window function to
the data stream.
Advantages:
• Essential for real-time or high-latency environments (e.g., satellite, deep-space, streaming).
• Reduces the need for retransmissions, increasing throughput.
Applications:
• Wireless communication, satellite links, digital TV, storage devices.

Summary Table: Hamming Code vs. General FEC


Method Type Error Capability How Correction Works Typical Use Cases

Hamming Corrects 1-bit, Parity bits identify error RAM, digital comms,
Code Block FEC detects 2 position; flip bit storage

Varies (depends on Redundant bits allow receiver Wireless, satellite,


General FEC Block/Conv. code) to fix errors streaming

In Summary:
• Hamming code is a classic block FEC code that enables single-bit error correction and
double-bit error detection by inserting parity bits at calculated positions1257.
• Forward Error Correction (FEC) is a broad principle of adding redundancy to data so the
receiver can correct errors autonomously, crucial for reliable, real-time data transmission in
noisy or high-latency environments12.
For step-by-step examples and diagrams:
• Hamming Code Tutorial (Tutorialspoint)
• Hamming Code Error Correction Flowchart (Number Analytics)
Flow Control Protocols: Stop-and-Wait & Sliding Window
Flow control protocols ensure that a sender does not overwhelm a receiver by sending data faster
than it can be processed. The two fundamental flow control protocols are Stop-and-Wait and Sliding
Window.

1. Stop-and-Wait Protocol
Concept:
• The sender transmits one frame at a time and waits for an acknowledgment (ACK) from the
receiver before sending the next frame123457.
• If the ACK is not received within a timeout period, the sender retransmits the frame.
Operation Steps:
1. Sender sends a data frame to the receiver.
2. Sender stops and waits for an ACK.
3. Receiver receives the frame, processes it, and sends an ACK.
4. Upon receiving the ACK, the sender sends the next frame.
5. If the sender does not receive an ACK within a timeout, it retransmits the frame123457.
Key Features:
• Simple to implement and reliable.
• Used in both data link and transport layers.
• Ensures that data is not lost or duplicated.
Advantages:
• Accurate delivery: Each frame is acknowledged before the next is sent, minimizing loss25.
• Simplicity: Easy to implement and understand35.
Drawbacks:
• Inefficient for long-distance or high-latency links: The sender is idle while waiting for ACK,
leading to poor link utilization25.
• Low throughput: Only one frame is in transit at any time.
Diagram Reference:
• Stop-and-Wait Protocol Diagram – Tutorialspoint

2. Sliding Window Protocol


Concept:
• The sender can transmit multiple frames before needing an acknowledgment, up to a
specified window size.
• The receiver can receive frames out of order and buffer them until missing frames arrive.
Operation Steps:
1. Both sender and receiver maintain a window of sequence numbers.
2. Sender can send several frames (equal to window size) without waiting for ACKs.
3. As ACKs are received, the window slides forward, allowing more frames to be sent.
4. Receiver sends ACKs for correctly received frames and manages its own window for expected
frames.
Types:
• Go-Back-N: If a frame is lost or erroneous, all subsequent frames are retransmitted.
• Selective Repeat: Only the erroneous or lost frames are retransmitted.
Key Features:
• Efficient use of bandwidth: Multiple frames in transit, maximizing link utilization.
• Higher throughput than Stop-and-Wait.
Advantages:
• Better performance on high-latency or long-distance links.
• Allows for pipelining of frames, improving overall data rate.
Drawbacks:
• More complex to implement (requires sequence numbers, buffering, and management of
windows).
Diagram Reference:
• Sliding Window Protocol Diagram – GeeksforGeeks
Comparison Table: Stop-and-Wait vs. Sliding Window
Feature Stop-and-Wait Sliding Window

Frames in
Transit One at a time Multiple (up to window size)

Low (idle time waiting for


Efficiency ACKs) High (continuous transmission)

Complexity Simple More complex (requires window management)

Throughput Low High

Use Case Simple, low-latency links High-latency or high-bandwidth links

Retransmit single frame if Go-Back-N: retransmit from error; Selective Repeat:


Error Handling lost retransmit only lost frames

Summary
• Stop-and-Wait is simple and reliable but inefficient for modern high-speed networks.
• Sliding Window protocols maximize throughput and are widely used in real-world networks
(e.g., TCP uses a sliding window mechanism).
References:
123457

Medium Access Protocols: ALOHA, CSMA/CD, CSMA/CA


Medium Access Control (MAC) protocols manage how multiple devices share a common
communication channel to avoid collisions and maximize efficiency. The most important random
access protocols are ALOHA, CSMA/CD, and CSMA/CA.

1. ALOHA Protocol
Overview:
• Developed for wireless LANs and satellite networks.
• Allows stations to transmit whenever they have data, leading to possible collisions.
Types:
• Pure ALOHA:
• Stations transmit data whenever they have data to send.
• If a collision occurs, the station waits a random time and retransmits.
• Vulnerable time is twice the frame time.
• Maximum throughput: 18.4% (S-max = 0.184 when G = 0.5)6.
• Slotted ALOHA:
• Time is divided into slots; stations can only transmit at the start of a slot.
• Reduces collision window compared to Pure ALOHA.
• Maximum throughput: 36.8% (S-max = 0.368 when G = 1)6.
Key Points:
• Simple, but high collision probability.
• No carrier sensing; all stations are equal.
• Used in environments with uncoordinated devices26.

2. CSMA/CD (Carrier Sense Multiple Access with Collision Detection)


Overview:
• Used in traditional wired Ethernet networks.
• Devices sense the channel before transmitting (“sense before transmit”).
Working:
• A station listens to the channel.
• If the channel is idle, it transmits.
• If the channel is busy, it waits until it is free.
• While transmitting, the station monitors the channel for collisions.
• If a collision is detected, transmission stops, and a jam signal is sent.
• The station waits a random backoff time before retrying2456.
Persistence Methods:
• 1-persistent: Transmit immediately when idle.
• Non-persistent: Wait random time before checking again.
• P-persistent: Transmit with probability p when idle, else wait.
Key Points:
• Reduces collisions compared to ALOHA.
• Throughput is higher than ALOHA.
• Still possible to have collisions due to propagation delay456.

3. CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance)


Overview:
• Used in wireless networks (e.g., Wi-Fi/IEEE 802.11).
• Collisions cannot be detected easily, so the protocol aims to avoid them.
Working:
• A station senses the channel before transmitting.
• If the channel is idle, it waits for a random backoff period (contention window) before
transmitting.
• If the channel is busy, it waits for it to become idle, then waits an additional Inter-Frame
Space (IFS) before attempting to transmit.
• Uses acknowledgments to confirm successful transmission.
• Optional RTS/CTS (Request to Send/Clear to Send) handshake can further reduce collisions.
Key Points:
• Focuses on avoiding, rather than detecting, collisions.
• Essential in wireless networks where collision detection is not feasible26.
• Uses techniques like IFS, contention window, and ACKs for reliability.

Comparison Table: ALOHA vs. CSMA/CD vs. CSMA/CA


Feature ALOHA CSMA/CD CSMA/CA
Feature ALOHA CSMA/CD CSMA/CA

Yes (before and


Channel Sensing No during TX) Yes (before TX)

Collision
Detection No Yes No (collision avoidance)

Collision Retransmit after Stop, jam, backoff,


Handling random retry Backoff, avoid, use ACKs

Throughput Low Moderate-High Moderate

Wired LANs
Use Case Satellite, simple LANs (Ethernet) Wireless LANs (Wi-Fi)

Pure: 18.4%, Slotted: Lower than CSMA/CD, but needed


Efficiency 36.8% Higher than ALOHA for wireless

References for Diagrams and Further Reading


• StudyTonight: Random Access Protocols
• BYJU’S: Multiple Access Protocols
• Sanfoundry: Random Access Protocols

Summary:
• ALOHA is simple but inefficient due to high collision probability.
• CSMA/CD improves efficiency by sensing the channel and detecting collisions, suitable for
wired networks.
• CSMA/CA is designed for wireless networks, using strategies to avoid rather than detect
collisions, ensuring reliable communication where collision detection is impractical.
LAN Standards: Ethernet and Wi-Fi Basics

Ethernet (IEEE 802.3)


Overview:
Ethernet is the most widely used LAN technology, defined by the IEEE 802.3 standard. It uses a
variety of media (coaxial, twisted pair, fiber optic) and supports speeds from 10 Mbps up to 100 Gbps
and beyond. Ethernet operates using the CSMA/CD protocol for shared media access, though
modern networks typically use switches and full-duplex operation, eliminating collisions145.
Ethernet Naming Convention:
• Format: [Speed][Base][Media/Distance]
• Example: 100Base-TX
• 100: 100 Mbps
• Base: Baseband signaling
• TX: Twisted-pair cable
Common Ethernet Standards:
Standard IEEE Spec Cable/Media Data Rate Max Distance

10Base5 802.3 Coaxial (RG-8) 10 Mbps 500 meters

10Base2 802.3a Coaxial (RG-58) 10 Mbps 200 meters

10Base-T 802.3i UTP (Cat 3) 10 Mbps 100 meters

100Base-TX 802.3u UTP (Cat 5) 100 Mbps 100 meters

100Base-FX 802.3u Fiber (MMF/SMF) 100 Mbps 2–10 km

1000Base-T 802.3ab UTP (Cat 5e/6) 1 Gbps 100 meters

1000Base-SX 802.3z Fiber (MMF) 1 Gbps 550 meters

10GBase-T 802.3an UTP (Cat 6A) 10 Gbps 100 meters

40/100GBase 802.3ba/bj Fiber/Copper 40/100 Gbps up to 100 km

Key Features:
• Topology: Star (modern), bus (legacy)
• Access Method: CSMA/CD (Carrier Sense Multiple Access with Collision Detection)
• Frame Structure: Preamble, destination MAC, source MAC, type/length, data, CRC
• MAC Address: Unique 48-bit hardware address3
• Duplex Modes: Half and full duplex
Applications:
Office LANs, data centers, campus networks, industrial automation

Wi-Fi (IEEE 802.11) Basics


Overview:
Wi-Fi is the common name for wireless LANs based on the IEEE 802.11 standards. It enables devices
to communicate over radio waves, typically in the 2.4 GHz and 5 GHz frequency bands2.
Common Wi-Fi Standards:
Standard IEEE Spec Frequency Band Max Data Rate Modulation Max Range

802.11 802.11 2.4 GHz 1–2 Mbps FHSS, DSSS ~100 meters

802.11b 802.11b 2.4 GHz 11 Mbps DSSS ~100 meters

802.11a 802.11a 5 GHz 54 Mbps OFDM ~35 meters

802.11g 802.11g 2.4 GHz 54 Mbps OFDM, DSSS ~100 meters

802.11n 802.11n 2.4/5 GHz 600 Mbps OFDM ~250 meters


Standard IEEE Spec Frequency Band Max Data Rate Modulation Max Range

802.11ac 802.11ac 5 GHz >1 Gbps OFDM ~100 meters

Key Features:
• Access Method: CSMA/CA (Collision Avoidance)
• Security: WEP, WPA, WPA2, WPA3
• Topology: Infrastructure (via Access Point) or Ad-hoc (peer-to-peer)
• MAC Address: 48-bit, same as Ethernet3
Applications:
Home and office wireless networking, public hotspots, mobile device connectivity

Summary Table: Ethernet vs. Wi-Fi


Feature Ethernet (IEEE 802.3) Wi-Fi (IEEE 802.11)

Medium Wired (copper, fiber) Wireless (radio waves)

Access Method CSMA/CD CSMA/CA

Speed 10 Mbps–100+ Gbps 1 Mbps–>1 Gbps

Range Up to 100 meters (UTP) Up to 250 meters (open space)

Topology Star, bus Infrastructure, ad-hoc

Security Physical, VLANs Encryption (WEP, WPA, WPA2)

References:
• [Ethernet Standards and Protocols Explained]1
• [Ethernet Tutorial - Networking Basics]2
• [Ethernet - Wikipedia]3

In summary:
• Ethernet is the dominant wired LAN standard, scalable from 10 Mbps to 100 Gbps, with
robust and reliable performance12.
• Wi-Fi is the dominant wireless LAN standard, offering flexible connectivity and mobility, with
evolving speeds and security features2.
Switches and Bridges: Learning Bridge & Spanning Tree Algorithm

**1. Bridges
Definition & Role:
• A network bridge is a device operating at the Data Link Layer (Layer 2) of the OSI model.
• It connects and filters traffic between two LAN segments, forwarding frames based on MAC
addresses123.
• Bridges help reduce network collisions by dividing a large network into smaller collision
domains.
Learning Bridge:
• A learning bridge dynamically builds a MAC address table (also called a forwarding table) by
examining the source MAC address of incoming frames.
• When a frame arrives, the bridge records the source MAC address and the port it arrived on.
• For each outgoing frame, the bridge consults its table:
• If the destination MAC is known, it forwards the frame only to the correct port.
• If unknown, it floods the frame to all ports except the incoming one.
• This process allows the bridge to "learn" the network topology and optimize traffic flow2.
Types of Bridges:
• Transparent Bridge: Used in Ethernet, operates without requiring configuration.
• Source Routing Bridge: Used in Token Ring networks.
• Translational Bridge: Connects different network types (e.g., Ethernet to Token Ring)1.

**2. Switches
Definition & Role:
• A switch is a multiport network device, also operating at Layer 2 (and sometimes Layer 3 for
routing functions).
• It connects multiple devices within a LAN, forwarding frames based on MAC addresses,
similar to a multiport bridge123.
• Switches segment the network into many collision domains, greatly improving bandwidth
and reducing collisions.
Key Features:
• High Port Density: Supports many simultaneous connections, unlike bridges (which typically
have two ports)14.
• Higher Speed: Uses hardware-based switching for faster data transfer compared to bridges’
software-based approach1.
• Segmentation: Switches can segment a network into more physical segments, increasing
overall bandwidth1.
• Frame Forwarding Modes: Store-and-forward, cut-through, and fragment-free1.

**3. Spanning Tree Algorithm (STA)


Purpose:
• Prevents loops in networks with redundant paths (common in switched/bridged networks).
• Without STA, loops can cause broadcast storms and network failures.
How It Works:
• All switches/bridges in a LAN exchange Bridge Protocol Data Units (BPDUs) to elect a root
bridge.
• Each device determines the shortest path to the root bridge.
• Redundant links are placed into a blocking state to prevent loops; only one active path
remains per segment.
• If an active link fails, STA reactivates a backup path, maintaining network connectivity.
Learning Bridge & STA:
• Both bridges and switches can use the Spanning Tree Protocol (STP) for loop prevention.
• On a bridge, only one instance of STP is used; on switches, multiple STP instances can be
configured for different VLANs6.

Summary Table: Bridges vs. Switches


Feature Bridge (Learning Bridge) Switch

OSI Layer Data Link (Layer 2) Data Link (Layer 2), sometimes Layer 3

Ports Typically 2 Multiple (dozens or more)

MAC Address Table Yes (learns dynamically) Yes (learns dynamically)

Speed Lower (software-based) Higher (hardware-based)

Segmentation 2 segments Many segments

Spanning Tree Supported (single instance) Supported (multiple instances possible)

Modern Usage Rare (replaced by switches) Standard for LANs

Diagram Reference
• Bridges and Switches Diagram – Ruijie
• Spanning Tree Protocol Animation – YouTube

In summary:
• Learning bridges connect two LAN segments, filter traffic using a dynamically built MAC
table, and can use STP for loop prevention.
• Switches are multiport bridges with higher speed, greater segmentation, and support for
multiple STP instances, forming the backbone of modern LANs.
• Spanning Tree Algorithm is essential for both to prevent network loops and ensure reliable,
redundant connectivity.

UNIT 3
IP Addressing and Subnetting: Calculations, Classes, Subnet Masks, CIDR

**1. IP Address Classes


IP addresses are 32-bit numbers (IPv4) divided into four octets. They are grouped into five classes,
but only Classes A, B, and C are commonly used for host addressing:
Class First Octet Range Default Subnet Mask Network/Host Bits Example IP

A 0 – 127 255.0.0.0 8 / 24 10.52.36.11

B 128 – 191 255.255.0.0 16 / 16 172.16.52.63


Class First Octet Range Default Subnet Mask Network/Host Bits Example IP

C 192 – 223 255.255.255.0 24 / 8 192.168.123.132

D 224 – 239 (Multicast) N/A 224.0.0.1

E 240 – 255 (Experimental) N/A 240.0.0.1

• Class D is used for multicast; Class E is reserved for experimental use1.

**2. Subnet Masks


A subnet mask determines which portion of the IP address is the network part and which is the host
part.
• Written as four octets (e.g., 255.255.255.0), or in binary (e.g.,
11111111.11111111.11111111.00000000).
• Network bits are represented by 1s; host bits by 0s.
Example:
IP: 192.168.123.132
Subnet Mask: 255.255.255.0
• Network part: first 24 bits (192.168.123)
• Host part: last 8 bits (132)1.

**3. Subnetting: Calculations and Examples


Subnetting divides a large network into smaller, more manageable sub-networks.
Subnetting Example
Suppose you have a Class C network: 192.168.123.0/24 (default mask 255.255.255.0).
You want 4 subnets.
• 4 subnets require 2 bits (2² = 4).
• New subnet mask: 255.255.255.192 (last octet: 11000000 in binary).
Subnets:
• 192.168.123.0 (hosts: 1–62)
• 192.168.123.64 (hosts: 65–126)
• 192.168.123.128 (hosts: 129–190)
• 192.168.123.192 (hosts: 193–254)
Addresses ending in .0, .63, .64, .127, .128, .191, .192, .255 are reserved as network or broadcast
addresses and cannot be assigned to hosts1.
Host Calculation Formula
Number of hosts per subnet:
2h−22h−2
Where hh = number of host bits (zeros in subnet mask).
Subtract 2 for network and broadcast addresses3.

**4. CIDR (Classless Inter-Domain Routing)


CIDR allows for flexible division of IP address space beyond classful boundaries.
• CIDR notation: IP address followed by a slash and the number of network bits (e.g.,
192.168.123.0/26).
• Subnet mask: /26 means 26 network bits (255.255.255.192).
• Benefits: Efficient use of IP space, route aggregation, and more flexible subnetting.

5. Key Calculations
• Converting Subnet Mask to CIDR: Count the number of 1s in the subnet mask.
Example: 255.255.255.192 → 11111111.11111111.11111111.11000000 = /26
• Finding Subnet Address: AND the IP address with the subnet mask.
• Finding Broadcast Address: Set all host bits to 1 in the subnet.

Summary Table: IP Addressing Concepts


Concept Example Notes

IP Address 192.168.123.132 32 bits, 4 octets

Subnet Mask 255.255.255.192 or /26 Separates network/host portions

Network Addr 192.168.123.128 (for /26) First address in subnet

Broadcast Addr 192.168.123.191 (for /26) Last address in subnet

Host Range 192.168.123.129–190 (for /26) Usable host addresses

Hosts/Subnet 26−2=6226−2=62 (for /26 mask) Formula: 2host bits−22host bits−2

References for Calculators and Diagrams


• [Microsoft Learn: TCP/IP Addressing and Subnetting]1
• [TechTarget: Subnet Mask Calculation]3
• [IP Subnet Calculator]245

In summary:
• IP addressing uses classes and subnet masks to define network and host portions.
• Subnetting divides networks for efficient management.
• CIDR offers flexible, classless addressing.
• Calculations involve binary operations and host formulas for precise subnet planning.
ARP, RARP, DHCP, ICMP: Functions, Message Formats, and Use Cases

1. ARP (Address Resolution Protocol)


Function:
• Maps a known IP address to its corresponding physical MAC address on a local network1567.
• Essential for devices to communicate over Ethernet, as data link layer communication
requires MAC addresses.
Message Format:
• Fields: Hardware Type, Protocol Type, Hardware Address Length, Protocol Address Length,
Operation (request/reply), Sender Hardware Address, Sender Protocol Address, Target
Hardware Address, Target Protocol Address67.
• Operation:
• Device checks its ARP cache for the MAC address of a given IP.
• If not found, broadcasts an ARP request to all devices in the LAN.
• The device with the matching IP replies with its MAC address (unicast reply).
• The sender updates its ARP cache for future use56.
Use Cases:
• Sending data within a LAN when only the IP address is known.
• Populating ARP tables for efficient local communication.

2. RARP (Reverse Address Resolution Protocol)


Function:
• Maps a known MAC address to its corresponding IP address167.
• Used by diskless workstations or devices that know their hardware address but need to
discover their IP address at boot.
Message Format:
• Similar to ARP, but the operation is reversed: the device broadcasts a RARP request with its
MAC address, and a RARP server replies with the corresponding IP address7.
Use Cases:
• Bootstrapping diskless devices on a network.
• Rarely used now; replaced by BOOTP and DHCP for more robust configuration16.

3. DHCP (Dynamic Host Configuration Protocol)


Function:
• Dynamically assigns IP addresses and other network configuration parameters (subnet mask,
gateway, DNS) to devices on a network124.
• Allows devices to join a network without manual configuration.
Message Format:
• Messages: DHCPDISCOVER, DHCPOFFER, DHCPREQUEST, DHCPACK.
• Fields: Transaction ID, Client MAC address, Requested IP, Lease time, etc.
Operation:
1. DHCPDISCOVER: Client broadcasts to find available DHCP servers.
2. DHCPOFFER: Servers respond with available configuration.
3. DHCPREQUEST: Client requests chosen configuration.
4. DHCPACK: Server acknowledges and assigns IP.
Use Cases:
• Automatically configuring devices in enterprise, home, and public networks.
• Efficient IP address management and reuse.

4. ICMP (Internet Control Message Protocol)


Function:
• Provides error reporting, diagnostics, and informational messages for IP networks15.
• Used by routers and hosts to communicate network issues (e.g., unreachable hosts, TTL
expired).
Message Format:
• Fields: Type, Code, Checksum, Rest of Header, Data7.
• Common Messages:
• Echo Request/Echo Reply (used by ping).
• Destination Unreachable.
• Time Exceeded.
• Redirect.
Operation:
• ICMP messages are encapsulated in IP packets.
• Used to inform the sender about network problems or for diagnostic purposes (e.g., ping,
traceroute)5.
Use Cases:
• Network troubleshooting (ping, traceroute).
• Reporting errors like unreachable hosts or routers.
• Congestion reporting and redirection.

Summary Table
Protocol Function Message Format Highlights Typical Use Cases

Request/Reply: IP, MAC


ARP IP-to-MAC mapping fields LAN communication, ARP cache

Request/Reply: MAC, IP
RARP MAC-to-IP mapping fields Diskless device bootstrapping

Discover, Offer, Request, Auto network config, IP


DHCP Dynamic IP assignment ACK management

Error reporting,
ICMP diagnostics Type, Code, Checksum, Data Ping, unreachable, network errors

References for diagrams and message formats:


• [Slideshare: ARP, RARP, DHCP, ICMP Networking Protocols]1
• [TechTarget: Common Protocols]3
• [CSHub: Network Layer Protocols]5
• [Scribd: Addressing, ARP, RARP, ICMP, DHCP]4
• [Informatics: TCP/IP Protocols]7

In summary:
• ARP resolves IP to MAC addresses for local delivery.
• RARP resolves MAC to IP, mainly for legacy devices.
• DHCP automates IP and network parameter assignment.
• ICMP handles error reporting and diagnostics within IP networks.
Routing: Concepts, Static vs. Dynamic, Distance Vector and Link State Algorithms

Routing Concepts
• Routing is the process of selecting paths in a network along which to send network traffic
from source to destination.
• Routers use routing tables to determine the best path for each packet.
• Routing ensures data reaches its destination efficiently, reliably, and accurately2.

Static vs. Dynamic Routing


Feature Static Routing Dynamic Routing

Configuration Manually set by network admin Automatically updated by routing protocols

Adapts in real time to topology or link


Adaptability Does not adapt to network changes changes

Routing Table
Size Small (one entry per destination) Larger, updated dynamically

Higher resource use (CPU, memory,


Resource Use Low CPU, memory, and bandwidth bandwidth)

More secure (no info shared over Less secure (routes exchanged between
Security network) routers)

Protocols No protocol needed Uses protocols: RIP, OSPF, EIGRP, IS-IS, BGP

Best Use Small, stable networks Large, changing, or complex networks

Failure Handling Manual reconfiguration required Automatic rerouting and recovery

• Static Routing:
• Simple, predictable, and secure.
• Requires manual updates if the network changes.
• Ideal for small, stable environments1236.
• Dynamic Routing:
• Uses algorithms and protocols to discover and update routes automatically.
• Handles network changes and failures quickly.
• Suitable for large, complex, or frequently changing networks1236.

Dynamic Routing Algorithms


Dynamic routing relies on two main types of algorithms: Distance Vector and Link State.
Distance Vector Routing
• How it works:
• Each router periodically shares its routing table with directly connected neighbors.
• Routers update their own tables based on information from neighbors.
• Routes are chosen based on metrics like hop count (number of routers to
destination).
• Protocols: RIP (Routing Information Protocol), IGRP.
• Advantages: Simple to configure and understand.
• Disadvantages:
• Slower convergence (takes time to update after a change).
• Can choose suboptimal routes (e.g., a slow link with fewer hops).
• Consumes bandwidth by sending entire routing tables1.
Link State Routing
• How it works:
• Each router discovers the complete network topology by exchanging link state
information with all other routers.
• Routers use algorithms (e.g., Dijkstra’s algorithm) to compute the shortest path to
every destination.
• Protocols: OSPF (Open Shortest Path First), IS-IS.
• Advantages:
• Faster convergence and more accurate routing.
• Scales better for large networks.
• Disadvantages:
• More complex and resource-intensive (CPU, memory).
• Requires more configuration and management1.

Summary Table: Distance Vector vs. Link State


Feature Distance Vector Link State

Routing Info Shared With neighbors only With all routers in the network

Update Frequency Periodically (entire table) When topology changes (LSAs)

Metric Hop count, simple metrics Cost, bandwidth, delay, etc.

Convergence Speed Slower Faster

Protocols RIP, IGRP OSPF, IS-IS

Complexity Low High

References
• [TechTarget]1
• [IO River]2
• [TutorialsPoint]3
• [NetSecCloud]6

In summary:
• Routing selects optimal paths for data in a network.
• Static routing is manual, secure, and simple—best for small, stable networks.
• Dynamic routing is automatic, adaptive, and scalable—best for large or changing networks.
• Distance vector algorithms use neighbor-to-neighbor updates and simple metrics, while link
state algorithms build a full network map for precise, efficient routing.
Routing Protocols: RIP, OSPF, BGP Basics

1. RIP (Routing Information Protocol)


• Type: Distance vector, Interior Gateway Protocol (IGP)
• Metric: Hop count (maximum 15 hops; 16 = unreachable)
• Algorithm: Chooses path with the least number of hops
• Convergence: Slow
• Suitability: Small, simple networks (LANs)
• Resource Usage: Low CPU and memory consumption
• Update Mechanism: Periodic broadcast of entire routing table (default every 30 seconds)
• Versions: RIPv1 (classful), RIPv2 (classless, supports subnet masks)
• Security: Basic password authentication
• Limitation: Poor scalability, limited to small networks due to hop count restriction
Use Case:
Best for small, uncomplicated networks where simplicity is more important than scalability or fast
convergence135.

2. OSPF (Open Shortest Path First)


• Type: Link state, Interior Gateway Protocol (IGP)
• Metric: Cost (based on link bandwidth)
• Algorithm: Dijkstra’s shortest path first (SPF)
• Convergence: Fast
• Suitability: Medium to large enterprise networks
• Resource Usage: Moderate (CPU and memory intensive)
• Update Mechanism: Sends small updates only when topology changes (Link State
Advertisements, LSAs)
• Hierarchical Design: Supports areas for scalability
• Security: Supports multiple authentication methods (clear text, MD5, etc.)
• Flexibility: Supports VLSM, CIDR, and route summarization
Use Case:
Ideal for large, complex enterprise networks needing fast convergence and efficient routing within a
single autonomous system1356.

3. BGP (Border Gateway Protocol)


• Type: Path vector, Exterior Gateway Protocol (EGP)
• Metric: Path attributes (policy-based routing, not just shortest path)
• Algorithm: Best path selection based on policies and attributes
• Convergence: Slow
• Suitability: Very large networks, Internet-scale (between autonomous systems)
• Resource Usage: High (CPU and memory intensive, especially with large routing tables)
• Update Mechanism: Updates sent only when changes occur; uses TCP port 179
• Scalability: Extremely high; backbone of Internet routing
• Security: Supports MD5 authentication
• Policy Control: Extensive, allowing granular control over routing decisions
Use Case:
Essential for ISPs, data centers, and organizations that connect to multiple external networks or
participate in global Internet routing13567.

Comparison Table: RIP vs. OSPF vs. BGP


Feature RIP OSPF BGP

Protocol Type Distance vector (IGP) Link state (IGP) Path vector (EGP)

Intra-domain Intra-domain Inter-domain (between


Routing Domain (LAN/AS) (enterprise/AS) ASes)

Path attributes (policy-


Metric Hop count Cost (bandwidth-based) based)

Max Network Size Small Large (enterprise) Very large (Internet/global)

Convergence
Speed Slow Fast Slow

Resource Usage Low Moderate High

Update
Mechanism Periodic full table Event-driven LSAs Event-driven path updates

Scalability Low Moderate to high Very high

Security Basic (password) Multiple (MD5, clear text) MD5 authentication

Use Case Small LANs Enterprise networks Internet backbone, ISPs

Summary
• RIP: Simple, easy to configure, but limited to small networks due to hop count and slow
convergence.
• OSPF: Fast, scalable, and efficient for large enterprise networks, using link state information
for optimal routing.
• BGP: The backbone of the Internet, highly scalable, policy-driven, and used for routing
between different organizations and ISPs.
References:
1 InterLIR
3 Barracuda Campus
5 YouTube
6 Catchpoint
7 Spiceworks

Congestion Control: Causes, Effects, and Algorithmic Solutions

**Causes of Network Congestion


Network congestion arises when the volume of data traffic exceeds the capacity of a network node
or link, leading to reduced quality of service24. Common causes include:
• Excessive Bandwidth Use: Too many users or devices consuming large amounts of
bandwidth simultaneously (e.g., video streaming, large downloads)14.
• Too Many Hosts in a Broadcast Domain: Increases broadcast traffic, overwhelming network
devices16.
• Low Bandwidth or Over-subscription: Insufficient network capacity or more users than the
network can support14.
• Outdated or Faulty Hardware: Old or malfunctioning switches, routers, or cables create
bottlenecks6.
• Broadcast Storms: Faulty hardware or misconfigurations cause excessive broadcasts,
flooding the network6.
• Resource Exhaustion: Network devices (routers, switches) run out of processing power or
memory due to high load3.
• Collisions and Retransmissions: In shared media (like Ethernet), simultaneous transmissions
cause collisions, requiring retransmissions and increasing congestion356.
• Buffer Overflow: When buffers in network devices fill up, incoming packets are dropped or
delayed3.
• Routing Inefficiencies: Poor routing decisions can overload certain paths while others remain
underutilized3.
• Malware or Denial-of-Service (DoS) Attacks: Malicious traffic intentionally overwhelms
network resources24.

**Effects of Network Congestion


Network congestion leads to a range of performance and reliability issues:
• Queueing Delay: Packets wait in buffers, increasing end-to-end latency23.
• Packet Loss: Overloaded devices drop packets, leading to retransmissions and reduced
throughput234.
• Blocking of New Connections: New connection requests may be delayed or denied if
resources are exhausted2.
• Increased Jitter: Variability in packet delay disrupts real-time applications like VoIP and video
conferencing356.
• Throughput Reduction: The effective data transfer rate drops, sometimes drastically23.
• Retransmissions: Lost or damaged packets are resent, further increasing congestion5.
• Congestive Collapse: In severe cases, throughput decreases as load increases, potentially
leading to network failure2.
• Decreased Productivity and Reliability: Applications become slow or unresponsive,
impacting user experience and business operations3.
• Security Risks: Congestion can mask malicious activity and hinder detection of cyberattacks3.

**Algorithmic Solutions to Congestion Control


Modern networks use a combination of congestion control and avoidance algorithms to mitigate
congestion:
1. Window-Based Control (TCP Congestion Control)
• Window Reduction: TCP dynamically adjusts its congestion window size based on network
feedback (e.g., packet loss or delay). When congestion is detected, the window size is
reduced to limit the sending rate2.
• Slow Start, Congestion Avoidance, Fast Retransmit, and Fast Recovery: These phases help
TCP probe for available bandwidth and back off when congestion is detected.
2. Exponential Backoff
• Used in protocols like CSMA/CD (Ethernet) and CSMA/CA (Wi-Fi). After a collision, devices
wait a random, exponentially increasing time before retransmitting, reducing the chance of
repeated collisions2.
3. Fair Queueing
• Routers and switches allocate bandwidth fairly among flows, preventing any single flow from
monopolizing resources2.
4. Priority Schemes (Quality of Service, QoS)
• Some packets (e.g., voice, video) are given higher priority, ensuring critical traffic is
transmitted ahead of less important data23.
5. Admission Control
• Networks may limit the number of active flows or connections to prevent overload,
admitting new connections only if sufficient resources are available2.
6. Explicit Resource Allocation
• Allocates specific bandwidth or buffer space to certain flows, ensuring guaranteed
performance for critical applications2.
7. Buffer Management
• Intelligent buffer management (e.g., Random Early Detection, RED) drops packets early to
signal congestion before buffers overflow.

Summary Table: Causes, Effects, and Solutions


Aspect Examples/Details

Excessive bandwidth use, too many hosts, low bandwidth, outdated hardware, collisions, buffer
Causes overflow

Effects Delay, packet loss, jitter, throughput reduction, connection blocking, retransmissions, collapse

TCP window control, exponential backoff, fair queueing, QoS, admission control, explicit
Solutions allocation

In summary:
Network congestion is caused by excessive or poorly managed data traffic, leading to delays, packet
loss, and reduced throughput. Algorithmic solutions—including TCP window control, exponential
backoff, fair queueing, QoS, and admission control—are essential to maintain network performance
and prevent collapse234.
IPv4 and IPv6: Features, Address Structure, and Migration

**1. IPv4: Features and Address Structure


Features:
• 32-bit Addressing: Supports about 4.3 billion unique addresses (2³²)127.
• Address Representation: Numeric, written in dot-decimal notation (e.g., 192.168.10.150)13.
• Header Size: Variable (20–60 bytes)3.
• Configuration: Supports manual (static) and DHCP (dynamic) address assignment3.
• Security: No built-in encryption or authentication; relies on external protocols3.
• Fragmentation: Performed by both sender and routers3.
• NAT (Network Address Translation): Widely used to extend address space16.
• Broadcasting: Uses broadcast addresses for group communication6.
• Routing: Uses classful (A, B, C) and classless (CIDR) addressing6.
Address Structure:
• Format: Four octets, each 8 bits (e.g., 192.168.1.1)13.
• Classes: A (0–127), B (128–191), C (192–223), D (224–239, multicast), E (240–255,
experimental)6.
• Private/Public: Supports both private and public address ranges6.

**2. IPv6: Features and Address Structure


Features:
• 128-bit Addressing: Supports approximately 3.4 × 10³⁸ unique addresses (340
undecillion)127.
• Address Representation: Alphanumeric, written as eight groups of four hexadecimal digits
separated by colons (e.g., 3002:0bd6:0000:0000:0000:ee00:0033:6778)13.
• Header Size: Fixed at 40 bytes, with a simplified and more efficient structure38.
• Configuration: Supports both stateful (DHCPv6) and stateless (SLAAC) auto-configuration356.
• Security: Built-in IPsec for encryption and authentication1345.
• Fragmentation: Only performed by the sender, not routers3.
• No NAT: Designed for end-to-end connectivity, eliminating the need for NAT16.
• Multicasting and Anycasting: Multicasting is built-in; anycasting is supported15.
• Quality of Service (QoS): Built-in support for packet flow identification and prioritization156.
• Neighbor Discovery Protocol (NDP): Replaces ARP for address resolution5.
• Hierarchical Addressing: Streamlines routing and aggregation57.
Address Structure:
• Format: Eight groups of four hexadecimal digits (e.g., 2dfc:0:0:0:0217:cbff:fe8c:0)136.
• Types: Unicast, multicast, anycast, and unique local addresses (FD00::/8)6.
• No Classes: Uses hierarchical and flexible subnetting similar to CIDR57.

**3. Migration from IPv4 to IPv6


Why Migrate?
•IPv4 Exhaustion: The 32-bit address space is insufficient for the growing number of
devices1246.
• Scalability: IPv6 provides a vastly larger address pool and improved routing efficiency1456.
Migration Approaches:
• Dual Stack: Devices and networks run both IPv4 and IPv6 simultaneously, allowing gradual
transition6.
• Tunneling: IPv6 packets are encapsulated within IPv4 packets to traverse IPv4
infrastructure6.
• Translation: Protocol translation (e.g., NAT64, DNS64) enables communication between IPv4
and IPv6 devices6.
Challenges:
• Coexistence: IPv4 and IPv6 must operate together for the foreseeable future as the
transition is gradual6.
• Configuration and Compatibility: Some legacy systems and applications may not fully
support IPv66.
Improvements in IPv6 Over IPv4:
• Larger address space
• Built-in security (IPsec)
• Simplified and more efficient header
• Auto-configuration and easier network management
• Enhanced support for QoS and mobility
• No need for NAT; true end-to-end connectivity1456

Summary Table: IPv4 vs. IPv6


Feature IPv4 IPv6

Address Length 32 bits (4 octets) 128 bits (8 groups)

Address Format Decimal, dot-separated Hexadecimal, colon-separated

Address Space ~4.3 billion ~340 undecillion

Header Size 20–60 bytes (variable) 40 bytes (fixed)

Security External (not built-in) Built-in (IPsec)

Configuration Manual, DHCP Stateless (SLAAC), DHCPv6, manual

NAT Required due to address shortage Not required

Broadcast Supported Not supported (uses multicast/anycast)

Fragmentation Sender and routers Sender only

Routing Classful and CIDR Hierarchical, CIDR-like


Feature IPv4 IPv6

ARP Used Replaced by NDP

References:
12345678

In summary:
IPv4 uses 32-bit numeric addresses, is limited in size, and relies on external mechanisms for security
and address management. IPv6, with its 128-bit address space, built-in security, and streamlined
features, is designed to overcome IPv4's limitations and support the future growth of the Internet.
Migration from IPv4 to IPv6 is ongoing, using dual-stack, tunneling, and translation techniques to
ensure compatibility and continuity.

UNIT 4
Process-to-Process Delivery: End-to-End Communication and Port Addressing

End-to-End Communication
• Definition:
End-to-end communication refers to the transfer of data from a process (application) running
on a source host to a process running on a destination host across a network.
• Layer Responsibilities:
• Data Link Layer: Delivers frames node-to-node using MAC addresses (link-level
delivery).
• Network Layer: Delivers packets from host to host using IP addresses (host-level
delivery).
• Transport Layer: Delivers data from one process to another, i.e., process-to-process
delivery, using port numbers12.
• How It Works:
• The application layer generates data, which is passed down to the transport layer.
• The transport layer (using TCP, UDP, or SCTP) encapsulates the data into segments,
adding source and destination port numbers to identify the sending and receiving
processes125.
• The network layer adds source and destination IP addresses for host-to-host delivery.
• Lower layers handle the actual transmission over the network.
• At the destination, each layer removes its respective header, and the transport layer
uses the port number to deliver the data to the correct application process125.

Port Addressing
• Purpose:
Multiple processes can run simultaneously on a single host. Port numbers are used to
distinguish between these processes and ensure data is delivered to the correct one12.
• Port Numbers:
• 16-bit numbers (range: 0–65535).
• Well-known ports (0–1023): Reserved for common protocols (e.g., HTTP: 80, FTP:
21).
• Registered ports (1024–49151): Assigned for specific services by IANA.
• Dynamic/private ports (49152–65535): Used for temporary or private connections.
• Transport Layer Protocols:
• TCP (Transmission Control Protocol): Connection-oriented, reliable, uses port
numbers for process identification.
• UDP (User Datagram Protocol): Connectionless, simpler, also uses port numbers.
• SCTP (Stream Control Transmission Protocol): Designed for multimedia and other
applications, combines features of TCP and UDP1.
• Multiplexing and Demultiplexing:
• Multiplexing: Multiple processes on the sender can use the transport layer
simultaneously; the transport layer adds the correct port number to each segment.
• Demultiplexing: At the receiver, the transport layer uses the port number to deliver
incoming data to the correct process16.

Summary Table
Layer Delivery Type Address Used Example

Data Link Node-to-node MAC Address 00:1A:2B:3C:4D:5E

Network Host-to-host IP Address 192.168.1.10

Transport Process-to-process Port Number 80, 443, 8080

In summary:
The transport layer enables process-to-process (end-to-end) communication by using port numbers
to uniquely identify application processes on each host. This ensures that data sent across a network
is delivered to the correct application, not just the correct device125.

UDP and TCP Protocols: Features, Differences, Use Cases, Segment Structure

TCP (Transmission Control Protocol)


Features:
• Connection-oriented: Establishes a connection using a three-way handshake (SYN, SYN-ACK,
ACK) before data transfer begins56.
• Reliable delivery: Ensures all data is delivered in order and without errors through
acknowledgments, retransmissions, and sequencing147.
• Error detection and correction: Uses checksums, acknowledgments, and retransmissions for
error control347.
• Flow and congestion control: Manages data flow to prevent overwhelming the receiver and
adjusts transmission rate based on network conditions7.
• Ordered data transfer: Data packets (segments) are reassembled in the correct order at the
destination13.
• Heavyweight protocol: More overhead due to additional features and a larger header (20
bytes)67.
Segment Structure:
• Header fields: Source port, destination port, sequence number, acknowledgment number,
header length, flags (SYN, ACK, FIN, etc.), window size, checksum, urgent pointer, and
options67.
• Data field: Application data.

UDP (User Datagram Protocol)


Features:
• Connectionless: No connection setup; data (datagrams) is sent immediately without
handshake567.
• Unreliable delivery: No guarantee of delivery, order, or error correction; best-effort
transmission127.
• Minimal error detection: Only uses a checksum for basic error detection, no correction or
retransmission347.
• No flow or congestion control: Sender can transmit at any rate, regardless of receiver or
network conditions7.
• Supports multicast and broadcast: Allows data to be sent to multiple recipients efficiently5.
• Lightweight protocol: Minimal overhead and smaller header (8 bytes)567.
Segment Structure:
• Header fields: Source port, destination port, length, checksum67.
• Data field: Application data.

Key Differences (Comparison Table)


Feature TCP UDP

Protocol Type Connection-oriented Connectionless

Reliable, ordered delivery, error Unreliable, unordered, no error


Reliability correction correction

Flow/Congestion
Control Yes No

Header Size 20 bytes 8 bytes

Speed Slower (more overhead) Faster (less overhead)

Web, email, file transfer (HTTP, SMTP,


Use Cases FTP) Streaming, gaming, VoIP, DNS, DHCP

Acknowledgments Yes No
Feature TCP UDP

Sequencing Yes No

Retransmissions Yes No

Multicast/Broadcast Limited Supported

Use Cases
• TCP:
• Web browsing (HTTP/HTTPS)
• Email (SMTP, IMAP, POP3)
• File transfer (FTP, SFTP)
• Applications requiring reliable, ordered delivery
• UDP:
• Live video/audio streaming
• Online gaming
• Voice over IP (VoIP)
• DNS queries, DHCP
• Applications needing speed and low latency, where occasional data loss is acceptable

In summary:
TCP is a reliable, connection-oriented protocol suitable for applications where data integrity and
order are critical. UDP is a faster, connectionless protocol ideal for real-time applications where
speed is prioritized over reliability12345678.
Multiplexing: How Multiple Processes Share a Single Network Connection

What is Multiplexing in Networking?


Multiplexing at the transport layer is the process by which data from multiple application processes
(such as web browsers, email clients, or chat apps) on a single host are combined and sent over a
single network connection. This enables several applications to use the network simultaneously
without needing separate physical connections for each process13467.

How Multiplexing Works


• At the Sender:
• Each application process generates data to be sent to a remote host.
• The transport layer (using protocols like TCP or UDP) collects data from these
processes.
• For each data segment, the transport layer adds a header containing source and
destination port numbers (identifying the sending and receiving processes) and
passes the segment to the network layer36.
• This process allows the data from multiple applications to be "multiplexed"
(combined) into a single stream for transmission over the network134.
• At the Receiver:
• The transport layer receives incoming segments from the network layer.
• It examines the destination port number in each segment header to determine
which application process should receive the data.
• This process is called demultiplexing—delivering the correct data to the correct
application236.

Why is Multiplexing Important?


• Resource Sharing: Multiple applications can share the same network connection, maximizing
efficiency and resource utilization137.
• Process Isolation: Each application's data is kept separate and delivered only to its intended
process, using port numbers as unique identifiers36.
• Simultaneous Communication: Users can run several networked applications at once (e.g.,
browsing, emailing, chatting) without interference36.

Role of Port Numbers


• Port numbers (16-bit values) are used by the transport layer to distinguish between different
application processes on the same host.
• When sending data, the transport layer assigns the appropriate source and destination port
numbers to each segment.
• At the receiving end, the transport layer uses the destination port number to deliver the
segment to the correct process236.

Summary Table
Stage Action Key Mechanism

Sender Collects data from multiple processes, adds port numbers Multiplexing

Network Transmits combined data stream Single connection

Receiver Uses port numbers to deliver data to correct application Demultiplexing

In summary:
Multiplexing at the transport layer enables multiple application processes to share a single network
connection by tagging each data segment with port numbers. This allows efficient, simultaneous
communication for many applications over the same network infrastructure, with the transport layer
ensuring each process receives only its intended data1367.

TCP Connection Management: Three-Way Handshake and Teardown

TCP Connection Establishment: Three-Way Handshake


The TCP three-way handshake is a process used to reliably establish a connection between a client
and a server, ensuring both parties are synchronized and agree on initial sequence numbers before
data transfer begins. The handshake consists of three steps:
Step 1: SYN (Synchronize)
• The client initiates the connection by sending a TCP segment with the SYN flag set to 1 to the
server.
• This segment includes the client’s initial sequence number (ISN) and other parameters like
window size and maximum segment size245678.
Step 2: SYN-ACK (Synchronize-Acknowledge)
• The server responds with a segment that has both the SYN and ACK flags set to 1.
• The ACK acknowledges the client’s SYN (by setting the acknowledgment number to the
client’s ISN + 1).
• The server also includes its own ISN in the SYN part of the segment and may advertise its
own window size and segment size245678.
Step 3: ACK (Acknowledge)
• The client sends a final segment with the ACK flag set to 1, acknowledging the server’s SYN
(by setting the acknowledgment number to the server’s ISN + 1).
• At this point, the connection is established, and both sides can begin data transfer using the
agreed-upon sequence numbers245678.
Result:
Both client and server are synchronized, aware of each other's sequence numbers, and ready for
reliable, full-duplex communication67.

TCP Connection Teardown (Termination)


TCP connection termination is a controlled process to ensure all data is transmitted before closing
the connection. It typically involves a four-step exchange using the FIN (finish) and ACK flags:
1. FIN from Initiator: The client (or server) sends a segment with the FIN flag set to request
connection termination.
2. ACK from Receiver: The other side acknowledges the FIN with an ACK segment.
3. FIN from Receiver: The receiver then sends its own FIN when it is ready to close the
connection.
4. Final ACK from Initiator: The initiator acknowledges the receiver’s FIN with a final ACK.
Result:
Both sides agree the connection is closed, ensuring no data is lost in the process26.

Summary Table: TCP Connection Management


Phase Step Flags Set Purpose

Establishment Client → Server: SYN SYN Initiate connection, send ISN

Server → Client: SYN-ACK SYN, ACK Acknowledge SYN, send own ISN

Client → Server: ACK ACK Acknowledge server’s SYN, complete setup

Termination Initiator → Receiver: FIN FIN Request to close connection

Receiver → Initiator: ACK ACK Acknowledge FIN

Receiver → Initiator: FIN FIN Receiver requests to close


Phase Step Flags Set Purpose

Initiator → Receiver: ACK ACK Final acknowledgment, connection closed

In summary:
The TCP three-way handshake (SYN, SYN-ACK, ACK) establishes a reliable, synchronized connection
between two hosts, while connection teardown uses FIN and ACK exchanges to gracefully close the
session, ensuring all data is transmitted and acknowledged245678.
Flow Control and Retransmission: Sliding Window Protocol, Acknowledgments, Retransmission
Strategies

**Sliding Window Protocol


The sliding window protocol is a core mechanism for flow control in reliable data transfer protocols
like TCP. It enables efficient and orderly delivery of data by allowing the sender to transmit multiple
frames (or segments) before needing an acknowledgment for the first one235.
Key Concepts:
• Window Size: The sender and receiver each maintain a window (buffer) that defines how
many unacknowledged bytes or frames can be in transit at any time123.
• Sender Window: Limits how much data the sender can transmit without receiving an
acknowledgment.
• Receiver Window: Advertised by the receiver, indicating available buffer space. The sender
must not exceed this value16.
• Sliding: As acknowledgments (ACKs) are received, the window "slides" forward, allowing
more data to be sent235.
Example:
If the receiver advertises a window of 60,000 bytes and each segment is 1,500 bytes, the sender can
send up to 40 segments before waiting for an ACK6.

**Acknowledgments (ACKs)
• Purpose: ACKs inform the sender which data has been successfully received, enabling the
sender to slide its window and send more data25.
• Cumulative ACKs: Most protocols use cumulative ACKs, where an ACK for sequence number
N means all data up to N has been received.
• Selective ACKs (SACK): Some protocols support selective acknowledgments, allowing the
receiver to specify exactly which segments were received, improving efficiency in case of
packet loss.

**Retransmission Strategies
Retransmission is essential for reliability—if a segment is lost or corrupted, it must be resent.
Common Strategies:
• Timeout-based Retransmission:
• The sender starts a timer for each unacknowledged segment.
• If the timer expires before an ACK is received, the segment is retransmitted5.
• Duplicate ACKs & Fast Retransmit:
• If the sender receives multiple ACKs for the same data (duplicate ACKs), it assumes a
segment was lost and retransmits it immediately, even before the timer expires.
• Go-Back-N:
• If a packet is lost, the sender retransmits that packet and all subsequent packets in
the window.
• Selective Repeat:
• Only the lost or corrupted packets are retransmitted, not the entire window.

How Sliding Window Controls Flow and Retransmission


• Flow Control:
• The receiver advertises its window size (buffer space) to the sender, ensuring the
sender does not overwhelm the receiver16.
• If the receiver's buffer is full, it advertises a window size of zero, pausing the sender
until space is available16.
• Retransmission:
• The sender tracks which segments have been acknowledged.
• Segments not acknowledged within a certain time are retransmitted5.
• The window mechanism helps manage which data needs to be resent and which is
already confirmed as received.

Summary Table
Mechanism Purpose How It Works

Flow control, efficient Sender sends multiple frames, slides window as


Sliding Window transmission ACKs arrive1235

Acknowledgments Confirm receipt, slide


(ACK) window Receiver sends ACKs for received data25

Reliability, handle
Retransmission loss/corruption Timer/duplicate ACKs trigger resend5

In summary:
The sliding window protocol enables efficient flow control by letting the sender transmit multiple
segments up to the receiver’s advertised window size. Acknowledgments keep sender and receiver
synchronized, and retransmission strategies ensure lost or corrupted data is resent, maintaining
reliable, in-order delivery12356.

Window Management: How Window Size Is Managed for Flow and Congestion Control

Flow Control: Managing the Sender's Rate


• Sliding Window Protocol:
TCP uses a sliding window mechanism for flow control, allowing the sender to transmit
multiple bytes (or segments) before needing an acknowledgment. The window size
determines how much unacknowledged data can be "in flight" at any time1358.
• Receiver Window (rwnd):
The receiver advertises its available buffer space (the receive window) in each TCP segment.
The sender cannot send more data than the receiver's advertised window size158.
• Dynamic Adjustment:
• As the receiver processes data and frees buffer space, it updates the window size in
ACKs sent back to the sender.
• If the buffer is full, the receiver advertises a window size of zero, causing the sender
to pause transmission until space becomes available18.
• Window Size Field:
The TCP header includes a 16-bit window size field, allowing values up to 65,535 bytes. For
high-speed networks, the window scaling option (negotiated during the three-way
handshake) can increase this to up to 1 GB7.

Congestion Control: Adapting to Network Conditions


• Congestion Window (cwnd):
In addition to the receiver window, TCP maintains a congestion window, which limits the
amount of data sent based on perceived network congestion.
• Effective Window:
The sender's actual window is the minimum of the receiver window (rwnd) and the
congestion window (cwnd).
• Congestion Avoidance:
TCP algorithms (like Slow Start, Congestion Avoidance, Fast Retransmit, and Fast Recovery)
dynamically adjust the congestion window in response to network events (e.g., packet loss,
delays), reducing the window when congestion is detected and increasing it when the
network is clear.

Summary Table: Window Management


Window Type Purpose How It’s Managed

Flow control (receiver’s


Receiver Window buffer) Advertised by receiver, updated in each ACK158

Congestion Managed by sender, adjusted by congestion


Window Congestion control (network) algorithms

Sender’s Window Data in flight Minimum of receiver and congestion windows

Key Points
• The window size is dynamic and can be changed during a TCP session to optimize
throughput and prevent buffer overflows4567.
• Flow control ensures the sender does not overwhelm the receiver.
• Congestion control ensures the sender does not overwhelm the network.
• Window scaling allows for larger windows on high-bandwidth, high-latency networks7.

In summary:
TCP window management uses a sliding window protocol, with the window size dynamically
adjusted based on receiver buffer availability (flow control) and network congestion (congestion
control). The sender always respects the smallest allowed window, ensuring efficient, reliable, and
fair data transmission1358.
TCP Congestion Control: Algorithms and Phases
TCP congestion control is designed to prevent network congestion and ensure efficient, fair use of
network resources. It uses a set of algorithms that dynamically adjust the sender’s data rate based
on network feedback, primarily through management of the congestion window (CWND)124.

Key Algorithms and Phases


1. Slow Start
• Purpose: Quickly probe the available bandwidth at the start of a connection or after a
timeout.
• How it Works:
• CWND starts at a small value (typically 1 MSS—Maximum Segment Size).
• For each ACK received, CWND increases by 1 MSS, resulting in exponential growth
(doubling each round-trip time).
• This continues until either a packet loss is detected (signaling congestion) or CWND
reaches the slow start threshold (ssthresh).
• Transition:
• When CWND ≥ ssthresh, TCP switches to the congestion avoidance phase1245.
2. Congestion Avoidance
• Purpose: Avoid overloading the network once initial bandwidth is probed.
• How it Works:
• CWND increases more slowly—typically by 1 MSS per round-trip time (linear
growth).
• This is the additive increase part of the AIMD (Additive Increase/Multiplicative
Decrease) algorithm.
• Behavior:
• TCP remains in this phase as long as there are no signs of congestion (i.e., no packet
loss)124.
3. Fast Retransmit
• Purpose: Quickly detect and recover from isolated packet loss without waiting for a timeout.
• How it Works:
• If the sender receives three duplicate ACKs (indicating a segment was lost but
subsequent segments arrived), it immediately retransmits the missing segment.
• This avoids the longer delay of a retransmission timeout24.
4. Fast Recovery
• Purpose: Maintain higher throughput after a single segment loss, avoiding a full return to
slow start.
• How it Works:
• After fast retransmit, instead of resetting CWND to 1 MSS, TCP reduces CWND by
half (multiplicative decrease) and sets ssthresh to this value.
• TCP then enters congestion avoidance, allowing for a more rapid return to efficient
transmission rates24.

Additive Increase/Multiplicative Decrease (AIMD)


• Additive Increase: During congestion avoidance, CWND increases linearly (additively) to
probe for more bandwidth.
• Multiplicative Decrease: On detecting congestion (packet loss), CWND is reduced
multiplicatively (usually by half), responding quickly to network overload12.

Summary Table: TCP Congestion Control Phases


Phase CWND Growth Trigger to Exit Phase Action on Congestion

CWND ≥ ssthresh or Switch to congestion avoidance or reduce


Slow Start Exponential loss CWND

Congestion
Avoid. Linear (additive) Packet loss Multiplicative decrease (CWND halved)

Fast Retransmit N/A (retransmit) 3 duplicate ACKs Retransmit lost segment

Linear (from
Fast Recovery half) New ACK for all data Resume congestion avoidance

In Summary
• Slow Start: Rapidly increases sending rate to probe bandwidth.
• Congestion Avoidance: Grows sending rate cautiously to avoid congestion.
• Fast Retransmit: Quickly retransmits lost segments on duplicate ACKs.
• Fast Recovery: Reduces CWND by half and resumes linear growth, maintaining higher
throughput than a full reset.
TCP’s congestion control ensures efficient, fair, and stable network usage by dynamically adapting to
network conditions using these algorithms1245.

Quality of Service (QoS): Ensuring Reliable and Prioritized Delivery of Network Traffic

What is QoS?
Quality of Service (QoS) refers to a set of technologies and techniques used in networking to manage
and prioritize network traffic, ensuring that critical or time-sensitive data (like voice, video, or real-
time applications) receives the appropriate bandwidth, low latency, and minimal packet loss.

Why is QoS Important?


• Diverse Traffic Types: Networks carry various types of traffic with different requirements—
e.g., file downloads tolerate delays, but VoIP and video conferencing require low latency and
jitter.
• Limited Resources: Bandwidth, buffer space, and processing power are finite; QoS helps
allocate these resources effectively.
• User Experience: Ensures smooth performance for high-priority applications, improving
reliability and satisfaction.

Key QoS Objectives


• Bandwidth Management: Guarantee minimum bandwidth for critical applications.
• Latency Control: Minimize delay for real-time traffic.
• Jitter Reduction: Ensure consistent packet arrival times.
• Packet Loss Minimization: Prioritize important packets to avoid drops.
• Traffic Prioritization: Differentiate traffic classes and serve them accordingly.

QoS Mechanisms
1. Classification and Marking:
• Packets are classified based on criteria like source/destination IP, port numbers, or
protocol.
• Marking (e.g., DSCP—Differentiated Services Code Point) tags packets to indicate
priority.
2. Queuing and Scheduling:
• Packets are placed in different queues based on priority.
• Scheduling algorithms determine the order of packet transmission.
• Common algorithms:
• Priority Queuing (PQ): Highest priority queues served first.
• Weighted Fair Queuing (WFQ): Shares bandwidth fairly among queues.
• Class-Based Weighted Fair Queuing (CBWFQ): Extends WFQ with defined
classes.
3. Traffic Shaping and Policing:
• Traffic Shaping: Delays excess packets to smooth traffic bursts.
• Policing: Drops or marks packets exceeding bandwidth limits.
4. Resource Reservation:
• Protocols like RSVP (Resource Reservation Protocol) reserve resources along a path
for specific flows.

QoS Models
• Integrated Services (IntServ):
• Per-flow resource reservation.
• Uses RSVP.
• Precise but not scalable for large networks.
• Differentiated Services (DiffServ):
• Classifies and manages traffic in aggregates.
• Uses DSCP for marking.
• Scalable and widely used in modern networks.

Summary Table: QoS Components


Component Description Example/Protocol

Classification Identify traffic types Based on IP, port, protocol

Marking Tag packets with priority DSCP, IP precedence

Queuing Separate packets into priority queues Priority Queuing, WFQ


Component Description Example/Protocol

Scheduling Decide packet transmission order Round Robin, Weighted Fair Queuing

Traffic Shaping Smooth traffic bursts Token Bucket, Leaky Bucket

Policing Enforce bandwidth limits Drop or mark excess packets

Resource Reservation Reserve bandwidth for flows RSVP

In Summary
QoS ensures reliable and prioritized delivery of network traffic by classifying and managing packets
based on their importance and requirements. Through mechanisms like marking, queuing,
scheduling, and resource reservation, QoS optimizes network performance and user experience,
especially for delay-sensitive and critical applications.

References:
• Cisco QoS Fundamentals
• RFC 2475: An Architecture for Differentiated Services
• Network World: QoS Explained

UNIT 5
DNS: Hierarchy, Resolution Process, and Types of DNS Servers

DNS Hierarchy
The Domain Name System (DNS) is organized as a hierarchical, inverted tree structure with several
distinct levels1258:
1. Root Level
• The top of the DNS hierarchy, represented by a root zone managed by 13 sets of root
name servers (e.g., a.root-servers.net to m.root-servers.net).
• These servers direct queries to the appropriate Top-Level Domain (TLD) servers125.
2. Top-Level Domain (TLD)
• Directly below the root, TLDs include generic domains like .com, .org, .net, .edu, .gov,
and country codes like .uk, .fr, .in245.
• TLD servers are authoritative for their respective domains and guide queries to the
next level.
3. Second-Level Domain (SLD)
• These are domains registered under a TLD, such as "example" in "example.com"25.
• Managed by individuals or organizations, SLDs serve as the primary identifier for a
website.
4. Subdomain
• Domains under an SLD, used for further organization, such as "blog.example.com"25.
• Subdomains help categorize and manage content within a larger domain.
5. Host
• The specific device or server identified by a fully qualified domain name (FQDN),
such as "mail.example.com"125.
• The host is the endpoint for DNS resolution, mapping to an IP address.

DNS Resolution Process


When a user enters a domain name in a browser, the DNS resolution process typically follows these
steps47:
1. Local DNS Cache Check
• The operating system first checks its local cache for a recent mapping.
2. Recursive DNS Resolver
• If not found locally, the query is sent to a recursive resolver (usually provided by the
ISP).
3. Root Name Server Query
• The resolver queries a root name server, which responds with the address of the
relevant TLD server47.
4. TLD Name Server Query
• The resolver contacts the TLD server (e.g., for .com or .org), which returns the
address of the authoritative server for the SLD.
5. Authoritative Name Server Query
• The resolver queries the authoritative server for the domain, which provides the IP
address for the requested host.
6. Response to Client
• The resolver returns the IP address to the client, which can now connect to the
destination server.

Types of DNS Servers


• Root Name Servers
• At the top of the hierarchy, provide pointers to TLD servers125.
• TLD Name Servers
• Manage specific top-level domains, directing queries to the correct SLD authoritative
servers24.
• Authoritative Name Servers
• Hold the actual DNS records (A, AAAA, MX, etc.) for domains and subdomains45.
• Recursive Resolvers
• Intermediary servers that handle the full lookup process on behalf of clients,
querying other DNS servers as needed and caching results for efficiency47.

Summary Table: DNS Hierarchy and Server Types


Level Example Server Type Role in Resolution

Root . Root Name Server Directs to TLD servers

TLD .com, .org, .uk TLD Name Server Directs to SLD authoritative
Level Example Server Type Role in Resolution

Second-Level example.com Authoritative Server Holds domain records

Subdomain blog.example.com Authoritative Server Holds subdomain records

Host mail.example.com Authoritative Server Maps FQDN to IP address

Recursive Layer (varies, e.g., ISP) Recursive Resolver Handles full lookup process

In summary:
DNS is a hierarchical system with root, TLD, second-level, subdomain, and host levels. The resolution
process involves recursive queries through root, TLD, and authoritative servers, with recursive
resolvers managing the lookup for clients. Each server type plays a specific role in ensuring efficient
and reliable domain name resolution12457.
WWW & HTTP: Structure, Request/Response Model, Status Codes

1. Structure of HTTP
HTTP (HyperText Transfer Protocol) is the foundational protocol of the World Wide Web, enabling
communication between clients (like web browsers) and servers. HTTP is a stateless, text-based
protocol that follows a client-server model125.
HTTP Message Structure
Both HTTP requests and responses share a similar structure2:
• Start-line:
• For requests: describes the HTTP method, target URI, and HTTP version (e.g., GET
/index.html HTTP/1.1).
• For responses: includes the HTTP version, status code, and status text (e.g., HTTP/1.1
200 OK).
• Headers:
• Key-value pairs providing metadata (e.g., Host, Content-Type, User-Agent).
• Empty line:
• Separates headers from the body.
• Body (optional):
• Contains data sent with the request (e.g., form data in POST) or the
resource/content in the response235.

2. HTTP Request/Response Model


HTTP Request
A client sends an HTTP request to a server to perform an action on a resource35:
• Request Line:
• Format: <Method> <Request-URI> <HTTP-Version> (e.g., GET /about HTTP/1.1)
• Headers:
• Provide additional information (e.g., Host: example.com, Accept: text/html).
• Body:

Optional; present in methods like POST or PUT to send data to the server (e.g., form
submissions)235.
Common HTTP Methods:
Method Description

GET Retrieve data from the server

POST Send data to the server (e.g., form submission)

PUT Replace a resource with new data

DELETE Remove a resource

HEAD Like GET, but only retrieves headers

OPTIONS Describes communication options for the resource

PATCH Partially modify a resource

HTTP Response
The server replies to the client’s request with a response message24:
• Status Line:
• Format: <HTTP-Version> <Status-Code> <Status-Text> (e.g., HTTP/1.1 404 Not Found)
• Headers:
• Metadata about the response or resource (e.g., Content-Type: text/html)
• Body:
• Optional; contains the requested resource or error message24.

3. HTTP Status Codes


Status codes are three-digit numbers in the response start-line that indicate the result of the
request2:
Code Range Category Examples & Meaning

1xx Informational 100 Continue, 101 Switching Protocols

2xx Success 200 OK, 201 Created

3xx Redirection 301 Moved Permanently, 302 Found, 304 Not Modified

4xx Client Error 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found

5xx Server Error 500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable

• 200 OK: Request succeeded, resource returned.


• 201 Created: Resource created (e.g., after POST).
• 301/302: Resource moved; client should use new location.
• 400: Bad request; client error in syntax.
• 404: Resource not found.
• 500: Server encountered an error.

Summary Table: HTTP Message Structure


Component Request Example Response Example

Start-line GET /index.html HTTP/1.1 HTTP/1.1 200 OK

Headers Host: example.com Content-Type: text/html

Empty line (CRLF) (CRLF)

Body (e.g., form data in POST) (e.g., HTML page, JSON, error message)

In summary:
HTTP enables communication between web clients and servers using a request/response model.
Each message consists of a start-line, headers, an empty line, and an optional body. Status codes in
responses inform the client about the outcome of their request235.

Email Protocols: SMTP, POP, IMAP — Functions, Differences, Message Flow

1. SMTP (Simple Mail Transfer Protocol)


Function:
• Sending emails: SMTP is the standard protocol for transmitting emails from a client to a mail
server and between mail servers1348.
• Direction: Outgoing mail only.
Message Flow:
• When you send an email, your client uses SMTP to transfer the message to your email
provider’s server.
• The server may use SMTP again to relay the message to the recipient’s mail server.
• SMTP does not handle the retrieval or storage of emails.
Ports:
• Default: 25 (non-encrypted)
• Secure: 465 (SSL/TLS)

2. POP3 (Post Office Protocol version 3)


Function:
• Receiving emails: POP3 is used to download emails from the mail server to the client
device13458.
• Direction: Incoming mail only.
How It Works:
• POP3 downloads all new messages from the server to your device, then (by default) deletes
them from the server15.
• Emails are stored locally; server mailbox is cleared, minimizing server storage use.
• Best for accessing email from a single device.
Ports:
• Default: 110 (non-encrypted)
• Secure: 995 (SSL/TLS)

3. IMAP (Internet Message Access Protocol)


Function:
• Receiving emails: IMAP allows you to view and manage emails directly on the mail server,
keeping messages synchronized across multiple devices13458.
• Direction: Incoming mail only.
How It Works:
• Emails remain on the server; only headers or selected messages are downloaded until
opened5.
• Any changes (read, delete, move) are reflected on all devices.
• Ideal for users who access email from multiple devices or locations.
Ports:
• Default: 143 (non-encrypted)
• Secure: 993 (SSL/TLS)

4. Key Differences: SMTP vs. POP3 vs. IMAP


Protocol Main Function Direction Storage Device Use Case
Location Synchronization

Sending email from


SMTP Send/relay email Outgoing N/A N/A client/server

Single-device email
POP3 Retrieve email Incoming Local device No access

Multi-device,
IMAP Retrieve/manage Incoming Server Yes synchronized access

• SMTP is only for sending; POP3 and IMAP are for receiving.
• POP3 downloads and often deletes messages from the server; IMAP keeps them on the
server and syncs across devices135.
• IMAP supports multiple folders and real-time updates; POP3 is simpler, with limited folder
support.

5. Typical Email Message Flow


1. Sending:
• User composes an email in a mail client.
• Client uses SMTP to send the email to the sender’s mail server.
• Sender’s server uses SMTP to relay the email to the recipient’s mail server.
2. Receiving:
• Recipient’s mail client uses either POP3 or IMAP to access the mailbox.
• With POP3, messages are downloaded and (usually) deleted from the server.
• With IMAP, messages remain on the server and are synchronized across all devices.

In summary:
• SMTP handles outgoing mail (sending and relaying).
• POP3 and IMAP handle incoming mail (retrieving and managing).
• POP3 is best for single-device use; IMAP is preferred for multi-device synchronization and
management135.
FTP: Working, Control/Data Connections, and Commands

How FTP Works


FTP (File Transfer Protocol) is a standard application-layer protocol used to transfer files between
a client and a server over a TCP/IP network. It operates using a client-server model and
establishes two separate TCP connections:
1. Control Connection (Command Channel):
• Used for sending commands from the client to the server and receiving server
responses.
• This connection remains open throughout the FTP session.
• Typically operates over TCP port 21.
• Handles commands like login, directory changes, and file operations.
2. Data Connection (Data Channel):
• Used exclusively for transferring the actual file data or directory listings.
• Opened and closed as needed for each file transfer or directory listing.
• In active mode, the server initiates the data connection from its port 20 to a client
port.
• In passive mode, the server opens a random port and the client initiates the data
connection to that port (preferred behind firewalls and NAT).

FTP Modes
• Active Mode:
• Client opens control connection to server port 21.
• Server opens data connection from its port 20 back to a client-specified port.
• Can be blocked by client-side firewalls due to incoming connection.
• Passive Mode:
• Client opens control connection to server port 21.
• Server opens a random port and informs client.
• Client initiates data connection to that port, avoiding firewall issues.

Basic FTP Commands


Command Description

USER Send username for login

PASS Send password for login


Command Description

LIST List files/directories in current directory

RETR Retrieve (download) a file

STOR Store (upload) a file

CWD Change working directory

PWD Print working directory

QUIT Terminate session and close connections

Typical FTP Session Flow


1. Connection Establishment:
• Client connects to server’s port 21 (control connection).
• Server responds with a "220 Service ready" message.
2. Authentication:
• Client sends USER command with username.
• Server responds with "331 Username OK, need password".
• Client sends PASS command with password.
• Server responds with "230 User logged in".
3. Commands and Data Transfer:
• Client issues commands like LIST to get directory listing or RETR/STOR to
download/upload files.
• Server opens data connection (port 20 or passive port) to transfer requested data.
• Server sends "150 Opening data connection" before transfer and "226 Transfer
complete" after.
4. Session Termination:
• Client sends QUIT.
• Server responds with "221 Service closing control connection" and closes the
session.

Data Transfer Modes


• Stream Mode: Data sent as continuous stream without breaks.
• Block Mode: Data sent in blocks with headers.
• Compressed Mode: Data compressed using algorithms like Lempel-Ziv before transfer.

Summary Table
Aspect Details

Control Connection Commands and responses, port 21, persistent


Aspect Details

Data Connection Actual file/data transfer, port 20 (active) or random (passive)

Modes Active (server connects back), Passive (client connects)

Common Commands USER, PASS, LIST, RETR, STOR, CWD, QUIT

Transfer Modes Stream, Block, Compressed

In summary:
FTP uses two TCP connections—control for commands (port 21) and data for file transfer (port
20 or a dynamic port). It supports active and passive modes to accommodate different network
environments. Commands like USER, PASS, RETR, and STOR manage authentication and file
operations, enabling efficient file transfer between client and server.
TELNET: Remote Login Process and Use Cases

**Remote Login Process with TELNET


TELNET (TErminaL NETwork) is a client-server protocol that enables users to log in to and control
remote computers over a TCP/IP network using a text-based terminal interface36. Here’s how
the remote login process works:
1. Session Initiation:
• The user starts a TELNET client and specifies the domain name or IP address of the
remote server they wish to access6.
• The TELNET client establishes a TCP connection to the server, typically on port 2336.
2. Authentication:
• The server prompts the user for a username and password38.
• Upon successful authentication, the user is granted access to the remote system as if
they were physically present at its terminal3.
3. Command Transmission:
• User keystrokes are captured by the TELNET client, which converts them into a
standard format called Network Virtual Terminal (NVT) characters46.
• These NVT characters are sent over the TCP connection to the server, where they are
translated back to the server’s local terminal format6.
• The server processes the commands and returns output (also as NVT characters),
which the client displays to the user6.
4. Session Termination:
• The user can end the session by issuing a logout or quit command, closing the
TELNET connection4.
Key Points:
• TELNET provides a bidirectional, interactive text communication channel between the user
and the remote system34.
• The protocol is platform-independent due to the use of NVT, allowing different systems to
communicate seamlessly6.
**Use Cases for TELNET
• Remote System Administration:
Administrators can manage servers, network devices, or mainframes remotely using
command-line interfaces37.
• Accessing Legacy Systems:
Useful for connecting to older equipment or embedded devices that only support TELNET.
• Testing and Troubleshooting:
Network engineers use TELNET to test connectivity and manually interact with TCP services
(e.g., SMTP, HTTP) for troubleshooting.
• Educational Purposes:
Demonstrating basic client-server communication and remote login concepts.

**Limitations and Security Considerations


• No Encryption:
All data, including usernames and passwords, is transmitted in plaintext, making TELNET
insecure for sensitive applications48.
• Superseded by SSH:
For secure remote access, SSH (Secure Shell) is now the preferred protocol, as it provides
encrypted and authenticated connections5.

In summary:
TELNET enables users to remotely log in and control computers over a network by establishing a
text-based session via TCP. It is still used for legacy systems and network troubleshooting but has
largely been replaced by SSH due to security concerns.

SNMP: Components, Working, and Management Information Base (MIB)

SNMP Components
An SNMP-managed network typically includes these main components:
• SNMP Manager (Network Management Station, NMS):
• Acts as the central monitoring and control system.
• Sends requests to, and receives responses from, SNMP agents on network devices.
• Collects, analyzes, and displays network data for administrators367.
• SNMP Agent:
• Software running on managed devices (e.g., routers, switches, printers).
• Collects local device data and responds to manager queries.
• Can proactively send alerts (traps) to the manager if certain events occur347.
• Managed Devices (Managed Network Nodes):
• Network hardware or services with SNMP agents installed.
• Examples: routers, switches, servers, printers, access points367.
• Management Information Base (MIB):
• A structured database of objects (variables) that can be monitored or controlled via
SNMP.
• Each object is identified by a unique Object Identifier (OID)37.
How SNMP Works
1. Data Collection:
• SNMP agents on managed devices collect information about device status,
performance, and configuration.
• This data is stored in the device’s MIB37.
2. Communication:
• The SNMP manager communicates with agents using SNMP messages (GET, SET,
TRAP).
• GET: Manager requests specific information from an agent.
• SET: Manager modifies a value on the agent/device.
• TRAP/INFORM: Agent sends an unsolicited alert to the manager when specific
events occur67.
3. Request-Response Model:
• The manager sends a request (e.g., GET) to the agent.
• The agent retrieves the requested data from its MIB and responds.
• The manager can also set values or receive asynchronous notifications (traps) from
agents37.

Management Information Base (MIB)


• Definition:
The MIB is a hierarchical database of all manageable objects (variables) on a device,
described using OIDs (Object Identifiers)37.
• Structure:
• Organized in a tree-like structure, with each node representing a specific variable or
group of variables (e.g., system uptime, interface status).
• Each variable/object in the MIB has a unique OID, allowing precise querying and
control7.
• Role:
• The SNMP agent uses the MIB to answer manager queries and to determine what
information it can provide or modify37.
• MIBs are typically vendor-specific but follow standard structures for interoperability.

Summary Table: SNMP Components and Roles


Component Role/Function

SNMP Manager Central controller; queries agents, receives data

SNMP Agent Collects device data; responds to manager; sends traps

Managed Device Hardware running SNMP agent

MIB Database of manageable objects (OIDs)


In summary:
SNMP enables centralized monitoring and management of network devices through a manager-
agent architecture. The manager queries agents on managed devices, which store device data in
a structured MIB. The MIB organizes all manageable variables, each identified by an OID,
facilitating efficient network management and automation367.

Data Compression: Lossless vs. Lossy, Basic Algorithms

Lossless Compression
Definition:
Lossless compression reduces file size without any loss of original data. After decompression, the
data is restored exactly to its original form279.
Key Features:
• Data Integrity: No information is lost; perfect restoration is possible567.
• Quality: No degradation of quality, even after multiple compressions256.
• Compression Ratio: Typically achieves moderate file size reduction compared to lossy
methods56.
• Use Cases: Text files, program code, medical images, sensitive or confidential data, and
formats like PNG, TIFF, FLAC89.
Common Algorithms:
• Run-Length Encoding (RLE): Replaces sequences of repeated data with a count and a single
value.
• Huffman Coding: Uses variable-length codes for encoding symbols based on their
frequencies.
• Lempel-Ziv-Welch (LZW): Builds a dictionary of data patterns for efficient encoding.
• Arithmetic Encoding: Represents a sequence of symbols as a single number between 0 and
139.

Lossy Compression
Definition:
Lossy compression reduces file size by permanently removing some data, especially data considered
less noticeable to human perception. The original data cannot be perfectly restored after
decompression12679.
Key Features:
• Data Loss: Some original data is discarded, leading to irreversible changes259.
• Quality: May degrade, especially after repeated compressions, but typically not noticeable at
moderate compression levels156.
• Compression Ratio: Achieves much higher file size reduction than lossless compression567.
• Use Cases: Multimedia files such as images (JPEG), audio (MP3), and video (MPEG), where
perfect fidelity is less critical3689.
Common Algorithms:
• Transform Coding (e.g., Discrete Cosine Transform in JPEG): Converts data to frequency
components and removes less important frequencies.
• Fractal Compression: Encodes images using fractal codes.
• Subband Coding: Splits data into bands and compresses each differently.
• Vector Quantization: Maps vectors of data to a finite set of values39.

Comparison Table: Lossless vs. Lossy Compression


Feature Lossless Compression Lossy Compression

Data Restoration Perfectly restored Not perfectly restored

Quality No loss Some loss, often imperceptible

Compression Ratio Moderate High

Use Cases Text, code, sensitive data, PNG, FLAC Images, audio, video, JPEG, MP3, MPEG

Algorithms RLE, Huffman, LZW, Arithmetic DCT, Fractal, Subband, Vector Quantization

In summary:
• Lossless compression preserves all data, ideal for critical or sensitive files, using algorithms
like Huffman coding and LZW.
• Lossy compression discards some data for higher size reduction, suitable for multimedia,
using algorithms like JPEG and MP323679.
Cryptography: Symmetric/Asymmetric Encryption and Basic Terminology

What is Cryptography?
Cryptography is the science and practice of securing information by transforming it so that only
authorized parties can read or process it. It is fundamental for ensuring confidentiality, integrity,
authentication, and non-repudiation in digital communication126.

Basic Terminology
• Plaintext: The original, readable message or data that needs protection234.
• Ciphertext: The unreadable, scrambled output produced after encrypting plaintext2345.
• Encryption: The process of converting plaintext into ciphertext using an algorithm and a
key234.
• Decryption: The reverse process—converting ciphertext back to plaintext using a key and
algorithm234.
• Key: A value (numeric, alphanumeric, or symbolic) used by encryption and decryption
algorithms to lock (encrypt) or unlock (decrypt) information. The secrecy of the key is
essential for security2345.
• Cipher/Algorithm: The mathematical formula or method used to perform encryption and
decryption34.
• Hashing: Produces a fixed-size output (hash) from input data, used for integrity verification,
not reversible to original data2.
• Cryptanalysis: The study and practice of breaking cryptographic systems or discovering
weaknesses3.

Symmetric Encryption (Secret Key Cryptography)


• Definition: Uses the same key for both encryption and decryption35.
• Key Characteristics:
• Single shared key: Both sender and receiver must possess the same secret key.
• Speed: Generally faster and suitable for encrypting large amounts of data.
• Key Distribution: Securely sharing the key is a challenge, especially as the number of
users grows (scalability issue).
• Examples: AES, DES, 3DES, RC4.
• Use Cases: Encrypting files, databases, or network traffic where both parties can securely
share a key.

Asymmetric Encryption (Public Key Cryptography)


• Definition: Uses a pair of mathematically related keys—a public key (for encryption) and a
private key (for decryption)5.
• Key Characteristics:
• Key pair: Public key is shared openly; private key is kept secret.
• No need for a shared secret: Solves the key distribution problem.
• Slower: Computationally more intensive, often used to exchange symmetric keys or
for digital signatures.
• Examples: RSA, ECC, DSA.
• Use Cases: Secure email (PGP), SSL/TLS for web security, digital signatures, key exchange.

Summary Table: Symmetric vs. Asymmetric Encryption


Feature Symmetric Encryption Asymmetric Encryption

Keys Used Single shared secret key Public and private key pair

Speed Fast Slower

Key Distribution Challenging as users increase Easier (public key can be shared)

Use Cases Bulk data encryption Key exchange, digital signatures

Examples AES, DES, 3DES RSA, ECC, DSA

In summary:
• Symmetric encryption uses one shared key for both encryption and decryption, offering
speed but requiring secure key exchange.
• Asymmetric encryption uses a public/private key pair, solving key distribution issues and
enabling digital signatures, but is slower.
• Key cryptographic terms include plaintext, ciphertext, encryption, decryption, key, cipher,
and hashing2345.
VPN: Purpose, Basic Working, Tunneling

Purpose of a VPN
A Virtual Private Network (VPN) creates a secure, encrypted connection over a public network, like
the internet5. The main purposes of using a VPN are:
• Enhanced Security: VPNs encrypt your internet traffic, making it difficult for hackers to
intercept your data, especially on public Wi-Fi networks2. This protects sensitive information
like passwords and credit card numbers6.
• Privacy: VPNs mask your real IP address and location, hiding your browsing activity from
your ISP, advertisers, and websites16.
• Secure Remote Access: VPNs allow employees to securely access a company's network and
resources remotely, ensuring the integrity and confidentiality of corporate
communications45.
• Accessing Geo-Restricted Content: VPNs enable you to bypass geographical restrictions and
access content that might be blocked in your region by connecting to servers in other
locations36.
• Bypassing Censorship: VPNs can help you access websites and services that are blocked or
restricted in certain countries or networks, maintaining internet freedom6.

Basic Working of a VPN


A VPN works by creating a secure connection, often referred to as a "tunnel," between your device
and a VPN server5. Here's a simplified breakdown:
1. Encryption: When you connect to a VPN, your data is encrypted, transforming it into an
unreadable format6. This encryption prevents unauthorized parties from deciphering your
information3.
2. Tunneling: The encrypted data is then transmitted through the secure tunnel to the VPN
server5.
3. IP Address Masking: The VPN server acts as an intermediary, masking your real IP address
and assigning you a new one56. This gives the impression that your internet requests are
originating from the VPN server's location, not your actual location5.
4. Decryption: When the data reaches its destination, it is decrypted, allowing you to access
the content or service6.

Tunneling
Tunneling is a core component of how VPNs operate5. It involves encapsulating data packets within
other packets to create a secure pathway through a network5.
• Secure Connection: A VPN establishes a protected passageway known as a tunnel5.
• Data Concealment: Information from a device using a VPN is concealed and transmitted
through this tunnel5.
• Protocols: VPNs channel data through a secure tunneling protocol, with the data encrypted
to block unauthorized entities5. Widely recognized encryption standards include Transport
Layer Security (TLS) and Internet Protocol Security (IPsec)5.
In essence, tunneling ensures that your data remains private and protected as it travels across the
internet5.

DIFFERENCE BASED QUESTION


1. OSI Model vs. TCP/IP Model
Parameter OSI Model TCP/IP Model

Transmission Control
Full Form Open Systems Interconnection Protocol/Internet Protocol

7 (Physical, Data Link, Network, Transport, 4 (Network Access, Internet,


Layers Session, Presentation, Application) Transport, Application)

Approach Vertical (layered, protocol-independent) Horizontal (protocol-dependent)

Layer Separation Presentation and Session layers separate Combined into Application layer

Protocol suite for practical


Standardization Reference model for standardization implementation

Reliability Less reliable More reliable

Protocol
Replacement Easy Difficult

Real-world networking (e.g., the


Use Guidance and teaching Internet)

Introduction Year 1984 (ISO) 1982 (ARPANET)

References: 12356

2. LAN vs. WAN


Parameter LAN (Local Area Network) WAN (Wide Area Network)

Coverage Area Limited (e.g., building, campus) Large (city, country, or global)

Ownership Usually private (single organization) Public or private (multiple organizations)

Speed High (up to 10 Gbps or more) Lower (typically Mbps to Gbps)

Cost Low setup and maintenance High setup and maintenance

Devices Used Switches, hubs, routers Routers, switches, gateways

Example Office network, school network Internet, bank networks

3. Hub vs. Switch vs. Router


Feature Hub Switch Router
Feature Hub Switch Router

Layer Physical (Layer 1) Data Link (Layer 2) Network (Layer 3)

Broadcasts data to all Forwards data to specific


Function ports device/port Routes data between networks

Learns MAC addresses, Uses IP addresses, makes


Intelligence No filtering, no learning filters traffic routing decisions

Collision
Domain One (all ports share) Each port has its own Each port has its own

Broadcast Multiple (divides broadcast


Domain One One domains)

Small/simple networks Modern LANs, efficient Connecting different networks,


Use Case (legacy) traffic Internet

In summary:
• OSI is a conceptual, layered reference model; TCP/IP is a practical protocol suite.
• LAN covers small areas with high speed; WAN covers large areas with lower speed.
• Hub is basic and broadcasts, switch is smarter and forwards, router connects networks using
IP.

1. Stop-and-Wait vs. Sliding Window Protocol


Feature Stop-and-Wait Protocol Sliding Window Protocol

Sender sends one frame, waits for ACK Sender can send multiple frames
Mechanism before next frame before needing ACK

Variable (1 to N, where N is window


Window Size 1 size)

High (better link utilization, less idle


Efficiency Low (idle time during wait for ACK) time)

Transmission Type Half duplex Full duplex

Propagation Delay Lower (windowing mitigates delay


Impact High (greater effect on efficiency) impact)

Acknowledgment After every frame After a group/window of frames

Link Utilization Poor Better


Feature Stop-and-Wait Protocol Sliding Window Protocol

Sorting/Ordering Not needed Required for proper frame sequence

Summary: Sliding Window is more efficient and better utilizes the link, especially over high-delay
networks, while Stop-and-Wait is simpler but less efficient145.

2. Pure ALOHA vs. Slotted ALOHA


Feature Pure ALOHA Slotted ALOHA

Time Division No time slots; transmit anytime Time is divided into discrete slots

Transmission Start Any time Only at the start of a slot

Vulnerable Period 2 × frame time 1 × frame time

Maximum Efficiency 18.4% 36.8%

Collision Probability Higher Lower (due to synchronized slots)

Complexity Simpler Slightly more complex (needs synchronization)

Summary: Slotted ALOHA is more efficient and has fewer collisions than Pure ALOHA due to slot
synchronization.

3. CRC vs. Checksum


Feature CRC (Cyclic Redundancy Check) Checksum

Method Polynomial division, uses binary math Simple addition of data units

Error Detection Power Very high (detects burst errors) Moderate (detects simple errors)

Complexity More complex (hardware/software) Simple (easy to implement)

Use Cases Data link layer, storage, networking IP header, UDP/TCP, simple protocols

Error Correction Detection only Detection only

Summary: CRC provides stronger error detection (especially for burst errors) than checksum, but is
more complex to implement.

These comparisons cover the essential differences and use cases for each pair, as expected in AKTU
syllabus and exams.
1. IPv4 vs. IPv6
Feature IPv4 IPv6

Address Length 32 bits (4 octets) 128 bits (16 octets)

Decimal, dot-separated (e.g., Hexadecimal, colon-separated (e.g.,


Address Format 192.168.1.1) 2001:0db8::1)

Address Space ~4.3 billion addresses ~340 undecillion addresses

Header Size Variable (20–60 bytes) Fixed (40 bytes)

Security Optional (IPsec not mandatory) Mandatory (IPsec built-in)

Configuration Manual/DHCP Auto-configuration and renumbering supported

NAT Widely used Not required (end-to-end connectivity)

Fragmentation By sender and routers Only by sender

Packet Flow ID Not available Available (Flow Label field)

Multicasting Optional Built-in

Checksum Present Not present

Example
Address 192.168.10.150 3002:0bd6:0000:0000:0000:ee00:0033:6778

Summary:
IPv6 provides a vastly larger address space, improved security, simplified headers, and better support
for modern networking needs compared to IPv4123567.

2. Static vs. Dynamic Routing


Feature Static Routing Dynamic Routing

Configuration Manual (admin sets routes) Automatic (protocols calculate routes)

Does not adapt to network changes Adapts automatically to topology


Adaptability automatically changes

Complexity Simple for small networks Suitable for large, complex networks

Overhead Low (no protocol messages) Higher (uses bandwidth for updates)

Maintenance High (manual updates needed) Lower (routes update automatically)


Feature Static Routing Dynamic Routing

Examples Small office, simple LANs Internet, enterprise networks

Protocols N/A (manual) RIP, OSPF, EIGRP, BGP, etc.

3. Distance Vector vs. Link State Routing


Feature Distance Vector Routing Link State Routing

Algorithm Bellman-Ford Dijkstra

Updates Periodic, entire routing table Event-triggered, only changes advertised

Knowledge Knows only neighbors’ info Knows entire network topology

Convergence Slower Faster

Scalability Less scalable More scalable

Examples RIP, IGRP OSPF, IS-IS

Bandwidth Usage Higher (large updates) Lower (smaller, targeted updates)

Loop Prevention Difficult (uses split horizon, etc.) Easier (uses SPF tree, sequence numbers)

Summary:
• IPv6 solves IPv4’s address limitations and adds security and efficiency.
• Static routing is manual and best for small, stable networks; dynamic routing is automatic
and adapts to changes.
• Distance vector protocols are simpler but slower to converge; link state protocols are faster
and more efficient for large networks.
TCP vs. UDP
Feature TCP (Transmission Control Protocol) UDP (User Datagram Protocol)

Connection-oriented (requires
Connection handshake) Connectionless (no handshake)

Reliable: guarantees delivery, order, and Unreliable: no guarantee of delivery or order,


Reliability checks for errors minimal error checking

Data sent in sequence, reassembled at Data sent as independent packets


Data Transfer receiver (datagrams)

Error Handling Extensive (acknowledgments, Basic (checksum only, no retransmission)


Feature TCP (Transmission Control Protocol) UDP (User Datagram Protocol)

retransmission)

Yes (prevents sender from


Flow Control overwhelming receiver) No

Congestion Yes (adjusts rate based on network


Control conditions) No

Slower (due to overhead of reliability


Speed features) Faster (minimal overhead)

Header Size 20 bytes (minimum) 8 bytes

Web browsing, email, file transfer,


Use Cases banking Streaming, gaming, VoIP, DNS queries

TCP is chosen for applications where reliability and order are crucial, while UDP is preferred for
speed-sensitive, real-time applications where occasional data loss is acceptable2345678.

Flow Control vs. Congestion Control


Feature Flow Control Congestion Control

Prevents sender from overwhelming


Purpose the receiver Prevents network from becoming overloaded

Network-wide (sender adapts to network


Scope End-to-end (sender and receiver) conditions)

Uses acknowledgments, window size Uses algorithms like slow start, congestion
Mechanism (e.g., sliding window) avoidance, fast retransmit/recovery

Example TCP (congestion window, AIMD), other transport


Protocols TCP (window size adjustment) protocols

Network detects packet loss, delay, or


Trigger Receiver’s buffer is full or nearly full congestion signals

Summary:
• Flow control manages the rate of data between sender and receiver to match the receiver’s
capacity.
• Congestion control manages the rate of data entering the network to avoid overwhelming
the network infrastructure.
TCP implements both mechanisms to ensure efficient, reliable, and fair communication7.
1. SMTP vs. POP/IMAP
Feature SMTP (Simple Mail POP3 (Post Office IMAP (Internet Message Access
Transfer Protocol) Protocol 3) Protocol)

Main Sending emails (outgoing Retrieving emails Retrieving and managing emails
Function mail) (downloads to device) (syncs on server)

Outbound (client/server
Direction to server) Inbound (server to client) Inbound (server to client)

Message Not stored; transmits to Downloads and usually Keeps emails on the server; syncs
Storage recipient server deletes from server across devices

No (emails not synced


Device Sync Not applicable across devices) Yes (real-time sync across devices)

Accessing emails from a Accessing/managing emails from


Use Case Sending new messages single device multiple devices

Protocol
Type Push protocol Pop (pull) protocol Pull protocol

• SMTP is used for sending emails from a client to a server or between servers, not for
retrieving emails1457.
• POP3 downloads emails from the server to a single device and typically deletes them from
the server, making it best for single-device use245.
• IMAP keeps emails on the server and synchronizes them across multiple devices, allowing
organization and management on the server itself2457.

2. HTTP vs. HTTPS


Feature HTTP (HyperText Transfer Protocol) HTTPS (HTTP Secure)

Security Unencrypted, data sent in plain text Encrypted using SSL/TLS

Port 80 443

Data Vulnerable to interception and Protects data from eavesdropping and


Protection tampering tampering

Certificate No digital certificate required Requires SSL/TLS certificate

Use Case Non-sensitive browsing Sensitive transactions (banking, login, etc.)

URL Prefix http:// https://


• HTTPS is HTTP layered with SSL/TLS encryption, ensuring data confidentiality and integrity
during transmission.

3. Symmetric vs. Asymmetric Cryptography


Feature Symmetric Cryptography Asymmetric Cryptography

Keys Used Single shared secret key Key pair: public key (encrypt), private key (decrypt)

Speed Fast (efficient for large data) Slower (computationally intensive)

Key
Distribution Requires secure key exchange Public key can be shared openly

Bulk data encryption (files, disks,


Use Cases VPNs) Secure key exchange, digital signatures, SSL/TLS

Examples AES, DES, 3DES, RC4 RSA, ECC, DSA

Private key must be kept secret; public key can be


Security Compromised if key is leaked distributed

• Symmetric encryption is efficient but needs secure key sharing.


• Asymmetric encryption solves key distribution issues and enables digital signatures, but is
slower and used for smaller data or key exchange.

Summary:
• SMTP is for sending emails, while POP3 and IMAP are for retrieving them (POP3 for single-
device, IMAP for multi-device sync)12457.
• HTTP is unencrypted; HTTPS is secure and encrypted.
• Symmetric cryptography uses one shared key; asymmetric cryptography uses a
public/private key pair for enhanced security and easier distribution.

You might also like