Saturday, September 11, 2010

ADVANTAGES AND DISADVANTAGES OF TCP AND UDP

since, rhea talked about TCP, i would like to throw some light on the advantages and disadvantages of TCP and UDP.

I have only included those points which i could understand after reading . there are loads of points available on google on the advantages and disadvantages of TCP and UDP which you could refer. 


ADVANTAGES OF TCP

(1) TCP always guarantees three things - your data reaches its destination,it reaches there in time and it reaches    there without duplication.
(2) in TCP, since all the work is done by the operating system, so you just need to sit back and watch the show. Even the debugging is taken care of by your OS.
(3) It automatically breaks up data into packets for you.
(4) It is slower in functioning than UDP

DISADVANTAGES OF TCP

(1) since, all the work is being done by your OS, so if there are bugs in your OS, then you will face many problems like problems in surfing and downloading contents from the net.
(2) TCP cannot be used for broadcast and multicast connections.


ADVANTAGES OF UDP

(1) Broadcast and multicast connections are available with UDP which is not the case with TCP.
(2) It does not restrict you to connection based communication model
(3) Much faster than TCP

DISADVANTAGES OF UDP

(1) There are no guarantees with UDP. It is possible that a packet may not be delivered, or delivered twice, or delivered not in time.  
(2) you have to manually break the data into packets


Comments are always welcome :)

13 comments:

  1. Nice work. This has given an even clearer picture.
    But I was wondering, TCP being slower than UDP, is no advantage! I guess its a typo, right? :D

    ReplyDelete
    Replies
    1. its not a typo , just take a look at the picture given near the tcp heading, you'll understand why

      Delete
  2. TCP never guarantees that a packet arrives in time.
    Also, about UDP, "you have to manually break the data into packets"? What exactly are you on about? Data is always sent as packets. If you're talking about segmentation, TCP requires segmentation because of the way it works. Frames larger than the MTU are anyway fragmented into smaller units at lower layers. You can send messages much larger than MTU even over UDP, if your application needs it.

    ReplyDelete
  3. @rhea ,thanks for pointing out the the mistake. that point should be under the disadvantages of TCP

    @arjun sir, these are not my own points. these are the points which i gathered from the google putit down here. but, i will definitely look into what you said. thanks for your comment

    ReplyDelete
  4. I doubt anyone who knows even the slightest bit about how internet works would claim that TCP ensures that packets reach in time. Can you gimme the source?
    And, well, assuming that there is a page on the internet which claims that TCP gives guarantees on timely delivery of packets, had you actually googled well enough (ie. looked at more than one site) you would've realised that two of the three guarantees that you've mentioned are invalid.

    ReplyDelete
  5. @praneet: Check my post again. It does tell you than TCP ensures 'accurate delivery' rather than timely delivery!

    ReplyDelete
  6. @arjun bhaiya, @rhea , i looked at other sources and found what you have written as a comment. thanks for it. next time more googling from my side to ensure such mistakes never happen in future

    ReplyDelete
  7. good work praneet, it was clear enough to be understood easily and was not too technical, however if you could expand a bit more on how to manually break the data into packets, or how is it done, would be appreciated or if you could send me a link.

    ReplyDelete
  8. TCP Does Not Deliver The Packet Timely And During Segmentation And Transferring Of Data May Occurs.....

    ReplyDelete
  9. Tcp does not guarantee delivery of data packets, there's a strong chance that under duress there will be data collisions and data packets would be lost. Not only this but you will have to go through all the data manually and find what data packets have been lost.

    ReplyDelete
  10. Tcp does not guarantee delivery of data packets, there's a strong chance that under duress there will be data collisions and data packets would be lost. Not only this but you will have to go through all the data manually and find what data packets have been lost.

    ReplyDelete
  11. Nicely described and differences....its getting easy to understand. Thanks.....

    ReplyDelete
  12. Wonderful article, Which you have shared about the service. Your article is very important and I really enjoyed reading it. Get for more information look like elon musk twitterelon musk instagram

    ReplyDelete