NASA Banner + NASA Homepage
+ Ames Research Center
+ NASA Advanced Supercomputing
NREN Banner
Customer Service: TCP Performance Tuning
About NREN
Customer Servicee
Weather Map
Jumbo Frames
TCP Windows Sizes
SSH Passthrough
TCP Performance Tuning

TCP Performance Tuning on End Systems

For communications across wide area networks with large bandwidth and long-delay characteristics, larger TCP window sizes are recommended to improve data transfer rates. The TCP window size determines how much data a sending host can send to a receiving host, without receiving an acknowledgment of data transfer.

The default settings on most operating systems does not allow for high bandwidth data rates across long-delay networks, such as wide area networks. The table below lists some of the default parameters for various operating systems.

Operating System Default maximum socket buffer size Default TCP socket buffer size
FreeBSD 256 kilobytes 32 kilobytes
Linux 2.4 64 kilobytes 32 kilobytes
Linux 2.6 64 kilobytes 32 kilobytes
Mac OS X 256 kilobytes 32 kilobytes
Sun Solaris 1 Megabyte 48 kilobytes

Most operating system vendors provide parameters to adjust window sizes.

Here are some tips to keep in mind when sizing TCP windows:

  • UNIX systems typically have two to four adjustable kernel parameters related to increasing TCP window sizes.
  • In Linux, they (parameters or window size??) can be modified at run time with the 'sysctl' command and will remain in effect until the next reboot. To make the changes persistent, add the following entries to the kernel configuration file, /etc/sysctl.conf, and then run 'sysctl -p'.
  • The suggested 100 MB buffer size assumes a link speed of 10Gbps and RTT of 80ms. Thus, the Bandwidth Delay Product (BDP) = 10Gbps * 80ms = 100MB.
  • Root access is required to make these changes to the system.

TCP Performance Tuning on End Systems: Linux

Copy and paste the text below and run on your command line (as root). It will append your system's kernel configuration file with the appropriate tuning parameters:

cat << END_SCRIPT >> /etc/sysctl.conf
# TCP performance tuning entries:
# Set maximum TCP window sizes to 100 megabytes
net.core.rmem_max = 104857600
net.core.wmem_max = 104857600

# Set minimum, default, and maximum TCP buffer limits
net.ipv4.tcp_rmem = 4096 524288 104857600
net.ipv4.tcp_wmem = 4096 524288 104857600

# Set maximum network input buffer queue length
net.core.netdev_max_backlog = 30000

# Disable caching of TCP congestion state (2.6 only); fixes a bug in some Linux stacks.
net.ipv4.tcp_no_metrics_save = 1

# Disable TCP timestamp support to reduce CPU use
net.ipv4.tcp_timestamps = 0

# Disable SACK support; esp beneficial for systems with very fast bus to memory interface
net.ipv4.tcp_sack = 0

TCP Performance Tuning on End-Systems: Mac

Mac OS X parameters can be set with the sysctl command:

# Set maximum TCP window sizes to 16 megabytes
net.inet.tcp.sendspace= 16772216
net.inet.tcp.recvspace= 16772216

# Set maximum Socket Buffer sizes to 128 megabytes
kern.ipc.maxsockbuf= 134217728

In order to allow the Mac operating system to retain the parameters after a reboot, edit /etc/sysctl.conf

	prompt-> echo 'net.inet.tcp.sendspace=16772216' > /etc/sysctl.conf
	prompt-> echo 'net.inet.tcp.recvspace=16772216' > /etc/sysctl.conf
	prompt-> echo 'kern.ipc.maxsockbuf=134217728' > /etc/sysctl.conf

These changes require root access.

TCP Performance Tuning on End-Systems: Windows

The suggested method for tuning TCP Windows under Windows XP and Windows 2000 is by utilizing DrTCP.

screenshot of DrTCP settings
A Screenshot of DRTCP settings for WinXP on a 100 Mbps-attached host
(fast ethernet MTU is limited to 1500).

+ Utilize a Bandwidth-Delay calculator to determine your TCP receive window size.


  • Turn on "Window Scaling" and "Selective Acks".
  • If you expect to use 90 Mb/s or faster, you should also turn on "Time Stamping".
  • You must restart for the changes to take effect.

 More NASA on the Web:
FirstGov - Your First Click to the US Government + NASA Privacy Statement, Disclaimer,
 and Accessibility Certification

+ Copyright/Image Use Policy
NASA - National Aeronautics and Space Administration Webmaster: NREN
NASA Official: Hugh La Master
Last Updated: November 11, 2006
+ Contact NREN