SystemCity
WorkspaceProblemsCanvasPricing
Sign in
S

SystemCity

AI-powered system design tutor. Learn architecture, ace interviews, build real systems.

Learn

  • Learn System Design
  • Interview Prep Guide
  • All Problems
  • Glossary
  • Compare
  • Design Canvas

Product

  • Pricing
  • Portfolio
  • Support

Legal

  • Terms
  • Privacy
  • Refunds

© 2026 SystemCity. All rights reserved.

Master system design · interview prep · 120+ problems

Back to glossary

Networking & Infrastructure

TCP vs UDP

TCP is a reliable, ordered, connection-oriented protocol. UDP is a fast, connectionless, best-effort protocol. They serve different workloads.

In depth

TCP (Transmission Control Protocol) provides a reliable, ordered, byte-stream connection between two endpoints. It handshakes (SYN, SYN-ACK, ACK), retransmits lost packets, reorders delivery, and applies congestion control. Almost everything you think of as "the web" — HTTP, HTTPS, SSH, database connections — runs on TCP. The cost is overhead: handshake latency, head-of-line blocking, and bandwidth used for acknowledgments.

UDP (User Datagram Protocol) sends individual packets (datagrams) with no connection setup, no acknowledgment, and no ordering. Packets can arrive out of order, multiple times, or not at all. UDP is fast and minimal — perfect when you would rather drop a packet than wait for a retransmission. Real-time media (voice, video), gaming, DNS lookups, and many telemetry protocols use UDP.

QUIC, the protocol that powers HTTP/3, is built on UDP but adds reliability and ordering on top — getting most of TCP's safety with better recovery from packet loss and faster connection setup.

When to use

Use TCP for any workload where reliability and order matter (almost everything). Use UDP when low latency matters more than reliability — real-time media, gaming, telemetry.

Tradeoffs

TCP handshakes and head-of-line blocking add latency. UDP forces the application to handle reliability if it needs it, which is non-trivial.

Related terms

HTTP/2

A major revision of the HTTP protocol that introduces multiplexing, header compression, and server push over a single binary framing layer on TCP.

Latency

The time delay between a request being sent and a response being received — typically measured in milliseconds.

WebSocket

A persistent, bidirectional communication channel between client and server over a single TCP connection — the standard for real-time web features.

Reverse Proxy

A server that sits in front of one or more backend servers and forwards client requests to them, often handling TLS, caching, compression, and load balancing.

DNS

A hierarchical, distributed naming system that translates human-readable domain names like systemcity.io into IP addresses computers route to.