TCP vs UDP Reference
TCP and UDP protocol comparison reference with key differences and use cases.
Key Comparison
| Feature | TCP | UDP |
|---|---|---|
| Connection | Connection-oriented (3-way handshake) | Connectionless |
| Reliability | Reliable (ACK, retransmission) | Unreliable (best effort) |
| Ordering | Guaranteed in-order | No ordering guarantee |
| Speed | Slower (overhead) | Faster (low overhead) |
| Overhead | High | Low |
| Flow Control | Yes (sliding window) | No |
| Congestion Control | Yes | No |
| Header Size | 20-60 bytes | 8 bytes |
Use Cases
| TCP | UDP |
|---|---|
| Web browsing (HTTP/HTTPS) | DNS lookups |
| Email (SMTP, IMAP, POP3) | Video streaming |
| File transfers (FTP, SFTP) | Online gaming |
| Database connections | VoIP calls |
| SSH / Remote access | NTP time sync |
| API requests | IoT sensor data |
Common Ports
| Port | Protocol | Service |
|---|---|---|
| 20 | TCP | FTP Data |
| 21 | TCP | FTP Control |
| 22 | TCP | SSH |
| 23 | TCP | Telnet |
| 25 | TCP | SMTP |
| 53 | TCP/UDP | DNS |
| 67 | UDP | DHCP Server |
| 68 | UDP | DHCP Client |
| 80 | TCP | HTTP |
| 110 | TCP | POP3 |
| 123 | UDP | NTP |
| 143 | TCP | IMAP |
| 161 | UDP | SNMP |
| 162 | UDP | SNMP Trap |
| 389 | TCP | LDAP |
| 443 | TCP | HTTPS |
| 445 | TCP | SMB |
| 465 | TCP | SMTPS |
| 514 | UDP | Syslog |
| 587 | TCP | SMTP Submission |
| 636 | TCP | LDAPS |
| 993 | TCP | IMAPS |
| 995 | TCP | POP3S |
| 1194 | UDP | OpenVPN |
| 3306 | TCP | MySQL |
| 3389 | TCP | RDP |
| 5432 | TCP | PostgreSQL |
| 5672 | TCP | AMQP (RabbitMQ) |
| 6379 | TCP | Redis |
| 8080 | TCP | HTTP Alt |
| 8443 | TCP | HTTPS Alt |
| 9200 | TCP | Elasticsearch |
| 27017 | TCP | MongoDB |
About this tool
TCP and UDP are the two primary transport layer protocols that applications use to send data over networks. TCP (Transmission Control Protocol) guarantees reliable, ordered delivery with error checking and connection management, making it ideal for applications where accuracy is critical. UDP (User Datagram Protocol) prioritizes speed over reliability, sending data without establishing connections or ensuring delivery, making it suitable for real-time applications where occasional packet loss is acceptable. Understanding the differences between these protocols is essential for developers, network engineers, and IT professionals who need to choose the right protocol for their specific use case.
This TCP vs UDP reference guide provides a side-by-side comparison of the key differences—connection requirements, reliability guarantees, speed, latency, header size, and ordering—along with real-world examples of when to use each protocol. You can quickly look up which protocol best fits your needs, whether you're building a file transfer system that cannot afford data loss, a multiplayer game that prioritizes low latency, or a video streaming application where speed matters more than perfection. The tool helps you understand the trade-offs inherent in each protocol so you can make informed architectural decisions.
This reference is invaluable for software engineers designing network applications, system administrators configuring network infrastructure, and network security professionals understanding traffic patterns. Whether you're troubleshooting connection issues, optimizing application performance, or simply learning network fundamentals, this tool distills complex protocol differences into a clear, searchable format that works entirely offline in your browser.
Frequently Asked Questions
Comments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.