Concept Flow - TCP connection termination (four-way handshake)
Client sends FIN
Server receives FIN
Server sends ACK
Server sends FIN
Client receives FIN
Client sends ACK
Connection closed
The TCP connection closes in four steps: client sends FIN, server acknowledges and sends its own FIN, client acknowledges, then connection closes.