The short answer
TCP and UDP are transport protocols. They help applications move data between devices after IP routing has found a path across networks. TCP prioritizes reliable, ordered delivery of a stream of bytes. UDP sends independent datagrams with less built-in delivery management.
Neither is "better" in every situation. The right choice depends on what the application needs when packets are delayed, lost, duplicated, or delivered out of order.
Where TCP and UDP fit in the network stack
An IP address identifies a network endpoint. A port identifies the application or service at that endpoint. TCP and UDP use ports so a device can keep web browsing, calls, games, and other applications separate even when they share one IP address.
IP itself is a best-effort delivery protocol. It does not promise that every packet arrives. TCP and UDP sit above IP and make different choices about what to do with that reality.
This distinction is useful when reading about firewalls, routers, VPN protocols, or connection troubleshooting. A rule that permits TCP on one port does not automatically permit UDP on the same number.
How TCP works
TCP establishes a connection between two endpoints and maintains a reliable, ordered byte stream. It uses sequence numbers, acknowledgements, retransmission, flow control, and congestion control to handle the normal problems of packet networks.
If a TCP segment is lost, TCP can detect the loss and retransmit the missing data. If data arrives out of order, TCP presents it to the application in the correct order. If the receiver cannot keep up, flow control helps the sender avoid overwhelming it.
That behavior is valuable when the complete, correct result matters. Loading an HTML document, transferring a file, receiving an email message, or sending a database request are all common cases where missing or rearranged bytes would be a problem.
TCP has overhead because it tracks connection state and responds to network conditions. That is not wasted work; it is the cost of the guarantees it provides. The current core TCP specification is RFC 9293.
How UDP works
UDP sends self-contained datagrams. It includes source and destination ports and a checksum, but it does not provide connection setup, delivery acknowledgements, retransmission, or in-order delivery in the way TCP does.
That makes UDP a useful building block when an application wants to control those tradeoffs itself or values timely delivery over waiting for every older packet. Examples can include real-time voice, live games, DNS queries, and certain streaming workloads.
UDP does not mean that data is guaranteed to be lost, unordered, or insecure. It means UDP itself does not repair those conditions. An application can add sequencing, loss recovery, encryption, or reliability when needed. The basic UDP specification is RFC 768.
Is UDP faster than TCP?
This popular shortcut is incomplete. UDP has less protocol overhead and does not wait for TCP-style acknowledgements and retransmissions. In some applications, that can reduce delay or avoid waiting for data that is no longer useful.
But an application still has to send data across the same physical links and network path. If it needs reliability, it may implement its own acknowledgements and recovery, which adds work back in. TCP can also be very efficient for the workloads it was designed for.
A better question is: what does this application need when the network is imperfect? A video call may prefer a recent audio packet over an old one that finally arrived. A software download needs every byte, in order. Those are different requirements, not a simple speed contest.
QUIC shows that the choice is more nuanced
QUIC is a modern transport protocol that runs over UDP. It adds features including secure connection establishment, multiplexed streams, and loss recovery above UDP. It is used by HTTP/3.
This does not turn UDP into TCP or make TCP obsolete. It demonstrates that applications and protocols can build the behavior they need on top of a lightweight datagram transport. RFC 9000 defines QUIC as a UDP-based secure transport.
The practical lesson is that users should look at the full protocol and application design, not only the word TCP or UDP in a firewall log.
TCP, UDP, and VPNs
VPN protocols can use TCP or UDP, and the choice affects behavior under loss and congestion. WireGuard uses UDP. OpenVPN can use either UDP or TCP, depending on configuration. A VPN carried over TCP can be appropriate in some restricted networks, but putting one reliable stream inside another can create performance problems when packets are lost.
The transport protocol is only one part of a VPN's security and privacy properties. Encryption, authentication, routing, DNS handling, client behavior, and provider practices all matter. For the full connection path, read What Is a VPN and How Does It Actually Work?.
The takeaway
TCP is designed for reliable, ordered delivery. UDP is a simpler datagram transport that leaves more control to the application. Both are essential internet tools. Understanding their tradeoffs is more useful than treating one as automatically faster or more modern.