Pcornel
Networking · Network & Protocols › TCP, UDP & Transport

TCP Operational Reference

Cheat sheet · https://pcornel.dk/topic.php?topic=164

Back to the Topic

Answer

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.

Remember

What comes back to a SYN tells you the most: SYN-ACK means the port is open, RST means reachable but refused, silence means dropped or unroutable. A completed handshake means the network path works; the problem is then above it.

First checks

  • ss -ltn — is the server listening on the port? (netstat -an on other systems.)
  • ss -tan — connections and their states.
  • curl -v telnet://<host>:<port> or Test-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.

Commands

ss -i
ss -tan
ss -ltn
curl
tcpdump
show tcp brief

Verify in this order

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

Where it usually breaks

physical/link dependency → local object state → peer/control state → policy → forwarding/adjacency → end-to-end result

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=164

Confirmation

Confirm action

Continue?