[Samba] TCP/IP block size

Jeremy M jrmymllr at hotmail.com
Tue Aug 5 02:18:37 GMT 2008




> 
> If it returns 1300 bytes for a few times, then reduces the block size, then 
> I'm going to guess that the TCP/IP stack on your microcontroller is giving 
> Samba some clue that it's having trouble keeping up.
> 
> >It appears that Samba is transmitting data in chunks of 4K, and if I
> 
> How does it appear so? You have Wireshark on it? If Samba/Linux is sending 
> 4k, then why did you say you're getting 512, 1024, or 1104? I'm not sure I 
> understand your question.
> 

Let me clarify.  First, yes, I'm using Wireshark; troubleshooting would be a nightmare without it.  

About the 4K thing: it looks like, and I could be wrong, that when I request sequential packets of data from a file, Samba/OS/whatever pulls 4K off the drive and feeds that 4K block to me, and *does not* send TCP packets that contains data which spans across blocks.  

Example:  

I request 1024 bytes, I get 1024 back
I request 1024 bytes, I get 1024 back
I request 1024 bytes, I get 1024 back
I request 1024 bytes, I get 1024 back

4K block all gone.  Another request for data goes to the next block.  Similar situation with 512 bytes, or any even multiple of 4096.

Example:

I request 1400 bytes, I get 1400 back
I request 1400 bytes, I get 1400 back
I request 1400 bytes, OOPS, only 1296 bytes left of the 4K, I get 1296 bytes back
THEN, it sends another 104 bytes in another message to complete my request for 1400 bytes

This happens every time, all the time, in the exact same manner as I present here.  Requests for 1024 or 512 always get fulfilled in one TCP response.  Any other data request size gets split like I describe.  My TCP/IP stack is uIP, which is fairly mature.  It could be uIP, but I say based upon the behavior chances are very slim.



_________________________________________________________________
Get Windows Live and get whatever you need, wherever you are.  Start here.
http://www.windowslive.com/default.html?ocid=TXT_TAGLM_WL_Home_082008


More information about the samba mailing list