Differences between UDP and TCP

A diagram of the relationship between sequence...
Image via Wikipedia

This is another reminder post, I am afraid.

UDP – user datagram protocol – and TCP – transmission control protocol – are two transport layer protocols in the in internet stack.

UDP is a lightweight protocol and it’s key features are:

  • end to end (multiplexed and demultiplex via port numbers)
  • connectionless
  • message-orientated (ie each datagram is self-contained)
  • Best effort delivery
  • Arbitrary interaction – one application can send packets to many other applications at the same time

These characteristics make it good for applications such as streaming or broadcasting video or voice communications, where resending dropped packets would only degrade the application’s performance.

TCP’s key features are:

  • End to end (as with UDP)
  • Connection-orientated (although the IP layer underneath is fundamentally connectionless and packets are routed via switching, TCP layers connect via a three-way handshake)
  • Reliability, packets are guaranteed to be delivered without missing or duplicated date, being received as they were sent (or not at all)
  • Fully duplex
  • Stream orientated
  • Reliable startup (via three way handshake)
  • Graceful shutdown (as for startup)
%d bloggers like this: