liveBook · Manning

Four-way handshake

As explained in Acing the CCNA Exam: Volume 1 Fundamentals and Protocols

A four-way handshake is the typical four-message TCP procedure for terminating a connection using FIN and ACK control flags.

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:

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

How Acing the CCNA Exam: Volume 1 Fundamentals and Protocols covers it

How deep it goes
Shows the FIN, ACK, FIN, ACK sequence and notes combined flags, while deferring unusual termination details.
Examples
Uses PC1 and SRV1 to illustrate the four termination messages after TCP data exchange.
What it assumes
Assumes basic TCP communication and connection establishment before explaining termination after data exchange.
What you can do after
Understand TCP termination by recalling and identifying the typical FIN, ACK, FIN, ACK exchange.
How it connects
Connects TCP connection termination with TCP connection establishment, FIN, ACK, SYN, and the three-way handshake.

Also explained in

Compare how 2 books explain four-way handshake →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the CCNA Exam: Volume 1 Fundamentals and Protocols. The section links point to the parts of the book it draws on.