What is the difference between TCP and UDP?


TCP is a connection oriented protocol, which means that every time a packet is sent say from host A to B, we will get an acknowledgement. Whereas UDP on the other hand, is a connection less protocol.

Where will it be used: TCP -> Say you have a file transfer and you need to ensure that the file reaches intact, and time is not a factor, in such a case we can use TCP.

UDP-> Media Streaming, question is say you are watching a movie…would you prefer that your movie comes. Perfectly…. but u need to wait a long time before you see the next frame? or would you prefer the movie to keep streaming…Yes…The second option is defiantly better…. This is when we need UDP.