Common Ports & Protocols

Key Takeaways

  • Port numbers run 0-65,535, split into well-known (0-1023), registered (1024-49151), and dynamic/ephemeral (49152-65535) ranges.
  • Memorize the core ports: FTP 20/21, SSH/SFTP 22, Telnet 23, SMTP 25, DNS 53, DHCP 67/68, HTTP 80, POP3 110, IMAP 143, HTTPS 443, SMB 445, RDP 3389.
  • Secure variants use distinct ports: HTTPS 443, IMAPS 993, POP3S 995, LDAPS 636, and SMTP submission over STARTTLS 587.
  • DNS resolves names to IP addresses; a DNS failure looks like a total internet outage even when Layer 3 connectivity is fine.
  • DHCP hands out IP, mask, gateway, and DNS via the four-step DORA process (Discover, Offer, Request, Acknowledge).
Last updated: June 2026

Port Number Ranges

A port is a 16-bit number that identifies a service or a client-side conversation so multiple connections can share one IP address.

RangeCategoryDescription
0-1,023Well-knownReserved for standard servers (HTTP, DNS, SSH)
1,024-49,151RegisteredVendor/application services (RDP 3389, SQL 1433)
49,152-65,535Dynamic/ephemeralTemporary source ports for client connections

Ports You Must Memorize

Web & file transfer

PortProtocolNotesTCP/UDP
20FTP dataFile transfer payload channelTCP
21FTP controlCommands and authenticationTCP
22SSH / SFTP / SCPEncrypted shell and file copyTCP
23TelnetPlaintext remote terminal (insecure)TCP
80HTTPUnencrypted webTCP
443HTTPSWeb over TLSTCP

Email

PortProtocolNotesTCP/UDP
25SMTPMail relay between serversTCP
110POP3Download mail (no sync)TCP
143IMAPServer-side mail syncTCP
587SMTP (STARTTLS)Modern authenticated mail submissionTCP
993IMAPSIMAP over TLSTCP
995POP3SPOP3 over TLSTCP

Network services & remote access

PortProtocolNotesTCP/UDP
53DNSName resolutionTCP & UDP
67/68DHCPServer 67 / client 68UDP
137-139NetBIOSLegacy Windows name/session servicesTCP/UDP
161/162SNMP / SNMP trapDevice monitoringUDP
389/636LDAP / LDAPSDirectory lookups (636 secure)TCP
445SMB/CIFSWindows file sharingTCP
3389RDPWindows Remote DesktopTCP

Exam trap: match plaintext protocols to their encrypted upgrades. Telnet (23) -> SSH (22); HTTP (80) -> HTTPS (443); FTP (21) -> SFTP (22) or FTPS (990); LDAP (389) -> LDAPS (636).


DNS - Port 53

DNS (Domain Name System) maps human names to IP addresses. It usually uses UDP for fast lookups and TCP for large responses or zone transfers.

RecordPurposeExample
AHostname -> IPv4example.com -> 93.184.216.34
AAAAHostname -> IPv6example.com -> 2606:2800:220:1::...
MXMail exchangerexample.com -> mail.example.com
CNAMEAlias to another namewww -> example.com
TXTText/verification (SPF, DKIM)"v=spf1 ..."
PTRReverse lookup (IP -> name)34.216.184.93.in-addr.arpa

Diagnostic move: if ping 8.8.8.8 succeeds but ping google.com fails, connectivity is fine and DNS is broken. Use nslookup to confirm and ipconfig /flushdns to clear stale records.


DHCP - Ports 67/68

DHCP (Dynamic Host Configuration Protocol) automates client configuration via the DORA exchange:

  1. Discover - client broadcasts a request for an address.
  2. Offer - a DHCP server proposes an available lease.
  3. Request - client formally requests the offered address.
  4. Acknowledge - server confirms and records the lease.

A DHCP scope delivers the IP address, subnet mask, default gateway, DNS servers, and a lease time. When DHCP fails, the client falls back to a 169.254.x.x APIPA address - a classic exam tell for "DHCP server is down."


FTP - Ports 20/21

FTP separates control from data. Port 21 carries commands and authentication; port 20 carries the file data in active mode.

  • Active mode: the server opens the data connection back to the client - often blocked by client-side firewalls.
  • Passive mode: the client opens both connections - firewall-friendly and the modern default.

Security note: plain FTP and Telnet send credentials in cleartext. Prefer SFTP (22) or FTPS (990) and SSH (22) instead.


TCP vs. UDP at the Port Level

A single port number can mean different services depending on whether it rides TCP or UDP, so the exam often pairs a port with a transport protocol. DNS is the classic example: it uses UDP 53 for ordinary lookups because a single small query and answer fit in one datagram with no handshake overhead, but it falls back to TCP 53 for responses larger than 512 bytes and for zone transfers between name servers. DHCP runs entirely over UDP (server 67, client 68) because the client has no address yet and must broadcast, which connectionless UDP supports and connection-oriented TCP cannot.

Most other services - HTTP, HTTPS, SSH, SMTP, RDP, and SMB - are TCP because they need reliable, ordered delivery.

Why Secure Variants Exist

Early internet protocols carried everything, including passwords, in plaintext. Anyone capturing traffic with a tool such as a packet sniffer could read Telnet sessions, FTP credentials, or POP3 mailboxes. The modern fix is a TLS-protected variant on its own port: HTTP became HTTPS on 443, IMAP became IMAPS on 993, POP3 became POP3S on 995, and LDAP became LDAPS on 636. Some protocols instead upgrade the existing port in place using STARTTLS, which is why authenticated mail submission uses port 587 - the connection opens in the clear, then negotiates encryption before any credentials are sent.

On the exam, when a question asks how to secure an existing plaintext service, the answer is almost always "switch to the encrypted variant on its dedicated port" rather than "hide the service" or "change the password."

A Port-Troubleshooting Scenario

A user can reach an internal web server by IP on port 80 but a new HTTPS site times out. Because plain HTTP works, Layer 3 connectivity and the route are fine; the failure is specific to port 443. The most common causes are a firewall rule blocking 443 inbound, a missing or expired TLS certificate on the server, or the service simply not listening on 443. Running netstat on the server reveals whether anything is bound to port 443, and checking the firewall rule set confirms whether 443 is permitted. This isolates the problem to the transport/application layers rather than the physical link.

Test Your Knowledge

Which port does HTTPS use by default?

A
B
C
D
Test Your Knowledge

What is the correct order of the DHCP DORA process?

A
B
C
D
Test Your KnowledgeMatching

Match each port to its protocol:

Match each item on the left with the correct item on the right

1
Port 22
2
Port 53
3
Port 3389
4
Port 445
Test Your Knowledge

A user can browse by IP address but every domain name fails to load. Which service is the most likely culprit?

A
B
C
D