A typical TCP connection shutdown consists of several key states.
Under normal circumstances, after the first side initiates the connection termination by sending a FIN (Finish) flag, it transitions to the **FIN_WAIT_1** state. This state means the device is waiting for an acknowledgment of its FIN, and possibly another FIN from the other side.
- **FIN_WAIT_2**: After receiving an ACK for its FIN, the device waits for a FIN from the other side.
- **TIME_WAIT**: After successfully exchanging FINs and ACKs, the connection moves to TIME_WAIT, ensuring that the final acknowledgments are properly handled before fully closing.
However, there's a fourth sequence where the connection skips FIN_WAIT_2. When the other side sends a combined FIN and ACK, the local device, upon acknowledging, directly moves from **FIN_WAIT_1** to **TIME_WAIT**. This expedited transition happens because the combined message confirms both the acknowledgment and the termination request simultaneously.