View Single Post
Old 29-Mar-2007, 01:46 AM   #2 (permalink)
Iphone
Fixed Error!
 
Iphone's Avatar

Posts: 4,202
Join Date: Mar 2007
Rep Power: 6 Iphone is on a distinguished road

IM:
Default Re: Is this how GPRS works?

There are four major differences between UDP and TCP:

1. TCP can establish a Connection, UDP cannot;
2. TCP provides a stream of unlimited length, UDP sends small packets;
3. TCP guarantees that as long as you have a connection data sent will
arrive at the destination, UDP provides no guaranteed delivery;
4. UDP is faster for sending small amounts of data since no connection
setup is required, the data can be sent in less time than it takes for TCP
to establish a connection.

Related to 2 above is the fact that UDP packets are limited in size, with
the extact size limit being determined potentially on a per-system basis.
IIRC studies have shown that 1400 bytes is a safe maximum size, and 900
bytes is even safer.

Related to 3 above is the fact that UDP packets may simply disappear in
transit. Routers may toss them if there's a lot of traffic at any given
moment, and the receiving system may not have room to buffer them when
received.

If you want to use UDP you need to be aware of those issues. And, if you
need to ensure that UDP packets are received - or you know they're not -
then you need to implement a send/reply protocol over top of UDP, with
timeouts.
Iphone is offline   Reply With Quote