Three tickets that come down to port numbers
A firewall rule says "permit TCP to port 22, deny everything else". A help desk ticket says "users cannot reach the server on 3389". A packet capture shows a lot of traffic on UDP 53. To understand any of these quickly, you need to know which service uses which port.
Where the client knocks: the well-known port
Read each entry as a service, transport and port together. SSH normally listens on TCP 22. Classic DNS supports both UDP 53 and TCP 53; TCP is not restricted to zone transfers. HTTPS can use TCP 443 for HTTP/1.1 or HTTP/2 and UDP 443 for HTTP/3 over QUIC. The service's configuration, not the number alone, decides what is actually listening.
A familiar port number suggests a service; it does not prove the application is present, secure or authorised. Port 443 alone does not prove that a certificate is valid. Use the registry to understand the default, then verify the listener, protocol and application response. Changing SSH's listening port can change noise in logs, but it does not replace authentication and access control.
A default service port gives clients a conventional place to connect. Many such defaults are in the well-known 0–1023 range, while others are in the User Ports range. The client still needs the correct transport, address and actual service configuration. Some services support both TCP and UDP.
Default ports are a convention, not a law. An administrator can move SSH or RDP to another port, and when that happens the firewall rules have to follow, or the service seems to vanish.
Device key: Admin PC (computer) · Core switch (Layer 3 switch) · R1 (router) · DNS, NTP (server)
Lines show the example’s network connections. The coloured path and envelope follow the current step; its text identifies the sender, receiver and traffic type.
Reading the addresses
IP labels identify interfaces or destinations. Subnet labels identify networks; /n is the prefix length. A router ID (RID) identifies a routing process and need not be a reachable interface.
An IP address alone is not a URL. A web URL includes a scheme such as https://; an address on a router or printer does not imply a website.
- Admin PC: IP 10.1.1.50
- R1: SSH 22
- DNS: UDP 53
- NTP: UDP 123
- 1. SSH to the router. Every character of a login session must arrive complete and in order, so SSH uses TCP.
- 2. DNS lookup. This example query and answer use UDP 53. Classic DNS also supports TCP 53; a firewall must not assume that only UDP can carry a query.
- 3. Time check. NTP sends small, regular time requests over UDP. A delayed answer gives a less accurate time sample, so there is no point resending; the client simply asks again later.
Fifteen ports worth memorising
| Port | Service | Transport | Used for |
|---|---|---|---|
20, 21 | FTP (data, control) | TCP | File transfer |
22 | SSH | TCP | Secure remote login; also SCP and SFTP |
23 | Telnet | TCP | Remote login with no encryption |
25 | SMTP | TCP | Sending email between servers |
53 | DNS | UDP and TCP | Classic DNS queries can use either; TCP also supports zone transfers |
67, 68 | DHCP (server, client) | UDP | Handing out IP addresses |
69 | TFTP | UDP | Simple file transfer, e.g. IOS images and configs |
80 | HTTP | TCP | Web pages without encryption |
110 | POP3 | TCP | Downloading email |
123 | NTP | UDP | Time synchronisation |
143 | IMAP | TCP | Reading email kept on the server |
161, 162 | SNMP (queries, traps) | UDP | Monitoring network devices |
443 | HTTPS | TCP (and UDP for HTTP/3) | Encrypted web pages |
514 | Syslog | UDP | Sending log messages to a server |
3389 | RDP | TCP (and UDP) | Windows remote desktop |
Memory aid: several ports come in order. FTP is 20/21, then SSH 22, Telnet 23 and SMTP 25. DHCP is 67/68, then TFTP 69. SNMP is 161/162.
Whole files over TCP, short messages over UDP
The choice depends on the job. Services that move files, web pages or login sessions need every byte, so they use TCP. Services that send small, quick messages (DNS, DHCP, NTP, SNMP, syslog) use UDP. Each message usually fits in one datagram, and if it is lost, the application simply asks again or sends the next one.
DHCP has one more reason to use UDP. A new client has no IP address yet, so it has to broadcast its request. A TCP handshake needs a known address at each end, so it cannot work with a broadcast. UDP can.
Listing a router's open ports
A Cisco device can show which ports it is listening on itself. The output below is based on Cisco documentation, not captured from a lab device.
R1#show control-plane host open-ports Active internet connections (servers and established) Prot Local Address Foreign Address Service State tcp *:22 *:0 SSH-Server LISTEN tcp *:23 *:0 Telnet LISTEN udp *:123 *:0 NTP LISTEN udp *:161 *:0 IP SNMP LISTEN udp *:162 *:0 IP SNMP LISTEN
Test yourself: which traffic gets through?
You are copying an IOS image from a TFTP server, but a firewall is in the way. Which port and protocol must the firewall allow to the TFTP server?
A firewall allows only TCP 443 out to the internet. Which of these connections can still leave the network?
A new laptop joins the network and needs an IP address. Why does DHCP use UDP for this instead of TCP?
Technical references
RFC 6335: port ranges and assignment; IANA service/port registry; RFC 7766: DNS over TCP.