OS-Specific Configuration Hints: BSD Variants
By default, earlier BSD versions use very modest buffer sizes and don't enable Window Scaling by default. See the references below how to do so.
In contrast, FreeBSD 7.0 introduced TCP buffer auto-tuning, and thus should provide good TCP performance out of the box even over LFNs. This release also implements large-send offload (LSO) and large-receive offload (LRO) for some Ethernet adapters. FreeBSD 7.0 also announces the following in its presentation of technological advances:
10Gbps network optimization: With optimized device drivers from all major 10gbps network vendors, FreeBSD 7.0 has seen extensive optimization of the network stack for high performance workloads, including auto-scaling socket buffers, TCP Segment Offload (TSO), Large Receive Offload (LRO), direct network stack dispatch, and load balancing of TCP/IP workloads over multiple CPUs on supporting 10gbps cards or when multiple network interfaces are in use simultaneously. Full vendor support is available from Chelsio, Intel, Myricom, and Neterion.
Recent TCP Work
The FreeBSD Foundation has granted a project "Improvements to the FreeBSD TCP Stack" to Lawrence Stewart at Swinburne University. Goals for this project include support for Appropriate Byte Counting (ABC, RFC 3465), merging SIFTR into the FreeBSD codebase, and improving the implementation of the reassembly queue. Information is available on Center for Advanced Internet Architectures. Other improvements done by this group are support for modular congestion control, implementations of CUBIC, H-TCP, TCP Vegas, the SIFTR TCP implementation tool, and a testing framework including improvements to iperf for better buffer size control.
The CUBIC implementation for FreeBSD was announced on the ICCRG mailing list in September 2009. Currently available as patches for the 7.0 and 8.0 kernels, it is planned to be merged "into the mainline FreeBSD source tree in the not too distant future".
In February 2010, a set of Software for FreeBSD TCP R&D was announced by the Swinburne group: This includes modular TCP congestion control, Hamilton TCP (H-TCP), a newer "Hamilton Delay" Congestion Control Algorithm v0.1, Vegas Congestion Control Algorithm v0.1, as well as a kernel helper/hook framework ("Khelp") and a module (ERTT) to improve RTT estimation.
Another release in August 2010 added a "CAIA-Hamilton Delay" congestion control algorithm as well as revised versions of the other components.
On BSD systems ALTQ implements a couple of queueing/scheduling algorithms for network interfaces, as well as some other QoS mechanisms.
To use ALTQ on a FreeBSD 5.x or 6.x box, the following are the necessary steps:
- build a kernel with ALTQ
options ALTQand some others beginning with
ALTQ_should be added to the kernel config. Please refer to the ALTQ(4) man page.
- define QoS settings in
pfctlto apply those settings
/etc/rc.conf(set as well the other variables related to
pfaccording to your needs) in order to apply the QoS settings every time the host boots.
- TCP Tuning Guide - FreeBSD (psc.edu, http://www.psc.edu/networking/projects/tcptune/#FreeBSD
- TCP Tuning Guide - FreeBSD, http://www-didc.lbl.gov/TCP-tuning/FreeBSD.html
- Tuning and Testing the FreeBSD 6 TCP Stack, http://caia.swin.edu.au/reports/070717B/CAIA-TR-070717B.pdf
- What's New in FreeBSD 7.0, F. Biancuzzi, A. Oppermann et al., February 2008, ONLamp
- Improving the FreeBSD TCP Implementation (an update on all things TCP in FreeBSD and how they affect you), L. Stewart, BSDCan 2009 conference