UdpClient vs TcpClient

What is the difference between UdpClient and TcpClient? When should Tcp and Udp be used in terms of software architecture? I hope I explained it correctly.

+6
source share
4 answers

Basically,

  • UDP is faster than TCP because packets are sent without a delivery or order guarantee
  • TCP is more secure as each packet is acknowledged and ordered

You should read these links:

+10
source

Comparing TCP and UDP - Using

  • TCP is used for non-urgent critical applications.
  • UDP is used for games or applications requiring fast data transfer. UDP stateless is also useful for servers that respond to small requests from a huge number of clients.

Comparing TCP and UDP - Function

  • How a message breaks through the Internet from one computer to another. This compound is based.
  • UDP is also a protocol used to send or transmit messages. This is not a connection based on the fact that one program can send a packet load to another, and this will be the end of the relationship.

TCP vs UDP comparison - Acronym for

  • Transmission Control Protocol
  • User Datagram Protocol or Universal Datagram Protocol

Comparing TCP and UDP - Weight

  • TCP requires three packets to establish a socket connection before any user data can be sent. TCP handles reliability and congestion control.
  • UDP is lightweight. There is no ordering messages, no tracking connections, etc. This is a small transport layer created over IP.

Comparing TCP and UDP - Streaming Data

  • Data is read as a byte stream, no distinguishing features are transmitted to the boundaries of the signal messages (segments).
  • Packets are sent individually and checked for integrity only if they arrive. Packets have certain boundaries that are executed upon receipt, that is, a read operation on the recipient's socket will give a complete message, since it was originally sent.

Comparing TCP and UDP - Transmission Rate

  • TCP speed is slower than UDP.
  • UDP is faster because packet checking for packets is missing.

Comparing TCP and UDP - Examples

  • HTTP, HTTP, FTP, SMTP Telnet, etc.
  • DNS, DHCP, TFTP, SNMP, RIP, VOIP, etc.

Comparing TCP and UDP - Data Reliability

  • There is an absolute guarantee that the transmitted data remains intact and arrives in the same order in which it was sent.
  • There is no guarantee that sent messages or packages will be available at all.

Comparing TCP and UDP - Reliability of Connection

  • Two-way connection reliable
  • one way connection Reliability

Comparing TCP and UDP - Ordering

  • TCP reorders data packets in that order.
  • UDP does not order packets. If an order is required, it must be managed by the application layer.

Comparing TCP and UDP - error checking

  • TCP performs error checking
  • UDP does not have the ability to check for errors.

Comparing TCP and UDP - Header Size

  • The size of the TCP header is 20 bytes.
  • The size of the UDP header is 8 bytes.

A short comparison. Must have a book.

+14
source

UDP and TCP are two different protocols.

Basically, you almost always want to use TCP unless you have a very good reason.

UDP is a very simple protocol on top of the IP protocol and only adds simple checks if the data is not corrupted.

TCP, on the other hand, is much more complex, but also much more reliable, because it ensures that you are entering the data, doing the right thing and things, such as congestion control.

+2
source

To summarize TCP, where you don’t want to lose data (send data) Real-time live streaming, such as video, we don’t want lost packets to be repeated in real time, so use UDP

0
source

Source: https://habr.com/ru/post/885495/


All Articles