Use it when a service depends on a session and you must separate reachability, port listening, handshake, loss, reset and application exchange.
TCP
TCP provides connection-oriented, sequenced and acknowledged byte-stream delivery with retransmission, flow control and congestion behavior.
1. TCP is connection-oriented, reliable and ordered.
2. Three-way handshake (SYN, SYN-ACK, ACK).
3. Windowing and retransmissions.
4. RST means refused; no answer means filtered.
SYN → SYN-ACK → ACK → data with ACKs → FIN
1. Verify IP path and return path.
2. Confirm destination port is listening.
3. Inspect the three-way handshake.
4. Look for retransmissions, zero window, resets and MSS/MTU symptoms.
5. Validate application request/response.
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
show tcp brief allShow Commands
Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.
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 Verification and output interpretation Verify boundary
Verify that the server is listening on the expected address/port, then distinguish SYN exchange, Established state, data transfer, retransmissions and closure. A packet capture or socket table can show whether the failure is before handshake, during transport or after application data begins. Repeated retransmissions show missing acknowledgements for transmitted sequence space, but they do not by themselves identify whether loss occurs in the forward path, return path or endpoint. Check MSS/MTU when larger payloads fail while small exchanges succeed.
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.
Subtopics
Go one level deeper into this subject.
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.
Subtopic Three-way handshakeTCP connection establishment uses SYN, SYN-ACK and ACK to synchronize both directions, negotiate connection state and establish the initial sequence-number spaces before application data is exchanged.
Subtopic SequencingTCP sequence numbers identify byte positions in each direction so receivers can order data, detect gaps and duplicates, and acknowledge the next contiguous byte expected.
Subtopic AcknowledgementsTCP acknowledgements report the next contiguous byte expected and provide sender feedback for reliable delivery; SACK can additionally describe received blocks beyond a gap.
Subtopic Flow controlTCP flow control protects the receiver by advertising how much additional byte-stream data it can accept, using the receive window independently from sender congestion-control logic.
Subtopic ReliabilityTCP reliability uses acknowledgements, retransmission, timers and optional selective acknowledgement to recover missing byte ranges while preserving an ordered byte stream to the application.
- 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.
show tcp brief— TCP sessions on the device- Client: ss -tn / Get-NetTCPConnection — sessions
Test-NetConnection <host> -Port <port>— handshake test
ReferenceImportant terms & boundaries5 sections · depth on demand
Key operational limits
- SYN, SYN-ACK, ACK establish a connection
- Sequence and acknowledgement numbers track bytes
- Receive windows provide flow control; retransmission handles loss
- A completed handshake shows a transport endpoint, not application correctness.
In depth
TCP
TCP gives applications a reliable connection over unreliable IP. RFC 9293 describes it as providing a reliable, in-order byte-stream service, connection-oriented and bidirectional, with port numbers to multiplex connections; reliability comes from sequence numbers, checksums and retransmission.
Connection set-up (RFC 9293)
| Step | Segment |
|---|---|
| 1 | Client → server: SYN with the client's initial sequence number |
| 2 | Server → client: SYN-ACK, acknowledging the client's number and carrying its own |
| 3 | Client → server: ACK |
Header fields (RFC 9293)
| Field | Purpose |
|---|---|
| Source / destination port | Identify applications |
| Sequence number | Position of the first byte in this segment |
| Acknowledgement number | Next byte expected (cumulative) |
| Flags | SYN, ACK, FIN, RST, PSH, URG, ECE, CWR |
| Window | Receive buffer space (flow control) |
| Checksum | Covers a pseudo-header, header and data |
| Options | MSS, window scale, SACK, timestamps |
States (RFC 9293)
LISTEN, SYN-SENT, SYN-RECEIVED, ESTABLISHED, FIN-WAIT-1/2, CLOSE-WAIT, CLOSING, LAST-ACK, TIME-WAIT (2×MSL after an active close) and CLOSED. Each direction closes separately with FIN; RST aborts a connection.
host$ ss -tn state established '( dport = :443 )'
Recv-Q Send-Q Local Address:Port Peer Address:Port
0 0 10.110.0.64:51522 142.250.74.46:443
host$ sudo tcpdump -ni eth0 'tcp[tcpflags] & (tcp-syn|tcp-rst) != 0' -c 3
10:41:22.100 IP 10.110.0.64.51530 > 10.30.0.15.443: Flags [S], seq 2911022, win 64240, options [mss 1460,...]
10:41:22.102 IP 10.30.0.15.443 > 10.110.0.64.51530: Flags [S.], seq 81100, ack 2911023, win 65160, options [mss 1460,...]
R1# show tcp brief
MSS (RFC 9293)
The MSS option is sent in SYN segments; without it, the default is 536 bytes for IPv4. Tunnels often need ip tcp adjust-mss so segments fit the reduced MTU.
Reading failures
| Observation | Likely cause |
|---|---|
| SYN with no reply | Packet dropped by a filter or routing |
| SYN answered by RST | Port closed on the server |
| Retransmissions mid-flow | Loss, often congestion or MTU problems |
Documented example, not captured output.
Quick reference
TCP is the connection-oriented transport protocol used by most applications. It provides reliability (acknowledgements and retransmission), ordering (sequence numbers), flow control (receive window) and congestion control.
TCP's reliability means packet loss shows up as retransmissions and lower throughput rather than missing data; captures reveal it as duplicate ACKs and retransmitted segments.
State model and technical mechanics
TCP identifies each connection by endpoint addresses and ports and establishes state through the SYN, SYN-ACK and ACK exchange. Sequence numbers order bytes; cumulative acknowledgements confirm received data; receive windows provide flow control; retransmission and timers recover from loss, while congestion-control algorithms adapt sending rate to network conditions. MSS constrains the TCP payload size announced by an endpoint and is related to, but distinct from, interface MTU. FIN normally closes a stream gracefully, while RST aborts state. Because TCP is a byte stream, application message boundaries are not preserved by the transport itself. A connection can therefore be Established while the application protocol is stalled, sending unexpected content or waiting on a higher-layer transaction.
Limits and common misconceptions
A completed three-way handshake shows bidirectional transport reachability for the handshake packets, not that authentication, TLS, DNS-dependent application logic or backend processing works. Likewise, an RST is not automatically “network failure”; it is an explicit transport reset that can be generated by an endpoint or stateful device. Do not equate high latency with TCP loss without separating RTT, server think time and retransmission evidence.
ReferenceConfiguration & state1 section · depth on demand
Design and configuration model
Treat listening port, local/remote address selection and application timeout behavior as part of the transport contract. Avoid arbitrary TCP timer or MSS changes unless the design has evidence for them; tuning around packet loss can conceal MTU, path or application problems. Where firewalls, NAT or load balancers exist, remember they may maintain their own TCP state and timeout assumptions. Document which endpoint initiates the connection and whether long-lived idle sessions are expected, because that determines how keepalive and stateful middleboxes should be interpreted.
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. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc9293.html · confidence 94%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.
Quick lookup tables
TCP evidence chain
Configuration, operational state, counters and downstream proof remain separate.
| Boundary | Question | Evidence | Does not prove |
|---|---|---|---|
| Definition | What is configured or intended? | running configuration / controller policy | live operation |
| Local state | Is the feature active at the expected scope? | show tcp brief all | remote success |
| Counters | Did controlled traffic or an event reach this stage? | scoped counters/timestamps | complete return path |
| Next boundary | What consumes or transports this state? | name/address → routed path → SYN/SYN-ACK/ACK → reliable byte stream → application protocol → close/reset | application success |
TCP · technical reference
Compact mechanics, configuration and evidence boundaries for fast lookup.
| TCP evidence | Meaning |
|---|---|
| SYN/SYN-ACK/ACK | Connection establishment |
| Established | Transport state exists |
| Retransmissions | Data/ACK not confirmed in time |
| FIN / RST | Graceful close / abort |