mirror of
https://github.com/openbsd/src.git
synced 2026-06-18 23:33:33 +02:00
Don't let MiRA trigger event-based probing if the current measurement
equals the average measurement, i.e. if the standard deviation is zero. Change comparisons of current measurement to the average measurement from >= to > in the "channel becomes good" check, and from <= to < in the "channel becomes bad" check. The paper's equations are written with <= and >= and thus so was our implementation. But checking for equality makes no sense in the context of event-triggered probing: The intention is to react to changes in channel quality, which occur for instance when a laptop moves around or when RF noise comes and goes. When the current measurement and the average measurement are equal, this means channel quality has not changed at all and starting to probe for a new rate is not necessary. We should probably even add a margin to avoid triggering probing based on small fluctuations, but this can be done later. ok tb@
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: ieee80211_mira.c,v 1.24 2020/03/29 08:14:05 stsp Exp $ */
|
||||
/* $OpenBSD: ieee80211_mira.c,v 1.25 2020/03/30 19:10:42 stsp Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2016 Stefan Sperling <stsp@openbsd.org>
|
||||
@@ -1193,7 +1193,7 @@ ieee80211_mira_choose(struct ieee80211_mira_node *mn, struct ieee80211com *ic,
|
||||
}
|
||||
|
||||
/* Check if event-based probing should be triggered. */
|
||||
if (g->measured <= g->average - 2 * g->stddeviation) {
|
||||
if (g->measured < g->average - 2 * g->stddeviation) {
|
||||
/* Channel becomes bad. Probe downwards. */
|
||||
DPRINTFN(2, ("channel becomes bad; probe downwards\n"));
|
||||
DPRINTFN(3, ("measured: %s Mbit/s\n",
|
||||
@@ -1214,7 +1214,7 @@ ieee80211_mira_choose(struct ieee80211_mira_node *mn, struct ieee80211com *ic,
|
||||
(1 << ieee80211_mira_next_lower_intra_rate(mn, ni));
|
||||
#endif
|
||||
ieee80211_mira_cancel_timeouts(mn);
|
||||
} else if (g->measured >= g->average + 2 * g->stddeviation) {
|
||||
} else if (g->measured > g->average + 2 * g->stddeviation) {
|
||||
/* Channel becomes good. */
|
||||
DPRINTFN(2, ("channel becomes good; probe upwards\n"));
|
||||
DPRINTFN(3, ("measured: %s Mbit/s\n",
|
||||
|
||||
Reference in New Issue
Block a user