TCP vs UDP Cheat Sheet

A Programming › Network cheat sheet in English by bytebar

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.

686 views 156 downloads 14 Sep 2026 History

Side by Side

Full name
Transm­ission Control Protocol (TCP) · User Datagram Protocol (UDP)
Connection
TCP: Connec­tio­n-o­riented (handshake first) · UDP: Connec­tio­nless (fire and forget)
Reliab­ility
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
The head-t­o-head every Network+, Security+, and CCNA exam asks about.

The Three-Way Handshake

Step 1: SYN
Client → Server
Step 2: SYN/ACK
Server → Client
Step 3: ACK
Client → Server
Teardown
FIN → FIN-ACK → ACK
SYN flood attacks abuse this by leaving connec­tions half-open.

Use TCP When…

Web browsing
HTTP/HTTPS
Email
SMTP, IMAP, POP3
File transfer
FTP, SFTP
Remote admin
SSH, RDP
Use TCP when accuracy matters.

Use UDP When…

DNS lookups
Port 53
DHCP
Ports 67/68
Streaming / VoIP / gaming
Speed matters more than perfection
NTP / SNMP / TFTP
Ports 123 / 161 / 69
Use UDP when speed matters.

Exam Traps

"­Which is connec­tio­nle­ss?­"
UDP
SYN flood attack
Abuses the TCP handshake (half-open connec­tions)
Sequencing + ACKs
TCP uses them; UDP has neither
DNS transport
UDP for queries, TCP for zone transfers
Read the question twice — these are designed to trick you.

More from ByteBar

Added More from ByteBar footer block with study guide CTA link.

Comments

No comments yet.

Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.