mina-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Barrie Treloar" <baerr...@gmail.com>
Subject Re: How to check UDP message header length?
Date Mon, 12 Jan 2009 03:44:29 GMT
>> With MINA, how do we send a UDP message in one, and in multiple packets?
> Well at this point, keep life simple, and let the stack handle it. You
> just write data and internally stack shall
> take care of it. For UDP, max data that can be send is 64K. So, if
> ethernet MTU is 1500, you packet shall be fragmented
> and reassembled at destination, and passed on as single packet back to
> application layer. Beyond this you will run into issues of sequencing,
> packet losses etc, so can prototype with smaller packets and take a
> call later.

As noted above, your application will see one UDP packet - regardless
of data size (up to max).

HOWEVER - if the stack is fragmenting the packets there is a chance
that you *lose* a packet and in this case you lose the whole message.

The morale of the story is not to use UDP for large message sizes or
else you end up wasting bandwidth (a lost large packet = bandwidth
waste)

If you must use UDP and you have large packet sizes (our application
does) then you must re-implement some of the TCP/IP features yourself.
In our case we are manually fragmenting the packet into small chunks
so that if we lose a packet we dont lose the whole message, we only
lose the current packet which is much cheaper to resend.
We are also implementing a packet ack protocol so we get guaranteed messages.

We are stuck with this because we are sending messages over a Motorola
radio network (~14kbps) and TCP/IP has too much overhead to run over
this.

Mime
View raw message