GateMCQSCIENTIFIC PREP LAB
PlanSign Up
INTERMEDIATEFrequently Tested 4 min read 20 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
Key Formulas Summary
TCP Effective Sending Window
Weffective=min⁡(cwnd,  rwnd)W_{\text{effective}} = \min(\text{cwnd},\; \text{rwnd})
Note: 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}
Note: TCP Tahoe resets cwnd = 1 MSS on BOTH Timeout and 3 Duplicate ACKs!
#Computer Networks#TCP#Congestion Control#Slow Start#OSPF#Distance Vector

Practice Questions on This Chapter (3)

Q1GATE CS NetworksMCQMEDIUM
+2M • -0.67

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}?

⚡ Click an option above to verify instantly
Q2UGC NET / GATE CNMCQEASY
+1M • -0.33

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

⚡ Click an option above to verify instantly
Q3GATE CS 2021NATMEDIUM
+2M • 0 Neg

An IPv4 datagram of total length 4,020 bytes4,020\text{ bytes} (20 B20\text{ B} standard header + 4,000 B4,000\text{ B} payload) crosses a link with MTU=1,420 bytes\text{MTU} = 1,420\text{ bytes}. Into how many fragments is it split, and what is the Fragment Offset field value of the last fragment? (Enter ONLY the Fragment Offset of the last fragment)

Previous TopicIPv4 CIDR Subnetting, CSMA/CD Minimum Frame & Sliding Window MathNext Topic Networks 2027 Rank-Decider: Token Bucket Burst Math, TCP Wrap-Around, BGP Policies & DNS RTTs