Networking Transport Layer: TCP vs UDP Protocols

๐—ง๐—ฟ๐—ฎ๐—ป๐˜€๐—บ๐—ถ๐˜€๐˜€๐—ถ๐—ผ๐—ป ๐—–๐—ผ๐—ป๐˜๐—ฟ๐—ผ๐—น ๐—ฃ๐—ฟ๐—ผ๐˜๐—ผ๐—ฐ๐—ผ๐—น (๐—ง๐—–๐—ฃ)

  • A heavy-weight connection-oriented protocol that treats the data as a stream of bytes.
  • Helps us to send data without errors or duplication and receive it in the same order as it is sent.
  • Uses handshake protocols like SYN, SYN-ACK, and ACK to guarantees the delivery of data to the destination. That's why it is highly reliable but slower in performance.
  • Performs error checking and error recovery.

๐—จ๐˜€๐—ฒ๐—ฟ ๐——๐—ฎ๐˜๐—ฎ๐—ด๐—ฟ๐—ฎ๐—บ ๐—ฃ๐—ฟ๐—ผ๐˜๐—ผ๐—ฐ๐—ผ๐—น (๐—จ๐——๐—ฃ)

  • A light-weight connectionless protocol that provides an unreliable datagram connection between applications.
  • There is no fixed order of the data transmission and data can be lost or duplicated.
  • Faster in performance but does not guarantee the delivery of data to the end destination.
  • Performs error checking but not error recovery.

Applications that use TCP - Gmail, World Wide Web, etc.
Applications that use UDP - Media Streaming application like YouTube, online multiplayer games, etc.

Similar Blogs

Enjoy Problem Solving

Subscribe to get free weekly content on DSA, Machine Learning and System Design. Content will be delivered every Monday.

ยฉ 2020 EnjoyAlgorithms, Inc. All rights reserved.