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.

More from EnjoyAlgorithms

Self-paced Courses and Blogs