Middle+
What is the difference between TCP and UDP? Why is TCP used for HTTPS?
sobes.tech AI
Answer from AI
TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) are transport protocols that differ in several key parameters:
- TCP provides reliable, connection-oriented data transfer. It guarantees the delivery of packets in the correct order, implements error checking, and retransmits lost data.
- UDP is connectionless, does not guarantee delivery or order of packets, but is faster and has lower overhead.
HTTPS uses TCP because:
- HTTPS requires reliable data transfer to ensure integrity and security (TLS/SSL encryption is built on top of TCP).
- TCP guarantees that all data will be delivered and in the correct order, which is critical for the proper functioning of the protocol.
UDP is mainly used where speed is important and losses are acceptable (e.g., video streaming, gaming).