Use it when one application fails while ping works, and to tell which protocol and port a service needs.
TCP, UDP & Network Devices
TCP sets up a connection and delivers data reliably and in order; UDP just sends datagrams. Both use port numbers to identify the application — 443 for HTTPS, 53 for DNS, 22 for SSH. Routers forward by IP address; firewalls and access lists also look at the ports.
1. Which protocol and port does the application use?
2. ping the server — IP reachability?
3. Test the port itself: open, refused, or timeout?
4. Refused → the service is not listening on the server.
5. Timeout → a firewall or access list on the path: show access-lists counters.
name resolved → IP path to the server → no filter drops the port → service listening on that port → TCP handshake completes (or UDP reply returns) → application answers
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
show ip interface briefShow 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 Commands & verification Verify boundary
| Command | Shows |
|---|---|
telnet <host> <port> | Tests a TCP port from a Cisco device: "Open", refused, or timeout |
show tcp brief | The device's own TCP connections |
show control-plane host open-ports | Ports the device itself listens on |
show access-lists | Match counters for filters on the path |
show ip interface <interface> | Whether a filter is applied to the interface (the "access list" lines) |
From a host: Test-NetConnection <host> -Port <port> (Windows) or nc -vz <host> <port> (Linux) test a TCP port; on the server, netstat -an or ss -ltnu shows what is listening.
Step 2 Troubleshooting workflow Narrow the fault
1. Which protocol and port does the application use? Without this nothing else can be tested.
2. ping the server — is there IP reachability at all? If not, it is a routing or addressing problem.
3. Test the port. Three outcomes:
- Open — the path and the service are fine; look at the application.
- Refused (an immediate reset) — the server was reached and nothing listens on that port.
- Timeout — a firewall or access list dropped it silently, or the server is down.
4. Timeout → find the filter: show access-lists counters on each device on the path.
5. UDP cannot be tested by a handshake; test with the application itself (a DNS query, an SNMP get) and look at filters in both directions.
Step 3 Common mistakes Narrow the fault
- "Ping works, so the network is fine." Ping uses ICMP; the application's port may still be blocked.
- "UDP is unreliable, so loss is a network fault." UDP only means the application handles loss; whether it retries is up to the application.
- "The destination port is all a firewall needs." Replies come back to the client's temporary source port; a stateless filter must allow them.
- "A refused connection means the firewall blocks it." Refused means the host answered; firewalls usually drop silently, giving a timeout.
- "DNS is UDP only." Large answers and zone transfers use TCP port 53.
- "A switch can filter on ports." A Layer 2 switch forwards on MAC addresses; filtering by port needs an access list or a firewall.
Ping proves IP reachability, not that the port is open. A TCP connection is identified by source and destination address and port. "Connection refused" means the host answered and nothing listens; a timeout means something on the path, or the host, dropped it silently. UDP has no handshake, so silence proves little.
telnet <host> <port>from a Cisco device — tests a TCP port: "Open" or refused/timeout.Test-NetConnection <host> -Port <port>(Windows),nc -vz <host> <port>(Linux) — the same from a host.show access-lists— match counters on any filter in the path.show ip interface <interface> | include access list— is a list applied?- On the server:
netstat -anorss -ltn— is the port listening?
ReferenceWhat it is1 section · depth on demand
Concept overview
TCP and UDP are the two transport protocols that carry application data over IP. TCP sets up a connection and guarantees that the data arrives complete and in order; UDP simply sends each message on its own. Both add port numbers, which identify the application at each end.
ReferenceWhy it matters1 section · depth on demand
Why it matters
"Ping works but the application does not" is the everyday case this topic explains: ping tests IP reachability only, while the application needs a specific TCP or UDP port to be open all the way — through access lists and firewalls — and a service listening on it. Knowing which protocol and port an application uses is the first step in any such fault.
ReferenceHow it works1 section · depth on demand
How it works
TCP — connection-oriented and reliable.
1. Three-way handshake: SYN, SYN-ACK, ACK. Only then is data sent.
2. Sequence numbers and acknowledgments: every byte is numbered; the receiver acknowledges what it got, and the sender retransmits what was not acknowledged.
3. Flow control: the receiver advertises a window — how much more it can accept.
4. Close: FIN from each side, or RST to abort.
UDP — connectionless. No handshake, no acknowledgment, no retransmission, no ordering. The header is 8 bytes against TCP's 20 or more. Anything the application needs beyond that it must do itself.
| TCP | UDP | |
|---|---|---|
| Connection | Yes, handshake | No |
| Reliability | Retransmits lost data | None |
| Order | Guaranteed | Not guaranteed |
| Overhead | Higher | Minimal |
| Typical use | Web, mail, file transfer, SSH | DNS, DHCP, voice and video, SNMP, syslog |
Ports. A 16-bit number. Servers listen on a known port; the client picks a temporary source port, usually above 49152. A connection is identified by the combination of source address, source port, destination address and destination port — which is how one host keeps many connections to the same server apart.
What the devices on the path look at.
| Device | Forwards by | Layer |
|---|---|---|
| Switch | Destination MAC address | 2 |
| Router, Layer 3 switch | Destination IP address | 3 |
| Access list, firewall | Addresses and ports; a firewall also tracks the connection | 3–4 and up |
Routers ignore ports unless an access list is applied; firewalls decide by them.
ReferenceImportant terms & boundaries3 sections · depth on demand
Important terms & boundaries
In depth
TCP, UDP and what network devices do with them
Applications use either TCP or UDP, and network devices treat the two differently. RFC 9293 describes TCP as connection-oriented:
- A handshake sets up state at both ends.
- Every byte is numbered and acknowledged.
- Lost data is retransmitted.
- The receiver's window controls the sending rate.
UDP offers only ports and a checksum. Routers forward both kinds without caring which it is. Firewalls, NAT devices and load balancers do care, because they keep state per connection.
How devices interact with TCP and UDP
| Device | TCP | UDP |
|---|---|---|
| Switch | Not visible (Layer 2) | Not visible |
| Router | Forwards; may clamp the MSS on tunnels | Forwards |
| Firewall | Tracks the handshake and state; drops out-of-state segments | Creates pseudo-sessions with idle timers |
| NAT / PAT | Translates ports; times out idle sessions | Translates ports; usually shorter timeouts |
| Load balancer | Terminates or proxies connections | Usually per-flow hashing |
Four questions for any connectivity problem
1. Which protocol and port does the application use?
2. Does basic IP reachability work, using ping from the right source?
3. Does the port answer? For TCP that means a SYN-ACK. For UDP, an application response.
4. Is a stateful device in the path, and does it see both directions?
What TCP signals tell you (RFC 9293)
| Observation | Meaning |
|---|---|
| SYN, then nothing | Filtered silently, or the host is down |
| SYN answered by RST | Nothing listening, or a firewall rejecting |
| Connection established, then a RST later | An idle timeout on a middlebox, or the application closing |
| Retransmissions growing | Loss on the path |
host$ nc -vz -w 3 10.30.0.15 443
Connection to 10.30.0.15 443 port [tcp/https] succeeded!
host$ nc -vzu -w 3 10.20.0.53 53
host$ dig @10.20.0.53 www.example.net +short
host$ ss -tan state established dst 10.30.0.15
fw# show conn address 10.30.0.15 port 443 | include TCP|UDP
UDP tests need the application
nc -u often reports success even when nothing listens, because no answer is the normal case for UDP. Use the real protocol, such as dig for DNS, to get a meaningful result.
Documented example, not captured output.
Quick reference
TCP and UDP are the two main transport protocols, and they solve different problems: TCP provides reliable, ordered delivery at the cost of overhead and latency, while UDP provides speed and simplicity without guarantees. Network devices work at different layers of this stack, which decides what information they can use when forwarding and filtering traffic.
TCP vs UDP and where devices operate:
| TCP | UDP | |
|---|---|---|
| Connection | 3-way handshake | None |
| Reliability | ACKs, retransmissions, ordering | None |
| Flow/congestion control | Yes | No (application decides) |
| Header | 20–60 bytes | 8 bytes |
| Uses | HTTP/1.1–2, SSH, BGP, SMTP | DNS, DHCP, syslog, VoIP (RTP), QUIC/HTTP3 |
| Device | Layer | Decision based on |
|---|---|---|
| Switch | 2 | MAC address |
| Router / L3 switch | 3 | IP prefix |
| Firewall | 3–7 | Rules, state, applications |
| Load balancer | 4–7 | Ports, HTTP content |
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 Fundamentals → TCP, UDP & Network Devices. 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.
Operational notes
Former standalone Cheat Sheet content now lives directly inside the Topic where it belongs.
TCP Session Fast Check
SYN → SYN/ACK → ACK → data → teardown.
Capture logic
- SYN only: return path/filter/listener boundary
- SYN + RST: active reject/no listener
- 3-way handshake succeeds: transport established
- Retransmissions: loss/delay/window/path issue
Useful filters
Wireshark: tcp.flags.syn == 1, tcp.analysis.retransmission, tcp.flags.reset == 1
tcpdump: tcp port <port>
TCP Flags Fast Check
SYN, ACK, FIN, RST and what each capture pattern usually means.
| Pattern | Likely meaning |
|---|---|
| SYN only/retries | No reply / return path / filter / listener boundary |
| SYN → RST | Active reject or no listener |
| SYN → SYN/ACK → ACK | Transport established |
| Repeated retransmission | Loss, delay, path or receiver issue |
| FIN sequence | Graceful close |
| RST mid-session | Abrupt endpoint/intermediary reset |
Wireshark: tcp.flags.syn == 1, tcp.flags.reset == 1, tcp.analysis.retransmission