datastorage/uci/msghandler/ubus: add steering with beacon reports

The AP periodically asks all clients in the environment with what signal
strength they see the other APs. Instead of the RSSI, which can only be
collected if the client scans, the 802.11k values are much more
up-to-date.

In the future it will no longer be necessary to exchange all
probe request frames with all APs, which will significantly reduce the
message overhead and complexity.

Right now there is the issue that clients react very strangely to
becaon requests or they do not react at all.

The client will hopefully report back the RCPI or the RSNI.

Theoretically the values can be converted into each other and so
compared, but this did not work well in self-experiments. Therefore, we
compare the values like the rssi.

We introduce
- rcpi: value that is added to the AP score if rcpi is above rcpi_val
- rcpi_val: threshold that indicates a good rcpi value
            (between 0 and 255)
- low_rcpi: value that is added to the AP score if rcpi is under
	    low_rcpi_val (use a negative value)
- low_rcpi_val: threshold that indicates a bad rcpi value
                (between 0 and 255)
- rsni: value that is added to the AP score if rsni is above rsni_val
- rsni_val: threshold that indicates a good rsni value
            (between 0 and 255)
- low_rsni: value that is added to the AP score if rsni is under
            low_rsni_val (use a negative value)
- low_rsni_val: threshold that indicates a bad rsni value
                (between 0 and 255)
I have to find out values for each parameter myself. So please take a
look at the dawn-hearingmap and if you have a good setting, you can send
it to me.
This commit is contained in:
Polynomialdivision 2020-09-06 23:14:44 +02:00
parent b639145ce9
commit 05565ae1e2
5 changed files with 55 additions and 2 deletions

View file

@ -52,11 +52,19 @@ struct probe_metric_s {
int no_vht_support; // eval_probe_metric()()
int rssi; // eval_probe_metric()()
int low_rssi; // eval_probe_metric()()
int rcpi; // eval_probe_metric()()
int low_rcpi; // eval_probe_metric()()
int rsni; // eval_probe_metric()()
int low_rsni; // eval_probe_metric()()
int freq; // eval_probe_metric()()
int chan_util; // eval_probe_metric()()
int max_chan_util; // eval_probe_metric()()
int rssi_val; // eval_probe_metric()()
int low_rssi_val; // eval_probe_metric()()
int rcpi_val; // eval_probe_metric()()
int low_rcpi_val; // eval_probe_metric()()
int rsni_val; // eval_probe_metric()()
int low_rsni_val; // eval_probe_metric()()
int chan_util_val; // eval_probe_metric()()
int max_chan_util_val; // eval_probe_metric()()
int min_probe_count;

View file

@ -426,8 +426,21 @@ int eval_probe_metric(struct probe_entry_s* probe_entry, ap* ap_entry) {
// TODO: Should RCPI be used here as well?
// TODO: Should this be more scaled? Should -63dB on current and -77dB on other both score 0 if low / high are -80db and -60dB?
// TODO: That then lets device capabilites dominate score - making them more important than RSSI difference of 14dB.
score += (probe_entry->signal >= dawn_metric.rssi_val) ? dawn_metric.rssi : 0;
score += (probe_entry->signal <= dawn_metric.low_rssi_val) ? dawn_metric.low_rssi : 0;
if (probe_entry->rcpi != -1) // -1 currently magic number
{
score += (probe_entry->rcpi >= dawn_metric.rcpi_val) ? dawn_metric.rcpi : 0;
score += (probe_entry->rcpi <= dawn_metric.low_rcpi_val) ? dawn_metric.low_rcpi : 0;
}
else if(probe_entry->rsni != -1)
{
score += (probe_entry->rsni >= dawn_metric.rsni_val) ? dawn_metric.rsni : 0;
score += (probe_entry->rsni <= dawn_metric.low_rsni_val) ? dawn_metric.low_rsni : 0;
}
else //rssi is just fallback
{
score += (probe_entry->signal >= dawn_metric.rssi_val) ? dawn_metric.rssi : 0;
score += (probe_entry->signal <= dawn_metric.low_rssi_val) ? dawn_metric.low_rssi : 0;
}
// TODO: This magic value never checked by caller. What does it achieve?
if (score < 0)

View file

@ -93,15 +93,23 @@ struct probe_metric_s uci_get_dawn_metric() {
ret.no_ht_support = uci_lookup_option_int(uci_ctx, s, "no_ht_support");
ret.no_vht_support = uci_lookup_option_int(uci_ctx, s, "no_vht_support");
ret.rssi = uci_lookup_option_int(uci_ctx, s, "rssi");
ret.rcpi = uci_lookup_option_int(uci_ctx, s, "rcpi");
ret.rsni = uci_lookup_option_int(uci_ctx, s, "rsni");
ret.freq = uci_lookup_option_int(uci_ctx, s, "freq");
ret.rssi_val = uci_lookup_option_int(uci_ctx, s, "rssi_val");
ret.rcpi_val = uci_lookup_option_int(uci_ctx, s, "rcpi_val");
ret.rsni_val = uci_lookup_option_int(uci_ctx, s, "rsni_val");
ret.chan_util = uci_lookup_option_int(uci_ctx, s, "chan_util");
ret.max_chan_util = uci_lookup_option_int(uci_ctx, s, "max_chan_util");
ret.chan_util_val = uci_lookup_option_int(uci_ctx, s, "chan_util_val");
ret.max_chan_util_val = uci_lookup_option_int(uci_ctx, s, "max_chan_util_val");
ret.min_probe_count = uci_lookup_option_int(uci_ctx, s, "min_probe_count");
ret.low_rssi = uci_lookup_option_int(uci_ctx, s, "low_rssi");
ret.low_rcpi = uci_lookup_option_int(uci_ctx, s, "low_rcpi");
ret.low_rsni = uci_lookup_option_int(uci_ctx, s, "low_rsni");
ret.low_rssi_val = uci_lookup_option_int(uci_ctx, s, "low_rssi_val");
ret.low_rcpi_val = uci_lookup_option_int(uci_ctx, s, "low_rcpi_val");
ret.low_rsni_val = uci_lookup_option_int(uci_ctx, s, "low_rsni_val");
ret.bandwidth_threshold = uci_lookup_option_int(uci_ctx, s, "bandwidth_threshold");
ret.use_station_count = uci_lookup_option_int(uci_ctx, s, "use_station_count");
ret.eval_probe_req = uci_lookup_option_int(uci_ctx, s, "eval_probe_req");

View file

@ -579,11 +579,19 @@ enum {
UCI_NO_VHT_SUPPORT,
UCI_RSSI,
UCI_LOW_RSSI,
UCI_RCPI,
UCI_LOW_RCPI,
UCI_RSNI,
UCI_LOW_RSNI,
UCI_FREQ,
UCI_CHAN_UTIL,
UCI_MAX_CHAN_UTIL,
UCI_RSSI_VAL,
UCI_LOW_RSSI_VAL,
UCI_RCPI_VAL,
UCI_LOW_RCPI_VAL,
UCI_RSNI_VAL,
UCI_LOW_RSNI_VAL,
UCI_CHAN_UTIL_VAL,
UCI_MAX_CHAN_UTIL_VAL,
UCI_MIN_PROBE_COUNT,
@ -632,11 +640,19 @@ static const struct blobmsg_policy uci_metric_policy[__UCI_METIC_MAX] = {
[UCI_NO_VHT_SUPPORT] = {.name = "no_vht_support", .type = BLOBMSG_TYPE_INT32},
[UCI_RSSI] = {.name = "rssi", .type = BLOBMSG_TYPE_INT32},
[UCI_LOW_RSSI] = {.name = "low_rssi", .type = BLOBMSG_TYPE_INT32},
[UCI_RCPI] = {.name = "rcpi", .type = BLOBMSG_TYPE_INT32},
[UCI_LOW_RCPI] = {.name = "low_rcpi", .type = BLOBMSG_TYPE_INT32},
[UCI_RSNI] = {.name = "rsni", .type = BLOBMSG_TYPE_INT32},
[UCI_LOW_RSNI] = {.name = "low_rsni", .type = BLOBMSG_TYPE_INT32},
[UCI_FREQ] = {.name = "freq", .type = BLOBMSG_TYPE_INT32},
[UCI_CHAN_UTIL] = {.name = "chan_util", .type = BLOBMSG_TYPE_INT32},
[UCI_MAX_CHAN_UTIL] = {.name = "max_chan_util", .type = BLOBMSG_TYPE_INT32},
[UCI_RSSI_VAL] = {.name = "rssi_val", .type = BLOBMSG_TYPE_INT32},
[UCI_LOW_RSSI_VAL] = {.name = "low_rssi_val", .type = BLOBMSG_TYPE_INT32},
[UCI_RCPI_VAL] = {.name = "rcpi_val", .type = BLOBMSG_TYPE_INT32},
[UCI_LOW_RCPI_VAL] = {.name = "low_rcpi_val", .type = BLOBMSG_TYPE_INT32},
[UCI_RSNI_VAL] = {.name = "rsni_val", .type = BLOBMSG_TYPE_INT32},
[UCI_LOW_RSNI_VAL] = {.name = "low_rsni_val", .type = BLOBMSG_TYPE_INT32},
[UCI_CHAN_UTIL_VAL] = {.name = "chan_util_val", .type = BLOBMSG_TYPE_INT32},
[UCI_MAX_CHAN_UTIL_VAL] = {.name = "max_chan_util_val", .type = BLOBMSG_TYPE_INT32},
[UCI_MIN_PROBE_COUNT] = {.name = "min_probe_count", .type = BLOBMSG_TYPE_INT32},

View file

@ -1332,6 +1332,10 @@ int uci_send_via_network()
blobmsg_add_u32(&b, "no_vht_support", dawn_metric.no_vht_support);
blobmsg_add_u32(&b, "rssi", dawn_metric.rssi);
blobmsg_add_u32(&b, "low_rssi", dawn_metric.low_rssi);
blobmsg_add_u32(&b, "rcpi", dawn_metric.rcpi);
blobmsg_add_u32(&b, "low_rcpi", dawn_metric.low_rcpi);
blobmsg_add_u32(&b, "rsni", dawn_metric.rsni);
blobmsg_add_u32(&b, "low_rsni", dawn_metric.low_rsni);
blobmsg_add_u32(&b, "freq", dawn_metric.freq);
blobmsg_add_u32(&b, "chan_util", dawn_metric.chan_util);
@ -1339,6 +1343,10 @@ int uci_send_via_network()
blobmsg_add_u32(&b, "max_chan_util", dawn_metric.max_chan_util);
blobmsg_add_u32(&b, "rssi_val", dawn_metric.rssi_val);
blobmsg_add_u32(&b, "low_rssi_val", dawn_metric.low_rssi_val);
blobmsg_add_u32(&b, "rcpi_val", dawn_metric.rcpi_val);
blobmsg_add_u32(&b, "low_rcpi_val", dawn_metric.low_rcpi_val);
blobmsg_add_u32(&b, "rsni_val", dawn_metric.rsni_val);
blobmsg_add_u32(&b, "low_rsni_val", dawn_metric.low_rsni_val);
blobmsg_add_u32(&b, "chan_util_val", dawn_metric.chan_util_val);
blobmsg_add_u32(&b, "max_chan_util_val", dawn_metric.max_chan_util_val);
blobmsg_add_u32(&b, "min_probe_count", dawn_metric.min_probe_count);