What happens under the hood during the TCP 3-Way Handshake and 4-Way Termination?
Quick Revision Summary
TCP Handshake establishes synchronized sequence numbers via SYN -> SYN-ACK -> ACK. Termination safely closes both communication directions via 4 packets.
Interactive Practice Mode
Formulate your thoughts or take notes before revealing the model solution.
Saved automatically
Model Answer & Deep-Dive Explanation
TCP 3-Way Handshake (Connection Establishment):
- SYN: Client sends
SYN=1and an initial sequence number $ISN_c$ to the server. (Client entersSYN_SENT). - SYN-ACK: Server acknowledges by sending
ACK = ISN_c + 1and its own sequence number $ISN_s$. (Server entersSYN_RCVD). - ACK: Client acknowledges receipt with
ACK = ISN_s + 1. Connection is nowESTABLISHED.
TCP 4-Way Handshake (Connection Termination):
- Client sends
FINto close its writing channel. - Server sends
ACK. - Server finishes sending remaining pending data and sends its own
FIN. - Client sends final
ACKand entersTIME_WAITstate (usually 2MSL) to ensure final ACK delivery before fully closing.
Interviewer Evaluation Points & Scoring Rubric
- 1 1. Correctly outlines SYN -> SYN-ACK -> ACK sequence. 2. Explains sequence number acknowledgment ($ISN + 1$). 3. Explains purpose of TIME_WAIT.
Related Questions in Computer Networks & OS
What is a Process vs a Thread, and what are the causes and conditions of a Deadlock?
Intermediate level • 5 views
Why can adding more threads make a CPU-bound service slower?
Medium level • 5 views
What is the architectural difference between Docker Containers and Virtual Machines (VMs)?
Beginner level • 4 views
What happens step-by-step during a DNS Lookup when typing a URL into the browser?
Intermediate level • 4 views
A service name resolves correctly but connections time out. How would you investigate?
Medium level • 4 views