Skip to content
We areTOP 1%

Why do DNS, online games and video calls use UDP instead of TCP?

MediumConceptTCP & UDP
Track your progress
First attempt
Re-solve after a few days
Final pass before interviews

Answer

These applications value low delay over perfect delivery, and TCP's guarantees add delay that they either cannot afford or do not need.

  • No handshake: a DNS query and its answer each fit in one datagram, so the lookup finishes in one round trip. TCP would spend an extra round trip just opening the connection.
  • No head-of-line blocking: TCP delivers bytes strictly in order, so one lost segment stalls all the data behind it until it is retransmitted. A game or a call would rather skip a stale packet and use the next one.
  • Less overhead: an 8-byte header and no per-connection state let one server handle huge numbers of short exchanges. UDP also supports broadcast and multicast, which DHCP and some live streams rely on.
  • Applications that need some reliability add just that on top of UDP, as QUIC does for HTTP/3.

Example: A game server sends each player's position 30 times a second. If one update is lost, TCP would hold back every later update until the lost one is resent, and the game would freeze for a moment. With UDP, the client simply uses the next update, which already contains the newer position.

More in TCP & UDP

Sign in to track your progress

Your checkboxes, streak and activity heatmap are saved to your account and sync across devices. It is free.
Sign in with email

New here? Create an account