Interview Prep/Networking/Performance, MTU, Latency & Tools

TCP or UDP: how do you choose for an application?

BeginnerScenarioPerformance, MTU, Latency & Tools
Answer

Situation read → Reliability and ordering versus latency and overhead.

What I'd do →

  1. TCP gives ordered, reliable delivery with congestion control, good for web, databases, APIs
  2. UDP has no handshake or retransmit, good for DNS, real-time media, gaming and QUIC (which builds reliability on top)
  3. Test UDP reachability with nc -u -vz host 53
  4. Open the correct protocol in security groups, since TCP rules don't cover UDP

Why → TCP trades latency for guarantees; UDP leaves reliability to the application.

Interview tip → Say HTTP/3 is reliable but runs on UDP through QUIC.

All Networking questions Roadmap: Networking for DevOps

More on Performance, MTU, Latency & Tools