Hack 83 Slow Down to Speed Up
On a flaky link, talking slowly can actually
speed up data transfers.
The speed at which a radio can
communicate with another depends on how much signal is available. In
order to maintain communications as the available signal fades, the
radios need to transmit data at a slower rate. Normally, the radios
attempt to work out the available signal on their own and
automatically select the fastest possible speed for communications.
But in fringe areas with a barely adequate signal, packets may be
needlessly lost while the radios continually renegotiate the link
speed. For example, suppose you have a long distance point-to-point link
made of Orinoco radios. The received signal at each end varies
between -83 and -80 dBm. The threshold for an Orinoco to flip from 11
Mbps to 5.5 Mbps is -82 dBm, so the radios spend at least part of
their time negotiating the best speed. Operating on a borderline
signal level like this leads to excessive retransmissions that can
seriously degrade performance. If you can't add more antenna gain or reposition
your equipment to achieve enough signal for your link, consider
forcing your card to sync at a lower rate. This will mean fewer
retries, and can be substantially faster than using a continually
flip-flopping link. Each driver has its own method for setting the
link speed. In Linux, set the link speed with
iwconfig: pebble~# iwconfig eth0 rate 2M
This forces the radio to always sync at 2 Mbps, even if other speeds
are available. You can also set a particular speed as a ceiling, and
allow the card to automatically scale to any slower speed, but go no
faster. For example, you might use this on the example link above: pebble~# iwconfig eth0 rate 5.5M auto
Using the auto directive this way tells the driver
to allow speeds up to 5.5 Mbps, and to run slower if necessary, but
will never try to sync at anything faster. To restore the card to
full auto scaling, just specify auto by itself: pebble~# iwconfig eth0 rate auto
Cards can generally reach much further at 1 Mbps than they can at 11
Mbps. There is a difference of 12 dB between the 1 Mbps and 11 Mbps
ratings of the Orinoco cardthat's four times
the potential distance just by dropping the data rate! On a marginal
link, it is usually worth sacrificing an attempt at speed to achieve
a more efficient link. If you absolutely need to go faster, find a
way to get more signal between the two points. |