[JDEV] UDP vs TCP
David Waite
mass at ufl.edu
Fri Sep 1 13:12:56 CDT 2000
Peter, perhaps you don't realize every IM system out there uses TCP for both
client-server and (when they support them) peer-peer connections. The only
exception is ICQ, and AOL is rapidly changing this as they are moving the
service to Oscar.
It is true that for a long-lived connection, you have the chance of buffers
sitting empty for TCP connections, and being a substantial draw on system
resources. However, many systems (I can only assume Solaris, but know linux
as of 2.4) don't do this - they have a shared buffer space for all TCP
connections in the kernel.
Also realize that there are lots and lots of clients out there - my
estimates put it at least at 30 (these are just the ones I've heard about).
You really want to write portions of the TCP functionality on top of UDP in
Visual Basic? One of the reasons TCP was chosen was not just that it makes
the server code simpler, but that it makes clients simpler - meaning there
are more clients supporting Jabber, bringing everyone happily closer to
World Domination (tm). One of the major goals (perhaps *the* major goal) of
Jabber was to make client authoring simple.
Finally, the last four companies I've worked at (read: EVERY company I've
worked at which had a computer) has had my computer situated behind a proxy.
Most Universities now use proxies for all their computers (I know University
of Florida even proxies the residence halls.) And I have a NAT proxy at
home, so that my notebook can access the internet through my linux 'server'.
How do these computers connect, if at all, on a UDP system?
-David Waite
-----Original Message-----
From: Peter Donald <donaldp at mad.scientist.com>
To: jdev at jabber.org <jdev at jabber.org>
Date: Friday, September 01, 2000 4:22 AM
Subject: Re: [JDEV] UDP vs TCP
>At 08:19 31/8/00 -0500, you wrote:
>>UDP gets its performance boost because it doesn't care if its
>>packets get there or not.
>
>partially. It also is a lot less memory usage as memory beffers are done in
>application space and can be much much more efficiently managed - including
>size and content wise. It also gets a speed up because it doesn't have to
>maintain ordering. Is order that important in sub-second range for IM ? I
>would say nay except for a single conversation between 2 parties.
>
>UDP is a much more rawer - you get to do all management facilities and is
>thus potentially much faster and more memory efficient.
>
>>IM doesn't fall into either one of those categories. You do need to
>>make sure that all of the packets got there and in the proper order.
>
>do you ? I would only say that they have to be ordered in a single
>conversation ? How often do 2 messages from same conversation end up being
>co-located on server ???? Very rarely I would say.
>
>>While you could indeed add this capability to your IM application,
>>in the end, you'll just end up re-implementing TCP and probably
>>poorly.
>
>unlikely - you need a very small subset of TC that TCP contains
>
>>Also there's no gurantee of the sequence of packets sent via UDP,
>>you have a very hard time implementing standard security
>>mechanisms such as SSL.
>
>true. UDP encryption/signing is more difficult to implement.
>
>>That's why most people stick to TCP instead of UDP. If UDP
>>provided more bang for the buck, it would be used. But it doesn't
>>so, we stick with TCP.
>
>People stick with TCP because it is easier and most use cases of TCP/IP is
>consistent with design choices. IM has different demands IMO - sequencing
>is different as is frequency and type of data transmitted.
>
>Using IM of TCP ends up with lots of small fragmented IP packets, excessive
>buffering and potentially long timeout times.
>
>>I"m not saying you shouldn't try your system. It might be useful for
>>local IM where the network is a lot more reliable than over the
>>general Internet.
>
>gee thanks.
>
>TCP is not a magic bullet. I do know the differences between the way you
>design applications. TCP is a lot easier and requires a lot less developer
>thought. UDP is a lot different, harder and requires more management code
>but can potentially be faster given the usage requirements of IM.
>
>It wont be as easy as TCP server nor can I safely saY I will be successful
>but if I am it is much more likely to be scalable than TCP. There is a
>reaons that many other protocols are UDP, scalability is one of them
>
>
>Cheers,
>
>Pete
>
>*------------------------------------------------------*
>| "Nearly all men can stand adversity, but if you want |
>| to test a man's character, give him power." |
>| -Abraham Lincoln |
>*------------------------------------------------------*
>
>_______________________________________________
>jdev mailing list
>jdev at jabber.org
>http://mailman.jabber.org/listinfo/jdev
>
More information about the JDev
mailing list