Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

TCP, UDP & Network Devices

Direct answer

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.

When to use this

Use it when one application fails while ping works, and to tell which protocol and port a service needs.

First 30 seconds

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.

Operational verification

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
Platform / version applicability
Protocol standard + deployed implementation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformProtocol standard · Cisco IOS XE
Key commandshow ip interface brief
Scope / prerequisiteUse it when one application fails while ping works, and to tell which protocol and port a service needs.
Show · 1
What next?3 suggested next steps
Catalog command links1
Evidence0
On this pageJump to a specific section
Verification

Show Commands

Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.

Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

3 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Commands & verification Verify boundary
CommandShows
telnet <host> <port>Tests a TCP port from a Cisco device: "Open", refused, or timeout
show tcp briefThe device's own TCP connections
show control-plane host open-portsPorts the device itself listens on
show access-listsMatch 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.
Command lookup Jump straight to Cisco syntax
Key points

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.

Key checks
  • 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 -an or ss -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.

TCPUDP
ConnectionYes, handshakeNo
ReliabilityRetransmits lost dataNone
OrderGuaranteedNot guaranteed
OverheadHigherMinimal
Typical useWeb, mail, file transfer, SSHDNS, 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.

DeviceForwards byLayer
SwitchDestination MAC address2
Router, Layer 3 switchDestination IP address3
Access list, firewallAddresses and ports; a firewall also tracks the connection3–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

PortProtocolService
20, 21TCPFTP data, control
22TCPSSH
23TCPTelnet
25TCPSMTP
53UDP and TCPDNS
67, 68UDPDHCP server, client
69UDPTFTP
80TCPHTTP
123UDPNTP
161, 162UDPSNMP, SNMP traps
443TCPHTTPS
514UDPSyslog
3389TCPRemote Desktop

Ports 0–1023 are well-known, 1024–49151 registered, 49152–65535 dynamic.

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

DeviceTCPUDP
SwitchNot visible (Layer 2)Not visible
RouterForwards; may clamp the MSS on tunnelsForwards
FirewallTracks the handshake and state; drops out-of-state segmentsCreates pseudo-sessions with idle timers
NAT / PATTranslates ports; times out idle sessionsTranslates ports; usually shorter timeouts
Load balancerTerminates or proxies connectionsUsually 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)

ObservationMeaning
SYN, then nothingFiltered silently, or the host is down
SYN answered by RSTNothing listening, or a firewall rejecting
Connection established, then a RST laterAn idle timeout on a middlebox, or the application closing
Retransmissions growingLoss 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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

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:

TCPUDP
Connection3-way handshakeNone
ReliabilityACKs, retransmissions, orderingNone
Flow/congestion controlYesNo (application decides)
Header20–60 bytes8 bytes
UsesHTTP/1.1–2, SSH, BGP, SMTPDNS, DHCP, syslog, VoIP (RTP), QUIC/HTTP3
DeviceLayerDecision based on
Switch2MAC address
Router / L3 switch3IP prefix
Firewall3–7Rules, state, applications
Load balancer4–7Ports, HTTP content
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docProtocol standard + deployed implementation RFC 9293

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%
Technical changelog & impact

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.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Embedded quick reference

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.

PatternLikely meaning
SYN only/retriesNo reply / return path / filter / listener boundary
SYN → RSTActive reject or no listener
SYN → SYN/ACK → ACKTransport established
Repeated retransmissionLoss, delay, path or receiver issue
FIN sequenceGraceful close
RST mid-sessionAbrupt endpoint/intermediary reset

Wireshark: tcp.flags.syn == 1, tcp.flags.reset == 1, tcp.analysis.retransmission

Confirmation

Confirm action

Continue?