2.1 Comparing and Contrasting TCP and UDP Ports, Protocols, and Their Purposes
COMPTIA A+ CORE 1 - DOMAIN 2
Cyber Wizard
This article explores the differences between TCP and UDP, their associated ports, and their functions, as required for the CompTIA A+ exam.
CompTIA A+ Exam Domain: Domain 2.1 - Compare and contrast Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) ports, protocols, and their purposes.
Introduction to TCP and UDP
Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) are core transport-layer protocols in the TCP/IP suite. They serve different purposes based on reliability, connection requirements, and data transmission methods.
TCP (Transmission Control Protocol)
Connection-oriented – Establishes a session before transmitting data.
Reliable – Ensures data integrity with error checking and retransmission.
Slower but accurate – Guarantees ordered and complete data delivery.
Common Uses: Web browsing (HTTPS, HTTP), secure remote access (SSH, RDP), and email (SMTP, IMAP, POP3).
UDP (User Datagram Protocol)
Connectionless – No handshake before sending data.
Unreliable – No error correction or retransmission.
Faster but less reliable – Used for real-time applications where speed is prioritized over accuracy.
Common Uses: Streaming (VoIP, video conferencing), DNS queries, and DHCP.
Common TCP and UDP Ports and Their Protocols
File Transfer and Remote Access
20/21 – File Transfer Protocol (FTP) (TCP)
Port 20 handles data transfer; Port 21 manages control commands.
Used for file transfers over a network.
22 – Secure Shell (SSH) (TCP)
Provides secure remote command-line access.
Encrypts communication to prevent eavesdropping.
23 – Telnet (TCP)
Unencrypted remote terminal access.
Insecure and largely replaced by SSH.
Email Protocols
25 – Simple Mail Transfer Protocol (SMTP) (TCP)
Handles outbound email transmission.
110 – Post Office Protocol 3 (POP3) (TCP)
Downloads emails from a mail server for local storage.
143 – Internet Message Access Protocol (IMAP) (TCP)
Allows real-time email access without full downloads.
Networking Services
53 – Domain Name System (DNS) (TCP/UDP)
Resolves domain names to IP addresses.
Uses UDP for quick lookups and TCP for zone transfers.
67/68 – Dynamic Host Configuration Protocol (DHCP) (UDP)
Port 67 is used by DHCP servers.
Port 68 is used by DHCP clients.
Assigns IP addresses dynamically to network devices.
161/162 – Simple Network Management Protocol (SNMP) (UDP)
Port 161 is for device monitoring queries.
Port 162 is for trap notifications from network devices.
389 – Lightweight Directory Access Protocol (LDAP) (TCP/UDP)
Provides directory services for authentication and resource lookup.
Secure version runs on Port 636.
Web Services
80 – Hypertext Transfer Protocol (HTTP) (TCP)
Standard for unencrypted web communication.
443 – Hypertext Transfer Protocol Secure (HTTPS) (TCP)
Secure version of HTTP using encryption via SSL/TLS.
File Sharing and Remote Access
137/139 – NetBIOS/NetBIOS over TCP/IP (NetBT) (TCP/UDP)
Enables legacy Windows file and printer sharing.
445 – Server Message Block (SMB)/Common Internet File System (CIFS) (TCP)
Used for Windows file and printer sharing.
3389 – Remote Desktop Protocol (RDP) (TCP)
Allows remote desktop connections for system administration.
TCP vs. UDP Use Cases
Connection-Oriented Protocols (TCP)
HTTPS (443): Ensures encrypted web communication.
SSH (22): Secure shell remote access.
IMAP (143): Maintains email synchronization between clients and servers.
RDP (3389): Enables remote desktop control with reliability.
Connectionless Protocols (UDP)
DHCP (67/68): Assigns IP addresses without requiring a session.
TFTP (69): Transfers small files without complex error checking.
DNS (53): Uses UDP for fast name resolution and TCP for reliability when required.
SNMP (161/162): Facilitates efficient device monitoring without maintaining persistent connections.
Final Thoughts
Understanding TCP and UDP, their differences, and associated ports is crucial for networking and IT support roles. The CompTIA A+ exam tests knowledge of these protocols, requiring familiarity with their use cases, benefits, and configurations. Mastering these concepts ensures a solid foundation for troubleshooting and managing network communications.