∑GateAndNet
Practice MCQs
GATE CS / Computer Networks
Edit
INTERMEDIATE🔥 High-Yield Exam Topic 4 min read 2 views

TCP 3-Way Handshake, AIMD Congestion Control & Routing (Distance Vector vs OSPF)

TCP SYN/FIN sequence number consumption, Slow Start exponential growth vs Congestion Avoidance additive increase, 3-Dup-ACK vs Timeout cwnd transitions, and Count-to-Infinity.

1. TCP Connection Management & Sequence Numbers

  • SYN flag consumes 1 sequence number even if it carries 0 payload bytes!
    1. Client →\to Server: SYN=1, Seq = x
    2. Server →\to Client: SYN=1, ACK=1, Seq = y, Ack = x + 1
    3. Client →\to Server: ACK=1, Seq = x + 1, Ack = y + 1 (can carry data!)
  • FIN flag also consumes 1 sequence number; pure ACK segments (with 0 data bytes) consume 0 sequence numbers.
  • After sending the final ACK in 4-way teardown, the active closer waits 2×MSL2 \times \text{MSL} in TIME_WAIT to absorb delayed duplicate segments and prevent port reuse collisions.

2. TCP Slow Start & AIMD Congestion Control

  1. Slow Start (cwnd<ssthresh\text{cwnd} < \text{ssthresh}): Every ACK received increases cwnd\text{cwnd} by +1 MSS+1\text{ MSS}   ⟹  \implies cwnd\text{cwnd} DOUBLES every 1 RTT (1→2→4→8…1 \to 2 \to 4 \to 8 \dots).
  2. Congestion Avoidance (cwnd≥ssthresh\text{cwnd} \ge \text{ssthresh}): cwnd\text{cwnd} increases by +1 MSS+1\text{ MSS} per entire RTT (linear / additive increase).
  3. Loss Detection:
    • RTO Timeout (Severe congestion): ssthresh←⌊cwnd/2⌋\text{ssthresh} \leftarrow \lfloor \text{cwnd} / 2 \rfloor, cwnd←1 MSS\text{cwnd} \leftarrow 1\text{ MSS} (re-enters Slow Start).
    • 3 Duplicate ACKs (Mild loss in TCP Reno): ssthresh←⌊cwnd/2⌋\text{ssthresh} \leftarrow \lfloor \text{cwnd} / 2 \rfloor, cwnd←ssthresh\text{cwnd} \leftarrow \text{ssthresh} (Fast Retransmit + Fast Recovery — skips reset to 1 MSS!).

3. Routing Protocols Comparison

ProtocolAlgorithmMetricKey Exam Fact
RIP (Intra-AS)Distance Vector (Bellman-Ford)Hop Count (infty=16infty = 16)Suffers Count-to-Infinity; partially mitigated by Split Horizon with Poison Reverse
OSPF (Intra-AS)Link State (Dijkstra)Bandwidth / Admin CostFloods Link-State Advertisements (LSAs) to all routers in area; loop-free convergence
BGP (Inter-AS)Path VectorPolicy + AS-PATHRuns over TCP Port 179; prevents inter-domain routing loops via full AS-PATH list
📐 Quick Revision Formula Sheet
TCP Effective Sending Window
Weffective=min⁡(cwnd,  rwnd)W_{\text{effective}} = \min(\text{cwnd},\; \text{rwnd})
💡 cwnd = network congestion window; rwnd = receiver advertised flow-control window
TCP Reaction to Packet Loss (Tahoe vs Reno)
Timeout  ⟹  ssthresh=cwnd2,  cwnd=1 MSS;3 Dup ACKs (Reno)  ⟹  cwnd=ssthresh=cwnd2\text{Timeout} \implies ssthresh = \frac{cwnd}{2},\; cwnd = 1\text{ MSS}; \quad \text{3 Dup ACKs (Reno)} \implies cwnd = ssthresh = \frac{cwnd}{2}
💡 TCP Tahoe resets cwnd = 1 MSS on BOTH Timeout and 3 Duplicate ACKs!
#Computer Networks#TCP#Congestion Control#Slow Start#OSPF#Distance Vector

🎯 Practice PYQs on This Topic (2)

Q1.GATE CS NetworksMCQMEDIUM
+2 Marks • -0.67 Neg

A TCP Reno connection currently has congestion window cwnd=32 MSS\text{cwnd} = 32\text{ MSS} and ssthresh=24 MSS\text{ssthresh} = 24\text{ MSS}. If a Retransmission Timeout (RTO) occurs, what become the new values of ssthresh\text{ssthresh} and cwnd\text{cwnd}?

Q2.UGC NET / GATE CNMCQEASY
+1 Marks • -0.33 Neg

Which routing protocol suffers from the Count-to-Infinity problem when link failures occur?

Previous TopicIPv4 CIDR Subnetting, CSMA/CD Minimum Frame & Sliding Window Math