TCP and UDP are protocols part of a conceptual model (OSI model) that standardizes communication functions in computing divided into 7 layers.
UDP is a suitable choice for real-time data flows, especially those that support loss or corruption of some of your content, such as video or voice (VoIP). ...
... it is on which most cybernetic applications, such as SSH, FTP, HTTP - hence the World Wide Web, are based. The Transmission Control Protocol provides reliability . ..
The difference between them can be seen in headers:
UDPisconnectionorientedthroughyour Acknowledgment and
TCP no, since a connection is not created, there is only direct sending of data.
In very general terms - the TCP protocol divides the information to be transmitted in packets. These packets are sent to the destination and, if any of them do not arrive, or arrive corrupted, the destination can request for those packets again. Thanks to the header that the protocol defines on top of each packet, the client can determine if any of them are missing or not.
The UDP protocol also breaks information into smaller packets but is not careful about integrity or loss correction. The data is sent and there is no way for the customer to know if any has been lost or if it has been corrupted. This happens because in UDP, there is no header as elaborate as TCP.
In practical terms, the TCP protocol is more robust and heavier. It should be used in situations where you want to ensure the integrity or absolute order of transmitted information, such as when downloading a file.
UDP is lighter, but this lightness comes from the fact that it tolerates packet loss. It should be used in situations where this is not a big problem, such as online games, streaming video and voice.