Question:
what is the main difference between UPD and TCP protocol? is is that UDP drop packets and TCP doesnt?
anonymous
2012-04-12 06:58:43 UTC
what is the main difference between UPD and TCP protocol? is is that UDP drop packets and TCP doesnt?
Five answers:
Andrew S
2012-04-12 07:49:09 UTC
UDP doesn't drop packets - its tries to deliver the data as best it can. What UDP doesn't do is actively hunt down errors - if a packet is lost due to garbled transmission there is no automatic recovery mechanism. Rather it is up to to the applications to take corrective action.



TCP does guarantee that the data will be received but it does this because is it a connection orientated protocol that is the real difference. In UDP each message exist in isolation., in TCP a connection is established first - the first computer asks the second "are you ready to talk?" and the second responds "OK, let's talk". The "conversation" then persists until one or the other computer states that it is finished with. The error correction is simply a natural part of managing that conversation.



Considered another way, UDP is like sending a postcard through the mail - the message you want to send and who is to receive it is all sent as one unit. If you don't receive a reply back in response you don't know what has happened - it could never have been received, they may simply have not replied to it, or the reply got lost on the way back. After a while you may decide that you are not going to receive a reply and send another card asking "Did you get my first card? Here is what I wrote..."



TCP is more like a phone call - a "connection" between the two parties is established first. You pick up the phone, dial the number you want and wait for someone to answer. When they do you can begin communicating with each other and what you say is going to be heard by the other party. When the conversation is over you both hang up. TCP uses an essentially similar mechanism.



Where the metaphor falls down is in the speed of the communication. In contrast to the mail vs a phone call UDP is generally faster. Both use the same underlying medium so individual messages travel at the same speed. However, TCP requires additional messages to be sent to set up the connection in the first instance, monitor it as it progresses and recover any parts of the "conversation" that went missing. This slows it down compared to UDP.
anonymous
2012-04-12 07:30:55 UTC
Both are Network layer Protocol.

UDP packets do not follow dedicated path but TCP packet follow virtual dedicated path.

So,UDP packets do not give guaranteed to reach destination but TCP give guarantee to reach destination.

But we use UDP because they are faster than TCP.UDP does not have error handling mechanism and reverse acknowledgement.



Because of all this reasons, We send E-mail through TCP and Live Streaming through UDP.



In other word we say that,UDP packets acts as Postal office letters and of no assurance of delivery.

TCP packets acts as Electronic mails and assurance of delivery.
Adrian
2012-04-12 07:09:19 UTC
Simple answer is that UDP is more of a "broadcast" protocol, and does not require acknowledgment of any packet receipt. Lost packets for UDP are not re-sent. TCP requires all packets to be acknowledged. Any lost packets are re-sent.
anonymous
2012-04-12 07:02:30 UTC
Haha, are you applying for the Open DNS testing thingy?
anonymous
2012-04-12 07:07:17 UTC
See http://www.skullbox.net/tcpudp.php


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...