Network Bytes · Episode 13 · CCNA 1.5
TCP vs UDP
Both carry your data across the internet. TCP checks every delivery and resends what's lost; UDP just fires packets and keeps going. Here's when each one wins.
Two ways to deliver
Both TCP and UDP work at the transport layer (OSI layer 4). Their job is to carry data between programs on two devices, for example between your browser and a web server. They sit on top of IP, which gets each packet to the right address but makes no promises that it arrives.
The difference is how much care they take. Picture two delivery workers: one checks every parcel off on a clipboard, the other just throws the parcel and hopes it lands.
TCP: the careful one
TCP (Transmission Control Protocol) is connection-oriented. Before sending any data, the two sides set up a connection with a short exchange called the handshake.
Then TCP numbers every packet (sequence numbers), so the receiver can put them back in order. The receiver sends back acknowledgements, its way of saying "got it". If a packet goes missing and no acknowledgement comes back in time, the sender resends it. TCP also slows down when the network is busy, so it doesn't flood it.
The result: everything arrives, complete and in order. The cost is extra messages and extra waiting.
UDP: fire and forget
UDP (User Datagram Protocol) is connectionless. There's no setup, no "got it" and no resending. It puts a small header on each message and sends it straight away, as fast as the application wants.
If a packet is lost, UDP doesn't notice and doesn't care. That makes it lighter and quicker, with a much smaller header than TCP's and no waiting for replies. If an app needs some reliability on top, it has to add it itself.
Who uses what
- TCP: web pages, email and file downloads. One missing byte would break a page or corrupt a file, so every byte has to arrive.
- UDP: video calls, online games and live streams often use it. A packet that arrives late is useless anyway: the moment has passed. Better to skip it and keep going than freeze while waiting for a resend.
Try it yourself
On a Windows, Mac or Linux computer, open a terminal and run netstat -an. You'll see lines starting with TCP (or tcp) and UDP (or udp). The TCP lines have a state such as ESTABLISHED or LISTEN, because TCP keeps track of connections. The UDP lines have no state at all: there's no connection to track.
Good to know
- This is simplified. DNS lookups mostly use UDP, because they're tiny and a quick retry is cheaper than a connection, and they switch to TCP for large answers.
- HTTP/3, the newest version of the web's protocol, runs over QUIC, which is built on UDP but adds its own reliability and encryption. So "the web uses TCP" is true for HTTP/1.1 and HTTP/2, not for every page any more.
- "Often" matters for video: many streaming services, such as on-demand video, use TCP, while live calls and games lean on UDP.
For CCNA learners
This is CCNA 200-301 exam topic 1.5, compare TCP to UDP: know that TCP is connection-oriented with sequencing, acknowledgements and retransmission, that UDP is connectionless with none of these, and which kinds of apps suit each.
Test your knowledge
Quick quiz: TCP vs UDP
4 multiple-choice questions. Pick one answer for each, then check how you did.
Sources
- Cloudflare Learning Center, "What is TCP/IP?": TCP sets up a connection, numbers and confirms packets, and resends lost ones
- Cloudflare Learning Center, "What is the User Datagram Protocol (UDP)?": no handshake, no resending; used for video calls, gaming, live streams and DNS
- IETF, "RFC 9293: Transmission Control Protocol (TCP)": the TCP standard
- IETF, "RFC 768: User Datagram Protocol": the UDP standard
- Cisco, CCNA 200-301 v1.1 exam topics: 1.5 compare TCP to UDP
Video transcript
One protocol checks every delivery. The other just throws it and hopes.
Both carry your data across the internet. TCP is the careful one. It sets up a connection first, numbers every packet, and waits for the other side to say "got it." If a piece goes missing, it sends it again.
UDP skips all that. No setup, no "got it," no resending. It just fires packets as fast as it can, so it's lighter and quicker.
Web pages, email and downloads use TCP, because every byte has to arrive. Video calls, games and live streams often use UDP, because a late packet is useless anyway.
Need it perfect? TCP. Need it now? UDP.