TCP vs. UDP
TCP and UDP are two common ways that data travels across a network, each with a different tradeoff between reliability and speed.
What You'll Learn
- What TCP is used for
- What UDP is used for
- The tradeoff between reliability and speed
TCP: Reliable Delivery
TCP (Transmission Control Protocol) checks that data arrives completely and in the correct order, resending anything that's lost. This reliability makes it ideal for things like loading web pages or sending emails, where missing data would be a problem.
UDP: Speed Over Guarantees
UDP (User Datagram Protocol) sends data quickly without checking that it all arrives, making it faster but less reliable. It's commonly used where speed matters more than perfect accuracy.
Example
Video calls and online games often use UDP: a dropped frame here and there is barely noticeable, but waiting for retransmission would cause noticeable lag.
Key Concepts
Key Takeaways
- TCP guarantees reliable, ordered delivery of data
- UDP prioritizes speed over guaranteed delivery
- The right choice depends on whether reliability or speed matters more
Knowledge Check
Which protocol is generally used when reliable, complete delivery matters most?