What is TCP and UDP? What is the difference between the two protocols?

Asked

Viewed 35,740 times

23

Whenever I come across some speed meter, or even when talking about streaming services like Streaming, these two terms are cited somehow, but what do they mean anyway? What’s the difference between the two?

  • 2

    Some extra information on the subject: https://answall.com/q/198252/101. Also related: https://answall.com/q/186437/101

2 answers

25


TCP and UDP are protocols part of a conceptual model (OSI model) that standardizes communication functions in computing divided into 7 layers.

http://slideplayer.com.br/slide/355743/2/images/13/Modelo+OSI+-+Processo+de+encapsulamento.jpg

TCP and UDP are in the transport layer that is responsible for the efficient, reliable and economical transfer of data between the source machine and the destination machine, regardless of the type, topology or configuration of the physical networks existing between them, ensuring that data still arrives without errors and in the correct sequence.

UDP

UDP is a suitable choice for real-time data streams, especially those that admit loss or corruption of part of their content, such as videos or voice (Voip). ...

TCP

...This is what most cybernetic applications, such as SSH, FTP, HTTP, are about - hence the World Wide Web. The transmission control protocol provides reliability...

The difference between them can be seen in headers:

inserir a descrição da imagem aqui

The TCP values the added reliability in your header flow control bits and receiving.

inserir a descrição da imagem aqui

Already the UDP dispenses with these control bits.

It can be said that the TCP is oriented to connection through your Acknowledgment and the UDP no, since a connection is not created, there is only direct sending of data.

18

In general terms - the protocol TCP divides the information to be transmitted into packets. These packets are sent to the destination and if any of them do not arrive, or arrive corrupted, the destination can request these packets again. Thanks to the header that the protocol defines on top of each package, the client can determine whether any of them are missing or not.

Already the protocol UDP also breaks information into smaller packets but does not take care of integrity or correction of losses. The data is sent and there is no way the customer knows if any has been lost or has been corrupted. This happens because in UDP, there is not a header as elaborate as the 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 the transmitted information, such as when downloading a file.

The UDP is lighter, but this lightness comes from the fact that it tolerates packet losses. Should be used in situations where this is not a big problem, such as online games, video streaming and voice streaming.

  • 4

    This detail gets sharper when dealt with the connection. The TCP works on a connection between the two terminals, and the transmitter only sends the packets when the connection is established, ensuring that the receiver is prepared to receive them. Already the UDP sends the packets "without pity"; if the receiver receives, better, if not, his problem.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.