Why does the UDP protocol not support streams like TCP protocol does?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Others have given perfectly good answers, but I think an analogy may help.
Imagine that UDP is a bit like a mailman – putting letters through people’s doors, but never checking that they actually see the letter, or that the person even exists. This is cheap, and works well for junk mail send to many people (read: broadcast packets).
TCP is more like a messenger who will knock on your door and deliver a message in person. If you’re not in, he’ll come back and try a bit later. Eventually, you’ll get the message – or the messenger will know that he hasn’t delivered it. You can also send a message back to the sender via the messenger.
Don’t try to read too much into my analogy – it’s not like there’s actually a single ‘messenger’ in TCP – but it might help in terms of thinking about things. In particular, imagine you were sending a whole series of letters to someone, which they had to read in order – that can’t work (reliably) with a mailman, as you might come down to find 10 letters sitting on your doormat, with no idea what order to read them in. The mailman might have dropped a few on the way, as well – and no-one will know. That’s not a suitable basis for a reliable stream.
(On the other hand, it’s a fine model for newspaper distribution. If you happen to miss a few, that’s not a problem – you’ll still get the later ones, which will be more interesting to you by then. That’s why some streaming media solutions use UDP, despite it not giving a reliable actual stream.)