Group B — Medium / Descriptive Questions (5 Marks Each)

Q1Explain OSI 7 Layer Architecture with functions of each layer.

OSI 7 Layer Architecture

The Open Systems Interconnection (OSI) model is a conceptual framework used to describe the functions of a networking system. It characterizes computing functions into a universal set of rules and requirements to support interoperability.

  1. Physical Layer: Transmits raw bit streams (0s and 1s) over a physical medium (cables, radio). Deals with voltages, hubs, and repeaters.
  2. Data Link Layer: Organizes bits into Frames. Provides node-to-node data transfer and handles MAC addressing and Error Detection (CSMA/CD, Switches).
  3. Network Layer: Organizes frames into Packets. Handles logical IP addressing and Routing to determine the best path (Routers, IPv4/IPv6).
  4. Transport Layer: Organizes packets into Segments. Ensures reliable, in-order, end-to-end delivery using Port numbers. Handles Error Correction and Flow Control (TCP, UDP).
  5. Session Layer: Establishes, maintains, and terminates connections (sessions) between local and remote applications.
  6. Presentation Layer: Formats, encrypts, and compresses data so it can be understood by the application layer (SSL/TLS, JPEG, ASCII).
  7. Application Layer: Directly interacts with the software application. Provides network services to end-users (HTTP, FTP, SMTP, DNS).
graph TD L7["Layer 7 — Application · Data (HTTP, FTP, SMTP, DNS)"] L6["Layer 6 — Presentation · Data (SSL/TLS, JPEG, ASCII)"] L5["Layer 5 — Session · Data (Session setup / teardown)"] L4["Layer 4 — Transport · Segments (TCP, UDP, Ports)"] L3["Layer 3 — Network · Packets (IP, Routers)"] L2["Layer 2 — Data Link · Frames (MAC, Switches)"] L1["Layer 1 — Physical · Bits (Cables, Hubs, Repeaters)"] L7 --> L6 --> L5 --> L4 --> L3 --> L2 --> L1
Figure: OSI layer stack from Application (top) down to Physical (bottom), with the PDU handled at each layer.
Q2Compare OSI Model vs TCP/IP Model.

OSI Model vs TCP/IP Model

Feature OSI Model TCP/IP Model
Origin & Nature A theoretical reference model developed by ISO. A practical, implementation-first model developed by ARPANET/DoD.
Number of Layers 7 Layers (Physical, Data Link, Network, Transport, Session, Presentation, Application) 4 Layers (Network Access, Internet, Transport, Application)
Session & Presentation Has dedicated Session and Presentation layers. Session and Presentation functions are merged into the Application layer.
Network Layer Delivery Supports both connectionless and connection-oriented communication. Internet layer exclusively supports connectionless communication (IP).
graph LR A7["7 · Application"] --> T4["Application"] A6["6 · Presentation"] --> T4 A5["5 · Session"] --> T4 A4["4 · Transport"] --> T3["Transport"] A3["3 · Network"] --> T2["Internet"] A2["2 · Data Link"] --> T1["Network Access"] A1["1 · Physical"] --> T1
Figure: Layer-to-layer mapping — OSI layers 5-7 collapse into the TCP/IP Application layer, and OSI layers 1-2 collapse into Network Access.
Q3Explain Transmission Media: Twisted Pair, Coaxial, Fiber Optics.

Transmission Media (Guided)

Transmission media are the physical pathways that carry data from a transmitter to a receiver.

  • Twisted Pair Cable: Consists of two insulated copper wires twisted around each other to cancel out Electromagnetic Interference (EMI) and crosstalk.
    Unshielded (UTP): Cheap, flexible, used in standard Ethernet (Cat5e/Cat6).
    Shielded (STP): Has metal foil casing for better noise protection.
  • Coaxial Cable: Has a central copper conductor core, surrounded by an insulating layer, a braided metal shield, and an outer plastic jacket. Carries higher frequency signals than twisted pair. Used heavily for Cable TV and older broadband.
  • Fiber Optics: Uses total internal reflection to transmit data as pulses of light through a glass or plastic core.
    Pros: Extremely high bandwidth, completely immune to electromagnetic interference, spans massive distances.
    Cons: Expensive, fragile, and difficult to splice.
Q4Explain Switching Techniques: Circuit Switching vs Packet Switching.

Switching Techniques

Feature Circuit Switching Packet Switching
Connection Path A dedicated, physical path is established between sender and receiver before transmission begins. No dedicated path. Data is broken into packets which travel independently over various routes.
Bandwidth Usage Bandwidth is reserved and wasted if no data is being sent (inefficient). Bandwidth is dynamically shared among all users (highly efficient).
Order of Delivery Data always arrives in the exact order it was sent. Packets may arrive out-of-order and must be reassembled at the destination.
Primary Use Case Traditional telephone networks (Voice calls). The Internet (Data transfer).
Q5Explain Error Detection using Cyclic Redundancy Check (CRC).

Error Detection: Cyclic Redundancy Check (CRC)

CRC is a highly robust error-detecting code used in the Data Link Layer (like Ethernet). It uses polynomial binary division.

Mechanism:

  1. Generator Polynomial: Both sender and receiver agree on a generator polynomial \(G(x)\) (represented as a binary divisor, e.g., 1101). Let the length of \(G\) be \(n\).
  2. Appending Zeros: The sender appends \(n-1\) zero bits to the end of the original Data message \(M\).
  3. Modulo-2 Division: The sender performs binary Modulo-2 division (which is just XORing) of the appended data by \(G\).
  4. Remainder (CRC): The remainder of this division is the CRC checksum.
  5. Transmission: The sender replaces the appended zeros with the CRC checksum and transmits the frame.
  6. Verification: The receiver divides the received frame by \(G\). If the remainder is exactly zero, the frame is accepted as error-free. Otherwise, it is rejected.
graph TD A["Sender: data M, k bits"] --> B["Append n-1 zeros to M"] B --> C["Modulo-2 divide by generator G, n bits"] C --> D["Remainder = CRC, n-1 bits"] D --> E["Transmit frame = M followed by CRC"] E --> F["Receiver divides whole frame by the same G"] F --> G{"Remainder = 0 ?"} G -->|Yes| H["Accept frame"] G -->|No| I["Reject frame, error detected"]
Figure: CRC generation at the sender and verification at the receiver — a zero remainder means no error was detected.
Q6Explain Error Correction using Hamming Code with an example.

Error Correction: Hamming Code

Hamming Code is a block code that is capable of detecting up to two simultaneous bit errors and correcting single-bit errors.

Mechanism:

  1. Redundant Bits Calculation: Given \(m\) data bits, the number of redundant parity bits \(r\) must satisfy: \(2^r \ge m + r + 1\).
  2. Positioning: Parity bits are placed at positions that are powers of 2 (1, 2, 4, 8...). Data bits fill the remaining positions.
  3. Parity Calculation: Each parity bit calculates Even (or Odd) parity for a specific overlapping set of bit positions. For example, \(P_1\) checks positions 1, 3, 5, 7. \(P_2\) checks 2, 3, 6, 7.
  4. Error Correction at Receiver: The receiver recalculates all parity bits. If there is an error, the parity bits that fail will form a binary number indicating the exact position of the flipped bit. The receiver simply flips that bit back to correct the error.
Q7Explain Stop-and-Wait ARQ protocol and efficiency formula.

Stop-and-Wait ARQ Protocol

Stop-and-Wait ARQ is the simplest flow and error control protocol.

  • Mechanism: The sender transmits exactly ONE frame and then stops. It waits for an Acknowledgement (ACK) from the receiver before sending the next frame.
  • Error Handling: If the frame is lost or corrupted (failed CRC), the receiver stays silent (or sends a NAK). The sender's timer expires (Timeout), and it retransmits the same frame.
  • Sequence Numbers: Frames and ACKs are numbered (0 or 1) to prevent duplicate frames.

Efficiency Formula

\[ \text{Efficiency } (\eta) = \frac{\text{Transmission Time (Tt)}}{\text{Total Cycle Time}} = \frac{T_t}{T_t + 2 \times T_p} = \frac{1}{1 + 2a} \]

Where \(a = \frac{T_p}{T_t}\) (Propagation Delay / Transmission Delay). It is highly inefficient for links with high propagation delay (like satellites) because the sender is idle most of the time.

Q8Explain Go-Back-N ARQ protocol and window sizes.

Go-Back-N ARQ Protocol

Go-Back-N is a Sliding Window protocol that improves upon Stop-and-Wait by allowing the sender to transmit multiple frames before receiving an ACK.

  • Window Sizes:
    • Sender Window Size \(W_s = N\) (can send up to N unacknowledged frames).
    • Receiver Window Size \(W_r = 1\) (can only accept frames strictly in order).
  • Mechanism: If frame 3 is lost, but the sender continues to send frames 4, 5, and 6, the receiver will discard 4, 5, and 6 because it is strictly waiting for frame 3.
  • Retransmission: When the sender times out waiting for the ACK for frame 3, it must "Go Back N" frames and retransmit frame 3 AND all subsequent frames (4, 5, 6).
  • Efficiency: Much better than Stop-and-Wait, but wastes bandwidth on noisy channels due to retransmitting correctly received out-of-order frames.
sequenceDiagram participant S as Sender (Ws = N) participant R as Receiver (Wr = 1) S->>R: Frame 2 R-->>S: ACK 2 S-xR: Frame 3 (lost) S->>R: Frame 4 Note right of R: Discards 4, expects 3 S->>R: Frame 5 Note right of R: Discards 5, expects 3 Note left of S: Timeout for Frame 3 S->>R: Frame 3 (resent) S->>R: Frame 4 (resent) S->>R: Frame 5 (resent) R-->>S: ACK 5 (cumulative)
Figure: Go-Back-N — losing frame 3 forces the sender to retransmit 3, 4 and 5, because the receiver window is 1 and discards anything out of order.
Q9Explain Selective Repeat ARQ protocol and window sizes.

Selective Repeat ARQ Protocol

Selective Repeat is the most efficient Sliding Window protocol, designed to overcome the wasted bandwidth of Go-Back-N on noisy channels.

  • Window Sizes:
    • Sender Window Size \(W_s = 2^{m-1}\).
    • Receiver Window Size \(W_r = 2^{m-1}\) (where m is sequence number bits). Both windows must be equal and half the maximum sequence number.
  • Mechanism: The receiver has a window larger than 1, meaning it can accept and buffer out-of-order frames. If frame 3 is lost, but 4, 5, and 6 arrive intact, the receiver buffers 4, 5, and 6 and sends a NAK specifically for frame 3.
  • Retransmission: The sender only retransmits the specific frame that was lost (frame 3). Once the receiver gets frame 3, it delivers 3, 4, 5, and 6 to the Network layer in order.
sequenceDiagram participant S as Sender (Ws = N) participant R as Receiver (Wr = N) S->>R: Frame 2 R-->>S: ACK 2 S-xR: Frame 3 (lost) S->>R: Frame 4 Note right of R: Buffers 4 (out of order) R-->>S: NAK 3 S->>R: Frame 5 Note right of R: Buffers 5 S->>R: Frame 3 (only 3 resent) Note right of R: Delivers 3, 4, 5 in order R-->>S: ACK 5
Figure: Selective Repeat — the receiver buffers out-of-order frames 4 and 5, so only the lost frame 3 is retransmitted.
Q10Explain Pure ALOHA vs Slotted ALOHA throughput analysis.

ALOHA Protocols: Pure vs Slotted

ALOHA is a random-access MAC protocol used for satellite and wireless communications.

Feature Pure ALOHA Slotted ALOHA
Transmission Rule Any station can transmit data at any time it has a frame ready. Time is divided into discrete slots. Stations can only transmit at the beginning of a time slot.
Vulnerable Time \(2 \times T_f\) (Twice the frame transmission time). \(T_f\) (Exactly one frame transmission time). Collisions only happen if two stations pick the exact same slot.
Maximum Throughput \(S = G \times e^{-2G}\)
Max efficiency is 18.4% (when \(G = 0.5\)).
\(S = G \times e^{-G}\)
Max efficiency is 36.8% (when \(G = 1\)).
Q11Explain CSMA/CD protocol and Binary Exponential Backoff algorithm.

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

CSMA/CD is a MAC protocol used in traditional wired Ethernet LANs.

Mechanism:

  1. Sense: A station listens to the cable. If idle, it transmits. If busy, it waits.
  2. Detect: While transmitting, the station simultaneously listens. If it detects a signal amplitude higher than its own, a Collision has occurred.
  3. Abort & Jam: It immediately stops transmitting the data frame and sends a short "Jam Signal" so all other stations know a collision happened.

Binary Exponential Backoff Algorithm

To prevent immediate re-collision, colliding stations wait a random amount of time before retrying. After the \(c\)-th collision (where \(c \le 10\)), a station chooses a random number \(K\) between \(0\) and \(2^c - 1\). It waits \(K \times 51.2 \mu s\) before sensing the line again. This exponentially increases the waiting time range, spreading out retries under heavy load.

graph TD A["Frame ready"] --> B{"Channel idle?"} B -->|Busy| W["Defer, keep sensing"] W --> B B -->|Idle| C["Transmit and listen"] C --> D{"Collision?"} D -->|No| E["Frame sent OK"] D -->|Yes| F["Abort, send jam signal"] F --> G{"Attempts c = 16 ?"} G -->|Yes| H["Give up, report error"] G -->|No| I["Wait K x 51.2 us, 0 <= K < 2^c, c capped at 10"] I --> B
Figure: CSMA/CD flow — sense, transmit-and-listen, jam on collision, then binary exponential backoff before re-sensing.
Q12Explain CSMA/CA protocol and Wireless LAN collision avoidance.

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

CSMA/CA is used in Wireless LANs (Wi-Fi / 802.11) because wireless nodes cannot transmit and listen at the same time to detect collisions (the "Hidden Terminal Problem").

Mechanism (Collision Avoidance):

  1. DIFS: A station with a frame to send listens to the channel. If idle for a period called DIFS, it proceeds.
  2. RTS/CTS Handshake: To avoid hidden terminals, the sender transmits a short Request To Send (RTS) frame. The Access Point responds with a Clear To Send (CTS) frame broadcasted to everyone, reserving the channel.
  3. Data & ACK: The sender transmits the Data frame. The receiver replies with an ACK. If no ACK is received, a collision is assumed, and the sender uses exponential backoff before retrying.
sequenceDiagram participant A as Station A participant AP as Access Point participant C as Hidden Node C Note over A: Idle for DIFS A->>AP: RTS (NAV duration) AP->>A: CTS (after SIFS) AP->>C: same CTS, broadcast Note over C: Sets NAV, silent A->>AP: DATA AP-->>A: ACK (after SIFS)
Figure: CSMA/CA with RTS/CTS — one broadcast CTS reserves the channel and silences the hidden station C for the NAV duration.
Q13Explain IPv4 Address Classes (A, B, C, D, E) and ranges.

IPv4 Address Classes

An IPv4 address is 32 bits long. Classful addressing divided the IP space into 5 distinct classes based on the leading bits of the first octet.

Class Leading Bits First Octet Range Network/Host Split Purpose
Class A 0 1 - 126 N.H.H.H (8/24) Massive networks (16M hosts).
Class B 10 128 - 191 N.N.H.H (16/16) Medium networks (65K hosts).
Class C 110 192 - 223 N.N.N.H (24/8) Small networks (254 hosts).
Class D 1110 224 - 239 N/A Multicasting (Sending to groups).
Class E 1111 240 - 255 N/A Reserved for Future/Experimental use.

(Note: 127.x.x.x is reserved for Loopback testing).

Q14Explain Subnetting and Subnet Mask calculation.

Subnetting and Subnet Masks

Subnetting is the process of logically dividing a single large IP network into multiple smaller, manageable sub-networks (subnets). This reduces broadcast traffic and conserves IP addresses.

Mechanism

It works by "borrowing" bits from the Host portion of the IP address and reassigning them to the Network portion to create Subnet IDs.

Subnet Mask

A 32-bit number used by routers to distinguish the Network/Subnet ID from the Host ID. It consists of a continuous stream of 1s (representing Network/Subnet bits) followed by a continuous stream of 0s (representing Host bits).

Example: A default Class C mask is 255.255.255.0. If we borrow 1 bit for subnetting, the mask becomes 255.255.255.128 (11111111.11111111.11111111.10000000), yielding 2 subnets of 126 hosts each.

Q15Explain CIDR (Classless Inter-Domain Routing) notation and prefix.

CIDR (Classless Inter-Domain Routing)

CIDR was introduced to replace the rigid Classful (A, B, C) IP addressing system, which was rapidly depleting the IPv4 address space due to massive waste.

CIDR Notation (Slash Notation)

Instead of relying on fixed classes, CIDR uses a variable-length subnet mask (VLSM). An IP address is written with a slash followed by the prefix length: IP_Address / Prefix.

The Prefix (e.g., /26) explicitly states exactly how many bits from left to right represent the Network ID. The remaining bits (\(32 - \text{Prefix}\)) represent the Host ID.

Example: 192.168.1.0 /26. The network uses 26 bits. Hosts use \(32 - 26 = 6\) bits. Total hosts per subnet = \(2^6 - 2 = 62\) usable hosts.

Q16Explain ARP (Address Resolution Protocol) request/reply workflow.

Address Resolution Protocol (ARP)

ARP is a critical protocol used to map a known logical IP Address to an unknown physical MAC Address on a local network.

Workflow:

  1. ARP Request: A host wants to send data to IP 192.168.1.10 but doesn't know its MAC address. The host broadcasts an ARP Request frame to the entire local network: "Who has IP 192.168.1.10? Tell me your MAC address." (Destination MAC is FF:FF:FF:FF:FF:FF).
  2. ARP Reply: All devices receive the request, but only the device with IP 192.168.1.10 processes it. It sends a Unicast ARP Reply back to the original sender containing its MAC address.
  3. Caching: The sender saves this IP-to-MAC mapping in its local ARP Cache table for future use.
Q17Explain RARP, BOOTP, and DHCP protocols.

RARP, BOOTP, and DHCP

These protocols handle assigning IP addresses to devices.

  • RARP (Reverse ARP): Used by diskless workstations to discover their own IP address when they boot up. The device broadcasts its MAC address asking, "What is my IP?". It was obsolete because it only provided an IP address, no subnet mask or gateway.
  • BOOTP (Bootstrap Protocol): An improvement over RARP. It provided the IP address, subnet mask, and default gateway. However, mappings were static; an admin had to manually bind MACs to IPs in a server file.
  • DHCP (Dynamic Host Configuration Protocol): The modern standard. It dynamically leases IP addresses from a pool to devices for a specific duration. It automates entire network configurations (IP, Mask, Gateway, DNS servers) with zero manual admin work. Uses the DORA process (Discover, Offer, Request, Acknowledge).
sequenceDiagram participant C as Client (no IP) participant S as DHCP Server C->>S: 1. DHCPDISCOVER (broadcast) S->>C: 2. DHCPOFFER (IP, mask, gateway, DNS) C->>S: 3. DHCPREQUEST (broadcast) S->>C: 4. DHCPACK (lease confirmed) Note over C: Configured until lease expires
Figure: DHCP DORA exchange — Discover and Request are broadcast because the client has no IP address yet.
Q18Explain Distance Vector Routing and Count-to-Infinity problem.

Distance Vector Routing

A dynamic routing algorithm (like RIP) where every router shares its entire routing table, but only with its immediate neighbors, at regular intervals.

Mechanism:

Routers calculate the best path using the Bellman-Ford equation. They don't know the full topology of the network; they only know "Route X is in that direction and is Y hops away".

Count-to-Infinity Problem:

A major flaw in DVR. If a network link goes down, Router A might think it can reach the broken network via Router B, while Router B thinks it can reach it via Router A. They continuously update each other, infinitely increasing the hop count (distance) until it hits infinity. Solutions include Split Horizon and Route Poisoning.

Q19Explain Link State Routing and Dijkstra's Algorithm.

Link State Routing

A modern dynamic routing algorithm (like OSPF) that solves the Count-to-Infinity problem.

Mechanism:

  1. Discovery: Every router says "hello" to its immediate neighbors to learn their identities and link costs.
  2. Flooding (LSA): Each router creates a Link State Packet (LSP) containing the state/cost of its direct links. It floods this packet to every single router in the entire network.
  3. Database Construction: Every router builds an identical, complete map (Topology Database) of the entire network.
  4. Dijkstra's Algorithm: Every router independently runs Dijkstra's Shortest Path algorithm on this map to compute the optimal routing table to all destinations.
Q20Explain ICMP protocol and Ping/Traceroute utility tools.

Internet Control Message Protocol (ICMP)

ICMP is a Network Layer protocol used by routers and hosts to send error messages and operational information. It does not carry user data.

Key Utility Tools:

  • Ping: Sends an ICMP Echo Request message to a destination IP. If the destination is alive and reachable, it replies with an ICMP Echo Reply. Used to test basic connectivity and measure round-trip time.
  • Traceroute: Used to map the exact path a packet takes through the internet. It works by sending packets with increasing TTL (Time To Live) values (1, 2, 3...). When a packet reaches a router and TTL hits 0, the router drops it and sends back an ICMP Time Exceeded error, revealing that router's IP address.
Q21Explain TCP 3-Way Handshake connection establishment.

TCP 3-Way Handshake

TCP is a connection-oriented protocol. Before any data can be transferred, a reliable connection must be established between the client and server using a 3-way handshake.

sequenceDiagram participant Client participant Server Client->>Server: 1. SYN (seq=x) Server->>Client: 2. SYN + ACK (seq=y, ack=x+1) Client->>Server: 3. ACK (ack=y+1)
  1. SYN: The client sends a packet with the SYN flag set and a random initial Sequence Number (x) to the server.
  2. SYN-ACK: The server receives the SYN. It replies with a packet that has both SYN and ACK flags set. It acknowledges the client's sequence number (ack = x+1) and provides its own random initial Sequence Number (y).
  3. ACK: The client receives the SYN-ACK. It replies with an ACK acknowledging the server's sequence number (ack = y+1). The connection is now established.
Q22Explain TCP 4-Way Connection Termination.

TCP 4-Way Connection Termination

TCP connections are full-duplex, meaning both directions must be shut down independently. This takes 4 steps.

sequenceDiagram participant Client participant Server Client->>Server: 1. FIN Server->>Client: 2. ACK Note over Server: Server finishes sending remaining data Server->>Client: 3. FIN Client->>Server: 4. ACK
  1. FIN (Client): The client has no more data to send, so it sends a FIN segment to the server.
  2. ACK (Server): The server acknowledges the FIN with an ACK. The client-to-server connection is now closed. However, the server might still have data to send to the client.
  3. FIN (Server): Once the server finishes sending all its data, it sends its own FIN segment to the client.
  4. ACK (Client): The client acknowledges the server's FIN with a final ACK. The connection is completely closed.
Q23Explain TCP Flow Control (Sliding Window) mechanism.

TCP Flow Control (Sliding Window)

Flow control prevents a fast sender from overwhelming a slow receiver. TCP uses a dynamic Sliding Window protocol to achieve this.

  • Receiver Window (rwnd): Every time the receiver sends an ACK to the sender, it includes a "Window Size" field in the TCP header. This number tells the sender exactly how many bytes of buffer space are currently available at the receiver.
  • Dynamic Adjustment: If the receiver's application processes data slowly, its buffer fills up, and it advertises a smaller window to the sender. The sender must slow down.
  • Zero Window: If the receiver's buffer is completely full, it advertises a window size of 0. The sender stops transmitting entirely until it receives a window update greater than 0.
Q24Explain TCP Congestion Control: Slow Start, Congestion Avoidance.

TCP Congestion Control

While Flow Control protects the receiver, Congestion Control protects the entire network (routers and links) from being overwhelmed.

TCP maintains a Congestion Window (cwnd). The sender can only transmit up to the minimum of cwnd and rwnd.

  1. Slow Start: The connection starts with a very small cwnd (e.g., 1 MSS). For every ACK received, cwnd doubles. The window grows exponentially until it reaches a threshold (ssthresh).
  2. Congestion Avoidance: Once ssthresh is reached, the growth slows down. cwnd only increases by 1 MSS per RTT (Additive Increase).
  3. Congestion Detection:
    3 Duplicate ACKs (Fast Retransmit): Implies mild congestion. ssthresh is halved, and cwnd is halved.
    Timeout: Implies severe congestion (packet totally lost). ssthresh is halved, and cwnd drops all the way back to 1 MSS (Multiplicative Decrease).
stateDiagram-v2 [*] --> SlowStart SlowStart : Slow Start (cwnd doubles per RTT) CongAvoid : Congestion Avoidance (cwnd + 1 MSS per RTT) FastRecovery : Fast Recovery (cwnd = ssthresh) SlowStart --> CongAvoid : cwnd reaches ssthresh SlowStart --> SlowStart : Timeout - ssthresh = cwnd/2, cwnd = 1 MSS CongAvoid --> SlowStart : Timeout - ssthresh = cwnd/2, cwnd = 1 MSS CongAvoid --> FastRecovery : 3 duplicate ACKs - ssthresh = cwnd/2, cwnd = ssthresh FastRecovery --> CongAvoid : New ACK arrives FastRecovery --> SlowStart : Timeout
Figure: TCP congestion-control state machine — exponential growth until ssthresh, then linear growth; a timeout resets cwnd to 1 MSS while 3 duplicate ACKs only halve it.
Q25Explain Leaky Bucket Algorithm for traffic shaping.

Leaky Bucket Algorithm

The Leaky Bucket algorithm is a traffic shaping mechanism used to convert bursty, erratic traffic into a smooth, steady stream of packets.

Mechanism:

  • Imagine a bucket with a hole at the bottom. Water (packets) pours into the top in bursts.
  • No matter how fast water pours in, it leaks out of the bottom hole at a constant, fixed rate.
  • If water pours in so fast that the bucket fills up entirely, any extra water spills over and is lost (packets are dropped).

Use Case: Ideal for applications that require a strict, constant bandwidth without fluctuations, like Voice over IP (VoIP) or Live Video Streaming.

Q26Explain Token Bucket Algorithm for bursty traffic.

Token Bucket Algorithm

The Token Bucket algorithm is another traffic shaping mechanism, but unlike the Leaky Bucket, it allows for temporary bursts of data.

Mechanism:

  • A bucket holds "Tokens" instead of packets. Tokens are generated and added to the bucket at a constant rate.
  • To transmit a packet, the sender must grab and destroy one token from the bucket.
  • If the bucket is empty, the sender must wait for a new token to be generated.
  • If the sender has been idle, tokens accumulate in the bucket (up to its maximum capacity). When the sender suddenly needs to transmit a massive burst of data, it can use all the accumulated tokens at once to send the burst at maximum line speed.

Use Case: Standard internet traffic (web browsing, file downloads) which is naturally bursty.

Q27Explain Domain Name System (DNS) hierarchy and resolution.

Domain Name System (DNS)

DNS is the "phonebook of the Internet". It translates human-readable domain names (like www.google.com) into machine-readable IP addresses (like 142.250.190.46).

Hierarchy

  • Root Servers (.): The top of the tree. They know where all the TLD servers are.
  • TLD Servers (.com, .org): Top-Level Domain servers know where the Authoritative servers for specific domains are located.
  • Authoritative Servers (google.com): The final servers that actually hold the exact IP address records for a specific domain.

Resolution Process

When you type a URL, your browser asks a Recursive Resolver (usually provided by your ISP). If the IP isn't cached, the resolver asks the Root Server → then the TLD Server → then the Authoritative Server, finally returning the IP to your browser.

sequenceDiagram participant R as Resolver participant Ro as Root (.) participant T as TLD (.com) participant A as Auth NS Note over R: Recursive query in R->>Ro: www.google.com ? Ro-->>R: Refer to .com R->>T: www.google.com ? T-->>R: Refer to ns.google.com R->>A: www.google.com ? A-->>R: A record = IP Note over R: Cache, then reply
Figure: Recursive query from the browser, then iterative queries from the resolver down the Root → TLD → Authoritative hierarchy.
Q28Explain HTTP vs HTTPS protocols (Port 80 vs Port 443).

HTTP vs HTTPS

Feature HTTP (Hypertext Transfer Protocol) HTTPS (HTTP Secure)
Security Data is transmitted in plain text. Anyone intercepting the traffic can read it (passwords, credit cards). Data is heavily encrypted using SSL/TLS before transmission.
Port Number Uses TCP Port 80. Uses TCP Port 443.
Authentication No authentication. You don't know if the server is really who it claims to be. Uses Digital Certificates issued by a Certificate Authority (CA) to prove the server's identity.
Q29Explain FTP (File Transfer Protocol) dual connection (Data & Control).

File Transfer Protocol (FTP)

FTP is an application layer protocol used to transfer files between a client and a server. Uniquely, FTP requires two separate TCP connections to function:

  1. Control Connection (Port 21): This connection is established first and stays open for the entire session. It is used exclusively to send commands (like LIST, RETR, QUIT) and receive server replies. No files are sent over this connection.
  2. Data Connection (Port 20): This connection is opened dynamically only when a file transfer or directory listing is requested. The actual file bytes are transferred here. Once the specific file finishes transferring, this data connection is immediately closed.
Q30Explain Email Protocols: SMTP, POP3, IMAP.

Email Protocols

Sending and receiving emails involves distinct protocols:

  • SMTP (Simple Mail Transfer Protocol - Port 25/587): Used exclusively for sending (pushing) emails. It pushes the email from the sender's client to the sender's mail server, and then from the sender's mail server to the recipient's mail server.
  • POP3 (Post Office Protocol v3 - Port 110): Used for receiving (pulling) emails. It connects to the mail server, downloads all the emails to the local device, and then usually deletes them from the server. Not ideal for multiple devices.
  • IMAP (Internet Message Access Protocol - Port 143): A modern receiving protocol. It syncs the local client with the mail server. Emails remain stored on the server. If you read or delete an email on your phone, it syncs and shows as read/deleted on your laptop.
Q31Explain Network Devices: Hub, Switch, Router, Bridge, Gateway.

Network Devices

  • Hub (Layer 1): A dumb device that connects multiple computers. When it receives a packet on one port, it blindly broadcasts it to all other ports. High collision rate.
  • Bridge (Layer 2): Connects two LAN segments. It learns MAC addresses and filters traffic, only forwarding frames across the bridge if the destination MAC is on the other side.
  • Switch (Layer 2): A multi-port bridge. It maintains a MAC address table. When a frame arrives, the switch intelligently forwards it only to the specific port where the destination MAC lives. Eliminates collisions.
  • Router (Layer 3): Connects different logical networks (e.g., your home LAN to the ISP's network). Uses IP addresses to determine the best path to forward packets globally.
  • Gateway (All Layers): A device that translates between entirely different network architectures and protocols (e.g., connecting a TCP/IP network to an old IPX/SPX network).
Q32Explain IPv6 Header format and benefits over IPv4.

IPv6 Header and Benefits over IPv4

IPv6 was developed to solve the IPv4 address exhaustion problem by expanding the address space from 32 bits to 128 bits.

Benefits of IPv6:

  • Massive Address Space: \(2^{128}\) addresses, enough for every grain of sand on Earth to have an IP.
  • Simpler Header: The IPv6 header has a fixed length of 40 bytes. Several optional IPv4 fields (like Fragmentation and Checksum) were removed or moved to Extension Headers, making routing much faster.
  • No NAT Required: Because there are so many public IPs, every device can have a globally unique public IP, restoring true end-to-end connectivity without NAT.
  • Built-in Security: IPSec (which is optional in IPv4) is fully integrated into the IPv6 protocol standard.
Q33Explain Wireless LAN (IEEE 802.11) architecture.

Wireless LAN (IEEE 802.11) Architecture

The IEEE 802.11 standard defines the architecture for Wi-Fi networks.

  • BSS (Basic Service Set): The fundamental building block. It consists of a group of wireless stations and one central Access Point (AP). All communication goes through the AP.
  • IBSS (Independent BSS / Ad-Hoc): A network with no AP. Stations communicate directly with each other (peer-to-peer).
  • ESS (Extended Service Set): Created by connecting multiple BSSs together using a Distribution System (usually a wired Ethernet backbone). This allows users to roam from one AP's coverage area to another without dropping their connection (like Wi-Fi in a large university).
Q34Explain Bluetooth Architecture: Piconet and Scatternet.

Bluetooth Architecture: Piconet & Scatternet

Bluetooth (IEEE 802.15.1) is a short-range wireless Personal Area Network (PAN) technology.

  • Piconet: The basic Bluetooth network. It consists of exactly one Master node and up to 7 active Slave nodes. The Master controls the clock and frequency hopping sequence. Slaves can only communicate with the Master, not directly with each other.
  • Scatternet: Formed when two or more Piconets overlap. A node can act as a Slave in one Piconet and a Master in another, effectively bridging the two Piconets together.
Q35Explain NAT (Network Address Translation) and PAT.

Network Address Translation (NAT) & PAT

NAT is used by routers to translate Private, non-routable IP addresses (like 192.168.1.5) into a single Public, routable IP address (like 8.8.8.8) before sending traffic out to the Internet.

Types:

  • Static/Dynamic NAT: Translates 1 private IP to 1 public IP. Does not conserve addresses, mostly used to hide internal server IPs.
  • PAT (Port Address Translation / NAT Overload): This is what home routers use. It maps multiple private IP addresses to a single public IP address. It distinguishes different internal devices by assigning them unique TCP/UDP Port Numbers in the router's NAT table.
Q36Explain Symmetric vs Asymmetric Cryptography.

Symmetric vs Asymmetric Cryptography

Feature Symmetric (Secret Key) Asymmetric (Public Key)
Keys Used Uses the exact same key for both encryption and decryption. Uses a pair of keys: a Public Key (to encrypt) and a Private Key (to decrypt).
Speed Extremely fast. Excellent for bulk data transfer. Very slow (computationally heavy math).
Key Distribution Problem Major issue. Sender and receiver must securely exchange the secret key beforehand. Solved. The Public Key is shared openly with everyone. Only the Private Key is kept secret.
Examples AES, DES, 3DES RSA, ECC, Diffie-Hellman
Q37Explain RSA Public Key Cryptography algorithm.

RSA Public Key Algorithm

RSA is the most widely used asymmetric encryption algorithm, based on the mathematical difficulty of factoring the product of two massive prime numbers.

Key Generation Steps:

  1. Choose two large distinct prime numbers, \(p\) and \(q\).
  2. Compute \(n = p \times q\). (\(n\) is the modulus for both keys).
  3. Compute Euler's totient function: \(\phi(n) = (p-1) \times (q-1)\).
  4. Choose an integer \(e\) such that \(1 < e < \phi(n)\), and \(e\) is coprime with \(\phi(n)\).
  5. Compute \(d\) such that \((d \times e) \pmod{\phi(n)} = 1\). (\(d\) is the modular multiplicative inverse of \(e\)).

Keys: Public Key is \((e, n)\). Private Key is \((d, n)\).

Encryption: \(Cipher = Message^e \pmod{n}\)

Decryption: \(Message = Cipher^d \pmod{n}\)

Q38Explain Firewall types: Packet Filter, Stateful Inspection, Proxy.

Firewall Types

A firewall is a network security device that monitors and filters incoming and outgoing traffic based on security rules.

  • Packet Filter (Stateless): Operates at Layer 3 (Network). It examines every individual packet in isolation and checks its IP address and Port number against a strict access control list (ACL). Fast, but easily bypassed.
  • Stateful Inspection: Operates at Layer 4 (Transport). It remembers the "state" of active TCP connections. It knows if an incoming packet is a legitimate response to an outgoing request you just made, blocking unsolicited incoming traffic.
  • Proxy (Application-Level Gateway): Operates at Layer 7 (Application). It acts as an intermediary. The client connects to the proxy, and the proxy connects to the outside world on behalf of the client. Highly secure, capable of deeply inspecting HTTP/FTP traffic for viruses, but very slow.
Q39Explain Quality of Service (QoS) parameters and techniques.

Quality of Service (QoS)

QoS refers to any technology that manages data traffic to reduce packet loss, latency, and jitter on a network. It prioritizes specific types of traffic (like VoIP) over less critical traffic (like file downloads).

Parameters:

  • Bandwidth: The maximum rate of data transfer.
  • Delay (Latency): The time it takes a packet to travel from source to destination.
  • Jitter: The variation in packet delay. High jitter causes audio/video to stutter.
  • Packet Loss: The percentage of packets that fail to reach their destination.

Techniques:

Traffic Shaping (Leaky Bucket), Scheduling (Priority Queuing where voice traffic goes first), and Resource Reservation.

Q40Explain Socket Programming concepts (IP, Port, Socket API).

Socket Programming Concepts

Socket programming allows two applications on different computers to communicate across a network.

  • IP Address: Identifies the specific computer/server on the global network.
  • Port Number: Identifies the specific application/process running on that computer (e.g., Port 80 for the web server, Port 22 for SSH).
  • Socket: One endpoint of a two-way communication link. A socket is fundamentally defined by the combination of an IP Address and a Port Number (e.g., 192.168.1.5:80).
  • Socket API (Berkeley Sockets): Provides functions for developers to use:
    socket(): Creates a new socket.
    bind(): Associates the socket with a specific local IP and port.
    listen() & accept(): Server waits for incoming client connections.
    connect(): Client initiates a connection to a server.
    send() & recv(): Transmit data.