Sobes.tech
Junior

Ποια είναι η διαφορά μεταξύ των πρωτοκόλλων TCP και UDP;

sobes.tech AI

Απάντηση από AI

TCP (Transmission Control Protocol):

  • Reliable: Guarantees delivery of packets, retransmits lost packets, maintains order. Uses acknowledgments and timers.
  • With connection establishment: Requires a "three-way handshake" to start data exchange.
  • Stream-oriented: Data is transmitted as a continuous stream of bytes.
  • Slow: Overheads for connection setup and delivery guarantees make it slower than UDP.
  • Applications: HTTP/HTTPS, FTP, SMTP, Telnet.

UDP (User Datagram Protocol):

  • Unreliable: Does not guarantee delivery, order, or absence of duplicates.
  • Without connection establishment: Does not require a "handshake".
  • Datagram-based: Data is sent in separate packets (datagrams).
  • Fast: Low overhead ensures high speed.
  • Applications: DNS, DHCP, streaming audio/video, online games.
Characteristic TCP UDP
Reliability High (guarantees delivery and order) Low (no guarantees)
Connection establishment Yes (three-way handshake) No
Data transmission Stream-based Datagram-based
Speed Slower Faster
Error control Yes No (header checksum only)
Order guarantee Yes No
Flow control Yes No