Computer Networking Basics
In the three-way handshake that establishes a TCP connection, what is the correct order of the packets exchanged?
- ASYN → ACK → FIN
- BACK → SYN → SYN+ACK
- CSYN → SYN+ACK → ACK
Show answer and explanation
Answer: C. SYN → SYN+ACK → ACK
In the three-way handshake, the client first requests a connection with a SYN and announces the first number of the data it will send (its initial sequence number). The server replies with a SYN+ACK, acknowledging (ACK) that and announcing its own initial sequence number. Finally the client returns an ACK, and both directions are ready. Confirming the numbers in both directions in three exchanges prevents mistaken connections, for example from old packets that arrive late. As a result, TCP needs at least one round-trip time (RTT) before data can start flowing. FIN is used to close a connection.
- A. FIN is the flag used to close a connection.
- B. It starts with a SYN requesting the connection; the acknowledging ACK comes after.
- C. Correct. SYN, SYN+ACK and ACK establish the connection.