Subject: TCP/IP tuning
To: None <current-users@netbsd.org>
From: Thomas Miller <tom@insolvencyhelp.org>
List: current-users
Date: 02/27/2004 22:16:44
Hello, 

I have a new cable connection which is supposed 
to give me downloads of "up to 5 Mb/sec," and I 
want to tune my -current i386 1.6ZK system to 
take advantage of the new connection.  

I found the following: 

  1. Enabling High Performance Data Transfers
     http://www.psc.edu/networking/perf_tune.html
  2. TCP tuning cookbook
     http://proj.sunet.se/E2E/tcptune.html

and the the latter gives specific suggestions 
concerning NetBSD-current:  

   Only  NetBSD-current  (upcoming  version  2.0) seems to support really
   fast  connections, as there has been much work done on the "zero-copy"
   TCP features of NetBSD lately.
     * Install NetBSD-current
     * Increase  IFQ_MAXLEN in /usr/src/sys/net/if.h from 50 (default) to
       something like 1000
     * Enter  the  line "options NMBCLUSTERS=16384" in Your kernel config
       file
     * Recompile  and  install  Your  new  kernel.  Do not try to set the
       values  below too high until You have increased NMBCLUSTERS - risk
       of "hanging" the network part of the OS!

   Command
   Description
   sysctl -w net.inet.tcp.rfc1323=1 Activate window scaling and timestamp
   options according to RFC 1323.
   sysctl -w kern.sbmax=[wmax] Set maximum size of TCP window.
   sysctl  -w  net.inet.tcp.recvspace=[wstd]  Set  default  size  of  TCP
   receive window.
   sysctl  -w  net.inet.tcp.sendspace=[wstd]  Set  default  size  of  TCP
   transmit window.
   sysctl  kern.mbuf.nmbclusters  View  maximum  number of mbuf clusters.
   Used  for  storage  of data packets to/from the network interface. Can
   only be set by recompiling Your kernel - see above!

I was unable to find much about TCP/IP tuning in
the NetBSD.org web pages or in the mailing list
archives.  So, before I wade in and start changing 
stuff, I though I'd ask here if the above information 
seems correct and complete.  Any additional hints 
or tips would be appreciated.  

Thanks!  

Tom