Group A — Short Answer Questions (1 Mark Each)

Q1What is a Computer Network?

Ans: A Computer Network is a collection of independent computers and devices (nodes) interconnected by communication links (wired or wireless) that allows them to exchange data and share resources.

Q2List the main applications of computer networks.

Ans: Business applications (email, e-commerce), home applications (smart home, IoT, social networks), and mobile users (smartphones, tablets, wireless connectivity).

Q3What is network hardware?

Ans: Network hardware refers to physical components used for connectivity: NIC (Network Interface Card), repeaters, hubs, switches, routers, bridges, and gateways.

Q4What is network software?

Ans: Network software includes protocols (TCP/IP), operating system network modules, middleware, and applications that enable communication over the network. It is organized in layers.

Q5Define network architecture.

Ans: Network architecture is the design specification that defines how network components (hardware, software, protocols) are organized and interact. It includes layering principles, protocols, interfaces, and services.

Q6What is layering in networking?

Ans: Layering decomposes the complex networking problem into manageable sub-problems. Each layer provides services to the layer above using services from the layer below. It enables modularity and interoperability.

Q7What is a protocol in networking?

Ans: A protocol is a set of rules governing data communication between entities in different systems. It defines syntax (format), semantics (meaning), and timing (when and how fast).

Q8Define interface and service in network layering.

Ans: An interface defines the operations and services that a lower layer provides to an upper layer. A service is the set of operations that the lower layer provides to the upper layer.

Q9Differentiate connectionless and connection-oriented services.

Ans: Connectionless (e.g., IP/UDP): Each packet is independent, no setup needed, unreliable delivery. Connection-oriented (e.g., TCP): Requires setup (3-way handshake), guarantees delivery, uses sequence numbers.

Q10What are service primitives?

Ans: Service primitivesREQUEST, INDICATION, RESPONSE, CONFIRMATION.

Q11List the types of service types.

Ans: Three types: Connection-oriented reliable (TCP), Connectionless reliable (ATM), Connectionless unreliable (UDP/IP).

Q12What are the 7 layers of the OSI Reference Model?

Ans: Physical → Data Link → Network → Transport → Session → Presentation → Application. Mnemonic: "All People Seem To Need Data Processing".

Q13What are the 4 layers of the TCP/IP Reference Model?

Ans: Link (Network Interface) → Internet → Transport → Application.

Q14What is the main difference between OSI and TCP/IP models?

Ans: OSI has 7 layers and is a reference model (theoretical); TCP/IP has 4 layers and is a practical model used in the Internet. OSI separates Session and Presentation layers; TCP/IP merges them into Application layer.

Q15What is X.25?

Ans: X.25 is an early packet-switching WAN protocol (ITU-T standard). It uses virtual circuits and operates at physical, data link, and packet (network) layers.

Q16What is Frame Relay?

Ans: Frame Relay is a high-performance WAN protocol that operates at the data link layer. It uses packet switching and virtual circuits but does not perform error correction (assumes reliable physical layer).

Q17What is ATM (Asynchronous Transfer Mode)?

Ans: ATM is a cell relay protocol using fixed-size 53-byte cells (48-byte payload + 5-byte header). It supports both voice and data, provides QoS, and uses virtual circuits (PVC/SVC).

Q18What is ISDN?

Ans: ISDN (Integrated Services Digital Network) is a circuit-switched digital telephone network. It provides two 64 kbps B-channels and one 16 kbps D-channel (2B+D = 144 kbps).

Q19What is B-ISDN?

Ans: B-ISDN (Broadband ISDN) supports high data rates (155 Mbps to 622 Mbps) using ATM technology. It provides integrated services (voice, video, data) over a single network.

Q20What is ADSL?

Ans: ADSL (Asymmetric Digital Subscriber Line) is a broadband access technology using copper telephone lines. Download speeds are faster than upload (asymmetric), typically up to 8 Mbps downstream and 1 Mbps upstream.

Q21What is a Cable Modem?

Ans: A Cable Modem provides broadband Internet access over coaxial cable TV infrastructure. It uses DOCSIS standard, offering shared bandwidth with speeds up to 100 Mbps.

Q22What is ARPANET?

Ans: ARPANET (Advanced Research Projects Agency Network) was the precursor to the Internet, funded by the US DoD. It first connected UCLA, Stanford, UCSB, and Utah in 1969 using packet switching.

Q23What is an ISP?

Ans: An ISP (Internet Service Provider) is an organization that provides Internet access to users and organizations. Examples: Airtel, Jio, BSNL. ISPs form the Internet backbone through peering and transit agreements.

Q24What is Classful Addressing in IPv4?

Ans: Classful addressing divides the 32-bit IPv4 address space into 5 classes: A (0–127, 16.7M hosts), B (128–191, 65K hosts), C (192–223, 254 hosts), D (multicast), E (reserved).

Q25What is Classless Addressing (CIDR)?

Ans: Classless addressing uses a prefix length (e.g., /24) instead of class boundaries. CIDR notation: IP/Prefix. It allows flexible allocation of address blocks of any size.

Q26What is a subnet?

Ans: A subnet (subnetwork) is a logical subdivision of an IP network. It is created by borrowing host bits and uses a subnet mask. It reduces broadcast domains and improves address utilization.

Q27What is Supernetting?

Ans: Supernetting (route aggregation) combines multiple contiguous networks into a single larger network by borrowing from the network ID. It reduces routing table size.

Q28What is NAT?

Ans: NAT (Network Address Translation) maps private IP addresses to a public IP address. It allows multiple devices to share one public IP. Types: Static NAT, Dynamic NAT, PAT/NAPT.

Q29What is ICMP?

Ans: ICMP (Internet Control Message Protocol) is used for diagnostic and error-reporting functions at the Network layer. Tools: ping (ICMP Echo Request/Reply) and traceroute.

Q30What is ARP?

Ans: ARP (Address Resolution Protocol) maps an IPv4 address to a MAC address. It broadcasts an ARP Request and caches the result in an ARP table. RARP does the reverse mapping.

Q31What is DHCP?

Ans: DHCP (Dynamic Host Configuration Protocol) automatically assigns IP addresses and network configuration to devices. The DORA process: Discover → Offer → Request → Acknowledgment.

Q32What is RARP?

Ans: RARP (Reverse Address Resolution Protocol) maps a MAC address to an IP address. Used by diskless workstations to obtain their IP at boot. Largely replaced by BOOTP and DHCP.

Q33What is Cryptography?

Ans: Cryptography is the science of protecting information by transforming it into a secure format. It provides confidentiality, integrity, authentication, and non-repudiation.

Q34What is a Block Cipher?

Ans: A Block Cipher encrypts fixed-size blocks of plaintext (e.g., 128 bits) into ciphertext blocks of the same size. Examples: AES, DES, 3DES. Contrast: Stream Cipher encrypts bit by bit.

Q35What is AES?

Ans: AES (Advanced Encryption Standard) is a symmetric block cipher using key sizes of 128, 192, or 256 bits with 128-bit block size. It replaced DES and uses substitution-permutation network.

Q36What is Public Key Cryptography?

Ans: Public Key Cryptography (asymmetric) uses a key pair: a public key (shared openly) for encryption and a private key (kept secret) for decryption. Examples: RSA, Diffie-Hellman, ECC.

Q37What is the RSA algorithm?

Ans: RSA (Rivest-Shamir-Adleman) is a public key algorithm based on the difficulty of factoring large numbers. Key generation: choose two primes \(p,q\), compute \(n=pq\) and \(\phi(n)=(p-1)(q-1)\), choose \(e\) coprime to \(\phi(n)\), compute \(d = e^{-1} \bmod \phi(n)\).

Q38What is a Digital Signature?

Ans: A Digital Signature provides authentication and non-repudiation. The sender hashes the message and encrypts the hash with their private key. The receiver decrypts with the sender's public key and compares hashes.

Q39What is DNS?

Ans: DNS (Domain Name System) translates human-readable domain names (e.g., google.com) to IP addresses. It uses a hierarchical distributed database. Record types: A, AAAA, MX, CNAME, NS.

Q40What is the application layer in TCP/IP?

Ans: The Application Layer (Layer 7) provides network services directly to end-user applications. Protocols: HTTP, DNS, SMTP, FTP, SSH, Telnet.

Group B — Descriptive Questions (5 Marks Each)

Q1Explain the OSI Reference Model with all seven layers and their functions.

Ans: The OSI Reference Model is a 7-layer framework for understanding network communications:

LayerNameFunction
7ApplicationNetwork services to applications (HTTP, DNS, SMTP)
6PresentationData format, encryption, compression
5SessionDialog control, session management
4TransportEnd-to-end delivery, TCP/UDP
3NetworkRouting, IP, logical addressing
2Data LinkFraming, MAC addressing, error detection
1PhysicalBits over physical medium (copper, fiber, wireless)
graph BT A["Application (7)"] --> P["Presentation (6)"] P --> S["Session (5)"] S --> T["Transport (4)"] T --> N["Network (3)"] N --> D["Data Link (2)"] D --> Ph["Physical (1)"] style A fill:#059669,color:#fff style Ph fill:#7c3aed,color:#fff
OSI Reference Model — 7 Layers
Q2Compare OSI and TCP/IP Reference Models.

Ans: Key differences between the two models:

AspectOSI ModelTCP/IP Model
Layers7 layers4 layers
NatureReference model (theoretical)Practical implementation model
Session/PresentationSeparate layers (5 & 6)Merged into Application layer
Network LayerConnection-oriented onlyBoth connectionless (IP) and connection-oriented (TCP)
DevelopmentDeveloped by ISODeveloped by DoD/ARPANET
UsageLess used in practiceBasis of the Internet
Q3Explain Classful and Classless Addressing in IPv4.

Ans: Classful Addressing divides IPv4 into 5 classes:

  • Class A: 0xxx xxxx — 0.0.0.0 to 127.255.255.255 (16M hosts)
  • Class B: 10xx xxxx — 128.0.0.0 to 191.255.255.255 (65K hosts)
  • Class C: 110x xxxx — 192.0.0.0 to 223.255.255.255 (254 hosts)
  • Class D: 1110 xxxx — 224.0.0.0 to 239.255.255.255 (multicast)
  • Class E: 1111 xxxx — 240.0.0.0 to 255.255.255.255 (reserved)

Classless Addressing (CIDR) uses prefix notation (e.g., 192.168.1.0/24), allowing flexible allocation without class boundaries. Supernetting aggregates multiple networks into one prefix.

Q4What is Subnetting? Explain with an example.

Ans: Subnetting divides a large network into smaller logical networks (subnets) by borrowing host bits. This reduces broadcast traffic and improves security.

Example: Network 200.1.1.0/24 with subnet mask 255.255.255.0. If we borrow 2 bits (subnet mask /26 = 255.255.255.192):

  • Subnet 0: 200.1.1.0 – 200.1.1.63 (62 usable hosts)
  • Subnet 1: 200.1.1.64 – 200.1.1.127
  • Subnet 2: 200.1.1.128 – 200.1.1.191
  • Subnet 3: 200.1.1.192 – 200.1.1.255
graph LR N["200.1.1.0/24"] --> S0["Subnet 0: .0/26"] N --> S1["Subnet 1: .64/26"] N --> S2["Subnet 2: .128/26"] N --> S3["Subnet 3: .192/26"] style N fill:#059669,color:#fff
Subnetting: /24 → /26 (4 subnets)
Q5Explain the DORA process in DHCP.

Ans: DHCP (Dynamic Host Configuration Protocol) uses a 4-step process called DORA:

  • Discover: Client broadcasts DHCPDISCOVER to find available DHCP servers.
  • Offer: Server responds with DHCPOFFER containing an available IP address and lease details.
  • Request: Client broadcasts DHCPREQUEST accepting the offered address.
  • Acknowledgment: Server sends DHCPACK confirming the lease with configuration details (IP, subnet mask, gateway, DNS).
sequenceDiagram participant C as Client participant S as DHCP Server C->>S: DHCPDISCOVER (broadcast) S->>C: DHCPOFFER (unicast/broadcast) C->>S: DHCPREQUEST (broadcast) S->>C: DHCPACK (unicast/broadcast)
DHCP DORA Process — Sequence Diagram
Q6Explain the working of ARP.

Ans: ARP (Address Resolution Protocol) maps IP addresses to MAC addresses:

  1. Sender checks its ARP cache for the destination IP's MAC address.
  2. If not found, it broadcasts an ARP Request containing the target IP.
  3. All hosts on the LAN receive it; the owner responds with an ARP Reply (unicast) containing its MAC address.
  4. Sender caches the IP-MAC mapping in its ARP table.

RARP is the reverse: a host with only a known MAC address requests its IP from a RARP server.

Q7Explain the different types of network topologies.

Ans:

  • Bus: All nodes share a single communication line. Simple but collision-prone. Example: 10BASE2.
  • Star: All nodes connect to a central hub/switch. Easy to manage; hub failure disrupts network.
  • Ring: Each node connects to two neighbors; data travels in one direction. Uses token passing.
  • Mesh: Every node connects to every other node. High redundancy, expensive. Used in WANs.
  • Tree: Hierarchical combination of star topologies. Used in large organizations.
  • Hybrid: Combination of two or more topologies.
graph TD T1["Bus Topology"] -->|"Single cable"| N1[Node 1] T1 --> N2[Node 2] T1 --> N3[Node 3] T2["Star Topology"] --> H[Hub/Switch] H --> N4[Node 4] H --> N5[Node 5] H --> N6[Node 6] T3["Ring Topology"] --> N7[Node 7] N7 --> N8[Node 8] N8 --> N9[Node 9] N9 --> N7
Network Topologies: Bus, Star, Ring
Q8Explain Classical Encryption Techniques: Caesar Cipher and Substitution Cipher.

Ans: Caesar Cipher: Each letter is shifted by a fixed number of positions. Example with shift 3: A→D, B→E, … X→A, Y→B, Z→C. Encryption: \(C = (P + k) \bmod 26\). Decryption: \(P = (C - k) \bmod 26\).

Monoalphabetic Substitution: Each letter maps to a unique substitute letter. The key is a permutation of 26 letters. Vulnerable to frequency analysis.

Playfair Cipher: Encrypts digraphs (pairs of letters). Uses a 5×5 key square. Stronger than simple substitution.

Q9Explain the AES encryption algorithm (conceptually).

Ans: AES (Advanced Encryption Standard) is a symmetric block cipher:

  • Block size: 128 bits (16 bytes)
  • Key sizes: 128, 192, or 256 bits
  • Rounds: 10 (128-bit key), 12 (192-bit), or 14 (256-bit)

Each round applies: SubBytes (S-box substitution), ShiftRows (row shifting), MixColumns (column mixing), AddRoundKey (XOR with round key). Last round omits MixColumns.

Q10Explain the RSA algorithm with key generation steps.

Ans: RSA (Rivest-Shamir-Adleman) algorithm:

  1. Choose two large primes \(p\) and \(q\). Compute \(n = p \times q\).
  2. Compute Euler's totient: \(\phi(n) = (p-1)(q-1)\).
  3. Choose public exponent \(e\) such that \(1 < e < \phi(n)\) and \(\gcd(e, \phi(n)) = 1\).
  4. Compute private exponent \(d = e^{-1} \bmod \phi(n)\).
  5. Public key: \((e, n)\). Private key: \((d, n)\).

Encryption: \(C = M^e \bmod n\). Decryption: \(M = C^d \bmod n\). Security relies on the difficulty of factoring large \(n\).

Q11What are Digital Signatures and how do they work?

Ans: A Digital Signature ensures message authenticity and non-repudiation:

  1. Sender computes a hash of the message: \(H = \text{hash}(M)\).
  2. Sender encrypts the hash with their private key: \(S = H^d \bmod n\). This is the signature.
  3. Receiver decrypts signature with sender's public key: \(H' = S^e \bmod n\).
  4. Receiver independently computes hash of received message and compares with \(H'\). Match → authentic.
Q12Explain the TCP 3-Way Handshake.

Ans: TCP establishes a connection using a 3-step handshake:

  1. SYN: Client sends SYN (seq=x) to server.
  2. SYN-ACK: Server responds with SYN-ACK (seq=y, ack=x+1).
  3. ACK: Client sends ACK (seq=x+1, ack=y+1). Connection established.
sequenceDiagram participant C as Client participant S as Server C->>S: SYN (seq=x) S->>C: SYN-ACK (seq=y, ack=x+1) C->>S: ACK (seq=x+1, ack=y+1) Note over C,S: Connection Established
TCP 3-Way Handshake
Q13Explain UDP header format.

Ans: The UDP header is 8 bytes with four fields:

  • Source Port (16 bits): Sender's port number
  • Destination Port (16 bits): Receiver's port number
  • Length (16 bits): Header + Data length in bytes
  • Checksum (16 bits): Optional error detection (covers header + data + pseudo-header)

UDP is connectionless, lightweight, and provides no reliability guarantees.

Q14Explain the TCP header format.

Ans: The TCP header is 20–60 bytes with fields:

  • Source/Dest Port (16 bits each): Application endpoints
  • Sequence Number (32 bits): Byte stream position
  • Acknowledgment Number (32 bits): Next expected byte
  • Data Offset (4 bits): Header length in 32-bit words
  • Flags (9 bits): URG, ACK, PSH, RST, SYN, FIN
  • Window Size (16 bits): Receive buffer space
  • Checksum (16 bits): Error detection
  • Urgent Pointer (16 bits): Points to urgent data
Q15Explain the principle of reliable data transfer.

Ans: Reliable Data Transfer ensures data arrives correctly despite an unreliable channel:

  1. Error detection: Checksums detect corrupted packets.
  2. Acknowledgments: Receiver confirms receipt of data.
  3. Retransmission: Sender retransmits unacknowledged data after timeout.
  4. Sequence numbers: Identify duplicate or out-of-order packets.

Implemented through protocols: Stop-and-Wait, Go-Back-N, Selective Repeat.

Q16Explain Stop-and-Wait protocol.

Ans: In Stop-and-Wait, the sender transmits one frame and waits for an ACK before sending the next. A timer is set; if ACK not received before timeout, the frame is retransmitted.

Utilization: \(U = \dfrac{T_{frame}}{T_{frame} + T_{ACK} + T_{prop} + T_{proc}}\). For large bandwidth-delay products, utilization drops significantly.

Q17Explain Go-Back-N protocol.

Ans: Go-Back-N (GBN) allows the sender to transmit up to \(N\) frames before needing an ACK (sliding window of size \(N\)).

  • If a frame is lost or damaged, all subsequent frames (including correctly received ones) are retransmitted.
  • Receiver only accepts frames in order.
  • Cumulative ACK acknowledges all frames up to a sequence number.
Q18Explain Selective Repeat protocol.

Ans: Selective Repeat is more efficient than GBN. The receiver buffers out-of-order frames and sends individual ACKs for each correctly received frame. Only the lost/damaged frame is retransmitted (not all subsequent frames). Requires window size \(N \leq 2^{k-1}\) where \(k\) is sequence number bits.

Q19Explain TCP Sliding Window mechanism.

Ans: TCP uses a sliding window for flow control. The receiver advertises its available buffer space (rwnd). The sender can have at most min(cwnd, rwnd) unacknowledged bytes in flight. As ACKs arrive, the window slides forward, allowing new data to be sent.

Effective Window = min(cwnd, rwnd)
Q20Explain TCP Congestion Control: Slow Start and Congestion Avoidance.

Ans: TCP uses Jacobson's congestion control algorithm:

  • Slow Start: cwnd starts at 1 MSS. For each ACK, cwnd increases by 1 MSS (exponential growth). At threshold ssthresh, switches to congestion avoidance.
  • Congestion Avoidance: cwnd increases by \(1/\text{cwnd}\) per RTT (linear growth: additive increase).
  • On loss: ssthresh = cwnd/2, cwnd = 1 (returns to slow start).
\text{Throughput} \approx \frac{1.22 \times \text{MSS}}{\text{RTT} \times \sqrt{p}}
Q21Explain Fast Retransmit and Fast Recovery.

Ans: Fast Retransmit: When the sender receives 3 duplicate ACKs, it retransmits the missing segment immediately (without waiting for the timeout).

Fast Recovery: After fast retransmit, ssthresh = cwnd/2, cwnd = ssthresh + 3, then cwnd = ssthresh for each additional duplicate ACK (additive increase). On new ACK, cwnd = ssthresh.

Q22Explain Packet Switching and its types.

Ans: Packet Switching divides data into packets that are routed independently through the network. Two approaches:

  • Datagram Networks: Each packet is routed independently. No connection setup. Packets may take different paths and arrive out of order. Used by IP (Internet).
  • Virtual Circuit Networks: A logical path is established before data transfer. All packets follow the same path with the same sequence number. Used by Frame Relay and ATM.
Q23Explain the working of the Domain Name System (DNS).

Ans: DNS translates domain names to IP addresses using a hierarchical distributed system:

  1. Client sends a query to its local DNS server (recursive query).
  2. Local server checks cache. If miss, it queries root servers, then TLD servers (.com, .org), then authoritative servers.
  3. Response is cached and returned to client.

DNS uses UDP port 53 for queries and TCP port 53 for zone transfers.

Q24Explain Email: SMTP, POP3, and IMAP.

Ans: Email uses three main protocols:

  • SMTP (Simple Mail Transfer Protocol, port 25): Used to send email between servers and from client to server. Push-based, text-based, ASCII only.
  • POP3 (Post Office Protocol v3, port 110): Used to retrieve email. Downloads and optionally deletes from server. Simple, single-device.
  • IMAP (Internet Message Access Protocol, port 143): Retrieves email while keeping it on the server. Supports folders, multiple devices, partial downloads.
Q25Explain the IPv6 header format and improvements over IPv4.

Ans: IPv6 uses 128-bit addresses (vs 32-bit in IPv4) and a simplified 40-byte fixed header:

  • Version (4 bits): 6
  • Traffic Class (8 bits): QoS priority
  • Flow Label (20 bits): Identifies packet flow for QoS
  • Payload Length (16 bits): Upper-layer payload size
  • Next Header (8 bits): Type of extension header or upper-layer protocol
  • Hop Limit (8 bits): Replaces TTL
  • Source/Dest Address (128 bits each)

Improvements: larger address space, no NAT needed, built-in IPSec, simpler header, efficient routing.

Group C — Long Answer Questions (15 Marks Each)

Q1Describe the OSI Reference Model in detail. Compare it with the TCP/IP model. Draw a diagram showing the correspondence between layers.

Ans: The OSI Reference Model is a 7-layer framework standardized by ISO (ISO 7498) that defines how data flows from one application to another across a network. Each layer performs a specific function and communicates only with its peer layer on the receiving system.

7 Layers of OSI Model:

LayerNamePDUKey Functions
7ApplicationDataNetwork services to applications (HTTP, DNS, SMTP, FTP)
6PresentationDataData format conversion, encryption, compression, character encoding
5SessionDataDialog control, session establishment/termination, synchronization
4TransportSegmentEnd-to-end reliability, flow control, error recovery (TCP/UDP)
3NetworkPacketRouting, logical addressing, fragmentation (IP)
2Data LinkFrameFraming, MAC addressing, error detection/correction (Ethernet, PPP)
1PhysicalBitsTransmission of raw bits over physical medium

TCP/IP Reference Model:

LayerNameProtocols
4ApplicationHTTP, DNS, SMTP, FTP, Telnet
3TransportTCP, UDP
2InternetIP, ICMP, ARP
1LinkEthernet, Wi-Fi, PPP

Comparison:

AspectOSITCP/IP
Layers74
Session/PresentationSeparate layersMerged into Application
Network LayerConnection-oriented onlyConnectionless (IP) + Connection-oriented (TCP)
Standard BodyISODoD/ARPANET
ImplementationReference modelPractical Internet model
graph BT subgraph OSI_Model ["OSI Reference Model (7 Layers)"] direction BT O7["7: Application"] O6["6: Presentation"] O5["5: Session"] O4["4: Transport"] O3["3: Network"] O2["2: Data Link"] O1["1: Physical"] O7 --> O6 --> O5 --> O4 --> O3 --> O2 --> O1 end subgraph TCP_IP ["TCP/IP Model (4 Layers)"] direction BT T4["Application
HTTP, DNS, SMTP"] T3["Transport
TCP, UDP"] T2["Internet
IP, ICMP, ARP"] T1["Link
Ethernet, Wi-Fi"] T4 --> T3 --> T2 --> T1 end O7 -.-> T4 O6 -.-> T4 O5 -.-> T4 O4 -.-> T3 O3 -.-> T2 O2 -.-> T1 O1 -.-> T1
OSI (7 layers) vs TCP/IP (4 layers) — Layer Correspondence
Q2Explain IPv4 addressing: Classful, Classless (CIDR), Subnetting, and Supernetting with numerical examples.

Ans:

Classful Addressing:

IPv4 is a 32-bit address divided into network and host portions:

ClassFirst BitsNetwork IDHost IDRange
A08 bits24 bits0.0.0.0 – 127.255.255.255
B1016 bits16 bits128.0.0.0 – 191.255.255.255
C11024 bits8 bits192.0.0.0 – 223.255.255.255
D1110——224.0.0.0 – 239.255.255.255 (Multicast)
E1111——240.0.0.0 – 255.255.255.255 (Reserved)

Classless Addressing (CIDR):

CIDR notation: IP-Address/Prefix-Length (e.g., 192.168.1.0/24). Number of addresses = \(2^{(32 - \text{prefix})}\).

Example: 172.16.0.0/16 has \(2^{16} = 65536\) addresses. Subnet mask: 255.255.0.0.

Subnetting Example:

Given: 200.10.10.0/24. Create 4 subnets.

Borrow 2 bits: new prefix = /26. Subnet mask = 255.255.255.192.

Subnets: 200.10.10.0/26, 200.10.10.64/26, 200.10.10.128/26, 200.10.10.192/26. Each has 62 usable hosts.

\text{No. of subnets} = 2^s \quad \text{No. of hosts/subnet} = 2^h - 2

Supernetting Example:

Aggregate 200.10.10.0/24, 200.10.11.0/24, 200.10.12.0/24, 200.10.13.0/24 into one route.

Common prefix: /22 (200.10.10.0/22). This is a supernet — reduces routing table entries.

Q3Explain error detection and correction techniques: Parity Check, Hamming Code, and CRC. Include mathematical derivations where applicable.

Ans: Error detection and correction are essential at the Data Link layer.

1. Parity Check:

A single parity bit is added to detect single-bit errors. In even parity, the total number of 1s including the parity bit must be even. Detects single-bit errors but cannot correct or detect double-bit errors.

Probability of detecting a \(k\)-bit error: \(P_d = 1 - 2^{-k}\).

2. Hamming Code:

Hamming code adds \(r\) redundant bits to a \(m\)-bit message, forming an \((m+r)\)-bit codeword. The condition is:

2^r \geq m + r + 1

Redundant bits are placed at positions \(2^0, 2^1, 2^2, \dots\) (positions 1, 2, 4, 8, ...). Each redundant bit checks specific data bits using XOR. If the parity checks fail, the position of the error is given by the sum of positions with wrong parity.

Example: For 4 data bits (\(m=4\)), need \(r=3\) (\(2^3 = 8 \geq 4+3+1\)). Codeword positions: \(d_1, d_2, r_1, d_3, d_4, d_5, r_2, d_6, d_7, r_3\).

3. CRC (Cyclic Redundancy Check):

CRC uses polynomial division modulo-2. A \(k\)-bit frame is treated as a polynomial of degree \(k-1\). A generator polynomial \(G(x)\) of degree \(n\) is agreed upon:

  • Append \(n\) zero bits to the data (multiply by \(x^n\)).
  • Divide by \(G(x)\) using XOR (modulo-2 division).
  • Remainder (CRC) is appended to the data.
  • At receiver, divide the received frame by \(G(x)\). If remainder = 0, no error.

Common polynomials: CRC-32 (Ethernet), CRC-16 (USB). CRC detects all single-bit, double-bit, odd-length, and burst errors up to \(n\) bits.

graph TD A["Data (k bits)"] --> B["Append n zeros"] B --> C["Divide by G(x)"] C --> D["Remainder = CRC (n bits)"] D --> E["Append CRC to Data"] E --> F["Transmit (k+n) bits"] F --> G["Receiver: Divide by G(x)"] G --> H{Remainder = 0?} H -->|Yes| I["No Error"] H -->|No| J["Error Detected"]
CRC Encoding and Checking Process
Q4Explain the TCP sliding window protocol with diagrams. Include flow control and congestion control mechanisms.

Ans: TCP uses a sliding window protocol for flow control at the transport layer.

Sliding Window Mechanism:

The receiver advertises its rwnd (receive window) — the available buffer space. The sender maintains a window of size \(W = \min(\text{cwnd}, \text{rwnd})\).

  • Bytes within the window can be sent immediately.
  • As ACKs arrive, the window slides forward.
  • Bytes beyond the window must wait.
graph LR subgraph Sender ["Sender Window"] direction LR S1["Bytes 1-1000
(Sent & Acked)"] --> S2["Bytes 1001-2000
(Sent, Unacked)"] --> S3["Bytes 2001-3000
(Window Boundary)"] --> S4["Bytes 3001+
(Not Yet Sent)"] end subgraph Receiver ["Receiver Window (rwnd)"] direction LR R1["Bytes 1-1000
(Read by App)"] --> R2["Bytes 1001-2000
(Buffer)"] --> R3["Next Expected: 2001
(rwnd=1000)"] end
TCP Sliding Window — Sender and Receiver Views

Flow Control:

Receiver controls sender via rwnd in every ACK. Prevents sender from overwhelming receiver's buffer.

Congestion Control:

TCP maintains cwnd (congestion window):

  1. Slow Start: cwnd = 1 MSS. Doubles each RTT (exponential).
  2. Congestion Avoidance: After ssthresh, increases by 1 MSS per RTT (linear).
  3. Fast Retransmit: 3 duplicate ACKs → retransmit immediately.
  4. Fast Recovery: Set ssthresh = cwnd/2, cwnd = ssthresh + 3.
\text{Throughput} \approx \frac{1.22 \times \text{MSS}}{\text{RTT} \times \sqrt{p}} \quad \text{where } p = \text{packet loss probability}
Q5Explain routing algorithms: Dijkstra's Link State, Bellman-Ford Distance Vector, and RIP. Include step-by-step examples.

Ans: Routing algorithms determine the best path from source to destination.

1. Link State (Dijkstra's Shortest Path First):

Each router knows the complete topology and link costs. Uses Dijkstra's algorithm:

  1. Initialize: Set cost to self = 0, others = infinity.
  2. Find the node with minimum cost not yet processed.
  3. Update costs to all neighbors: \(cost(v) = \min(cost(v), cost(u) + w(u,v))\).
  4. Repeat until all nodes processed.

Convergence: Fast. Overhead: High (flooding LS packets). Used in: OSPF.

2. Distance Vector (Bellman-Ford):

Each router maintains a distance vector (distance to all destinations via each neighbor). Periodically exchanges vectors with neighbors:

D_x(y) = \min_v \left[ c(x,v) + D_v(y) \right]

Where \(D_x(y)\) = cost from \(x\) to \(y\), \(c(x,v)\) = cost to neighbor \(v\).

Convergence: Slow (count-to-infinity problem). Used in: RIP.

3. RIP (Routing Information Protocol):

RIP is a distance vector protocol using hop count as metric (max 15 hops, 16 = unreachable). Updates every 30 seconds using periodic broadcasts.

  • Metric: Hop count (max 15)
  • Convergence: Slow (up to several minutes)
  • Split horizon: Don't advertise a route back to the neighbor it came from

4. OSPF (Open Shortest Path First):

OSPF uses Dijkstra's algorithm within an autonomous system. Divides AS into areas. Uses link-state advertisements (LSA). Converges faster than RIP.

graph TD R1["Router A"] -->|"Cost: 2"| R2["Router B"] R1 -->|"Cost: 5"| R3["Router C"] R2 -->|"Cost: 1"| R4["Router D"] R3 -->|"Cost: 2"| R4 R2 -->|"Cost: 4"| R5["Router E"] style R1 fill:#059669,color:#fff style R4 fill:#7c3aed,color:#fff
Sample Network Topology for Dijkstra/Bellman-Ford
Q6Explain CSMA/CD in detail with a flowchart. Compare ALOHA, CSMA, CSMA/CD, and CSMA/CA.

Ans:

ALOHA:

Pure ALOHA: Stations transmit whenever they have data. If collision detected (no ACK), wait a random time and retransmit. Throughput: \(S = G e^{-2G}\) (max 18.4% at \(G=0.5\)).

Slotted ALOHA: Time is divided into slots. Stations can only transmit at slot boundaries. Throughput: \(S = G e^{-G}\) (max 36.8% at \(G=1\)).

CSMA (Carrier Sense Multiple Access):

Before transmitting, a station listens to the medium. If idle, transmits; if busy, waits. Variants:

  • 1-persistent: Transmit immediately when idle (high collision probability).
  • Non-persistent: Wait a random time if busy (lower collision, lower efficiency).
  • p-persistent: Transmit with probability \(p\) when idle; defer with probability \(1-p\).

CSMA/CD (Collision Detection):

Used in wired Ethernet (IEEE 802.3). Stations listen while transmitting. If collision detected:

  1. Stop transmitting immediately.
  2. Send a jam signal to ensure all stations detect collision.
  3. Wait a random backoff time (binary exponential backoff).
  4. Retry up to 16 times, then abort.
graph TD A["Start"] --> B{"Medium Idle?"} B -->|"No"| C["Wait (Backoff)"] C --> B B -->|"Yes"| D["Transmit Frame"] D --> E{"Collision Detected?"} E -->|"No"| F["Transmission Complete"] E -->|"Yes"| G["Send Jam Signal"] G --> H["Increment Collision Count"] H --> I{"Count < 16?"} I -->|"Yes"| J["Random Backoff
k = min(count, 10)
Wait 0-2^k slot times"] J --> B I -->|"No"| K["Abort - Channel Failure"]
CSMA/CD Algorithm Flowchart

CSMA/CA (Collision Avoidance):

Used in wireless (IEEE 802.11/Wi-Fi). Stations cannot detect collisions (hidden terminal problem), so they avoid them:

  • Send RTS (Request to Send) before data.
  • Receiver responds with CTS (Clear to Send).
  • After DIFS (DCF Inter-Frame Space), transmit data.
  • Use NAV (Network Allocation Vector) to defer transmission when others are communicating.
ProtocolMediumCollision HandlingEfficiency
ALOHASharedNo sensing~18%
Slotted ALOHASharedNo sensing, timed slots~37%
CSMABus/StarCarrier sensingBetter
CSMA/CDWired (Ethernet)Collision DetectionHigh (up to 98%)
CSMA/CAWireless (WiFi)Collision AvoidanceModerate
Q7Explain RSA public key cryptography with a worked numerical example.

Ans: RSA (Rivest-Shamir-Adleman, 1978) is an asymmetric cryptographic algorithm based on the computational difficulty of factoring large integers.

Key Generation:

  1. Choose two large primes: \(p = 3\), \(q = 11\)
  2. Compute \(n = p \times q = 3 \times 11 = 33\)
  3. Compute \(\phi(n) = (p-1)(q-1) = 2 \times 10 = 20\)
  4. Choose \(e\) such that \(1 < e < \phi(n)\) and \(\gcd(e, \phi(n)) = 1\). Let \(e = 7\)
  5. Compute \(d = e^{-1} \bmod \phi(n)\):
    7d \equiv 1 \pmod{20} \Rightarrow 7d = 1 + 20k \Rightarrow d = 3

Public Key: \((e, n) = (7, 33)\). Private Key: \((d, n) = (3, 33)\).

Encryption:

Plaintext: \(M = 2\). Ciphertext: \(C = M^e \bmod n = 2^7 \bmod 33 = 128 \bmod 33 = 29\).

Decryption:

Ciphertext: \(C = 29\). Plaintext: \(M = C^d \bmod n = 29^3 \bmod 33 = 24389 \bmod 33 = 2\).

The decrypted plaintext matches the original. For real-world RSA, \(p\) and \(q\) are 1024–4096 bit primes.

Q8Describe HTTP and its operations. Explain the differences between HTTP/1.0, HTTP/1.1, and HTTP/2.

Ans: HTTP (HyperText Transfer Protocol) is the application-layer protocol for the World Wide Web. It follows a client-server model where the client (browser) sends requests and the server responds.

HTTP Operations:

  • GET: Retrieve a resource from server.
  • POST: Submit data to server (form data, upload).
  • PUT: Replace a resource on server.
  • DELETE: Remove a resource.
  • HEAD: Same as GET but without body (headers only).
  • OPTIONS: Query supported methods.
  • PATCH: Partial update of a resource.

HTTP/1.0:

  • New TCP connection for each request-response.
  • No persistent connections by default.
  • Headers are not case-insensitive.

HTTP/1.1:

  • Persistent connections by default (keep-alive).
  • Pipelining (send multiple requests without waiting).
  • Host header for virtual hosting.
  • Chunked transfer encoding.

HTTP/2:

  • Binary framing (replaces text-based format).
  • Multiplexing: Multiple streams over one TCP connection.
  • Header compression (HPACK).
  • Server Push: Server can proactively send resources.
  • Stream prioritization.
sequenceDiagram participant B as Browser participant S as Web Server B->>S: GET /index.html HTTP/1.1 S->>B: 200 OK + HTML body B->>S: GET /style.css HTTP/1.1 S->>B: 200 OK + CSS body B->>S: GET /script.js HTTP/1.1 S->>B: 200 OK + JS body
HTTP Request-Response Sequence
Q9Explain the Data Link Layer design issues and error control mechanisms in detail.

Ans: The Data Link Layer (Layer 2) is responsible for reliable communication over a physical link.

Design Issues:

  1. Framing: Delimiting data into frames with Start/End flags or length fields.
  2. Physical Addressing: MAC addresses (48 bits, OUI-based).
  3. Flow Control: Preventing fast sender from overwhelming slow receiver.
  4. Error Control: Detecting and correcting transmission errors.
  5. Multiple Access: Coordinating shared-medium access (CSMA/CD, Token Ring).

Error Detection:

TechniqueMethodDetects
Parity CheckSingle bit for odd/even countSingle-bit errors
ChecksumSum of data wordsSome multi-bit errors
CRCPolynomial divisionAll single, double, odd-length, burst errors

Error Correction:

Hamming Code: For a message with \(m\) bits, need \(r\) redundant bits where \(2^r \geq m+r+1\). The code can detect and correct single-bit errors.

Flow Control Protocols:

  • Stop-and-Wait: Send one frame, wait for ACK.
  • Sliding Window: Send multiple frames before ACK (Go-Back-N or Selective Repeat).
Q10Explain IPv6 in detail: motivation, address types, transition strategies from IPv4, and header format.

Ans: IPv6 was developed by IETF to address IPv4 limitations.

Motivations for IPv6:

  1. Address exhaustion: IPv4 has ~4.3 billion addresses (32 bits). IPv6 has \(2^{128}\) addresses.
  2. No NAT required: Every device can have a globally routable address.
  3. Simplified header: Fixed 40-byte header vs variable IPv4 header.
  4. Built-in security: IPSec support at the network layer.
  5. Better QoS: Flow Label field for traffic prioritization.
  6. Efficient routing: Hierarchical addressing reduces routing table size.

IPv6 Address Types:

  • Unicast: One-to-one communication (2001:0db8::1).
  • Multicast: One-to-many (FF02::1 = all nodes on link).
  • Anycast: One-to-one-of-many (nearest node).

IPv6 Header (40 bytes, fixed):

FieldBitsPurpose
Version4IP version (6)
Traffic Class8QoS priority
Flow Label20Identify packet flow
Payload Length16Upper-layer data size
Next Header8Extension/upper-layer protocol
Hop Limit8Max routers to traverse
Source Address128Sender address
Destination Address128Receiver address

Transition Strategies:

  • Dual Stack: Hosts run both IPv4 and IPv6 simultaneously.
  • Tunneling: IPv6 packets encapsulated within IPv4 packets (6to4, 6in4).
  • Translation: NAT-PT (Network Address Translation - Protocol Translation) converts between IPv4 and IPv6 headers.
Q11Describe Ethernet, Fast Ethernet, and Gigabit Ethernet. Explain the evolution and key differences.

Ans: Ethernet is the dominant LAN technology, standardized by IEEE 802.3.

Original Ethernet (10 Mbps):

  • 10BASE5: Thick coaxial cable, 500m max segment, bus topology.
  • 10BASE2: Thin coaxial (Thinnet), 185m max, cheaper alternative.
  • 10BASE-T: Twisted pair (Cat-3), star topology with hub, 100m max.

Fast Ethernet (100 Mbps):

  • 100BASE-TX: Two pairs of Cat-5 UTP, star topology with switch.
  • 100BASE-FX: Two strands of multimode fiber.
  • Uses CSMA/CD (though switches reduce collisions).
  • Auto-negotiation for speed/duplex.

Gigabit Ethernet (1000 Mbps / 1 Gbps):

  • 1000BASE-T: Four pairs of Cat-5e/Cat-6 UTP, 100m.
  • 1000BASE-SX: Short wavelength (850nm) multimode fiber, up to 550m.
  • 1000BASE-LX: Long wavelength (1310nm) single-mode fiber, up to 5km.
  • Full-duplex only (no CSMA/CD in switched networks).

Key Differences:

Feature10BASE-T100BASE-TX1000BASE-T
Speed10 Mbps100 Mbps1000 Mbps
CableCat-3 UTPCat-5 UTPCat-5e/6 UTP
TopologyStar (hub)Star (switch)Star (switch)
CSMA/CDYesYesNo (full-duplex)
Q12Explain Virtual LANs (VLANs): motivation, types, configuration, and advantages.

Ans: A VLAN (Virtual LAN) is a logical grouping of devices on the same physical network into separate broadcast domains.

Motivation:

  • Reduce broadcast traffic (smaller broadcast domains).
  • Improve security by isolating traffic between groups.
  • Flexibility — group by function, not physical location.

Types of VLANs:

  • Port-based VLAN: Ports statically assigned to VLANs. Most common.
  • MAC-based VLAN: Devices assigned based on MAC address.
  • Protocol-based VLAN: Based on network layer protocol type.
  • IP Subnet VLAN: Based on IP subnet address.

Configuration:

Switches use 802.1Q tagging (4-byte VLAN tag inserted in Ethernet frame). The tag includes VLAN ID (12 bits, up to 4094 VLANs). Trunk ports carry tagged frames for multiple VLANs. Access ports carry untagged frames for a single VLAN.

Advantages:

  • Broadcast domain segmentation.
  • Security isolation.
  • Easy reconfiguration without physical rewiring.
  • Simplified network management.
Q13Describe circuit switching, packet switching, message switching, and broadcast switching with comparison.

Ans: Three fundamental switching paradigms:

1. Circuit Switching:

A dedicated end-to-end circuit is established before data transfer. Used in traditional telephone networks (PSTN).

  • Setup phase: Dedicated path established.
  • Data transfer: Full bandwidth reserved.
  • Teardown: Circuit released after use.
  • Inefficient for bursty data (bandwidth wasted during silence).

2. Packet Switching:

Data is divided into packets that are routed independently. Two types:

  • Datagram: Each packet routed independently (IP).
  • Virtual Circuit: Logical path established (Frame Relay, ATM).

Efficient for bursty data, shared bandwidth, no wasted capacity.

3. Message Switching:

Entire message is stored at each intermediate node (store-and-forward) and forwarded when the next link is available. Used in telegraph systems. No dedicated path.

4. Broadcast Switching:

In LANs, broadcasts reach all stations. Multicasting reaches a selected group. Broadcasting reaches all nodes on the network. Managed via switches (flooding initially, then MAC address learning).

FeatureCircuit SwitchingPacket SwitchingMessage Switching
Dedicated pathYesNoNo
Bandwidth reservationYesNo (shared)No
Store-and-forwardNoYesYes
Efficiency for bursty dataLowHighMedium
Q14Describe multiple access protocols: ALOHA, CSMA, CSMA/CD, CSMA/CA, FDMA, TDMA, CDMA, and Token Ring.

Ans: Multiple Access Protocols coordinate how multiple stations share a common communication channel.

Random Access Protocols:

ProtocolMethodCollision Handling
Pure ALOHATransmit wheneverRandom retransmit after timeout
Slotted ALOHATransmit at slot boundariesRandom retransmit after timeout
CSMAListen before transmitNo detection (wait for timeout)
CSMA/CDListen + detect collisionsJam + binary exponential backoff
CSMA/CAListen + avoid collisionsRTS/CTS, NAV, backoff

Controlled Access Protocols:

  • Token Ring (IEEE 802.5): A token circulates around the ring. Only the station holding the token can transmit. Deterministic, no collisions.
  • Token Bus (IEEE 802.4): Logical ring over physical bus topology. Stations pass a token in logical order.

Channelization Protocols:

  • FDMA (Frequency Division): Channel divided into frequency bands. Each station gets a dedicated band. Used in analog cellular (1G).
  • TDMA (Time Division): Channel divided into time slots. Each station gets a slot in a frame. Used in GSM (2G).
  • CDMA (Code Division): All stations use full bandwidth simultaneously with unique spreading codes. Used in 3G (UMTS).

Throughput Calculations:

\text{Pure ALOHA Throughput: } S = G e^{-2G} \quad \text{(max 18.4\%)}
\text{Slotted ALOHA Throughput: } S = G e^{-G} \quad \text{(max 36.8\%)}
Q15Explain Network Layer services, IP protocol, and routing in detail. Include fragmentation and reassembly.

Ans: The Network Layer (Layer 3) provides host-to-host communication across multiple networks.

Network Layer Services:

  • Routing: Determining the path from source to destination.
  • Forwarding: Moving a packet from router input to appropriate output.
  • Logical Addressing: IP addresses for host identification.
  • Fragmentation/Reassembly: Dividing large packets at routers and reassembling at destination.

IP Protocol:

IPv4 Header (minimum 20 bytes):

  • Version (4 bits): 4
  • IHL (4 bits): Header length in 32-bit words
  • Total Length (16 bits): Header + Data (max 65535 bytes)
  • TTL (8 bits): Max router hops
  • Protocol (8 bits): Upper-layer protocol (6=TCP, 17=UDP)
  • Header Checksum (16 bits): Header error detection
  • Source/Dest IP (32 bits each)

Fragmentation and Reassembly:

When a packet is too large for the next link's MTU, the router fragments it:

  • Identification (16 bits): Same for all fragments of one packet.
  • Flags (3 bits): DF (Don't Fragment), MF (More Fragments).
  • Fragment Offset (13 bits): Position of fragment in original packet (in 8-byte units).
\text{Total Fragments} = \left\lceil \frac{\text{Original Size} - \text{Header}}{\text{MTU} - \text{Header}} \right\rceil
\text{Offset}_i = \text{Offset}_{i-1} + \frac{\text{Data}_{i-1}}{8}

Reassembly:

Only the destination host reassembles fragments. Uses the Identification field to group fragments, and Fragment Offset + MF flag to order them.

Routing Algorithms:

  • RIP: Distance vector, hop count metric, 30s updates, max 15 hops.
  • OSPF: Link state, Dijkstra's SPF, areas, fast convergence.
  • BGP: Path vector, inter-AS routing, policy-based.

Multicast Routing:

Multicast delivers packets to a group of interested receivers. Uses IGMP for group management and PIM/DVMRP/MOSPF for multicast routing.