UDP and TCP are modest communication protocols in TCP/IP protocol stack. UDP and TCP are located on the Transport layer. It is the lowest level of starting writing distributed systems. It is not about computer network but it is about distributed systems. Every distributed systems programmer needs to understand the distinguish between them very clearly. This article will show you the difference to clear all your doubt.
Before we start, I just remind you that Transport layer focuses on two end-systems meaning that source and destination. The packets may go through many router in order to get the destination. In other words, it is a multi-hop network which packets may transit in several node before they reach end destination.
- Unreliable connection
- Not guarantee messages delivery
- No acknowledgement scheme
- Not guarantee order of message delivery
- No message duplication mechanism
- Less overhead
- Better for multimedia streaming application
- Support multicast communication
The main special feature of TCP is Congestion control. It can maximize the bandwidth in any circumstance. The motto of TCP Congestion Control is “Slow starts exponentially increases“. It starts with sending one congestion window and exponentially increases its congestion windows. The congestion window will keep increasing as long as the threshold reaches. Once the threshold is reached, it starts linearly increasing until it gets timeout as it sucks up the bandwidth when congestion window getting higher. Once timeout reaches, it resets its congestion windows to 1 and lowers its threshold by half. Then it will starts its slogan, “Slow starts exponentially increases”, once again.