Group C — Long / Numerical Questions (15 Marks Each)

Q1a) Data bits = 1101011011, Generator polynomial G(x) = x^4 + x + 1 (10011). Calculate CRC checksum and transmitted frame. b) Explain Sliding Window Protocols efficiency: Stop-and-Wait vs Go-Back-N vs Selective Repeat.

Master Answer: CRC & Sliding Window Protocols

Part (a) CRC Checksum Calculation

Given Data \(M = 1101011011\). Generator Polynomial \(G(x) = x^4 + x + 1\), which translates to binary divisor \(G = 10011\).

Length of G is \(n = 5\). Number of appended zeros = \(n - 1 = 4\).

Dividend = \(11010110110000\).

Perform Modulo-2 Division (XOR):

       1100001011
      ________________
10011 )11010110110000
       10011
       -----
        10011
        10011
        -----
         000010110
             10011
             -----
              010100
               10011
               -----
                01110

The Remainder (CRC Checksum) is 1110.

Transmitted Frame: Data + CRC = 11010110111110.

Part (b) Sliding Window Protocols Efficiency

Protocol Sender Window (Ws) Receiver Window (Wr) Efficiency (\(\eta\)) Pros & Cons
Stop-and-Wait 1 1 \(\frac{1}{1 + 2a}\) Simplest, but terrible efficiency on long-distance links. Sender is mostly idle.
Go-Back-N \(N\) 1 \(\frac{N}{1 + 2a}\) Better efficiency. Wastes bandwidth retransmitting successfully received out-of-order packets.
Selective Repeat \(N\) \(N\) \(\frac{N}{1 + 2a}\) Highest efficiency. Only retransmits lost packets. Requires complex buffering and sorting at the receiver.
Q2a) An IP block 192.168.1.0/24 is divided into 4 equal subnets. 1. Subnet mask. 2. Network address, Broadcast address, Usable Host IP range for each subnet. b) Explain Classless Inter-Domain Routing (CIDR) advantages.

Master Answer: Subnetting and CIDR

Part (a) Subnetting Calculation

Given IP Block: 192.168.1.0/24. We need 4 equal subnets.

To get 4 subnets, we need to borrow bits from the Host portion: \(2^n = 4 \implies n = 2\) bits borrowed.

New Prefix = \(24 + 2 = 26\).

1. Subnet Mask: /26 translates to 255.255.255.192 (binary: 11111111.11111111.11111111.11000000).

2. Subnet Details:

Host bits remaining = \(32 - 26 = 6\). Usable Hosts per subnet = \(2^6 - 2 = 62\). Block size = 64.

Subnet Network Address First Usable IP Last Usable IP Broadcast Address
Subnet 1192.168.1.0192.168.1.1192.168.1.62192.168.1.63
Subnet 2192.168.1.64192.168.1.65192.168.1.126192.168.1.127
Subnet 3192.168.1.128192.168.1.129192.168.1.190192.168.1.191
Subnet 4192.168.1.192192.168.1.193192.168.1.254192.168.1.255

Part (b) CIDR Advantages

  • Eliminates Class Rigidity: Addresses can be allocated in arbitrary block sizes, drastically reducing wasted IPs compared to Class A/B/C assignments.
  • Route Aggregation (Supernetting): Multiple contiguous smaller networks can be summarized into a single routing table entry (e.g., combining four /24 blocks into one /22 block), reducing router memory load and speeding up lookups.
Q3a) Apply Dijkstra's Algorithm to find shortest path from node A to all other nodes in a given 6-node weighted network graph. b) Compare Distance Vector Routing vs Link State Routing.

Master Answer: Routing Algorithms

Part (a) Dijkstra's Algorithm

Dijkstra's Algorithm is used in Link State Routing to find the shortest path from a source node to all other nodes.

  1. Initialize distance to Source as 0, and all other nodes as Infinity.
  2. Mark all nodes as unvisited. Set the Source node as the current node.
  3. For the current node, consider all its unvisited neighbors. Calculate their tentative distances through the current node.
  4. Compare the newly calculated tentative distance to the current assigned value and assign the smaller one.
  5. When finished considering all neighbors of the current node, mark the current node as visited. It will never be checked again.
  6. Select the unvisited node that is marked with the smallest tentative distance, set it as the new "current node", and go back to step 3.

Part (b) Distance Vector vs Link State Routing

Feature Distance Vector (e.g., RIP) Link State (e.g., OSPF)
Knowledge SharedSends the entire routing table.Sends only information about direct links.
Shared WithOnly immediate neighbors.Flooded to all routers in the entire network.
AlgorithmBellman-Ford algorithm.Dijkstra's Shortest Path algorithm.
Topology ViewRouters have no overall map of the network.Every router builds an identical full map of the network.
IssuesProne to Count-to-Infinity routing loops.Compute and memory-intensive. No routing loops.
Q4a) Explain TCP Congestion Control Algorithms in detail: Slow Start, Congestion Avoidance, Fast Retransmit, Fast Recovery. b) Draw Congestion Window Size graph over transmission rounds.

Master Answer: TCP Congestion Control

Part (a) Congestion Control Algorithms

  • Slow Start: The Congestion Window (cwnd) starts at 1 MSS. For every ACK received, cwnd increases by 1. Effectively, cwnd doubles every Round Trip Time (RTT). It grows exponentially until it reaches the ssthresh (Slow Start Threshold).
  • Congestion Avoidance: Once ssthresh is reached, exponential growth is too risky. The algorithm switches to linear growth (Additive Increase). cwnd increases by exactly 1 MSS per entire RTT.
  • Fast Retransmit: If a sender receives 3 duplicate ACKs for the same packet, it assumes the packet was dropped due to mild congestion. It immediately retransmits the missing packet without waiting for the timeout timer to expire.
  • Fast Recovery: After Fast Retransmit, instead of dropping cwnd back to 1 (which Slow Start would do), it cuts cwnd and ssthresh in half (Multiplicative Decrease) and immediately resumes Congestion Avoidance linear growth.

Part (b) Congestion Window Graph

cwnd (MSS)
 32 |                       /\
    |                      /  \
 16 |          /^\        /    \    (Linear Growth - Congestion Avoidance)
    |         /   |      /      \
  8 |        /    |     /        \
    |       /     |____/          \__ (3 Dup ACKs: Fast Recovery, drops to half)
  1 |______/      (Timeout: Drops to 1, Slow Start)
    |__________________________________
           Transmission Rounds (RTT)
Q5a) Explain RSA Asymmetric Encryption Algorithm with a numerical example (p=61, q=53, e=17). b) Explain Digital Signatures and SSL/TLS Handshake Protocol.

Master Answer: RSA and Security

Part (a) RSA Numerical Example

Given: \(p = 61, q = 53, e = 17\)

  1. Calculate Modulus (n):
    \(n = p \times q = 61 \times 53 = 3233\).
  2. Calculate Totient \(\phi(n)\):
    \(\phi(n) = (p-1)(q-1) = 60 \times 52 = 3120\).
  3. Calculate Private Key (d):
    We need \(d\) such that \((17 \times d) \pmod{3120} = 1\).
    Using the Extended Euclidean Algorithm, we find \(d = 2753\).

Keys: Public Key is \((17, 3233)\). Private Key is \((2753, 3233)\).

To encrypt a message \(M=65\): \(Cipher = 65^{17} \pmod{3233} = 2790\).

Part (b) Digital Signatures and SSL/TLS

  • Digital Signatures: Uses Asymmetric cryptography in reverse. The sender hashes the document and encrypts the hash using their Private Key. Anyone can decrypt it using the sender's Public Key. If it decrypts successfully and matches the document's hash, it proves Authenticity (only the sender has the private key) and Integrity (the document wasn't altered).
  • SSL/TLS Handshake:
    1. Client Hello: Client sends supported cipher suites.
    2. Server Hello & Certificate: Server chooses a cipher and sends its Digital Certificate (containing its Public Key).
    3. Key Exchange: Client verifies the certificate. The client generates a symmetric "Session Key", encrypts it with the server's Public Key, and sends it to the server.
    4. Secure Communication: Both parties now use the fast symmetric Session Key to encrypt all HTTP data.
Q6a) Construct 7-bit Hamming Code for 4-bit data 1011. b) Show error detection and correction if 3rd bit is flipped during transmission.

Master Answer: Hamming Code

Part (a) Constructing 7-bit Hamming Code for 1011

Data bits \(m = 4\) (1011). Required parity bits \(r = 3\) (since \(2^3 \ge 4+3+1\)). Total length = 7 bits.

Positions (Powers of 2 are parity): \(P_1, P_2, D_3, P_4, D_5, D_6, D_7\)

Insert data (1011): \(P_1, P_2, 1, P_4, 0, 1, 1\)

Calculate Even Parity:

  • \(P_1\) checks positions 1, 3, 5, 7 \(\rightarrow\) ?, 1, 0, 1 \(\rightarrow\) To make even, \(P_1 = 0\).
  • \(P_2\) checks positions 2, 3, 6, 7 \(\rightarrow\) ?, 1, 1, 1 \(\rightarrow\) To make even, \(P_2 = 1\).
  • \(P_4\) checks positions 4, 5, 6, 7 \(\rightarrow\) ?, 0, 1, 1 \(\rightarrow\) To make even, \(P_4 = 0\).

Transmitted Code: 0 1 1 0 0 1 1

Part (b) Error Detection and Correction

Suppose the 3rd bit flips during transmission. Received code: 0 1 0 0 0 1 1 (Data is now 0011).

Receiver calculates parity checks (C bits):

  • \(C_1\) checks 1, 3, 5, 7 (0, 0, 0, 1) \(\rightarrow\) Parity is Odd (1), meaning ERROR. So, \(C_1 = 1\).
  • \(C_2\) checks 2, 3, 6, 7 (1, 0, 1, 1) \(\rightarrow\) Parity is Odd (1), meaning ERROR. So, \(C_2 = 1\).
  • \(C_4\) checks 4, 5, 6, 7 (0, 0, 1, 1) \(\rightarrow\) Parity is Even (0), meaning OK. So, \(C_4 = 0\).

Read the C bits in reverse (\(C_4 C_2 C_1\)): 011 (which is decimal 3). The receiver knows exactly that the 3rd bit is flipped and changes it from 0 back to 1, restoring the original data.

Q7a) Explain CSMA/CD protocol timing constraint formula `T_frame >= 2 * T_prop`. b) Derive minimum frame size requirement for 1Gbps Ethernet over 1km link.

Master Answer: CSMA/CD Timing Constraint

Part (a) The Formula \(T_{frame} \ge 2 \times T_{prop}\)

In CSMA/CD, for a sender to detect a collision, it must still be transmitting its frame when the collision signal reaches back to it.

Worst-case scenario: Station A and Station B are at opposite ends of the cable. A transmits. Just before A's signal reaches B (taking \(T_{prop}\) time), B also transmits, causing a collision at B's end. The collision noise must travel all the way back to A (taking another \(T_{prop}\) time).

Therefore, A must keep transmitting for at least \(2 \times T_{prop}\) (the Round Trip Time) to guarantee it hears the collision. If A transmits a very short frame and stops before \(2 \times T_{prop}\), it will hear the collision but wrongly assume it was someone else's collision, thinking its own frame succeeded.

Thus: Transmission Time (\(T_{frame}\)) \(\ge\) Round Trip Time (\(2 \times T_{prop}\)).

Part (b) Minimum Frame Size Calculation

Given: Bandwidth = 1 Gbps (\(10^9\) bps). Distance = 1 km (\(1000\) m). Signal speed = \(2 \times 10^8\) m/s.

\(T_{prop} = \frac{\text{Distance}}{\text{Speed}} = \frac{1000}{2 \times 10^8} = 5 \times 10^{-6} \text{ seconds} (5 \mu s)\)

\(T_{frame} \ge 2 \times T_{prop} = 2 \times 5 \mu s = 10 \mu s\)

Since \(T_{frame} = \frac{\text{Frame Size (Bits)}}{\text{Bandwidth}}\):

\(\text{Frame Size} = T_{frame} \times \text{Bandwidth} = (10 \times 10^{-6}) \times 10^9 = 10,000 \text{ bits} = \mathbf{1250 \text{ bytes}}\).

Q8a) Explain Subnetting and Supernetting with numerical examples. b) Aggregate 4 class C networks 200.10.0.0/24, 200.10.1.0/24, 200.10.2.0/24, 200.10.3.0/24 into a single CIDR block.

Master Answer: Subnetting and Supernetting

Part (a) Concepts

  • Subnetting: Borrowing bits from the Host portion to create more networks. (e.g., Splitting one /24 into four /26 networks). Used to reduce broadcast domains.
  • Supernetting (Route Aggregation): Borrowing bits from the Network portion to combine multiple small networks into one large network. (e.g., Combining four /24 networks into one /22 network). Used to shrink the size of routing tables.

Part (b) Aggregating 4 Class C Networks

Given networks:

  • 200.10.0.0 (Binary: 200.10.00000000.0)
  • 200.10.1.0 (Binary: 200.10.00000001.0)
  • 200.10.2.0 (Binary: 200.10.00000010.0)
  • 200.10.3.0 (Binary: 200.10.00000011.0)

Looking at the 3rd octet, the first 22 bits (from the left) are identical across all 4 IP addresses (200.10.000000xx). We can summarize these 4 blocks by making the network mask 22 bits instead of 24.

Aggregated CIDR Block: 200.10.0.0 /22

Q9a) Explain Distance Vector Routing Bellman-Ford algorithm. b) Illustrate Count-to-Infinity problem and solutions: Split Horizon and Poison Reverse.

Master Answer: Distance Vector Routing Issues

Part (a) Bellman-Ford Algorithm

In Distance Vector Routing, each router periodically sends its entire routing table (vectors of distances to all known destinations) to its immediate neighbors. When a router receives an update from a neighbor, it updates its own table using the Bellman-Ford equation:

Dx(y) = min { c(x,v) + Dv(y) } for each neighbor v

Essentially: The cost from me to destination Y is the minimum of (cost from me to my neighbor V) + (neighbor V's advertised cost to destination Y).

Part (b) Count-to-Infinity & Solutions

If the link between Router A and Network N goes down, A updates its distance to N to Infinity. However, if neighbor Router B recently advertised "I can reach N in 2 hops" (which was actually bouncing through A), Router A will wrongly think "Oh, B has an alternate route! I will route through B, cost = 3". A advertises this to B. B updates its cost to 4. They bounce updates back and forth, counting to infinity.

Solutions:

  • Split Horizon: A router never advertises a route back out the same interface it learned it from. (If B learned the route to N from A, B will not advertise that route back to A).
  • Poison Reverse: Instead of not advertising, B actively advertises the route back to A with a metric of Infinity. This immediately kills any chance of A trying to use B for that route.
Q10a) Explain Border Gateway Protocol (BGP) Path Vector routing. b) Differentiate Interior Gateway Protocols (RIP, OSPF) vs Exterior Gateway Protocols (BGP).

Master Answer: BGP and Gateway Protocols

Part (a) BGP Path Vector Routing

Border Gateway Protocol (BGP) is the protocol that makes the internet work. Instead of Distance Vector or Link State, it uses Path Vector Routing.

Instead of just advertising a distance metric (like "cost 5"), BGP advertises the entire path of Autonomous Systems (AS) a packet must traverse (e.g., "Path to Network X: AS100 → AS300 → AS500").

Why Path Vector? It inherently prevents routing loops. If a router in AS100 receives a BGP advertisement and sees "AS100" already in the path string, it immediately rejects the route because accepting it would create a loop.

Part (b) IGP vs EGP

Feature Interior Gateway Protocol (IGP) Exterior Gateway Protocol (EGP)
Scope Operates inside a single Autonomous System (e.g., inside an ISP's or university's internal network). Operates between different Autonomous Systems (connecting ISPs together).
Goal Optimized for speed, shortest path, and fast convergence (efficiency). Optimized for security, policy enforcement, and scalability. (e.g., "Don't route traffic through Country X").
Examples RIP, OSPF, EIGRP BGP (The only major EGP in use today).
Q11a) Explain IPv4 Header fields in detail. b) Explain IPv4 Packet Fragmentation and Reassembly parameters (Identification, Flags, Fragment Offset) with an example.

Master Answer: IPv4 Header and Fragmentation

Part (a) IPv4 Header Fields

The IPv4 header is typically 20 bytes long.

  • Version (4 bits): Indicates IPv4.
  • IHL (Internet Header Length, 4 bits): Length of the header in 32-bit words (usually 5, meaning 20 bytes).
  • TOS (Type of Service, 8 bits): Used for QoS to prioritize packets.
  • Total Length (16 bits): Total length of the packet (header + data) in bytes. Max is 65,535.
  • Identification (16 bits): Unique ID assigned to a packet, used heavily in fragmentation.
  • Flags (3 bits): Bit 0: Reserved. Bit 1 (DF): Don't Fragment. Bit 2 (MF): More Fragments coming.
  • Fragment Offset (13 bits): Specifies where in the original original unfragmented packet this fragment belongs.
  • TTL (Time to Live, 8 bits): Decremented by 1 at every router. If it hits 0, the packet is discarded (prevents infinite routing loops).
  • Protocol (8 bits): Identifies the next-level protocol (e.g., 6 for TCP, 17 for UDP, 1 for ICMP).
  • Header Checksum (16 bits): Error-checking for the header only.
  • Source & Destination IP Addresses (32 bits each).

Part (b) Fragmentation and Reassembly

If a router receives a 4000-byte packet but the next link's MTU (Maximum Transmission Unit) is 1500 bytes, the router must fragment the packet.

Example: 4000-byte packet (20 bytes header + 3980 bytes data). MTU = 1500.

  • Fragment 1: Data = 1480 bytes. ID = 777. MF = 1 (More Fragments). Offset = 0.
  • Fragment 2: Data = 1480 bytes. ID = 777. MF = 1. Offset = 185 (1480 / 8 = 185).
  • Fragment 3: Data = 1020 bytes. ID = 777. MF = 0 (Last Fragment). Offset = 370 (2960 / 8 = 370).

The destination host uses the matching Identification numbers to group them, checks the MF flag to know when it has the last piece, and uses the Offset to order them correctly during Reassembly.

Q12a) Explain TCP Header format fields in detail. b) Explain TCP Connection Management State Transition Diagram (LISTEN, SYN_SENT, ESTABLISHED, FIN_WAIT).

Master Answer: TCP Header and Connections

Part (a) TCP Header Fields

The TCP header is typically 20 bytes long.

  • Source & Destination Port (16 bits each): Identifies the sending and receiving applications.
  • Sequence Number (32 bits): Identifies the byte in the stream of data from the sender to receiver.
  • Acknowledgment Number (32 bits): The next Sequence Number the receiver is expecting.
  • Data Offset / Header Length (4 bits): Size of the TCP header in 32-bit words.
  • Control Flags (6 bits): URG (Urgent), ACK, PSH (Push), RST (Reset connection), SYN (Synchronize), FIN (Finish connection).
  • Window Size (16 bits): Used for Flow Control. The number of bytes the receiver is currently willing to accept.
  • Checksum (16 bits): Error-checking for the header AND the data.
  • Urgent Pointer (16 bits): Points to urgent data if the URG flag is set.

Part (b) Connection State Transition Diagram

Key states during connection setup and teardown:

stateDiagram-v2 [*] --> CLOSED CLOSED --> LISTEN : Server starts passive open CLOSED --> SYN_SENT : Client sends SYN (Active open) LISTEN --> SYN_RCVD : Server receives SYN, sends SYN-ACK SYN_SENT --> ESTABLISHED : Client receives SYN-ACK, sends ACK SYN_RCVD --> ESTABLISHED : Server receives ACK ESTABLISHED --> FIN_WAIT_1 : Active close (sends FIN) ESTABLISHED --> CLOSE_WAIT : Passive close (receives FIN, sends ACK)
Q13a) Explain Traffic Shaping: Leaky Bucket vs Token Bucket. b) Calculate maximum burst duration for Token Bucket with capacity 1MB, token arrival rate 2MB/s, transmission rate 10MB/s.

Master Answer: Traffic Shaping

Part (a) Leaky Bucket vs Token Bucket

Feature Leaky Bucket Token Bucket
ConceptPackets enter at any rate, but leak out at a strictly constant rate.Tokens arrive at a constant rate. Packets transmit by consuming tokens.
BurstinessDoes not allow bursts. Completely smooths out traffic.Allows bursts up to the maximum bucket capacity.
Packet DropDrops packets if the bucket overflows.Never drops packets (it drops tokens if the bucket is full). Packets just wait for tokens.

Part (b) Token Bucket Burst Duration Calculation

Given:

  • Bucket Capacity \(C = 1 \text{ MB}\)
  • Token Arrival Rate \(R = 2 \text{ MB/s}\)
  • Max Transmission Rate \(M = 10 \text{ MB/s}\)

Let \(S\) be the maximum burst duration in seconds. During this time \(S\), the total data transmitted at max rate \(M\) must equal the data initially in the bucket \(C\) plus the new tokens generated during that time \((R \times S)\).

\[ M \times S = C + (R \times S) \]

\[ (M - R) \times S = C \]

\[ S = \frac{C}{M - R} = \frac{1}{10 - 2} = \frac{1}{8} = \mathbf{0.125 \text{ seconds}} \]

The system can transmit at the maximum 10 MB/s speed for 0.125 seconds before it runs out of tokens and is forced to slow down to the 2 MB/s token arrival rate.

Q14a) Explain Domain Name System (DNS) Iterative vs Recursive resolution. b) Detail DNS Resource Records (A, AAAA, CNAME, MX, NS, PTR).

Master Answer: Domain Name System (DNS)

Part (a) Iterative vs Recursive Resolution

  • Recursive: The client asks the Local DNS Server. The Local server takes full responsibility. It asks the Root, gets referred to the TLD, asks the TLD, gets referred to the Authoritative, asks the Authoritative, gets the IP, and finally hands the fully resolved IP back to the client. The client does no work.
  • Iterative: The Local DNS Server asks the Root. The Root replies, "I don't know, but here is the IP of the TLD." The Local Server then asks the TLD. The TLD replies, "I don't know, but here is the IP of the Authoritative." The Local server does all the back-and-forth legwork.

Part (b) DNS Resource Records (RR)

A Resource Record has the format (Name, Value, Type, TTL).

  • Type A (Address): Maps a hostname (www.google.com) to an IPv4 address.
  • Type AAAA (Quad-A): Maps a hostname to an IPv6 address.
  • Type CNAME (Canonical Name): Maps an alias hostname (www.ibm.com) to its true, canonical name (server-east.ibm.com).
  • Type MX (Mail Exchange): Identifies the mail server responsible for accepting email messages on behalf of a domain.
  • Type NS (Name Server): Identifies the Authoritative DNS server for a domain.
  • Type PTR (Pointer): Used for Reverse DNS lookup. Maps an IP address back to a hostname.
Q15a) Explain HTTP 1.0 vs HTTP 1.1 vs HTTP 2.0 vs HTTP 3.0 protocols. b) Detail Persistent Connections, Pipelining, Multiplexing, and QUIC protocol.

Master Answer: Evolution of HTTP

Part (a) HTTP 1.0 vs 1.1 vs 2.0 vs 3.0

Version Key Innovation Transport Protocol
HTTP 1.0Non-persistent connections (A new TCP connection is required for every single image/CSS file). Very slow.TCP
HTTP 1.1Introduced Persistent Connections (Keep-Alive) and Pipelining. One TCP connection can fetch multiple files sequentially.TCP
HTTP 2.0Introduced Multiplexing over a single TCP connection. Files are fetched concurrently, solving the Head-of-Line blocking problem. Uses binary framing.TCP
HTTP 3.0Replaces TCP entirely with QUIC to eliminate TCP handshake latency and TCP Head-of-Line blocking.UDP

Part (b) Advanced Concepts

  • Persistent Connections (Keep-Alive): Keeps the underlying TCP socket open after a request is completed, saving the massive overhead of performing a 3-way handshake for every asset on a web page.
  • Pipelining: Sending multiple HTTP requests on a persistent connection without waiting for the corresponding responses. (Mostly abandoned in favor of Multiplexing).
  • Multiplexing: HTTP/2 breaks requests and responses into small interleaved frames. If a massive image is downloading, a tiny CSS file can be downloaded simultaneously over the exact same TCP connection without waiting.
  • QUIC Protocol: Developed by Google. It provides the reliability of TCP but runs on top of UDP. It combines the cryptographic handshake (TLS) with the transport handshake, resulting in 0-RTT connection setups.
Q16a) Explain Cryptographic Hash Functions (MD5, SHA-256) and Digital Certificates. b) Detail Public Key Infrastructure (PKI) and Certificate Authority (CA) verification.

Master Answer: Cryptography, Hashing, and PKI

Part (a) Hash Functions and Certificates

  • Cryptographic Hash Functions (MD5, SHA-256): A mathematical algorithm that takes input data of any size and produces a fixed-size string of characters (a hash).
    Properties: It is a one-way function (cannot be reversed). Changing even one comma in a 500-page document completely changes the resulting hash (Avalanche Effect). Used to verify Data Integrity.
  • Digital Certificates: An electronic document used to prove the ownership of a Public Key. It acts like a digital passport. It contains the owner's identity (website name), their Public Key, and the Digital Signature of the Certificate Authority that issued it.

Part (b) Public Key Infrastructure (PKI) & CA Verification

PKI is the entire ecosystem of roles, policies, and hardware needed to manage digital certificates.

How your browser verifies a CA:

  1. You visit https://bank.com. The server sends its Digital Certificate.
  2. Your browser checks who issued the certificate (e.g., DigiCert CA).
  3. The browser looks in its internal, pre-installed "Trusted Root Store" to find DigiCert's Public Key.
  4. The browser uses DigiCert's Public Key to decrypt the Digital Signature on the bank's certificate.
  5. If the decrypted signature matches the certificate's hash, the browser knows the certificate is genuine and hasn't been tampered with. It now trusts the bank's Public Key.
Q17a) Explain IPsec Protocol Suite Architecture (AH, ESP, IKE). b) Differentiate IPsec Transport Mode vs Tunnel Mode.

Master Answer: IPsec Architecture

Part (a) IPsec Protocol Suite

IPsec (Internet Protocol Security) secures IP communications by authenticating and encrypting each IP packet of a communication session. It operates at Layer 3 (Network).

  • AH (Authentication Header): Provides data origin authentication, data integrity, and anti-replay protection. It signs the entire packet, including the IP header. It does not provide encryption (data is still in plain text).
  • ESP (Encapsulating Security Payload): Provides confidentiality (encryption) in addition to authentication and integrity. It encrypts the payload so sniffers cannot read the data.
  • IKE (Internet Key Exchange): The protocol used to set up the Security Associations (SA). It securely exchanges the cryptographic keys (using Diffie-Hellman) before AH or ESP can start transmitting data.

Part (b) Transport Mode vs Tunnel Mode

Feature Transport Mode Tunnel Mode
What is Encrypted? Only the Payload (TCP/UDP segment and data). The entire original IP packet (Payload + Original IP Header).
IP Header The original IP header is kept intact and used for routing. A brand new "Outer IP Header" is created and prepended. The original header is hidden inside the encrypted payload.
Primary Use Case Host-to-Host communication (End-to-End). Gateway-to-Gateway communication (Site-to-Site VPNs between corporate routers).
Q18a) Explain IEEE 802.11 Wireless LAN MAC layer CSMA/CA protocol. b) Detail RTS/CTS handshake solving Hidden Terminal and Exposed Terminal problems.

Master Answer: Wireless LAN MAC (802.11)

Part (a) CSMA/CA Overview

Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) is required in Wi-Fi because wireless radios cannot transmit and receive simultaneously to detect collisions like Ethernet can.

Part (b) Hidden/Exposed Terminal Problems & RTS/CTS

  • The Hidden Terminal Problem: Station A and Station C can both see Access Point B, but A and C cannot see each other (they are hidden by distance/walls). If A and C both transmit to B simultaneously, they won't detect each other's carrier, causing a massive collision at B.
  • The Exposed Terminal Problem: Station B wants to transmit to A. Station C wants to transmit to D. B transmits to A. C hears B transmitting and wrongly assumes the channel is busy, so C waits. But C's transmission to D would NOT have interfered with B's transmission to A. C is unnecessarily blocked.

Solution: RTS/CTS Handshake:

Before sending data, A sends a short Request-To-Send (RTS) to B. B replies with a Clear-To-Send (CTS) broadcast. Station C hears B's CTS and knows to stay quiet. The Hidden Terminal is solved because C heard the receiver (B) grant permission, even if C couldn't hear the sender (A).

Q19a) Explain Software Defined Networking (SDN) Architecture. b) Detail Separation of Control Plane and Data Plane, OpenFlow protocol, and SDN Controller.

Master Answer: Software Defined Networking (SDN)

Part (a) SDN Architecture

Traditional routers combine both decision-making (Routing protocols like OSPF) and data-forwarding (moving packets from input port to output port) in the exact same hardware box. SDN completely separates these two functions.

Part (b) Planes and Protocols

  • Data Plane (Forwarding Plane): Dumb, fast hardware switches. Their only job is to look at an incoming packet, check a local Flow Table, and forward the packet out the correct port at lightning speed. They make no routing decisions.
  • Control Plane: The "Brains" of the network. This is moved out of the routers and into a centralized software application called the SDN Controller. The controller computes the optimal routing paths for the entire network globally.
  • OpenFlow Protocol: The standard communication protocol used between the centralized SDN Controller and the dumb Data Plane switches. The Controller uses OpenFlow to push down the computed Flow Tables to the switches.

Benefit: A network admin can program and change the behavior of the entire network globally from a single software dashboard, rather than logging into 500 individual routers to change OSPF configurations.

Q20a) Complete Computer Networks Case Study: Trace packet travel when user enters `https://www.google.com` in web browser. b) Detail DNS query, ARP resolution, TCP 3-way handshake, TLS handshake, HTTP GET, IP routing, and Ethernet framing.

Master Answer: Case Study - Web Browsing Lifecycle

Part (a) & (b) Tracing a packet to google.com

When a user types https://www.google.com, a massive chain of protocols executes in milliseconds:

  1. DNS Query: The browser doesn't know Google's IP. It checks its cache. If missing, it sends a UDP DNS request (Port 53) to the local DNS resolver to get the IP address (e.g., 142.250.190.46).
  2. ARP Resolution: The PC needs to send the packet to its Default Gateway (Home Router). It broadcasts an ARP Request: "Who has the router's IP?". The router replies with its MAC address.
  3. Ethernet Framing: The PC encapsulates the packet in an Ethernet Frame with the Router's MAC as the destination.
  4. TCP 3-Way Handshake: The browser initiates a TCP connection to Google's IP on Port 443 (HTTPS). It sends a SYN, Google sends SYN-ACK, PC sends ACK.
  5. TLS Handshake: Because it's HTTPS, the client and server negotiate encryption algorithms. Google sends its Digital Certificate. They establish a secure symmetric session key.
  6. HTTP GET Request: The browser finally encrypts an HTTP GET / request using the TLS key and sends it.
  7. IP Routing: The packet travels through dozens of ISP routers using OSPF and BGP to find the optimal path to Google's data center.
  8. Response: Google's server processes the request, sends back a 200 OK with the encrypted HTML payload. The browser decrypts and renders the page.
Q21a) Calculate maximum throughput for Pure ALOHA and Slotted ALOHA mathematically. b) Plot throughput S vs offered load G.

Master Answer: ALOHA Throughput Analysis

Part (a) Mathematical Calculation

Let \(G\) be the offered load (total number of frames generated by all stations in one frame transmission time \(T_f\)). Let \(S\) be the throughput (successful transmissions).

Pure ALOHA:

Vulnerable time is \(2 \times T_f\). A frame is successful only if no other frame is generated during this \(2T_f\) window. Using Poisson distribution, the probability of 0 frames generated in \(2T_f\) is \(e^{-2G}\).

\[ S_{pure} = G \times e^{-2G} \]

To find the maximum, set the derivative \(dS/dG = 0\). This occurs at \(G = 0.5\).

\[ S_{max} = 0.5 \times e^{-1} \approx 0.184 \text{ (18.4% efficiency)} \]

Slotted ALOHA:

Vulnerable time is reduced to exactly \(1 \times T_f\) because transmissions can only start at slot boundaries. The probability of 0 frames generated in \(T_f\) is \(e^{-G}\).

\[ S_{slotted} = G \times e^{-G} \]

Maximum occurs at \(G = 1\).

\[ S_{max} = 1 \times e^{-1} \approx 0.368 \text{ (36.8% efficiency)} \]

Part (b) Throughput vs Load Graph

   Throughput (S)
      |
 0.368|             *  (Slotted ALOHA Max)
      |           *   *
 0.184|     *   *       * (Pure ALOHA Max)
      |   *   *           *
      | *   *               *
      |*__*___________________*_______
      0  0.5       1.0              Offered Load (G)
Q22a) Explain Optical Fiber communication principles (Total Internal Reflection, Single-mode vs Multi-mode). b) Calculate attenuation and dispersion limitations on fiber links.

Master Answer: Optical Fiber Communication

Part (a) Principles of Optical Fiber

  • Total Internal Reflection (TIR): The core principle. Light traveling through a denser medium (glass core) hits the boundary of a less dense medium (cladding) at an angle greater than the "critical angle". Instead of passing through, the light perfectly reflects back into the core, bouncing down the cable with zero loss through the walls.
  • Multi-mode Fiber: Has a thick core. Light rays bounce at multiple different angles (modes). This causes Modal Dispersion (pulses spread out and blur together over long distances). Used for short-distance LANs.
  • Single-mode Fiber: Has a microscopic core. Light can only travel straight down the middle in one single mode. Eliminates modal dispersion. Used for long-haul transoceanic cables.

Part (b) Limitations

  • Attenuation (Signal Loss): Measured in Decibels per kilometer (dB/km). Caused by impurities in the glass scattering or absorbing the light. Formula: \(\text{Loss} = 10 \log_{10}(\frac{P_{in}}{P_{out}})\). If a 100km link has 0.2 dB/km attenuation, total loss is 20 dB, meaning 99% of the signal power is lost and requires an optical amplifier.
  • Dispersion (Signal Smearing): As light pulses travel, they spread out in time. If they spread too much, adjacent pulses overlap (Inter-Symbol Interference), and the receiver cannot distinguish a 1 from a 0. Limits the maximum bandwidth and distance.
Q23a) Explain Data Link Layer Framing methods: Byte Count, Byte Stuffing, Bit Stuffing. b) Perform bit stuffing on frame `011111101111110`.

Master Answer: Data Link Layer Framing

Part (a) Framing Methods

Framing breaks a continuous bit stream into manageable blocks (frames) so the receiver knows where data starts and ends.

  • Byte Count: The frame header specifies the exact number of bytes in the frame. (Flaw: If the count gets corrupted, the receiver loses sync entirely).
  • Byte Stuffing (Character Stuffing): Special FLAG bytes denote the start/end of a frame. If the FLAG byte accidentally appears inside the data, an ESC (Escape) byte is stuffed before it to tell the receiver "this is data, not the end of the frame".
  • Bit Stuffing: The FLAG is a specific 8-bit pattern: 01111110 (Six 1s). To ensure this pattern never appears in the data, the sender artificially stuffs a 0 after every five consecutive 1s in the payload.

Part (b) Bit Stuffing Example

Original Payload: 011111101111110

Rule: After exactly five 1s, stuff a 0.

  • First block: 011111 → Stuff a 0 → 011111(0)
  • Next bit is 1011111(0)1
  • Next bit is 0011111(0)10
  • Next block: 11111 → Stuff a 0 → 011111(0)1011111(0)
  • Next bit is 1011111(0)1011111(0)1
  • Next bit is 0011111(0)1011111(0)10

Stuffed Payload: 01111101011111010

Final Transmitted Frame: [FLAG] 01111101011111010 [FLAG]

Q24a) Explain Network Management Protocol SNMP (v1, v2, v3) Architecture. b) Detail Management Information Base (MIB) and SMI structure.

Master Answer: SNMP Architecture

Part (a) SNMP v1, v2, v3

Simple Network Management Protocol (SNMP) is used to monitor and configure network devices (routers, servers, printers).

  • SNMPv1: Original standard. Unencrypted (plaintext community strings).
  • SNMPv2c: Added Bulk GET requests for efficiency, but security was still weak plaintext.
  • SNMPv3: Introduced massive security upgrades: Authentication (passwords), Privacy (Data Encryption via AES), and Access Control (who can view what).

Part (b) MIB and SMI

  • SMI (Structure of Management Information): The rules defining how management data is structured, named, and formatted. It ensures all devices speak the same structural language.
  • MIB (Management Information Base): A hierarchical, tree-structured database of all the variables (objects) that can be monitored or changed on a device.
    Example: An Object Identifier (OID) like 1.3.6.1.2.1.2.2.1.10.1 specifically points to the "bytes received on interface 1". The SNMP manager queries this OID to draw a traffic graph.
Q25a) Explain Mobile IP Architecture. b) Detail Home Agent, Foreign Agent, Care-of Address, and Tunneling mechanism.

Master Answer: Mobile IP Architecture

Part (a) Overview

Standard IP assumes a device's IP address dictates its physical location. If a laptop moves to a new Wi-Fi network, its IP must change, breaking all active TCP connections. Mobile IP solves this, allowing a device to roam across different networks while keeping the exact same IP address.

Part (b) Core Components

  • Home Agent (HA): A router on the Mobile Node's permanent home network. It intercepts packets destined for the node when it is away.
  • Foreign Agent (FA): A router on the new, visited network that the Mobile Node has roamed into.
  • Care-of Address (CoA): A temporary IP address assigned to the Mobile Node by the Foreign network. It reflects the node's actual current physical location.
  • Tunneling Mechanism:
    1. The Mobile Node moves and registers its new CoA with its Home Agent.
    2. A sender sends a packet to the node's permanent Home IP.
    3. The Home Agent intercepts the packet, encapsulates it inside a new IP packet destined for the Care-of Address (IP-in-IP Tunneling), and sends it.
    4. The Foreign Agent receives the tunneled packet, strips the outer header, and delivers the original packet to the Mobile Node.
Q26a) Explain Network Security Threats: Denial of Service (DoS), Distributed DoS (DDoS), Man-in-the-Middle (MitM), SQL Injection. b) Detail SYN Flood attack and SYN Cookies defense.

Master Answer: Network Security Threats

Part (a) Common Threats

  • DoS (Denial of Service): Flooding a server with fake requests so legitimate users cannot access it.
  • DDoS (Distributed DoS): Using a massive botnet of thousands of compromised IoT devices to launch a DoS attack. Extremely hard to block because the traffic comes from everywhere.
  • Man-in-the-Middle (MitM): An attacker secretly intercepts and relays communications between two parties who believe they are talking directly (e.g., using a fake open Wi-Fi hotspot).
  • SQL Injection: Inserting malicious SQL commands into a website's input form to manipulate the backend database (e.g., stealing passwords or deleting tables).

Part (b) SYN Flood Attack & SYN Cookies

SYN Flood (DoS): An attacker sends millions of TCP SYN requests with spoofed IPs but never completes the 3-way handshake (never sends the final ACK). The server allocates memory for all these "half-open" connections until its RAM fills up, causing it to crash.

SYN Cookies Defense: The server stops allocating memory for half-open connections. Instead, when it receives a SYN, it cryptographically hashes the client's IP, Port, and a secret key to generate a unique "Cookie". It sends this Cookie as the SYN-ACK Sequence Number and forgets about the client. If the client is legitimate, it replies with an ACK containing (Cookie + 1). The server recalculates the hash to verify it, and only then allocates memory to establish the connection.

Q27a) Explain Peer-to-Peer (P2P) Architecture vs Client-Server Architecture. b) Detail BitTorrent protocol, DHT (Distributed Hash Table), and Choking algorithm.

Master Answer: P2P and BitTorrent

Part (a) P2P vs Client-Server

In Client-Server, all clients download files from a single, centralized server. As more users join, the server becomes a bottleneck and crashes. In Peer-to-Peer (P2P), every node is both a client and a server. As more users join, the total upload capacity of the network actually increases.

Part (b) BitTorrent Protocol Details

  • BitTorrent: A file is broken into hundreds of small chunks. A user downloads chunk A from Peer 1, chunk B from Peer 2, and simultaneously uploads chunk A to Peer 3.
  • DHT (Distributed Hash Table): A decentralized way for peers to find each other without needing a central "Tracker" server. Every peer acts as a mini-directory, maintaining a small routing table mapping file hashes to peer IPs.
  • Choking Algorithm (Tit-for-Tat): A defense against "Leechers" (people who download but refuse to upload). A peer monitors who is uploading to it the fastest. It "unchokes" (allows uploads to) the top 4 fastest peers, and "chokes" (blocks) the rest. If you want fast downloads, you are mathematically forced to upload fast in return.
Q28a) Explain Virtual Local Area Networks (VLAN) IEEE 802.1Q tagging. b) Detail VLAN configuration and Inter-VLAN routing.

Master Answer: VLAN Architecture

Part (a) VLAN and 802.1Q Tagging

A VLAN (Virtual LAN) logically divides a single physical network switch into multiple isolated broadcast domains. For example, Ports 1-10 are the "HR VLAN", and Ports 11-20 are the "Engineering VLAN". A broadcast sent by HR will never reach Engineering, even though they are plugged into the same switch.

IEEE 802.1Q Tagging: When a frame needs to travel between two different switches via a "Trunk Link", the switches need to know which VLAN the frame belongs to. 802.1Q inserts a 4-byte Tag into the Ethernet header containing the 12-bit VLAN ID (allowing up to 4094 VLANs).

Part (b) Configuration and Routing

VLANs provide strict Layer 2 isolation. Computers in VLAN 10 literally cannot ping computers in VLAN 20, even on the same subnet.

Inter-VLAN Routing: To allow controlled communication between VLANs, a Layer 3 Router (or Layer 3 Switch) is required.
Router-on-a-Stick: A single physical cable connects the switch to the router. The router interface is divided into multiple virtual "sub-interfaces", one for each VLAN. The router acts as the default gateway for each VLAN, routing packets securely between them based on ACLs.

Q29a) Explain Overlay Networks and Content Delivery Networks (CDN). b) Detail Anycast routing and Edge Caching strategies.

Master Answer: Overlay Networks & CDN

Part (a) Overlay Networks & CDNs

  • Overlay Network: A virtual, logical network built on top of an existing physical network. (e.g., A VPN is an overlay network built on top of the physical internet. P2P is an overlay network).
  • CDN (Content Delivery Network): A globally distributed network of proxy servers (like Cloudflare or Akamai). Its goal is to serve content (images, videos, HTML) to end-users with high availability and high performance by caching the content geographically closer to the user.

Part (b) Edge Caching and Anycast

  • Edge Caching: Instead of a user in India downloading a video from a server in New York (high latency), the CDN caches a copy of the video on an "Edge Server" located in Mumbai. The Indian user downloads from Mumbai, dropping latency from 250ms to 20ms.
  • Anycast Routing: A network routing methodology where multiple servers in different geographic locations all share the exact same IP address. When a user queries that IP, the BGP routing protocol automatically routes the request to the topologically closest server.
Q30a) Explain Real-time Audio/Video Streaming protocols: RTP, RTCP, RTSP, HLS. b) Detail Jitter buffering and Packet Loss concealment techniques.

Master Answer: Real-time Streaming

Part (a) Streaming Protocols

  • RTP (Real-time Transport Protocol): Runs over UDP. Provides sequence numbers and timestamps to the raw audio/video packets so the receiver can play them back in order and in sync.
  • RTCP (RTP Control Protocol): Operates alongside RTP. It sends periodic statistics (packet loss, delay) back to the sender so the sender can dynamically adjust the video quality.
  • RTSP (Real-Time Streaming Protocol): The "Remote Control" protocol. Used to establish the session and send Play, Pause, and Fast-Forward commands to the media server.
  • HLS (HTTP Live Streaming): Apple's protocol. It breaks a video into 10-second chunks and streams them over standard HTTP/TCP. It seamlessly adjusts video resolution based on current internet speed (Adaptive Bitrate Streaming).

Part (b) Overcoming Network Flaws

  • Jitter Buffering: Packets arrive over the internet with varying delays (Jitter). The receiver intentionally delays playing the video by a few seconds, storing incoming packets in a buffer. It then reads out of the buffer at a perfectly smooth, constant rate to prevent stuttering.
  • Packet Loss Concealment (PLC): If a UDP audio packet is completely lost, retransmitting it is too slow for a live call. The receiver uses PLC algorithms to "guess" and synthesize the missing 20 milliseconds of audio by interpolating the sound before and after the lost packet, masking the drop from the human ear.