Subject: TCP/IP tuning
To: None <>
From: Thomas Miller <>
List: current-users
Date: 02/27/2004 22:16:44

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
  2. TCP tuning cookbook

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
     * 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!

   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 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.