Changing ACK timeout on various OSes

Throughput can be improved over long distance links by changing the ACK/CTS timeouts and Slottime, see http://www.air-stream.org/ACK_Timeouts

Atheros cards using athctrl

athctrl is a small utility for Linux that changes the ACK Timeout, CTS Timeout and Slottime based on the maximum distance you specify, in meters. It's usage is:

athctrl [-h] [-i device] [-d distance]

The maximum acktimeout/ctstimeout possible on atheros based cards is currently 409 µs, working out to a maximum distance of about 53-57 km.

Examples

athctrl -d 1000

Set maximum distance of 1000m for wifi0.

athctrl -i wifi1 -d 5000

Set maximum distance of 5000m for wifi1.

OpenWrt + Madwifi

The physical layer parameters are stored in /proc/sys/dev/wifiX

To view a parameter, such as acktimeout on wifi0

OpenWrt:~# sysctl dev.wifi0.acktimeout
dev.wifi0.acktimeout = 22

Example

I want to set up my 802.11a card, wifi0, for an 8 km link.The default slottime is 9 and the default acktimeout is 22 as discovered from the above command.

I must add 1 to slottime and 2 to acktimeout for every 300 meters over the initial 300. This means I need to add an extra (8000 - 300) / 300 = 25.7 to slottime. I will round up to 26 to be safe. So my slottime will be 9 + 26 = 35, and my acktimeout and ctstimeout will both be 22 + 26 * 2 = 74.

This can be manually done as follows

OpenWrt:~# sysctl -w dev.wifi0.acktimeout=74
dev.wifi0.acktimeout = 74
OpenWrt:~# sysctl -w dev.wifi0.ctstimeout=74
dev.wifi0.ctstimeout = 74
OpenWrt:~# sysctl -w dev.wifi0.slottime=35
dev.wifi0.slottime = 35

To make this permanent on bootup, one would add the following lines to /etc/sysctl.conf

dev.wifi0.ctstimeout=74
dev.wifi0.acktimeout=74
dev.wifi0.slottime=35

BSD

sysctl can be used in BSD based operating systems to access and modify the parameters, the format is similar. 

Example

For example on interface wl1:

~# sysctl -w dev.wl.1.acktimeout=74
dev.wl.1.acktimeout: 22 -> 74
~# sysctl -w dev.wl.1.ctstimeout=74
dev.wl.1.ctstimeout: 22 -> 74
~# sysctl -w dev.wl.1.slottime=35
dev.wl.1.slottime: 9 -> 35

To make it permanent on bootup, one would add the following line to /etc/sysctl.conf

dev.wl.1.acktimeout=74
dev.wl.1.ctstimeout=74
dev.wl.1.slottime=35

OpenWrt Whiterussian + Broadcom

The dctrl utility by nbd or an nvram setting in Whiterussian can be used to specify the maximum distance between stations. dctrl usage is:

dctrl [max distance in meters]

In Whiterussian RC5 or higher, the nvram setting wl0_distance can control the maximum distance, specified in meters. A small utility called sdist, attached to this page, can be used to verify that the correct registers have been changed. Remember to run /sbin/wifi to reload wifi settings after changing nvram.

Example

Checking initial values using sdist, then changing wl0_distance to 20kms, reloading wifi settings. Checking that the registers in the wifi card actually changed, then committing the nvram so the wl0_distance setting persists on reboot.

OpenWrt:~# ./sdist
shm: 0x9
reg 684: 0x207
OpenWrt:~# nvram set wl0_distance=20000
OpenWrt:~# /sbin/wifi
OpenWrt:~# ./sdist
shm: 0x8f
reg 684: 0x28d
OpenWrt:~# nvram commit

HostAP + Prism ?

Do we care?

Note about Atheros: If using 802.11g it would be a good idea to lock the station into 11g, to prevent slottime resetting if a 11b client tries to connect. This is accessed in Linux/Madwifi through iwpriv <interface> mode 11g and in BSD through ifconfig <interface> mode 11g