GATE/Computer Networks/Transport Layer — TCP & UDP
Hard20 min readComputer Networks

Transport Layer — TCP & UDP

TCP provides reliable, ordered, connection-oriented delivery. UDP is lightweight and connectionless. GATE tests TCP connection setup, flow control, congestion control, and segment format.

Key Points

  • ·TCP: reliable, ordered, connection-oriented, full-duplex, flow control, congestion control
  • ·UDP: unreliable, unordered, connectionless, no flow/congestion control, low overhead
  • ·3-way handshake: SYN → SYN-ACK → ACK (connection setup); 4-way: FIN-ACK exchange (teardown)
  • ·TCP segment: SrcPort, DstPort, SeqNo, AckNo, flags (SYN/ACK/FIN/RST), window size, checksum
  • ·Flow control: receiver advertises window size (receive buffer); sender can't overflow receiver
  • ·Congestion control: slow start, congestion avoidance, fast retransmit, fast recovery
  • ·Slow start: cwnd doubles each RTT until ssthresh; then linear increase
  • ·On timeout: ssthresh = cwnd/2, cwnd = 1 MSS, restart slow start
  • ·On 3 duplicate ACKs: fast retransmit + fast recovery (cwnd = ssthresh = cwnd/2)

Key Formulas

  • Sender constraint: Bytes_in_flight ≤ min(cwnd, rwnd)
  • Slow start growth: cwnd doubles each RTT (cwnd += MSS per ACK)
  • Congestion avoidance: cwnd += MSS²/cwnd per ACK (≈ +1 MSS per RTT)

GATE Exam Tips

  • On timeout: cwnd → 1 MSS, ssthresh → cwnd/2. On 3 dup-ACKs (Reno): cwnd → ssthresh → cwnd/2.
  • GATE often traces a cwnd evolution graph — slow start doubles, congestion avoidance is linear.
  • TCP sequence numbers are byte-based, not segment-based — important for ACK calculations.
  • DNS uses UDP (port 53) for queries, TCP for zone transfers — a common GATE detail.

Finished reading this topic?

Mark it complete to track your study progress.