TCP vs UDP: transport differences and practical examples
A file download must arrive complete and in order; a voice call would sooner skip a lost fragment than wait for it. That difference is why the Internet has two main transport protocols. TCP gives an application an ordered byte stream with acknowledgements and retransmission. UDP sends individual datagrams without those guarantees. Neither is automatically better: the application’s requirements decide.
What TCP does for an application
TCP establishes a connection between the two endpoints before any application data is exchanged. It numbers what it sends, retransmits data that goes missing and delivers bytes to the receiving application in order. Flow control and congestion control keep a sender from overwhelming the receiver or the network. These properties suit files, email and many web connections. They do not imply encryption: a separate security protocol such as TLS is needed to protect the content.
The price of reliability: waiting and framing
When a segment is lost, the application may have to wait for the missing bytes before it can process later ones that have already arrived. That is appropriate for a document that must arrive intact, but it adds delay to interactive traffic.
TCP also does not preserve message boundaries. Two writes by the sender need not appear as two reads at the receiver, because TCP only promises a stream of bytes. The application must define how its messages are framed, for example with a length prefix or a delimiter.
What UDP leaves to the application
UDP preserves datagram boundaries and does not establish a TCP-style connection. UDP itself does not acknowledge delivery, reorder packets or retransmit missing data. An application built on UDP can add those features when it needs them, along with congestion control and encryption. DNS commonly uses UDP for queries, where one small question gets one small answer. QUIC runs over UDP and still implements reliable streams and modern security at a higher layer.
Why calls and games often use UDP, and why that does not make them fast
For live speech or a game, a very late packet may be less useful than the next timely one. Some applications therefore choose to manage loss and deadlines themselves. Using UDP does not make a congested network fast, because queues and drops affect either transport. Measure the actual application and do not assume that the protocol name predicts performance. To check from an outside point that a host is reachable, with the latency and the route to it, run 2ip ping and traceroute; it measures the path, not your application’s transport.
TCP 443 and UDP 443 are different endpoints
Both protocols use port numbers, but TCP port 443 and UDP port 443 identify different endpoints. A TCP port check therefore cannot prove that a UDP service on the same number works.
The web shows the split in practice. HTTP/1.1 and HTTP/2 normally use TCP with TLS, while HTTP/3 uses QUIC over UDP. When UDP connectivity fails, a client may use a TCP-based HTTP version, so the page still loads; the exact result depends on both endpoints.
Choosing a transport for your own application
Start with what the application needs: complete delivery, ordering, message boundaries and time limits. Then check what the network supports and what security requires, since some networks filter UDP more strictly than TCP. The specifications for TCP and UDP define the service each transport provides.