Skip to content

Commit

Permalink
datastorage/uci/msghandler/ubus: add steering with beacon reports
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
PolynomialDivision committed Sep 7, 2020
1 parent b639145 commit 05565ae
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/include/datastorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
17 changes: 15 additions & 2 deletions src/storage/datastorage.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 8 additions & 0 deletions src/utils/dawn_uci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
16 changes: 16 additions & 0 deletions src/utils/msghandler.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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},
Expand Down
8 changes: 8 additions & 0 deletions src/utils/ubus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1332,13 +1332,21 @@ 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);


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);
Expand Down

0 comments on commit 05565ae

Please sign in to comment.