tcp mss MCLBYTES restriction

Andrew Gallatin gallatin at cs.duke.edu
Tue Jan 20 13:26:07 PST 2004


David Borman writes:
 > On the sending side, you'll tend to get your best performance when the 
 > socket buffer is a multiple of the amount of TCP data per packet, and 
 > the users writes are a multiple of the socket buffer.  This keeps 
 > everything neatly aligned, minimizing the number of data copies that 
 > need to be done, and improving the chance of doing page flips.  

Yes, this was very handy when doing the zero-copy receives.

 > Rounding down a 1500 byte ethernet packet to a 1K boundary looses too 
 > much data, but  for larger MTUs, the win of keeping everything neatly 
 > aligned can exceed the cost of not packing each packet with the maximum 
 > amount of data.  Since applications that are writing large amounts of 
 > data to a socket will tend to be using buffers aligned on a K boundary, 
 > using a K aligned amount of TCP data increases the chances that 
 > everything stays aligned.

Good point.  But how would you feel about making it optional with it
defaulting as it is now?

There are special cases.  For example, I think its killing me on an
experimental network interface which stripes data across 2 links.

Drew





More information about the freebsd-net mailing list