TCP and UDP

TCP and UDP are network protocols that both deliver data. Both of these are similar, but have distinct differences.

TCP

TCP stands for Transmission Control Protocol and is established over an active connection. The protocol starts with a 3 way handshake: SYN ->SYN-ACK -> ACK before data is sent.

This protocol is designed to be extremely reliable, have error correction, and break messages into chunks. Generally TCP connections also have larger headers than UDP connections in order to check and guarantee its reliability.

The most common uses for TCP are http, email protocols, and file transfers. These types of transfers must be “lossless” because the end data must be complete and non-fragmented.

UDP

UDP stands for User Datagram Protocol. UDP does not establish a handshake before and does not guarantee delivery, ordering, or duplicate messages from being received.

The most common uses of UDP are streaming, video and audio delivery. Anything that could have acceptable “lossy” data will generally use UDP.

SSL/TLS