[gameprogrammer] Re: recommended size of data for udp packets

On Tue, 2005-08-16 at 16:02 -0500, Chris Nystrom wrote:
> On 8/16/05, Bob Pendleton <bob@xxxxxxxxxxxxx> wrote:
> > On Tue, 2005-08-16 at 14:43 -0400, Roger D Vargas wrote:
> > > Whats the recommended size of data to send inside an UDP packet?
> > 
> > I have never run into that question before. Cool!
> > 
> > You can send any size you want up to 64KB. But, lots of large UDP
> > messages can really clog up a network. OTOH, if the packet size isn't at
> > least several times the header overhead (28 bytes IIRC) you are wasting
> > bandwidth by sending to much header and not enough data.
> 
> Does not the UDP packet have to be smaller than the smallest MTU as well?

If you are talking about the Ethernet MTU then no. The properties of the
physical layer are hidden from the higher protocol layers by the
protocol stack. All IP packets can be broken up into smaller packets by
the physical layer. 

For example: In a typical DSL network the DSL layer is actually using an
ATM network protocol where the cell size is 53 bytes. Five bytes of
header and 48 bytes of payload.

I use DSL so when I send an IP packet (TCP, UDP, or whatever) out from
my computer it is broken up into MTU sized blocks with Ethernet headers
to give IP or Ethernet for the trip from my PC to the DSL modem. After
that, at the DSL modem, it may be converted to ATM which gives IP over
ATM, or it may be converted to Ethernet over ATM so I actually have IP
over Ethernet over ATM.

At some point as the data moves up the stack of physical layer and the
IP layer you finally get IP packets again and those are handed off to
your application.

The general rule is each layer of the protocol stack must hide the
effects of the next lower layer. Of course, the Ethernet MTU size can
have an effect on the performance of the physical layer and so can
affect the performance of all higher layers. But, it isn't allowed to
restrict the size of the packets used by higher layer protocols.

        Bob Pendleton


> 
> Chris
> 
-- 
+--------------------------------------+
+ Bob Pendleton: writer and programmer +
+ email: Bob@xxxxxxxxxxxxx             +
+ web: www.GameProgrammer.com          +
+ www.Wise2Food.com                    +
+ nutrient info on 6,000+ common foods +
+--------------------------------------+



---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: