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.
TCP vs UDP
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 WorkAn 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.
HTTP Requests: Methods, URLs, Headers, and Bodies
Start at the application layer and understand what a browser or API client is actually asking for.
DNS, Domain Names, and IP Addresses
Follow the lookup that turns a human-friendly hostname into a network destination.
Public IP, Private IP, NAT, and Ports
See how local devices reach the internet and how operating systems identify each service and flow.
TCP vs UDP
Compare reliable byte streams with simpler datagrams and understand where each transport fits.
Packets, Network Layers, Switches, and Routers
Learn how data is encapsulated and moved across local links and routed networks.
The Complete Website Request Journey
Put the layers together from the browser to production infrastructure and back again.
HTTPS, TLS, and HTTP Status Codes
Understand secure transport, certificate checks, and the response codes used during debugging.
Troubleshooting, Localhost, Cloud, and Containers
Apply the model with diagnostic tools and carry it into cloud and container environments.
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