| TCP (Transmission Control Protocol) | UDP (User Datagram Protocol) |
|---|---|
| It is a connection-oriented protocol. | It is a connectionless protocol. |
| The connection should be established before the data is transmitted over the network. | It sends the data without checking whether the system is ready to receive it or not. |
| Delivery of data to the destination router is guaranteed. If the connection is lost during transferring files, the server would request the lost part. | It doesn’t guarantee the delivery of data to the destination. |
| The message will be delivered in the order it is sent. | The message may not be delivered in the same order. |
| It doesn’t support broadcasting. | It supports broadcasting. |
| Data is read as a stream. When one packet ends, another begins. | Data Packets are transmitted individually. |
| Header size is 20 bytes. | Header size is 8 bytes. |
| It is slower than UDP | UDP is faster and more efficient than TCP |
| This protocol is mainly used where a secure communication process is required. Example: web browsing and e-mail. | This protocol is used when fast communication is required. Example: VoIP, video, and music streaming. |