Back to Articles
Cloud & Network6 min readHow Internet Requests Actually Work · Part 4 of 8

TCP vs UDP: Connections, Reliability, and Real-Time Traffic

Learn how the TCP handshake creates reliable ordered communication, why UDP uses simpler datagrams, and how applications choose between reliability, latency, and control.

TCPUDPTransport LayerQUICNetworking

After routing identifies a path, applications need a way to carry data between endpoints. TCP and UDP are major transport protocols, but they offer different contracts to the software above them.

Diagram 1

TCP vs UDP

TCP supplies an ordered reliable stream, while UDP supplies simpler datagrams that applications can handle according to their timing needs.

TCP Creates a Reliable Byte Stream

TCP is connection-oriented. The endpoints establish state with a three-way handshake: the client sends SYN, the server replies with SYN-ACK, and the client confirms with ACK.

Client SYN -> Server SYN-ACK -> Client ACK -> Application data

The handshake confirms both directions are reachable and establishes sequence state. It is not an HTTP exchange and does not encrypt anything. HTTP/1.1, HTTP/2, SSH, and many database protocols use TCP; TLS can run above it to secure their traffic.

What Reliability Requires

IP packets may be lost, duplicated, delayed, or delivered out of order. TCP numbers data, acknowledges progress, retransmits missing portions, reorders received data, and presents an ordered byte stream. Flow control protects the receiver, while congestion control adapts sending behavior to network conditions.

Reliability has a cost. Endpoints keep state, acknowledgements consume traffic, retransmissions take time, and ordered delivery can make later data wait behind an earlier missing portion.

UDP Sends Independent Datagrams

UDP has no TCP-style handshake. An application sends a datagram to an address and port, and UDP does not promise that it will arrive, arrive once, or arrive in order. That smaller contract gives applications more control over timing and recovery.

  • DNS commonly uses UDP for queries that fit, with TCP available when needed.
  • Voice, games, and live media may prefer fresh data over retransmitting information that is already late.
  • Telemetry may accept an occasional missing reading when another arrives soon.
  • Applications that cannot lose information must add acknowledgement and retry or use a reliable transport.

UDP Does Not Mean an Unreliable Application

QUIC, used by HTTP/3, runs over UDP but implements secure connections, reliability, congestion control, and independent streams above it. UDP does not make those features impossible; it simply does not provide them itself.

TCP
Reliable, ordered byte-stream transport with connection state and retransmission.
UDP
Independent datagrams with no built-in delivery or ordering guarantee.
QUIC
A secure modern transport implemented over UDP and used by HTTP/3.

Choose by failure behavior

Ask what the application should do when data is delayed, lost, duplicated, or reordered—not which protocol is universally better.

Series

How Internet Requests Actually Work

An eight-part beginner series tracing internet communication from an HTTP request through DNS, IP, ports, transport protocols, packets, network devices, server infrastructure, security, and troubleshooting.

Part 4 of 8
About the Author

Nikhlesh Yadav is a Technical Lead and Solution Architect with 12+ years of experience across cloud-native systems, distributed platforms, AI integrations, Web3, and cyber security.

Read full profile