Sobes.tech
Middle+

Why does HTTP operate over TCP and not UDP?

sobes.tech AI

Answer from AI

HTTP works over TCP, not UDP, because TCP provides reliable, ordered, and verified delivery of data, which is critical for the proper functioning of web applications.

Main reasons:

  • Reliability: TCP guarantees delivery of all packets, retransmitting lost ones.
  • Order: TCP ensures that data arrives in the same order it was sent.
  • Flow and congestion control: TCP regulates the transmission rate, preventing network overload.

UDP is a connectionless protocol, does not guarantee delivery or order, which can lead to data loss or corruption. For HTTP, it is important that requests and responses are complete and sequential, so TCP is more suitable.

In some cases, such as streaming video or gaming, UDP is used where speed is more important than 100% reliability.