Back to the 2026 paper

Module 4: Transport Layer & Congestion Control

20267m

Describe the connection establishment and connection termination mechanisms in TCP with sequence timing diagrams.

  • Explain the role of the SYN, ACK and FIN control flags
  • Explain the significance of the TIME_WAIT state during connection teardown
Worked SolutionAI Assisted

TCP Control Flags

  • SYN: synchronize sequence numbers; used to open a connection
  • ACK: acknowledgement field is valid
  • FIN: sender has no more data; used to close a connection

Connection Establishment: Three-Way Handshake

SVGVector Architecture Diagram (SVG)
Client Server SYN, seq=x SYN+ACK, seq=y, ack=x+1 ACK, ack=y+1 SYN_SENT ESTABLISHED LISTEN SYN_RCVD ESTABLISHED
  1. Client sends SYN with its initial sequence number xx.
  2. Server replies SYN + ACK with its own sequence number yy and ack x+1x+1.
  3. Client sends ACK with ack y+1y+1. Connection is established.

Connection Termination (four-way)

SVGVector Architecture Diagram (SVG)
Client (side A) Server (side B) FIN, seq=u ACK, ack=u+1 FIN, seq=v ACK, ack=v+1 FIN_WAIT_1 FIN_WAIT_2 TIME_WAIT (2 x MSL) CLOSE_WAIT LAST_ACK CLOSED
  1. Side A sends FIN.
  2. Side B ACKs it (it may still send remaining data: half-close).
  3. Side B sends its own FIN when done.
  4. Side A ACKs and enters TIME_WAIT.

Significance of TIME_WAIT

The side that closes first waits 2 x MSL (Maximum Segment Lifetime) before fully closing. Reasons:

  • Reliable termination: if the final ACK is lost, the peer retransmits its FIN, and the waiting side can re-send the ACK.
  • Avoid stale segments: lets old duplicate segments from the previous connection expire so they are not mistaken for data of a new connection using the same address/port pair.

Similar questions

Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.