TCP vs UDP, side by side: reliability, speed, headers, the three-way handshake, and real-world use cases — when to use each and why the exam loves asking. Answer the classic comparison questions with confidence. More free study resources at bytebarhq.com.
|
Full name
|
Transmission Control Protocol (TCP) · User Datagram Protocol (UDP)
|
|
Connection
|
TCP: Connection-oriented (handshake first) · UDP: Connectionless (fire and forget)
|
|
Reliability
|
TCP: Guaranteed delivery, ordered, error-checked · UDP: Best effort — no guarantees
|
|
Speed
|
TCP: Slower (overhead) · UDP: Faster (minimal overhead)
|
|
Header size
|
TCP: 20 bytes · UDP: 8 bytes
|
|
Use when
|
TCP: Accuracy matters · UDP: Speed matters
|
|
Step 1: SYN
|
Client → Server
|
|
Step 2: SYN/ACK
|
Server → Client
|
|
Step 3: ACK
|
Client → Server
|
|
Teardown
|
FIN → FIN-ACK → ACK
|
|
Web browsing
|
HTTP/HTTPS
|
|
Email
|
SMTP, IMAP, POP3
|
|
File transfer
|
FTP, SFTP
|
|
Remote admin
|
SSH, RDP
|
|
DNS lookups
|
Port 53
|
|
DHCP
|
Ports 67/68
|
|
Streaming / VoIP / gaming
|
Speed matters more than perfection
|
|
NTP / SNMP / TFTP
|
Ports 123 / 161 / 69
|
|
"Which is connectionless?"
|
UDP
|
|
SYN flood attack
|
Abuses the TCP handshake (half-open connections)
|
|
Sequencing + ACKs
|
TCP uses them; UDP has neither
|
|
DNS transport
|
UDP for queries, TCP for zone transfers
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.