Use it when an application cannot connect or is slow, to tell apart the cases: no answer, a reset, retransmissions, or a receiver that cannot keep up.
TCP Operational Reference
TCP gives applications a reliable connection: every byte is numbered, acknowledged and resent if lost, so data arrives complete and in order. A connection opens with a three-way handshake — SYN, SYN-ACK, ACK — and closes with FIN, or abruptly with RST.
1. On the server: ss -ltn — listening on that port and address?
2. From the client: try to connect — SYN-ACK, reset or timeout?
3. Timeout → capture at the server: does the SYN arrive, does a SYN-ACK leave?
4. Reset → no listener, or a firewall rejecting.
5. Connects but slow → look for retransmissions or zero-window in a capture.
server listening → SYN reaches the server → SYN-ACK returns → ACK completes the handshake → data acknowledged without repeated retransmission → receiver window above zero → closed with FIN
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
ss -tanVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification Verify boundary
ss -tan
ss -ltn
curl -v telnet://192.0.2.10:443
tcpdump -ni eth0 host 192.0.2.10 and tcp port 443
show tcp brief
ss -tan (Linux; netstat -an elsewhere) lists connections with their state; ss -ltn lists listening ports — the first thing to confirm on a server. A connection attempt with curl, nc or Test-NetConnection shows whether the handshake completes. tcpdump shows the packets themselves. On a Cisco device, show tcp brief lists the device's own TCP connections.
A capture at each end answers the basic questions: does the SYN leave, does it arrive, what comes back, and does that reach the client.
Known-good: the server listens on the port, the handshake completes, data is acknowledged without repeated retransmissions, and the connection closes with FIN.
Step 2 Failure boundaries & design notes Narrow the fault
- SYN sent repeatedly, no reply. The packet or its answer is dropped: no route, a firewall dropping silently, or the server down. Capture on the server side to see which direction fails.
- RST in answer to the SYN. Nothing listens on that port, or a firewall rejects. Check the listener on the server.
- The handshake completes, then nothing. The network path is fine; the application, TLS, or a device inspecting the content is the problem.
- Connects, but large transfers stall. An MTU problem on the path; full-size packets are dropped while small ones pass.
- Slow, with many retransmissions. Packet loss or congestion on the path.
- Slow, with zero-window messages. The receiving application is not reading fast enough; not a network fault.
- Connections reset after a period of idleness. A firewall or NAT device forgot the connection; use keepalives.
- Works one way only. Asymmetric routing through a stateful firewall that sees only half the conversation.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
ss -ltn— is the server listening on the port? (netstat -anon other systems.)ss -tan— connections and their states.curl -v telnet://<host>:<port>orTest-NetConnection— does the handshake complete?tcpdump -ni <if> host <ip> and tcp port <port>— the packets, at both ends.show tcp brief— a Cisco device's own connections.
ReferenceWhat it is1 section · depth on demand
Mechanics & mental model
TCP gives applications a reliable connection: data arrives complete, in order and without duplicates, or the connection fails visibly. It does this on top of IP, which promises none of that, by numbering every byte, acknowledging what arrives, and resending what does not.
ReferenceWhy it matters1 section · depth on demand
Why it matters operationally
Most applications run over TCP, so most "the application is slow" or "it cannot connect" reports are, at the network level, TCP behaving in a recognisable way: no answer to a connection attempt, a reset, retransmissions, a receiver that cannot keep up. Each of those points to a different place — the path, a firewall, the server, the application — and telling them apart is most of the diagnosis.
ReferenceHow it works1 section · depth on demand
Operational flow & dependencies
A connection is identified by four values: source address, source port, destination address, destination port. The server listens on a known port; the client picks a temporary one.
Opening — the three-way handshake.
1. The client sends SYN.
2. The server answers SYN-ACK.
3. The client answers ACK. Data can now flow in both directions.
Each side also announces its starting sequence number and its options — largest segment size, window scaling, selective acknowledgment — in these first packets.
What can come back to a SYN.
| Reply | Meaning |
|---|---|
| SYN-ACK | The port is open; something is listening |
| RST | The host is reachable, but nothing listens on that port — or a firewall actively rejected the attempt |
| Nothing | The SYN or its answer is lost or silently dropped: routing, a firewall, or the host is down |
| ICMP unreachable | A router or firewall on the way reports that it will not or cannot deliver |
Reliable transfer. Every byte has a sequence number. The receiver acknowledges the next byte it expects. Data that is not acknowledged in time is sent again. Segments arriving out of order are put back in order before the application sees them.
Flow control. The receiver states in every packet how much more it can accept — its window. A receiver whose application reads slowly shrinks the window, down to zero, and the sender must wait.
Congestion control. The sender also limits itself. It starts slowly, speeds up while acknowledgments arrive, and slows down sharply when it detects loss. This is why even a little packet loss reduces throughput considerably.
Closing. Each side sends FIN when it has nothing more to send, and the other acknowledges. A RST ends the connection at once, without that exchange.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
TCP requirements that show up in operations
RFC 9293 is the consolidated TCP specification, and many of its numbered requirements explain behaviour you see on real networks. Keep-alives must be off by default, and when enabled their interval must default to no less than two hours. Delayed ACKs must be shorter than 0.5 seconds. Zero-window probing must be supported, and the sender must keep the connection open as long as probes are answered. ICMP soft errors such as network or host unreachable must not abort a connection, while hard errors (protocol or port unreachable, fragmentation needed) should.
Requirements worth knowing (RFC 9293)
| Area | Requirement |
|---|---|
| Checksum | Senders must generate it; receivers must check it |
| Congestion control | Slow start, congestion avoidance and RTO backoff are mandatory (details in RFC 5681) |
| Retransmission timer | Computed as in RFC 6298, with Karn's algorithm |
| Give-up thresholds | R1 of at least 3 retransmissions, R2 of at least 100 s; for SYNs at least 3 minutes |
| ICMP Source Quench | Must be silently discarded |
| TIME-WAIT | 2×MSL, with MSL taken as 2 minutes |
| Default MSS | 536 bytes (IPv4), 1220 bytes (IPv6) without an MSS option |
Related specifications
| Topic | RFC |
|---|---|
| Congestion control | 5681 |
| Retransmission timer | 6298 |
| Window scale, timestamps, PAWS | 7323 |
| Selective acknowledgement | 2018 |
| ECN | 3168 (RFC 9293 says it should be implemented) |
host$ ss -tin state established dst 10.30.0.15
ESTAB 0 0 10.110.0.64:50414 10.30.0.15:443
cubic wscale:7,7 rto:204 rtt:3.1/0.8 mss:1448 cwnd:10 bytes_acked:184211 retrans:0/2
host$ sysctl net.ipv4.tcp_keepalive_time net.ipv4.tcp_retries2 net.ipv4.tcp_ecn
R1# show tcp brief all
R1# show tcp statistics | include retransmit|Rcvd|Sent
Reading ss -i against the RFCs
| Field | Meaning |
|---|---|
wscale:7,7 | Window scaling negotiated in both directions (RFC 7323) |
rto | Current retransmission timeout in ms (RFC 6298) |
cwnd | Congestion window in segments (RFC 5681) |
retrans:x/y | Unacknowledged retransmissions / total retransmissions |
The requirement IDs (MUST-n, SHLD-n) in RFC 9293 make it easy to check whether a device's behaviour is a bug or permitted by the standard.
Documented example, not captured output.
Quick reference
TCP provides reliable, ordered byte streams: a three-way handshake opens the connection, sequence and acknowledgement numbers track data, a sliding window controls flow, and congestion control adapts the sending rate. FIN or RST closes it.
| Field/feature | Purpose |
|---|---|
| SYN, SYN-ACK, ACK | Connection setup |
| Sequence/ACK numbers | Ordering and reliability |
| Window size (with scaling) | Receiver flow control |
| MSS option | Maximum segment size |
| RST | Abort, often "port closed" or firewall reject |
| Retransmission timers | Recover lost segments |
In captures, repeated SYNs without SYN-ACK mean the path or server is blocking; a SYN answered by RST means the port is closed or a device rejected it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Network & Protocols → TCP Operational Reference. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc9293.html · confidence 94%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Operational notes
Former standalone Cheat Sheet content now lives directly inside the Topic where it belongs.
TCP Handshake & Reset
One-screen TCP establishment/reset reference
Establish
SYN → SYN/ACK → ACK
Fast checks
1. Listener exists.
2. SYN reaches server.
3. SYN/ACK returns.
4. ACK completes.
5. Application payload follows.
Reset
RST = abort/reject, not an orderly close.
Capture
Wireshark: tcp.flags.syn == 1 || tcp.flags.reset == 1
tcpdump: tcp[tcpflags] & (tcp-syn|tcp-rst) != 0
Remember
Handshake proves transport establishment, not application success.