Computer Networks · TEE · papers
Q6(a) · TCP phases
2025-12-05 · 2022-23
Actual paper; 100 marks attempted. Current-syllabus alignment is stated per question.
Q6(a). How to establish communication in TCP. What are the different phases of it. Explain in detail. [10 marks]
Answer
A TCP connection establishes each endpoint’s initial sequence number and confirms that both can receive. Use client initial sequence x=1000 and server initial sequence y=5000; assume no payload in the handshake.
| Step | Segment | Meaning |
|---|---|---|
| 1 Client → server | SYN, Seq=1000 | Client proposes its starting sequence |
| 2 Server → client | SYN+ACK, Seq=5000, Ack=1001 | Server acknowledges client SYN and supplies its own start |
| 3 Client → server | ACK, Seq=1001, Ack=5001 | Client acknowledges server SYN; connection is established |
Data transfer
Client sends 200 bytes beginning at Seq=1001, so byte numbers are 1001…1200. The receiver acknowledges Ack=1201, the next byte expected. If bytes starting at 1201 are missing but later bytes arrive, the cumulative ACK remains 1201 until the gap is repaired. TCP may buffer out-of-order bytes; it delivers the byte stream in order. Each direction counts independently.
Orderly termination
- Assume client’s next data sequence is 1201. It sends FIN with Seq=1201, meaning it has finished sending.
- Server sends ACK=1202. The connection is half closed: the server can still send data until its application finishes.
- Assume server has sent no data since the handshake. It sends FIN with Seq=5001.
- Client responds with ACK=5002. In a common active-close path the client enters TIME-WAIT so delayed segments and retransmitted FINs can be handled before the tuple is reused.
- These are commonly four segments, but ACK and FIN can be combined and simultaneous close is possible. RST is an abort, not the same as the orderly FIN exchange.
Yaad rakho: SYN plus one, FIN plus one; ACK next expected byte.