SaveMyCert
Cloud basics

TCP vs UDP: what is the difference?

TCP and UDP are the two main transport protocols of the internet: TCP is connection-oriented and reliable, establishing a connection and guaranteeing that data arrives complete and in order, while UDP is connectionless and best-effort, sending data with less overhead but no delivery guarantee. TCP suits things where every byte matters, like web pages, email and file transfers. UDP suits things where speed and low delay matter more than perfection, like live voice and video, gaming and DNS lookups. Neither is better overall; they make opposite trade-offs. This guide explains each and when to use which.

What TCP does

TCP (Transmission Control Protocol) sets up a connection between two endpoints before sending data and then manages the conversation carefully. It numbers the data, checks that it arrives, retransmits anything lost and delivers it to the application in the right order. It also adapts its sending rate to avoid overwhelming the network. The result is reliability, at the cost of extra setup and bookkeeping, which adds some delay.

What UDP does

UDP (User Datagram Protocol) simply sends independent packets, called datagrams, with no connection set-up, no delivery confirmation and no ordering guarantee. Packets can arrive out of order, be duplicated or go missing, and UDP itself will not tell the application or fix it. That sounds like a weakness, but it makes UDP light and fast, and it lets applications decide for themselves how to handle loss, if at all.

Side by side

In practice, the two differ along these lines, with no performance numbers since results vary by network:

  • Connection: TCP is connection-oriented; UDP is connectionless.
  • Reliability: TCP guarantees delivery by retransmitting lost data; UDP is best-effort with no guarantee.
  • Ordering: TCP delivers data in order; UDP does not preserve order.
  • Overhead and speed: TCP has more overhead and added delay; UDP has less overhead and lower delay.
  • Typical uses: TCP for web, email and file transfer; UDP for live video and voice, gaming and DNS.

When each is used

Use TCP when correctness matters more than the last few milliseconds: loading a web page, sending an email or downloading a file would be useless with missing pieces. Use UDP when fresh data beats complete data: in a live call, a retransmitted packet from a moment ago is worse than skipping it, and a game needs the latest position rather than a perfect history. DNS lookups, covered in our what is DNS guide, are small request-and-reply exchanges that suit UDP’s low overhead. Some applications build their own reliability on top of UDP when they want a custom balance.

In the cloud and in cert study

The choice shows up in cloud networking, because load balancers and firewalls are configured by protocol. Our what is a load balancer and ALB vs NLB guides explain how layer 7 and layer 4 balancers differ, and why network-level balancers handle TCP and UDP traffic where application-level ones focus on web protocols. Kubernetes services and security groups also let you specify the protocol. Our /revision library covers that networking syllabus lesson by lesson.

Ready to start studying — free?

Original practice questions, timed mock exams and revision notes. No card, nothing to pay.

Jump straight into an exam
SAA-C03KCNA

Questions, answered

TCP is connection-oriented and reliable: it guarantees delivery and order. UDP is connectionless and best-effort: it is faster with less overhead but does not guarantee delivery or ordering.

Sources

Exam details in this post come from the vendor's published exam guide, which is the authority on what is tested and how.

Keep reading

Cloud basics
What is a SIEM? Security information and event management
Cloud basics
What is incident response? The lifecycle explained
Cloud basics
What is malware? Types, how it spreads and how to defend
Cloud basics
What is penetration testing? Ethical hacking explained