datastorage: use signal strength as a metric

This adds a few options to use the signal strength as a metric, band
dependent:

 - rssi_weight: every db of signal increases the score by this much.
 - rssi_center: if the signal is stronger than this, the score becomes
                positive; below this, it is negative.
 - initial_score:  since we are capping negative scores, it may be
   beneficial to have a positive base score to offset a possible
   negative signal value.  This is replacing the 'freq' metric.

To avoid a single-digit RSSI increase resulting in a kick, we add a
global threshold value to act as a buffer:

 - kicking_threshold: a candidate AP must have a score larger than that
                      of the current AP plus the value here.

The kicking_threshold also applies when assembling the list of roaming
neighbors we send with the "wnm_disassoc_imminent" command.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
This commit is contained in:
Eneas U de Queiroz 2021-08-04 09:11:06 -03:00 committed by Polynomdivision
parent 14e0f8386c
commit c70773a171
6 changed files with 89 additions and 32 deletions

View file

@ -55,7 +55,7 @@ int get_band(int freq);
// TODO: Define a proper version string
#ifndef DAWN_CONFIG_VERSION
#define DAWN_CONFIG_VERSION "2"
#define DAWN_CONFIG_VERSION "3"
#endif
// Band definitions
@ -90,11 +90,13 @@ struct probe_metric_s {
int chan_util_avg_period;
int set_hostapd_nr;
int kicking;
int kicking_threshold;
int duration;
int rrm_mode_mask;
int rrm_mode_order[__RRM_BEACON_RQST_MODE_MAX];
// Per-band Configuration
int initial_score[__DAWN_BAND_MAX]; // eval_probe_metric()()
int ap_weight[__DAWN_BAND_MAX]; // TODO: Never evaluated?
int ht_support[__DAWN_BAND_MAX]; // eval_probe_metric()()
int vht_support[__DAWN_BAND_MAX]; // eval_probe_metric()()
@ -102,13 +104,14 @@ struct probe_metric_s {
int no_vht_support[__DAWN_BAND_MAX]; // eval_probe_metric()()
int rssi[__DAWN_BAND_MAX]; // eval_probe_metric()()
int low_rssi[__DAWN_BAND_MAX]; // eval_probe_metric()()
int freq[__DAWN_BAND_MAX]; // eval_probe_metric()()
int chan_util[__DAWN_BAND_MAX]; // eval_probe_metric()()
int max_chan_util[__DAWN_BAND_MAX]; // eval_probe_metric()()
int rssi_val[__DAWN_BAND_MAX]; // eval_probe_metric()()
int low_rssi_val[__DAWN_BAND_MAX]; // eval_probe_metric()()
int chan_util_val[__DAWN_BAND_MAX]; // eval_probe_metric()()
int max_chan_util_val[__DAWN_BAND_MAX]; // eval_probe_metric()()
int rssi_weight[__DAWN_BAND_MAX]; // eval_probe_metric()()
int rssi_center[__DAWN_BAND_MAX]; // eval_probe_metric()()
struct mac_entry_s* neighbors[__DAWN_BAND_MAX]; // ap_get_nr()
};