Which is better and why ??
UDP is faster as compare to TCP. still both have serve differently as according to purpose. still in terms of speed UDP is far ahead. as there is no error-checking for packets.also no 3 way handshaking is required in UDP . ex-UDP can be multicasted to multiple hosts whereas TCP cannot do this at all.
Based on application only we can decide which one to use. 1.UDP connection takes less time But for TCP synchronization is first needed so for delay sensitive aplication we should use UDP. 2.One very good advantages of TCP is he reorders the packets But UDP it will not do. 3.In VOIP if we lost some packets also no need to do retransmission but for data sensitive application like file transfer (HTTP) we need complete packets. 4.Because UDP we will use where we don't care when any packet missed means dont have to take care for retransmission if more users are there.But TCP has to care about each and every user's Packet missing.
still many are there as both has its importance By combining the features of TCP and UDP with extra added feature like multi streaming and multihomming SCTP made and it is also used.
UDP is connection less protocol, So there is no need of buffering, timer and acknowledge mechanism in both end. So, it is faster than TCP.
Ex: Voice service will use UDP. Mail service will use TCP.
Out of three prominent advance transport protocols (TCP, UDP and SCTP) which is the best to use and why should i use that protocol ?