RSSADAPT(9) | Kernel Developer's Manual | RSSADAPT(9) |
rssadapt
,
ieee80211_rssadapt_choose
,
ieee80211_rssadapt_input
,
ieee80211_rssadapt_lower_rate
,
ieee80211_rssadapt_raise_rate
,
ieee80211_rssadapt_updatestats
—
#include
<net80211/ieee80211_var.h>
#include
<net80211/ieee80211_rssadapt.h>
void
ieee80211_rssadapt_input
(struct
ieee80211com *ic, struct
ieee80211_node *ni,
struct ieee80211_rssadapt
*ra, int rssi);
void
ieee80211_rssadapt_lower_rate
(struct
ieee80211com *ic, struct
ieee80211_node *ni,
struct ieee80211_rssadapt
*ra, struct
ieee80211_rssdesc *id);
void
ieee80211_rssadapt_raise_rate
(struct
ieee80211com *ic, struct
ieee80211_rssadapt *ra,
struct ieee80211_rssdesc
*id);
void
ieee80211_rssadapt_updatestats
(struct
ieee80211_rssadapt *ra);
int
ieee80211_rssadapt_choose
(struct
ieee80211_rssadapt *ra,
struct ieee80211_rateset
*rs, struct
ieee80211_frame *wh,
u_int len,
int fixed_rate,
const char *dvname,
int do_not_adapt);
rssadapt
module provides rapid adaptation of
transmission data rate to 802.11 device drivers based on received-signal
strength (RSS). A driver needs only to provide
rssadapt
with indications of RSS and failure/success
of transmissions for each 802.11 client or peer. For each transmit packet,
rssadapt
chooses the transmission data rate that
offers the best expected throughput, given the packet's length and
destination.
rssadapt
models an 802.11 channel very
simply (see also the BUGS section). It
assumes that the packet-error rate (PER) is determined by the
signal-to-noise ratio (S/N) at the receiver, the transmission data rate, and
the packet length. The S/N determines the choice of data rate that yields
the lowest PER for all packets of a certain length.
ieee80211_rssadapt_choose
(ra,
rs, wh,
len, fixed_rate,
dvname, do_not_adapt)rssadapt
state object
belonging to the node which is the packet destination. However, if the
destination is a broadcast/multicast address, then
ra belongs to the BSS node,
ic->ic_bss.ifconfig wi0 media ds1
, then
fixed_rate tells the index of that rate in
rs. rssadapt
obeys a
fixed data rate whenever the 802.11 standard allows it: sometimes the
standard requires multicast/broadcast packets to be transmitted at a
so-called “basic rate”.NULL
when no messages are desired.ieee80211_rssadapt_choose
() will choose the
highest rate in rs that suits the destination,
regardless of the RSS.ieee80211_rssadapt_choose
() is
an index into rs, indicating its choice of transmit
data rate.ieee80211_rssadapt_input
(ic,
ni, ra,
rssi)ieee80211_rssadapt_input
(), whose arguments are:
rssadapt
state object.ieee80211_rssadapt_lower_rate
(ic,
ni, ra,
id)ieee80211_rssadapt_raise_rate
(ic,
ra, id)ieee80211_rssadapt_raise_rate
() and
ieee80211_rssadapt_lower_rate
() to indicate
transmit successes and failures, respectively.
rssadapt
state object.ieee80211_rssadapt_updatestats
(ra)rssadapt
in tracking the
exponential-average packet rate by calling
ieee80211_rssadapt_updatestats
() every 1/10th
second for each node's ieee80211_rssadapt object.
rssadapt
state object.rssadapt
monitors the RSS from neighboring 802.11 nodes,
recording the exponential average RSS in each neighbor's
ieee80211_rssadapt structure.
rssadapt
uses transmit success/failure feedback from
the device driver to fill a table of RSS thresholds. The table is indexed by
packet size, L, and a data rate,
R, to find out the minimum exponential-average RSS that
a node must show before rssadapt
will indicate that a
packet L bytes long can be transmitted R bits per second
with optimal expected throughput. When the driver indicates a unicast packet
is transmitted unsuccessfully (that is, the NIC received no ACK for the
packet), rssadapt
will move the corresponding RSS
threshold toward the exponential average RSSI at the time of transmission.
Thus several consecutive transmit failures for the same
⟨L, R⟩ tuple will
ensure that the RSS threshold rises high enough that rate
R is abandoned for packets L bytes
long. When the driver indicates a successful transmission, the RSS threshold
corresponding to the same packet length, but the next higher data rate, is
lowered slightly. The RSS threshold is said to “decay”. This
ensures that occasionally rssadapt
indicates the
driver should try the next higher data rate, just in case conditions at the
receiver have changed (for example, noise levels have fallen) and a higher
data rate can be supported at the same RSS level.
The rate of decay is controlled. In an interval of 1/10th second to 10 seconds, only one RSS threshold per neighbor may decay. The interval is connected to the exponential-average rate that packets are being transmitted. At high packet rates, the interval is shortest. It is longest at low packet rates. The rationale for this is that RSS thresholds should not decay rapidly if there is no information from packet transmissions to counteract their decay.
struct ieee80211_rssdesc { u_int id_len; u_int id_rateidx; struct ieee80211_node *id_node; u_int8_t id_rssi; };
id_len is the length, in bytes, of the transmitted packet. id_node points to the neighbor's ieee8021_node, and id_rssi is the exponential-average RSS at the time the packet was transmitted. id_rateidx is an index into the destination-neighbor's rate-set, id_node->ni_rates, indicating the transmit data rate for the packet.
An ieee80211_rssadapt contains the
rate-adaptation state for a neighboring 802.11 node. Ordinarily a driver
will “subclass” ieee80211_node. The
ieee80211_rssadapt structure will be a subclass
member. In this way, every node's rssadapt
condition
is independently tracked and stored in its node object.
struct ieee80211_rssadapt { u_int16_t ra_avg_rssi; u_int32_t ra_nfail; u_int32_t ra_nok; u_int32_t ra_pktrate; u_int16_t ra_rate_thresh[IEEE80211_RSSADAPT_BKTS] [IEEE80211_RATE_SIZE]; struct timeval ra_last_raise; struct timeval ra_raise_interval; };
ra_avg_rssi is the exponential-average RSS,
shifted left 8 bits. ra_nfail tells the number of
transmit failures in the current update interval.
ra_nok tells the number of transmit successes in the
current update interval. ra_pktrate tells the
exponential average number of transmit failure/success indications over past
update intervals. This approximates the rate of packet-transmission.
ra_rate_thresh contains RSS thresholds that are
indexed by ⟨packet length, data rate⟩ tuples. When this node's
exponential-average RSS exceeds ra_rate_thresh[i][j],
then packets at most 128 x 8^i bytes long are eligible to be transmitted at
the rate indexed by j. ra_last_raise and
ra_raise_interval are used to control the rate that
RSS thresholds “decay”. ra_last_raise
indicates when ieee80211_rssadapt_raise_rate
() was
last called. ra_raise_interval tells the minimum
period between consecutive calls to
ieee80211_rssadapt_raise_rate
(). If
ieee80211_rssadapt_raise_rate
() is called more than
once in any period, the second and subsequent calls are ignored.
rssadapt
is in the file
sys/net80211/ieee80211_rssadapt.c.
wi(4) contains a reference implementation. See sys/dev/ic/wi.c.
Javier del Prado Pavon and Sunghyun Choi, Link Adaptation Strategy for IEEE 802.11 WLAN via Received Signal Strength Measurement, ICC'03, pp. 1108-1113, Anchorage, Alaska, May 2003.
rssadapt
first appeared in NetBSD
3.0.
rssadapt
should adapt the fragmentation threshold as well as the data rate.
For improved throughput, rssadapt
should
indicate to drivers when they should use the 802.11b short-preamble.
The constants in
ieee80211_rssadapt_updatestats
() should be
configurable.
March 23, 2004 | NetBSD 9.0 |