Middle
What data transfer protocols do you know? How do TCP and UDP differ? Where is UDP used?
sobes.tech AI
Answer from AI
There are different data transfer protocols, among which the most common are TCP and UDP.
-
TCP (Transmission Control Protocol) — connection-oriented, provides reliable, ordered delivery of data. Uses acknowledgments, retransmission in case of packet loss, flow control.
-
UDP (User Datagram Protocol) — connectionless, does not guarantee delivery, order, or integrity of packets. Faster and lighter than TCP.
Differences between TCP and UDP:
| Characteristic | TCP | UDP |
|---|---|---|
| Reliability | High (acknowledgments) | None |
| Connection | Established | None |
| Speed | Slower | Faster |
| Delivery order | Guaranteed | Not guaranteed |
Where UDP is used:
- Video conferencing and VoIP — speed is important, small losses are acceptable.
- Online games — minimal latency is more important than reliability.
- DNS queries — short requests where speed is crucial.
- Media streaming (streaming).
UDP is suitable for applications where minimal delay is important and data loss is acceptable.