Use it to explain why TCP sets up a session before sending data, and what a failed handshake means.
Connection-oriented
TCP is connection-oriented: a three-way handshake (SYN, SYN-ACK, ACK) sets up the session before data, and sequence numbers, acknowledgements and retransmission make delivery reliable and ordered.
1. Connection-oriented means state is set up before data and torn down after.
2. Both ends track sequence numbers.
3. Firewalls track state.
4. Half-open connections indicate filtering.
5. Retransmissions show loss.
handshake → established → data → teardown
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & 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 TCP problems and signs Narrow the fault
| Sign in capture | Likely cause |
|---|---|
| SYN without SYN-ACK | Firewall drop, host down, wrong route |
| SYN → RST | Port closed |
| Many retransmissions | Packet loss or congestion |
| Zero window | Receiver application too slow |
| RST mid-session | Firewall idle timeout, application crash |
Wireshark filters: tcp.analysis.retransmission, tcp.flags.reset==1, tcp.analysis.zero_window.
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.
- SYN, SYN-ACK, ACK establish a connection
- Sequence and acknowledgement numbers track bytes
- Receive windows provide flow control; retransmission handles loss
- A completed handshake proves a transport endpoint, not application correctness.
- Packet capture showing SYN, SYN-ACK, ACK — handshake
ss -tan state established— sessions
ReferenceWhat it is1 section · depth on demand
Connection lifecycle
1. Open: SYN → SYN-ACK → ACK; both sides agree on initial sequence numbers, MSS and window scaling.
2. Data: every byte is numbered; the receiver acknowledges what it has received and advertises a window.
3. Close: FIN/ACK from each side (four segments), or RST to abort.
ss -tn (Linux) or netstat -an (Windows) shows connection states such as ESTABLISHED, SYN-SENT, TIME-WAIT and CLOSE-WAIT. Many SYN-SENT entries mean the SYN gets no reply (firewall or routing); many CLOSE-WAIT entries mean the local application is not closing sockets.
ReferenceWhy it matters1 section · depth on demand
When to use it
Use it when a service depends on a session and you must separate reachability, port listening, handshake, loss, reset and application exchange.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
What "connection-oriented" means in TCP
A TCP connection is shared state at both ends, not a circuit through the network. RFC 9293 keeps that state in a transmission control block (TCB) and defines the states the TCB moves through. The model even includes CLOSED, a fictional state meaning no TCB exists. Routers in between keep no TCP state. Firewalls and NAT devices often do, and that is why they can break connections that both hosts still consider open.
Connection states (RFC 9293)
| Phase | States |
|---|---|
| Opening | LISTEN, SYN-SENT, SYN-RECEIVED |
| Data transfer | ESTABLISHED |
| Active close | FIN-WAIT-1, FIN-WAIT-2, CLOSING, TIME-WAIT |
| Passive close | CLOSE-WAIT, LAST-ACK |
| No connection | CLOSED |
State that each end keeps
| Item | Purpose |
|---|---|
| Local and remote addresses and ports | Identify the connection |
| Send and receive sequence variables | Track what has been sent, acknowledged and received |
| Windows | How much each side may send |
| Timers | Retransmission, TIME-WAIT, keep-alive |
host$ ss -tan | awk 'NR>1 {print $1}' | sort | uniq -c
212 ESTAB
38 TIME-WAIT
4 CLOSE-WAIT
2 SYN-SENT
R1# show tcp brief
TCB Local Address Foreign Address (state)
7F1A2C30 10.255.0.1.22 10.99.0.20.51522 ESTAB
7F1A3B10 10.255.0.1.179 10.255.0.2.24311 ESTAB
What the states tell you
| Observation | Meaning |
|---|---|
| Many CLOSE-WAIT | The local application doesn't close sockets after the peer has finished |
| Many TIME-WAIT | Normal on busy clients that close actively; each lasts 2×MSL |
| SYN-SENT that persists | No answer to the SYN: filtered, routing problem or host down |
| ESTAB on one side only | A middlebox timed out the session, or one end crashed |
Middleboxes and idle connections
Firewalls and NAT devices delete idle sessions after their own timeout. The hosts still believe the connection is open, so the next packet is dropped or reset. Application keep-alives or TCP keep-alives shorter than the middlebox timeout prevent this.
Documented example, not captured output.
Quick reference
TCP gives applications a reliable, ordered byte stream. It sets up state with a handshake, numbers every byte, acknowledges what arrived, retransmits what was lost and adapts its sending rate to congestion. These mechanisms make TCP behaviour a rich source of diagnostic evidence: which flags a connection shows tells you whether the far end is reachable, listening, filtered or overloaded.
TCP is connection-oriented: a 3-way handshake (SYN, SYN-ACK, ACK) establishes state with sequence numbers and window sizes before data flows; connections close with FIN/ACK (or RST).
ss -tan state established | head
netstat -an | findstr ESTABLISHED
show tcp brief ! IOS: sessions to the device
tcpdump -ni eth0 'tcp[tcpflags] & (tcp-syn|tcp-fin|tcp-rst) != 0'
SYN without SYN-ACK = filtered or host down; immediate RST = closed port or firewall reject. MSS (in SYN) is clamped on tunnels (ip tcp adjust-mss 1360) to avoid fragmentation.
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 IP Fundamentals → TCP → Connection-oriented. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc9293.html · confidence 94%