- Think Like A Computer - https://www.think-like-a-computer.com -

TCP and UDP Differences

I’m not going to list ALL the differences between TCP and UDP but just the fundamental ones. This article will list them along with the pros and cons of each.

Main Characterises of TCP

Main Characteristics of UDP

When to Use TCP or UDP and Why

So now knowing the main differences between TCP and UDP you may have already worked out yourself that sometimes it is better to use UDP over TCP. TCP should be used when no packet loss is a requirement and the data must be correct free from errors. This is obviously useful when viewing web pages, Emails and most forms of networking communication we are used to. But what about video and music streaming? What about Live TV, Radio and VoIP?

Does it really matter if when you are on a VoIP call that part of that sentence you heard was lost? Do you need the VoIP system to re-transmit that one word that was lost or can you work out what it probably was? Or better still ask the person to repeat himself…If it was resent then it wouldn’t even make sense anyway. Imagine this phrase “Hi Adam my name is DARYL”. What if the packets that made up the word Adam was lost so they only heard “Hi [crackle or pause] my name is DARYL”. If the lost packets were then resent you would hear the missing word at the end and it would sound like “Hi [crackle or pause] my name is DARYL Adam”. See….there is no need to confirm packet delivery in this case therefore UDP is perfect for VoIP. The same applies for live TV or a radio broadcast. Do you really care if you missed one word in that entire song you were listening to? Would you rather listen to the rest of the song sounding as it should or be interrupted at certain intervals playing those lost words? No, it would be frustrating… With these types of data streams it doesn’t really matter if a packet or two is lost or even corrupted. By using UDP it makes the data streams faster because the overhead is less than TCP.