Data Communication and Computer Networks

Table of Contents

  1. OSI Model (All 7 Layers)
  2. TCP/IP Model
  3. Transmission Media
  4. Multiplexing Techniques
  5. Switching Techniques
  6. Error Detection and Correction
  7. Flow Control
  8. Congestion Control
  9. Routing Algorithms
  10. IP Addressing (IPv4/IPv6)
  11. NAT, DHCP, DNS
  12. Application Layer Protocols
  13. Network Devices
  14. SDN Basics
  15. Quality of Service (QoS)

OSI Model (All 7 Layers)

The OSI (Open Systems Interconnection) model is a 7-layer reference framework defined by ISO (ISO 7498) that standardizes network communication.

Layer 7 — Application Layer

Layer 6 — Presentation Layer

Layer 5 — Session Layer

Layer 4 — Transport Layer

Layer 3 — Network Layer

Layer 1 — Physical Layer

OSI Layer Quick Reference Table

Layer Name PDU Key Function Example Protocols
7 Application Data User interface HTTP, FTP, SMTP
6 Presentation Data Translation/Encryption SSL, JPEG, ASCII
5 Session Data Session management NetBIOS, RPC
4 Transport Segment Reliability, flow ctrl TCP, UDP
3 Network Packet Routing, addressing IP, ICMP, OSPF
2 Data Link Frame MAC, error detection Ethernet, PPP
1 Physical Bits Bit transmission RS-232, DSL

TCP/IP Model

The TCP/IP model is the practical, implementation-focused model used on the internet. It has 4 layers.

TCP/IP Layer OSI Equivalent Key Protocols
Application Layers 5, 6, 7 HTTP, FTP, SMTP, DNS, SNMP
Transport Layer 4 TCP, UDP, SCTP
Internet Layer 3 IPv4, IPv6, ICMP, ARP, IGMP
Network Access (Link) Layers 1, 2 Ethernet, Wi-Fi, PPP, DSL

TCP vs UDP Comparison

Feature TCP UDP
Connection Connection-oriented Connectionless
Reliability Guaranteed delivery Best-effort (no guarantee)
Ordering Ordered delivery No ordering guarantee
Speed Slower (overhead) Faster (minimal overhead)
Header Size 20-60 bytes 8 bytes
Flow Control Yes (sliding window) No
Congestion Control Yes No
Use Cases Web, email, file transfer Streaming, gaming, VoIP, DNS

TCP Three-Way Handshake

  1. SYN: Client → Server (synchronize sequence)
  2. SYN-ACK: Server → Client (acknowledge + synchronize)
  3. ACK: Client → Server (acknowledge connection)

TCP Connection Termination (Four-Way)

  1. FIN from sender → ACK from receiver
  2. FIN from receiver → ACK from sender

Transmission Media

Guided (Wired) Media

Media Bandwidth Distance Interference Cost
Twisted Pair (Cat 5/6/7) Up to 10 Gbps 100m Moderate Low
Coaxial Cable Up to 100 Mbps 500m Low Medium
Fiber Optic (Single-mode) Up to 100+ Gbps 100+ km None High
Fiber Optic (Multi-mode) Up to 10 Gbps 2 km None Medium-High

Fiber Optic Advantages

Unguided (Wireless) Media

Type Frequency Range Use Case
Radio Waves 3 KHz – 1 GHz Omnidirectional AM/FM, TV
Microwaves 1 GHz – 300 GHz Directional Satellite, cellular
Infrared 300 GHz – 400 THz Line-of-sight Remote controls

Key Terms


Multiplexing Techniques

Multiplexing allows multiple signals to share a single communication channel.

Frequency Division Multiplexing (FDM)

Time Division Multiplexing (TDM)

Wavelength Division Multiplexing (WDM)

Code Division Multiplexing (CDM/CDMA)


Switching Techniques

Circuit Switching

Packet Switching

Message Switching


Error Detection and Correction

Error Types

Error Detection Methods

Parity Check

Checksum

Cyclic Redundancy Check (CRC)

Error Correction Methods

Hamming Code


Flow Control

Flow control ensures the sender doesn't overwhelm the receiver.

Stop-and-Wait Flow Control

Sliding Window Protocol

Go-Back-N ARQ

Selective Repeat ARQ


Congestion Control

Congestion occurs when too many packets are in the network, causing delays and loss.

TCP Congestion Control Algorithms

Slow Start

Congestion Avoidance

Fast Retransmit

Fast Recovery

TCP Variants


Routing Algorithms

Non-Adaptive (Static) Routing

Adaptive (Dynamic) Routing

Distance Vector Routing (e.g., RIP)

Path Vector Routing (e.g., BGP)

Routing Protocol Comparison

Protocol Type Algorithm Metric Domain
RIP Distance Vector Bellman-Ford Hop Count Intra-domain
OSPF Link State Dijkstra Cost (bandwidth) Intra-domain
BGP Path Vector Policy-based Path attributes Inter-domain

IP Addressing (IPv4/IPv6)

IPv4

IPv4 Classes (Classful Addressing)

Class First Octet Range Network Bits Host Bits Default Subnet Mask # Networks Hosts/Network
A 1-126 8 24 255.0.0.0 (/8) 126 16,777,214
B 128-191 16 16 255.255.0.0 (/16) 16,384 65,534
C 192-223 24 8 255.255.255.0 (/24) 2,097,152 254
D 224-239 Multicast
E 240-255 Reserved

Private IP Ranges

Subnetting

Example: 192.168.1.0/26
- Subnet mask: 255.255.255.192
- Subnets: 2² = 4 subnets
- Hosts per subnet: 2⁶ - 2 = 62
- Subnets: 192.168.1.0, 192.168.1.64, 192.168.1.128, 192.168.1.192

IPv6

IPv4 vs IPv6 Comparison

Feature IPv4 IPv6
Address Size 32 bits 128 bits
Header Size 20-60 bytes Fixed 40 bytes
NAT Required Not needed
IPsec Optional Built-in
Broadcast Yes No (replaced by multicast)
Checksum In header Removed (handled by upper layers)

NAT, DHCP, DNS

NAT (Network Address Translation)

DHCP (Dynamic Host Configuration Protocol)

DNS (Domain Name System)


Application Layer Protocols

HTTP/HTTPS

FTP (File Transfer Protocol)

SMTP / POP3 / IMAP

Other Important Protocols


Network Devices

Device Layer Function Key Feature
Hub Physical (L1) Repeats signal to all ports No intelligence; single collision domain
Repeater Physical (L1) Amplifies/regenerates signal Extends network distance
Bridge Data Link (L2) Connects two LAN segments Filters frames using MAC address table
Switch Data Link (L2) Forwards frames to specific port Each port = separate collision domain; uses MAC table
Router Network (L3) Routes packets between networks Uses IP address; separate broadcast domains
Gateway All layers Protocol translation between different networks Most complex; connects dissimilar systems
Modem Physical (L1) Modulates/demodulates signals Converts digital ↔ analog

Switch vs Router vs Hub

Feature Hub Switch Router
Layer 1 2 3
Address Used None MAC IP
Collision Domain Single Per port Per port
Broadcast Domain Single Single Per port
Intelligence None Moderate High

SDN Basics

Software-Defined Networking (SDN) separates the control plane from the data plane.

Architecture

Key Concepts

Advantages


Quality of Service (QoS)

QoS ensures reliable and predictable network performance for critical applications.

Key QoS Parameters

QoS Mechanisms

Traffic Classification and Marking

Queuing Mechanisms

Traffic Shaping and Policing

Integrated Services (IntServ)

Differentiated Services (DiffServ)


Key Formulas Summary

Formula Description
C = B × log₂(1 + SNR) Shannon's Channel Capacity
C = 2B × log₂(L) Nyquist Bit Rate
U = Td / (Td + 2Tp) Stop-and-Wait Efficiency
2^r ≥ m + r + 1 Hamming Code (r parity bits for m data bits)
Subnets = 2^n Subnetting (n = borrowed bits)
Hosts = 2^h - 2 Hosts per subnet (h = host bits)
W ≤ 2^k - 1 Go-Back-N window size
W ≤ 2^(k-1) Selective Repeat window size

Exam Tips

  1. OSI vs TCP/IP: Know which protocols belong to which layer — most asked topic
  2. Subnetting: Practice CIDR calculations — guaranteed question
  3. TCP vs UDP: Comparison table is frequently tested
  4. Hamming Code: Practice calculating parity bits and error detection
  5. Routing Protocols: RIP vs OSPF vs BGP differences are commonly asked
  6. TCP Congestion Control: Understand AIMD, slow start, fast retransmit
  7. Network Devices: Know which device operates at which layer
  8. CRC: Understand the division process for error detection

Practice Questions

10 MCQs for Data Communication and Computer Networks with detailed explanations.

Q1. Consider the following about defined by ISO (ISO 7498) that standardizes network communic...

Layer 7 — Application Layer

-
- D. It applies only to sequential processing models

✅ Correct Answer: Option C

Explanation:
The correct answer is Option C — defined by ISO (ISO 7498) that standardizes network communication.

Layer 7 — Application Layer

-.

This is a standard concept in Data Communication and Computer Networks. The answer follows from the fundamental definitions and properties covered in this topic.

Why other options are incorrect:
- Option A (It is not applicable in distributed systems...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option B (It requires a minimum of O(n²) time complexity...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option D (It applies only to sequential processing models...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.


Q2. Consider the following about Reduces data size for transmission

-...

✅ Correct Answer: Option B

Explanation:
The correct answer is Option B — Reduces data size for transmission
-.

This is a standard concept in Data Communication and Computer Networks. The answer follows from the fundamental definitions and properties covered in this topic.

Why other options are incorrect:
- Option A (It requires a minimum of O(n²) time complexity...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option C (It is not applicable in distributed systems...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option D (It applies only to sequential processing models...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.


Q3. Consider the following about Establishes, manages, and terminates sessions (connections) ...

✅ Correct Answer: Option C

Explanation:
The correct answer is Option C — Establishes, manages, and terminates sessions (connections) between applications
-.

This is a standard concept in Data Communication and Computer Networks. The answer follows from the fundamental definitions and properties covered in this topic.

Why other options are incorrect:
- Option A (It applies only to sequential processing models...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option B (It requires a minimum of O(n²) time complexity...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option D (It is not applicable in distributed systems...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.


Q4. Consider the following about Transmission of raw bit stream over physical medium

-...

✅ Correct Answer: Option C

Explanation:
The correct answer is Option C — Transmission of raw bit stream over physical medium
-.

This is a standard concept in Data Communication and Computer Networks. The answer follows from the fundamental definitions and properties covered in this topic.

Why other options are incorrect:
- Option A (It requires a minimum of O(n²) time complexity...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option B (It applies only to sequential processing models...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option D (It is not applicable in distributed systems...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.


Q5. Consider the following about Bit rate, physical topology (star, bus, ring, mesh), transmi...

✅ Correct Answer: Option D

Explanation:
The correct answer is Option D — Bit rate, physical topology (star, bus, ring, mesh), transmission mode (simplex, half-duplex, full-duplex), signal encod.

This is a standard concept in Data Communication and Computer Networks. The answer follows from the fundamental definitions and properties covered in this topic.

Why other options are incorrect:
- Option A (It is not applicable in distributed systems...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option B (It requires a minimum of O(n²) time complexity...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option C (It applies only to sequential processing models...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.


Q6. Consider the following about Quality of Service (QoS)](#qos)


OSI Model (All 7 La...


OSI Model (All 7 Layers)

The OSI (Open Systems Interc

✅ Correct Answer: Option D

Explanation:
The correct answer is Option D — Quality of Service (QoS)](#qos)


OSI Model (All 7 Layers)

The OSI (Open Systems Interc.

This is a standard concept in Data Communication and Computer Networks. The answer follows from the fundamental definitions and properties covered in this topic.

Why other options are incorrect:
- Option A (It applies only to sequential processing models...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option B (It is not applicable in distributed systems...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option C (It requires a minimum of O(n²) time complexity...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.


Q7. Consider the following about Purpose:** Interface between user applications and network s...

✅ Correct Answer: Option B

Explanation:
The correct answer is Option B — Purpose:** Interface between user applications and network services..

This is a standard concept in Data Communication and Computer Networks. The answer follows from the fundamental definitions and properties covered in this topic.

Why other options are incorrect:
- Option A (It is not applicable in distributed systems...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option C (It requires a minimum of O(n²) time complexity...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option D (It applies only to sequential processing models...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.


Q8. Consider the following about Key Protocols:** HTTP, HTTPS, FTP, SMTP, POP3, IMAP, DNS, SN...

✅ Correct Answer: Option B

Explanation:
The correct answer is Option B — Key Protocols:** HTTP, HTTPS, FTP, SMTP, POP3, IMAP, DNS, SNMP, Telnet, SSH.

This is a standard concept in Data Communication and Computer Networks. The answer follows from the fundamental definitions and properties covered in this topic.

Why other options are incorrect:
- Option A (It applies only to sequential processing models...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option C (It is not applicable in distributed systems...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option D (It requires a minimum of O(n²) time complexity...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.


Q9. Consider the following about Functions:** File transfer, email, web browsing, virtual ter...

✅ Correct Answer: Option C

Explanation:
The correct answer is Option C — Functions:** File transfer, email, web browsing, virtual terminal access.

This is a standard concept in Data Communication and Computer Networks. The answer follows from the fundamental definitions and properties covered in this topic.

Why other options are incorrect:
- Option A (It requires a minimum of O(n²) time complexity...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option B (It applies only to sequential processing models...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option D (It is not applicable in distributed systems...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.


Q10. Consider the following about Key Concept:** Does NOT refer to the application itself, but...

✅ Correct Answer: Option B

Explanation:
The correct answer is Option B — Key Concept:** Does NOT refer to the application itself, but the services the application uses.

This is a standard concept in Data Communication and Computer Networks. The answer follows from the fundamental definitions and properties covered in this topic.

Why other options are incorrect:
- Option A (It requires a minimum of O(n²) time complexity...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option C (It is not applicable in distributed systems...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option D (It applies only to sequential processing models...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.