Difference between TCP and UDP protocols.

Transport layer protocols that follow IP in the hierarchy are used to transfer data between application processes in network nodes. A data packet received from one computer to another via the Internet must be transferred to a processing process, and precisely for a specific purpose. The transport layer assumes responsibility for this. There are two main protocols at this layer - TCP and UDP.

Definition

TCP - transport protocol for data transmission in TCP / IP networks, which preliminarily establishes a connection to the network.

UDP is a transport protocol that transmits datagram messages without the need to establish a connection on an IP network.

Comparison

The difference between TCP and UDP is the so-called “delivery guarantee”. TCP requires a response from the client to which the data packet was delivered, a confirmation of delivery, and for this it needs a pre-established connection. Also, TCP is considered reliable, while UDP has even received the name “untrusted datagram protocol. TCP eliminates data loss, duplication and mixing of packets, delays. UDP allows all of this, and does not require a connection to work. Processes that send data over UDP must make do with received, even lossy ones. TCP monitors the congestion of the connection, UDP does not control anything except the integrity of the received datagrams.

On the other hand, due to this indiscriminate and uncontrolled nature, UDP delivers data packets (datagrams) much faster, therefore, for applications that are designed for high bandwidth and fast exchange, UDP can be considered the optimal protocol. These include network and browser games, as well as streaming video viewers and applications for video communication (or voice): from packet loss, complete or partial, nothing changes, you do not have to repeat the request, but the download is much faster. The TCP protocol, being more reliable, is successfully used even in mail programs, allowing you to control not only traffic, but also the length of the message and the speed of traffic exchange.

Conclusions TheDifference.ru

  1. TCP guarantees delivery of data packets unchanged, sequence and lossless, UDP does not guarantee anything.
  2. TCP requires a pre-established connection, UDP does not require a connection.
  3. UDP provides higher data rates.
  4. TCP is more reliable and controls the communication process.
  5. UDP is preferred for programs playing streaming video, videophone and telephony, network games.
.