TCP vs UDP
TCP is a connection-oriented protocol, whereas UDP is a connectionless protocol. A key difference between TCP and UDP is speed, as TCP is comparatively slower than UDP. Overall, UDP is a much faster, simpler, and more efficient protocol, however, retransmission of lost data packets is only possible with TCP.
TCP provides ordered delivery of data from user to server (and vice versa), whereas UDP is not dedicated to end-to-end communications, nor does it check the readiness of the receiver.
Features | TCP | UDP | |
---|---|---|---|
Connection | Requires an established connection | Connectionless protocol | |
Guaranteed delivery | Can guarantee delivery of data | Cannot guarantee delivery of data | |
Re-transmission | Re-transmission of lost packets is possible | No re-transmission of lost packets | |
Speed | Slower than UDP | Faster than TCP | |
Broadcasting | Does not support broadcasting | Supports broadcasting | |
Use cases | HTTPS, HTTP, SMTP, POP, FTP, etc | Video streaming, DNS, VoIP, etc |