Sockets - send()

Brian K. White brian at aljex.com
Thu Oct 30 18:32:25 PDT 2008


----- Original Message ----- 
From: "Fairlight" <fairlite at fairlite.com>
To: <filepro-list at lists.celestial.com>
Sent: Thursday, October 30, 2008 8:40 PM
Subject: Re: Sockets - send()


> Simon--er, no...it was Brian K. White--said:
>> Probably only most of the time, not by any garantee.
>> If Ken is right that fragmented tcp/ip packets are why you are
>> receiving less than the total 4000, well packets may be broken
>> any time to any size for any number of reasons by any device
>> along the way between sender/receiver.
>> So simply requesting a packet that is smaller than your own box's
>> mtu in no way ensures that you will receive 1000 bytes every time.
>> 
>> However _most_ ethernet devices have an mtu of 1500, and your
>> traffic is only likely to pass through a very few connections that have
>> lower mtus (Because of say, PPPoE eating some bytes as overhead
>> for the PPPoE protocol itself, this is generally just residential
>> DSL, but possibly some types of vpn  might incur some overhead too) 
>> TCP/IP itself uses up 44 bytes of each packet too, so the payload
>> that holds your data is actually smaller than that.
> 
> You can't rely on MTU -at all- in terms of anything other than the absolute
> maximum size you'll get in.  Even then, you dare not rely on it with
> anything that uses hardwired values, as if the MTU is ever increased you
> may hit a segv due to buffer overrun, depending on how your buffers are
> handled.  While MTU is a guarantee of fragmentation at the MTU point, you
> can fragment in ways that have -nothing- at all to do with MTU whatsoever.
> I've seen this lots of times.
> 
>> So, _usually_ 1000 bytes of payload data are going to be small
>> enough that nothing ever ends up needing to break the packet
>> into smaller packets. 1000 bytes from you at the application
> 
> Negative.  I've seen breaks at far smaller (e.g., 304 bytes, or even 84
> bytes) with MTUs of no less than 1456 along the whole chain.

You can't say I'm wrong and then correct me by saying exactly the
same thing.

The rest after this point was indeed all valid.
And good to know. Thanks.

-- 
Brian K. White    brian at aljex.com    http://www.myspace.com/KEYofR
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro  BBx    Linux  SCO  FreeBSD    #callahans  Satriani  Filk!



More information about the Filepro-list mailing list