TCP vs UDP: The Real Difference, With Real-Life Examples

TCP and UDP are the two main transport protocols on the internet. TCP sets up a connection first, numbers every byte, resends anything lost and delivers data in order, so web pages, email and file downloads arrive complete. UDP just sends independent datagrams with no handshake, no retransmission and no ordering, which makes it lighter and lower in delay.

Jun 20, 2025 - 10:42
Updated: 
102.8k

Networking in IT Infrastructure · Comparison

TCP vs UDP: The Real Difference, With Real-Life Examples

Quick answer: TCP and UDP are the two main transport protocols on the internet. TCP sets up a connection first, numbers every byte, resends anything lost and delivers data in order, so web pages, email and file downloads arrive complete. UDP just sends independent datagrams with no handshake, no retransmission and no ordering, which makes it lighter and lower in delay. That suits DNS lookups, voice and video calls, live streaming and online games, where a late packet is useless anyway. Modern protocols blur the line: QUIC, used by HTTP/3, runs over UDP but adds its own reliability and encryption.

Key takeaways

  • TCP trades some delay for reliability; UDP trades reliability for low delay.
  • The choice depends on the application, not on which protocol is better.
  • DNS mostly uses UDP but switches to TCP for large responses and zone transfers.
  • QUIC rebuilds reliability on top of UDP for faster web connections.
  • Each protocol has typical attack patterns that defenders should monitor.

Table of Contents

What Do TCP and UDP Actually Do?

Both sit at the transport layer and use port numbers to reach the right application. The difference is how much care they take.

TCP (RFC 9293) opens a connection with a three-way handshake (SYN, SYN-ACK, ACK), tracks sequence numbers, acknowledges data, resends lost segments and slows down when the network is congested. Think of a courier who needs a signature for every parcel.

UDP (RFC 768) is only a few pages long. It adds ports, a length and a checksum to each datagram and sends it. Think of dropping postcards in a letterbox: fast and cheap, but nobody tells you if one goes missing.

How Do TCP and UDP Compare Side by Side?

FeatureTCPUDP
ConnectionHandshake before dataNone
ReliabilityAcknowledgements and retransmissionNone built in
OrderingGuaranteed in orderNot guaranteed
Header size20 bytes minimum8 bytes
Flow and congestion controlYesNo
Data unitByte streamIndividual datagrams
Broadcast and multicastNoYes
Best forCompletenessLow delay

Which Everyday Apps Rely on TCP?

  • Web browsing (HTTP/1.1 and HTTP/2): one missing byte would break a page or a script.
  • Email (SMTP, IMAP): a message must arrive whole.
  • File transfer and downloads (SFTP, HTTPS): a corrupted installer is worse than a slow one.
  • Remote access (SSH, RDP): every keystroke must arrive in order. RDP can also use UDP for smoother display.
  • UPI and online banking apps: transactions run over HTTPS, which until HTTP/3 means TCP.

Which Everyday Apps Rely on UDP?

  • DNS lookups: a single small question and answer; if lost, the client simply asks again.
  • Voice and video calls: media travels over RTP (RFC 3550), usually on UDP. Resending a lost word half a second later only makes the call worse.
  • Online gaming and live sports streams: the latest position matters more than an old one.
  • DHCP: a new device has no IP address yet, so it broadcasts over UDP.
  • NTP, SNMP and syslog: small, frequent messages.

Why Do DNS and QUIC Use Both Ideas?

DNS starts on UDP port 53, but RFC 7766 requires support for TCP too. Large answers, such as DNSSEC responses, get truncated over UDP and the client retries over TCP. Zone transfers always use TCP.

QUIC (RFC 9000) takes the opposite route. It runs over UDP but adds its own acknowledgements, retransmission, congestion control and built-in TLS 1.3. HTTP/3 (RFC 9114) runs on QUIC, so a lost packet delays only one stream instead of the whole page. This is why you may see UDP 443 traffic in firewall logs.

How Do Attacks Differ for TCP and UDP?

ThreatProtocolDefence
SYN flood (half-open connections)TCPSYN cookies, rate limits, DDoS protection
Session hijack or reset injectionTCPEncryption (TLS, SSH), randomised sequence numbers
Reflection and amplification (DNS, NTP, memcached)UDPClose open resolvers, BCP 38 source filtering
IP address spoofingMainly UDPIngress and egress filtering

Because UDP has no handshake, a spoofed source address goes unchecked. That is the basis of the amplification attacks described by CISA alert TA14-017A.

How Do You Choose Between TCP and UDP?

Ask one question: is late data still useful? If every byte must arrive, choose TCP. If fresh data beats complete data, choose UDP, or a UDP-based protocol like QUIC that adds only the reliability you need.

For the simplest explanation, read IP, TCP and UDP explained like I am 5, and to see how TCP manages connections, read about TCP communication flags. Build these skills in our CCNA and networking training.

References

Frequently Asked Questions

TCP is connection-oriented and guarantees ordered, complete delivery, while UDP sends independent datagrams with no delivery guarantee.

UDP usually has lower delay because it skips the handshake and retransmissions, but it does not guarantee that data arrives.

DNS normally uses UDP port 53, but it uses TCP for large responses, truncated answers and zone transfers between servers.

In a live call, resending a lost packet arrives too late to help, so low delay matters more than perfect delivery.

QUIC is a transport protocol that runs over UDP and adds reliability, congestion control and TLS 1.3 encryption. HTTP/3 uses it.

Neither encrypts data by itself. Security comes from protocols on top, such as TLS, SSH, DTLS or QUIC.

An attacker sends small spoofed requests to open UDP services, which send much larger replies to the victim and flood it.

Yes. DNS, RDP and many games use both, choosing UDP for speed and TCP when reliability or large transfers are needed.

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Wow Wow 0
Sad Sad 0
Angry Angry 0
Vaishnavi

Vaishnavi is a skilled tech professional at the Ethical Hacking Training Institute in Pune, responsible for managing and optimizing the technical infrastructure that supports advanced cybersecurity education. With deep expertise in network security, backend operations, and system performance, she ensures that practical labs, online modules, and assessments run smoothly and securely. Her behind-the-scenes contributions play a vital role in delivering a seamless and secure learning experience for aspiring ethical hackers.