[JDEV] UDP vs TCP
Peter Donald
donaldp at mad.scientist.com
Fri Sep 1 04:17:16 CDT 2000
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 |
*------------------------------------------------------*
More information about the JDev
mailing list