Common ports and protocols: DNS, DHCP, HTTP/S, FTP, SSH, SMTP, SNMP, RDP

CompTIA Network+ Preparation · lesson 2 of 30 · 25 min

Why Ports Matter

Port numbers identify specific services on a host. When a packet arrives, the OS uses the destination port to deliver it to the correct application. The Network+ exam requires you to memorize well-known ports (0–1023) and know which transport protocol (TCP or UDP) each uses.

Must-Know Ports

TCP vs UDP — Which Protocols Use Which

Memory tip

UDP is used for services that prioritize speed over reliability: DNS, DHCP, TFTP, NTP, SNMP, Syslog. Everything else is typically TCP.

Flashcard Drill

Port 22 SSH — Secure Shell, encrypted remote access. TCP. Port 53 DNS — Domain Name System. UDP (TCP for zone transfers). Port 80 / 443 HTTP (80) unencrypted / HTTPS (443) encrypted web. Both TCP. Port 25 SMTP — sends email between servers. TCP. Port 110 / 143 POP3 (110) downloads email / IMAP (143) keeps on server. Both TCP. Port 67/68 DHCP — 67 server, 68 client. UDP. Port 161/162 SNMP — 161 queries, 162 traps. UDP. Port 3389 RDP — Remote Desktop Protocol. TCP. Port 123 NTP — Network Time Protocol. UDP. Port 514 Syslog — log forwarding. UDP.

Worked Scenario: Firewall Rule Analysis

Scenario

A security analyst reviews a firewall log and sees blocked traffic on port 23 from an internal host to an external IP. What protocol is being blocked, and why is this a security concern?

Answer: Port 23 is Telnet — an unencrypted remote access protocol. Blocking outbound Telnet is correct security practice because Telnet transmits all data including passwords in plaintext. An attacker with network access could capture credentials with a packet sniffer. The correct replacement is SSH (port 22), which encrypts the entire session.

Exam tip: When you see port 23 on the exam, the answer is almost always “use SSH instead” or “this is a security risk because it’s unencrypted.”

Knowledge Check — 12 Questions

Ports & Protocols (Network+)

Which port does SSH use?

  • 21
  • 22
  • 23
  • 25

Answer: 22
SSH uses TCP port 22 for encrypted remote access.

DNS primarily uses which transport protocol?

  • TCP
  • UDP
  • Both equally
  • Neither

Answer: UDP
DNS uses UDP port 53 for queries. TCP is used for zone transfers and large responses.

HTTPS uses port _____.

Answer: 443
HTTPS (HTTP over TLS) uses TCP port 443.

Which protocol uses ports 67 and 68?

  • DNS
  • DHCP
  • SNMP
  • NTP

Answer: DHCP
DHCP uses UDP port 67 (server) and 68 (client).

Which email protocol keeps messages on the server?

  • SMTP (25)
  • POP3 (110)
  • IMAP (143)
  • NNTP (119)

Answer: IMAP (143)
IMAP keeps email on the server and syncs across devices. POP3 downloads and typically deletes.

RDP uses which port?

  • 22
  • 23
  • 3389
  • 445

Answer: 3389
RDP (Remote Desktop Protocol) uses TCP port 3389.

SNMP traps are sent on which port?

  • 161
  • 162
  • 514
  • 123

Answer: 162
SNMP uses UDP 161 for queries and UDP 162 for traps (unsolicited alerts from devices).

Telnet (port 23) encrypts its traffic.

  • True
  • False

Answer: False
Telnet is unencrypted — all traffic including passwords is sent in plaintext. Use SSH instead.

Which protocol is used for Windows file sharing?

  • FTP (21)
  • SMB (445)
  • TFTP (69)
  • NFS (2049)

Answer: SMB (445)
SMB (Server Message Block) uses TCP port 445 for Windows file and printer sharing.

NTP (time synchronization) uses port _____.

Answer: 123
NTP uses UDP port 123 for time synchronization.

Which port does LDAP use for directory services queries?

  • 389
  • 636
  • 443
  • 445

Answer: 389
LDAP uses TCP port 389. LDAPS (LDAP over TLS) uses port 636.

A network admin needs to transfer a Cisco IOS image to a router with no authentication. Which protocol should they use?

  • FTP (21)
  • SFTP (22)
  • TFTP (69)
  • SCP (22)

Answer: TFTP (69)
TFTP (Trivial FTP) uses UDP port 69 and requires no authentication — commonly used for IOS image transfers in lab environments.


Previous lesson: OSI and TCP/IP models: layers, PDUs, encapsulation
Back to CompTIA Network+ Preparation
Next lesson: TCP three-way handshake, connection termination, UDP characteristics