TCP/IP Fundamentals
Explain the difference between TCP and UDP. When would you use each?
TCP (Transmission Control Protocol) is connection-oriented, ensuring reliable, ordered delivery with error checking and retransmission. UDP (User Datagram Protocol) is connectionless, offering faster but unreliable delivery without guarantees. Use TCP for web traffic (HTTP), file transfers, and email. Use UDP for streaming, gaming, DNS queries, and real-time applications where speed matters more than reliability.
Understanding TCP vs UDP is fundamental for troubleshooting network issues, configuring firewalls, and designing distributed systems. DevOps engineers must know which protocol applications use to properly monitor, secure, and optimize network traffic.
Check open TCP/UDP ports
- Assuming all network traffic uses TCP
- Blocking UDP on firewalls without understanding impact on DNS and NTP
- Not considering TCP overhead for high-throughput applications
- What is the TCP three-way handshake?
- Why does DNS use UDP by default but can fall back to TCP?
- What are the common TCP states and what do they mean?