TCP vs UDP: What the Difference Actually Means
TCP guarantees your bytes arrive complete and in order. UDP guarantees nothing and starts instantly. Here is why games, DNS, video calls, and now HTTP/3 run on the one everyone calls unreliable.
Tech Talk News Editorial
9 min readUpdated
Key takeaways
- TCP, defined in RFC 9293, provides a reliable, in-order byte stream by numbering every byte, opening each connection with a three-way handshake, and retransmitting anything that goes unacknowledged.
- UDP, defined in RFC 768 in 1980, has an 8-byte header and states that "delivery and duplicate protection are not guaranteed," so it adds no handshake, no ordering, and no retransmission.
- Use TCP when every byte must arrive, as with web pages, email, file transfers, and database queries. Use UDP when fresh data matters more than complete data, as with live video, voice calls, online games, and DNS lookups.
- HTTP/3 runs on QUIC (RFC 9000), which sits on UDP and rebuilds reliability per stream, so one lost packet no longer stalls every request the way it does with HTTP/2 over TCP. W3Techs measured HTTP/3 on 41.1% of websites in November 2026.
- UDP is not a worse TCP. RFC 8085 tells applications that need reliable delivery to implement it themselves, which is exactly the job QUIC took on.
On this page8 sections
TCP vs UDP comes down to one trade. TCP guarantees that your bytes arrive complete and in order, and charges you a handshake and some waiting for it. UDP guarantees nothing and starts sending immediately.
Use TCP when every byte has to arrive: web pages, email, files, database queries. Use UDP when old data is worthless: live video, voice calls, games, DNS lookups. Both sit on top of IP, the Internet Protocol, and between them they carry nearly everything you do online.
Most explainers stop at “TCP is reliable, UDP is unreliable.” That is true and it hides the interesting part. The unreliable one is under your video calls, your games, and since 2022 a growing share of the web itself.
Summary
Both protocols exist because IP drops packets
IP moves a packet from one address to another and promises nothing else. A packet can be lost, delayed, duplicated, or arrive after the one sent behind it, and IP does not notice.[1] It is a postal system that never confirms a delivery.
TCP and UDP are the two answers to “IP might drop my data, now what?” TCP says it will build a reliable layer and handle every failure for you. UDP says that is your decision, and here is the network back with almost nothing added.
TCP spends one round trip to buy a promise
TCP is connection-oriented. Before any data moves, the two ends run what RFC 9293 calls the three-way handshake, the procedure used to establish a connection.[2] Each side picks a starting sequence number and tells the other, so both can track every byte from then on.
TCP connection setup
Three messages before the connection is open
- Step 1Client to server
Client sends SYN
The client says it wants a connection (SYN, short for synchronize) and announces its starting sequence number.
- Step 2Server to client
Server replies SYN-ACK
The server acknowledges the client’s number and announces its own. This is the round trip the client waits out before it is allowed to send data.
- Step 3Client to server
Client sends ACK
The client acknowledges the server’s number. The connection is open, and this third segment can already carry application data.
Takeaway
The handshake costs one full round trip of waiting before the client can send data. On a 100 millisecond link, that is 100 milliseconds before the first request byte leaves, and it is paid again for every new connection.
Once the connection is open, TCP makes its promise. Every byte carries a sequence number. The receiver acknowledges what arrived. If an acknowledgment never comes, the sender retransmits, using a timeout the protocol recalculates as network conditions change.
Segments that arrive out of order get reassembled before your application sees them.[2] RFC 9293 sums it up in one sentence: TCP provides a reliable, in-order, byte-stream service to applications.
Your code never sees the mess underneath. That is the whole product, and it has a price. If one segment goes missing, every byte behind it waits for the retransmission before the application gets any of it. That stall is head-of-line blocking, and it is the cost of perfect ordering.
UDP sends the datagram and walks away
UDP is connectionless. There is no handshake and no session: you hand it a datagram addressed to an IP and port, and it goes. Jon Postel wrote the specification on 28 August 1980, and its own introduction says it provides “a minimum of protocol mechanism” and that “delivery and duplicate protection are not guaranteed.”[3]
The header shows how little is there. Source port (which is optional), destination port, length, and a checksum. That is eight bytes.[3] A TCP header is 20 bytes even when it carries no options.[2]
TCP
UDP
- Smallest header (bytes)208
- Round trips the client waits before sending data10
- Delivery guarantees the protocol gives you3 (ordered, complete, no duplicates)0
Takeaway
UDP is cheaper in bytes and in waiting, and it pays for that by giving up three guarantees. Whether that is a good deal depends entirely on what your application does with a packet that arrives late.
UDP's missing guarantees are a handoff, not a defect
The IETF's own guidance for people writing UDP applications is blunt. RFC 8085 says an application that needs reliable delivery must implement an appropriate mechanism itself, that it should control its own sending rate, and that it should handle duplicated datagrams gracefully.[4] UDP does not remove reliability. It moves the decision from the operating system to you.
That is the point for a lot of software. A video frame from two seconds ago is worthless. So is the position of a player who has already moved. Waiting for a retransmission of something stale is worse than dropping it and using the next fresh packet, and UDP lets the application make that call. TCP never will.
“The question is never which protocol is better. It is whether your data goes stale. If old data is useless, waiting for a resend is the wrong move.”
Pick by what a late packet is worth
Ask one question: does every byte have to arrive, or does fresh data beat complete data? Then follow the branch.
Decision flow
What your data needs decides the transport
What the data is like
- Every byte must arriveA missing byte corrupts the result
- Old data is uselessA late packet is worse than a dropped one
- One tiny question, one tiny answerA handshake would cost more than the exchange
Choose the transport
Default to TCP. Pick UDP for a concrete reason.
Where it lands
- TCPWeb pages, email, file transfer, database queries
- UDPLive video, voice calls, online games
- UDP, with TCP as backupDNS lookups
Defaults, not laws. Plenty of games use TCP for chat, and plenty of file tools build on UDP.
DNS shows the pattern clearly. RFC 1035 limits DNS messages carried over UDP to 512 bytes, so an ordinary question and answer each fit in one packet with no connection setup. If the answer does not fit, the server flags it as truncated and the client asks again over TCP, where every message gets a two-byte length prefix.[5]
If a UDP answer never arrives, the resolver just asks again. When that retry loop fails for you, the symptom is the one covered in DNS server not responding, and the mechanics behind it are in what DNS is.
| Property | TCP | UDP |
|---|---|---|
| Connection | Three-way handshake first | None, just send |
| Delivery | Acknowledged, retransmitted if lost | Not guaranteed |
| Ordering | Sequence numbers, delivered in order | None |
| Header size | 20 bytes minimum | 8 bytes |
| Data model | Continuous byte stream | Separate datagrams |
| Flow control | Built in (receive window) | None, the application decides |
| Typical use | Web, email, files, databases | Video, voice, games, DNS, QUIC |
The web moved to UDP because TCP stalls unrelated requests
For two decades the web was TCP. HTTP/1.1 and HTTP/2 both ride on it. HTTP/2 made things faster by packing many requests onto one connection, and that created a new problem.
RFC 9114 describes it plainly: TCP cannot see the separate requests inside the connection, so a lost or reordered packet makes every active transaction stall, including ones the lost packet had nothing to do with.[6]
The fix is QUIC, standardized in RFC 9000 in May 2021 as a UDP-based, multiplexed, secure transport.[7] It runs on UDP because that is the one transport middleboxes already pass through and kernels do not need to change for.
Then it rebuilds what the web needs in user space: flow-controlled streams, acknowledgments, retransmission, and congestion control. Each stream is reliable on its own, and the RFC says QUIC does not order bytes across different streams, so a loss on one stream leaves the others moving.[7]
QUIC also folds the TLS 1.3 handshake into its own. RFC 9001 says that, absent packet loss, most new connections can be established and secured within a single round trip.[8] With TCP plus TLS you do the transport handshake first and the security handshake after.
HTTP/3, published as RFC 9114 in June 2022, is HTTP carried over that.[6] W3Techs measured it on 41.1% of websites in November 2026.[9] The security half of that story is in HTTP vs HTTPS, and the round trips it removes are the same ones a CDN works to shave off.
Why this matters
My rule: start with TCP, leave it for a reason you can name
Here is how I think about it. TCP and UDP are not a quality ladder. TCP is a finished reliability system you can take for free. UDP is a blank slate.
When I build an API, a service, or a database client, I use TCP, because ordered delivery is exactly what those need and the operating system already did the hard part. Writing your own retransmission logic to save a handshake is a classic way to spend a month and end up with a worse TCP.
I reach for UDP when stale data is genuinely worthless, when the exchange is so small that a handshake costs more than the payload, or when I need delivery rules TCP cannot express, which is the QUIC case. Outside those three, I trust the boring default.
And please retire the habit of using “unreliable” as an insult. It is the same pattern that makes IP, which is dumber than both, the foundation of the whole network.
If latency is what you are actually chasing, the trade-offs are broken out in latency vs bandwidth. A cable such as the one in what an Ethernet cable does carries TCP, UDP, and QUIC without caring which, and that indifference is why all three work.
UDP was never the weak sibling. It was the clean foundation the clever protocols got built on.
Sources and further reading
- 1.PrimaryMDN Web Docs, "TCP/IP". IP handles addressing and routing but is unreliable on its own; TCP and UDP are the transport protocols layered on top of it.
- 2.PrimaryIETF, RFC 9293, "Transmission Control Protocol (TCP)". Three-way handshake (section 3.5), reliable in-order byte stream (section 2.2), sequence numbers, retransmission and the retransmission timeout (section 3.8), 20-byte header without options (section 3.7.1).
- 3.PrimaryIETF, RFC 768, "User Datagram Protocol" (J. Postel, 28 August 1980). Minimum protocol mechanism; delivery and duplicate protection are not guaranteed; header of source port, destination port, length, and checksum, with a minimum length of eight octets.
- 4.PrimaryIETF, RFC 8085, "UDP Usage Guidelines". Applications that need reliable delivery must implement it themselves; senders should control their datagram rate; applications should handle duplication gracefully.
- 5.PrimaryIETF, RFC 1035, "Domain Names - Implementation and Specification". Messages carried by UDP are restricted to 512 bytes (section 4.2.1); over TCP, each message is prefixed with a two-byte length field (section 4.2.2).
- 6.PrimaryIETF, RFC 9114, "HTTP/3" (M. Bishop, June 2022). HTTP/2 over TCP stalls all active transactions when a packet is lost or reordered; HTTP/3 delegates reliability per stream to QUIC.
- 7.PrimaryIETF, RFC 9000, "QUIC: A UDP-Based Multiplexed and Secure Transport" (May 2021). QUIC packets are carried in UDP datagrams; flow-controlled streams; no ordering guarantee between bytes on different streams.
- 8.PrimaryIETF, RFC 9001, "Using TLS to Secure QUIC". QUIC carries the TLS 1.3 handshake; absent packet loss, most new connections can be established and secured within a single round trip.
- 9.DataW3Techs, "Usage statistics of HTTP/3 for websites," November 2026. HTTP/3 is used by 41.1% of all websites.
Frequently asked questions
6 questions
What is the difference between TCP and UDP?
TCP guarantees that data arrives complete and in order, and UDP does not. TCP opens a connection with a three-way handshake, numbers every byte, waits for acknowledgments, and retransmits lost data. UDP sends independent datagrams with an 8-byte header and never checks whether they arrived. The trade is reliability against speed and overhead.
Why is UDP faster than TCP?
UDP is faster because it skips the handshake, the acknowledgments, and the retransmissions. A UDP sender can transmit its first datagram with zero setup round trips, while a TCP client waits one round trip for the handshake before sending data. UDP also has a smaller header, 8 bytes against at least 20 for TCP. The cost is that lost, duplicated, or reordered datagrams are the application's problem.
Is TCP or UDP better for gaming?
UDP is usually better for real-time games, because a position update that arrives late is worthless and a TCP retransmission would stall every update behind it. Games that use UDP typically send the newest state constantly and add their own lightweight reliability for the few messages that must arrive, such as a purchase or a match result. Turn-based and chat features can use TCP without trouble.
Does DNS use TCP or UDP?
DNS uses UDP first and falls back to TCP. RFC 1035 limits DNS messages carried by UDP to 512 bytes, so a normal query and answer fit in one packet with no handshake. When an answer is too large for the channel, the server sets a truncation flag and the client retries over TCP, where each message is prefixed with a two-byte length field.
Does HTTP use TCP or UDP?
HTTP/1.1 and HTTP/2 run on TCP, and HTTP/3 runs on QUIC, which is built on UDP. RFC 9114 explains why: with HTTP/2 over TCP, a lost or reordered packet stalls every active request on the connection, while QUIC provides reliability per stream so only the affected stream waits.
Can UDP be made reliable?
Yes, but the application has to do it. RFC 8085 says applications that need reliable message delivery must implement a suitable mechanism themselves. QUIC is the largest example: it runs on UDP and adds acknowledgments, retransmission, ordered streams, and congestion control in user space.
Keep reading
Written by
Tech Talk News Editorial
Computer engineering background. Writes about software, AI, markets, and real estate, and the places where the three meet.
About Tech Talk News

