The four-way handshake is the typical TCP procedure for terminating a connection after data exchange. Each host finishes sending by transmitting a segment with the FIN flag, and the other host acknowledges it with ACK. section 22.2.1
Remember the usual termination sequence:
- The first host sends FIN. section 22.2.1
- The other host replies with ACK. section 22.2.1
- The other host sends its own FIN. section 22.2.1
- The first host replies with ACK. section 22.2.1
TCP termination scenario
After PC1 and SRV1 establish a TCP connection and exchange data, PC1 sends FIN. SRV1 acknowledges with ACK, sends its own FIN, and PC1 responds with ACK. This produces FIN, ACK, FIN, ACK. section 22.2.1 section 22.3
Figure 22.6 TCP connection termination. After the connection establishment and data exchange, PC1 sends a segment with the FIN flag to terminate the connection. SRV1 replies with an ACK segment and then sends its own FIN segment, to which PC1 replies with an ACK segment.
Use the TCP termination diagram to follow the direction and order of the FIN and ACK segments. section 22.2.1
Unlike connection establishment, termination does not always use four separate messages. A host may combine ACK and FIN, producing FIN, ACK-FIN, ACK; the typical sequence remains the CCNA exam focus. section 22.2.1

