Computer Network Pyq
Computer Network Pyq
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.
Data Link Framing, MAC addressing, error detection Ethernet, PPP, Switches
References
• Hero Vired: 7 Layers of OSI Model1
• Imperva: OSI Model Layers2
• BYJU'S: OSI Model5
• TechTarget: OSI Model Explained6
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)
Number of Layers 7 4
Protocol
Specification Model first, then protocols Protocols first, then model
Example
Protocols FTP, SMTP, TCP, IP, Ethernet HTTP, FTP, TCP, UDP, IP, Ethernet
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.
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.
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.
Switch 2 (Data Link) Forwards data to specific MAC addresses, reduces collisions
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.
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
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.
PAN Personal Area Net. Few meters Bluetooth between phone & headset
• 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
Data Link Ethernet, PPP, HDLC Framing, MAC addressing, error detection
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).
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.
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
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
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.
Topologies Bus, Star, Ring, Mesh, Tree, Hybrid, Point-to-Point, Daisy Chain
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.
Data Link Framing, MAC addressing, error detection/correction, flow control, access control
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.
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.
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.
Single-bit
Parity Adds parity bit errors Simple, fast Not for burst errors
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
Hamming Corrects 1-bit, Parity bits identify error RAM, digital comms,
Code Block FEC detects 2 position; flip bit storage
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
Frames in
Transit One at a time Multiple (up to window size)
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
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.
Collision
Detection No Yes No (collision avoidance)
Wired LANs
Use Case Satellite, simple LANs (Ethernet) Wireless LANs (Wi-Fi)
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
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
802.11 802.11 2.4 GHz 1–2 Mbps FHSS, DSSS ~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
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.
OSI Layer Data Link (Layer 2) Data Link (Layer 2), sometimes Layer 3
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
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.
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
Summary Table
Protocol Function Message Format Highlights Typical Use Cases
Request/Reply: MAC, IP
RARP MAC-to-IP mapping fields Diskless device bootstrapping
Error reporting,
ICMP diagnostics Type, Code, Checksum, Data Ping, unreachable, network errors
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.
Routing Table
Size Small (one entry per destination) Larger, updated dynamically
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
• 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.
Routing Info Shared With neighbors only With all routers in the network
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
Protocol Type Distance vector (IGP) Link state (IGP) Path vector (EGP)
Convergence
Speed Slow Fast Slow
Update
Mechanism Periodic full table Event-driven LSAs Event-driven path updates
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
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
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
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
Flow/Congestion
Control Yes No
Acknowledgments Yes No
Feature TCP UDP
Sequencing Yes No
Retransmissions Yes No
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
Summary Table
Stage Action Key Mechanism
Sender Collects data from multiple processes, adds port numbers Multiplexing
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.
Server → Client: SYN-ACK SYN, ACK Acknowledge SYN, send own ISN
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
**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.
Summary Table
Mechanism Purpose How It Works
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
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.
Congestion
Avoid. Linear (additive) Packet loss Multiplicative decrease (CWND halved)
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.
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.
Scheduling Decide packet transmission order Round Robin, Weighted Fair Queuing
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.
TLD .com, .org, .uk TLD Name Server Directs to SLD authoritative
Level Example Server Type Role in Resolution
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.
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.
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
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.
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.
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
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.
Summary Table
Aspect Details
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
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
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.
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.
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.
Keys Used Single shared secret key Public and private key pair
Key Distribution Challenging as users increase Easier (public key can be shared)
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.
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.
Transmission Control
Full Form Open Systems Interconnection Protocol/Internet Protocol
Layer Separation Presentation and Session layers separate Combined into Application layer
Protocol
Replacement Easy Difficult
References: 12356
Coverage Area Limited (e.g., building, campus) Large (city, country, or global)
Collision
Domain One (all ports share) Each port has its own Each port has its own
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.
Sender sends one frame, waits for ACK Sender can send multiple frames
Mechanism before next frame before needing ACK
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.
Time Division No time slots; transmit anytime Time is divided into discrete slots
Summary: Slotted ALOHA is more efficient and has fewer collisions than Pure ALOHA due to slot
synchronization.
Method Polynomial division, uses binary math Simple addition of data units
Error Detection Power Very high (detects burst errors) Moderate (detects simple errors)
Use Cases Data link layer, storage, networking IP header, UDP/TCP, simple protocols
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
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.
Complexity Simple for small networks Suitable for large, complex networks
Overhead Low (no protocol messages) Higher (uses bandwidth for 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)
retransmission)
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.
Uses acknowledgments, window size Uses algorithms like slow start, congestion
Mechanism (e.g., sliding window) avoidance, fast retransmit/recovery
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
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.
Port 80 443
Keys Used Single shared secret key Key pair: public key (encrypt), private key (decrypt)
Key
Distribution Requires secure key exchange Public key can be shared openly
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.