Lesson 4 of 9 · 23m
Handshake, Timing, and Baseline
Read the three-way handshake, TCP options, connect latency, and first-byte timing before declaring anything abnormal.
TCP diagnosis starts with the boring truth: a connection is successful until you can say exactly where the expected progression stopped. Most people jump straight to retransmissions. Seniors first establish baseline behavior — who initiated, who accepted, what options were negotiated, and how long each stage took.
The handshake is three distinct facts
client -> server SYN
server -> client SYN, ACK
client -> server ACKEach packet answers a different question:
- SYN proves the client attempted the connection.
- SYN,ACK proves some listener or middlebox accepted and replied.
- Final ACK proves the client received that reply and completed the handshake.
If there is only repeated SYN, the server path, listener, firewall, or return path is suspect. If SYN,ACK appears but no final ACK, investigate the return path to the client or client-side filtering. If the handshake completes and then nothing happens, the network connection is no longer your first suspect — application behavior is.
Measure connect latency correctly
The cleanest measurement is time from the client's SYN to the server's SYN,ACK as seen at one capture point. On the client, that approximates round-trip network and server accept latency. On the server, it does not measure the client's perceived connect time.
12.000000 client -> server SYN
12.041300 server -> client SYN,ACK
12.041455 client -> server ACKHere the SYN-to-SYN,ACK delta is about 41 ms. If application logs report a 900 ms connect timeout but the handshake completes in 41 ms, look at proxy layers, TLS, authentication, or application queuing — not raw TCP connection establishment.
TCP options shape the whole flow
Look at the handshake's options before analyzing performance:
MSS: maximum segment size the sender is willing to receive
SACK permitted: selective acknowledgements may be used
Timestamps: PAWS and RTT measurement support
Window scale: multiplier for receive window advertisementsA missing window scale can explain small effective windows. Lack of SACK makes loss recovery more expensive. Path MTU problems often show up after a healthy handshake, when larger data segments vanish or ICMP fragmentation-needed messages arrive.
Establish a baseline before comparing
"Slow" is meaningless without a reference. Baseline the same path when healthy: handshake time, time to TLS ClientHello, time to first application response, packet sizes, and normal reset behavior. A web service behind a load balancer will not look like a direct database connection.
Useful comparisons are same client to a different server, same server from a different client network, the same capture point in healthy versus failing windows, and before versus after a configuration change. Do not compare a LAN capture to a mobile-client capture and call the difference an outage.
Field notes
- Relative sequence numbers are a Wireshark convenience; enable TCP sequence number validation knowledge, but remember the wire contains absolute numbers.
- A SYN retransmission after roughly one second is often normal exponential backoff after no answer, not proof of congestion.
- TCP fast open, SYN cookies, proxies, and load balancers can change who appears to complete the handshake.
- If you see only one direction of the handshake, first suspect asymmetric capture placement, not necessarily asymmetric routing.
Was this lesson helpful?