← Lessons

quiz vs the machine

Silver1100

Networking

TCP vs UDP

Reliability vs speed, and when to choose which.

4 min read · intro · beat Silver to climb

Two philosophies

TCP gives you a reliable, ordered byte stream — at the cost of handshakes, acknowledgements, and retransmissions. UDP just fires packets and forgets — no guarantees, but minimal overhead.

Choosing

  • TCP: web pages, APIs, file transfer — anything where a missing byte corrupts the result.
  • UDP: live video, games, DNS — where a dropped packet is better than a late one.

Key idea

TCP's reliability isn't free: head-of-line blocking means one lost packet stalls everything behind it. That's exactly why real-time media often prefers UDP and rebuilds only the reliability it needs.

Check yourself

Answer to earn rating on the learn ladder.

1. Which protocol guarantees ordered, reliable delivery?

2. Why might a live game prefer UDP?