Three-way handshake
Cheat sheet · https://pcornel.dk/topic.php?topic=912
Answer
The TCP three-way handshake establishes bidirectional transport state: the client sends SYN with its initial sequence number, the server answers SYN-ACK with its own sequence number plus acknowledgement, and the client completes with ACK.
Remember
A successful SYN/SYN-ACK/ACK proves that both directions carried the establishment packets to transport endpoints. It does not prove TLS, authentication, application readiness, sustained throughput or that a later data flow follows the same ECMP/stateful path.
First checks
- Packet capture:
tcpdump -nn -i <if> host <ip> and port <p>or Wireshark filtertcp.stream eq <n>. ss -tni(Linux) /netstat -ano(Windows) — connection state, RTT, retransmits and windows.Test-NetConnection <host> -Port <p>/nc -vz <host> <p>— does the handshake complete?show tcp brief(IOS) — TCP sessions to the device itself.show interfaces <if> | include drops|errors— drops on the path.
Verify in this order
SYN leaves the client → reaches a listening server → SYN-ACK returns over the reverse path → final ACK → both sides ESTABLISHED
Where it usually breaks
physical/link dependency → local object state → peer/control state → policy → forwarding/adjacency → end-to-end result
Three-way handshake operational reference
| Handshake signal | Known-good interpretation | Suspicious / broken state | Next boundary |
|---|---|---|---|
| SYN | Leaves intended source with expected tuple/options | Absent, wrong source/VRF, repeated with no progress | Source routing / local policy |
| SYN-ACK | Returns for same translated/original flow | Missing, wrong tuple, unexpected MSS/options | Listener / return path / stateful policy |
| RST | Deliberate rejection can be localized | Unexpected origin or immediate reset after accept | Endpoint vs middlebox ownership |
| Final ACK | Reaches server and completes establishment | Client receives SYN-ACK but server stays embryonic | Reverse path / NAT / capture scope |
| First application bytes | Transport carries expected protocol | Established socket but no protocol progress | TLS / application / backend |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=912