36 Commits

Author SHA1 Message Date
Stijn Tintel
041e884240 local_node: query client MBO support from hostapd
Query client MBO support from hostapd and display it in the output of
the connected_clients ubus method as "multi-band-operation".

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2022-08-16 10:40:28 +03:00
David Bauer
444b233b05 policy: only send preferred candidate with transition request
Only send the preferred candidate with a BSS transition request.
Otherwise, unsuitable candidates might be included in the neighbor-list
of a transition request.

Signed-off-by: David Bauer <mail@david-bauer.net>
2022-05-05 23:39:42 +02:00
David Bauer
f88ac23903 local-node: periodically send link-measurement requests
Send link-measurement requests to every supporting local-sta in order to
acquire information to assess the link-quality bi-directional.

The link-measurement request is sent each configurable interval. It can
be disabled by configuring the interval to 0.

Signed-off-by: David Bauer <mail@david-bauer.net>
2022-04-04 17:08:07 +02:00
David Bauer
6d3314ca56 local-node: handle received link-measurement reports
Store link-measurement reports received from STAs as measurements.

Signed-off-by: David Bauer <mail@david-bauer.net>
2022-04-04 14:52:35 +02:00
David Bauer
7df969fd39 measurement: generalize measurement handling
Generalize measurement handling in a way that RCPi and RSNI are stored
regardless of the specific measurement type. This allows us to handle
link-measurement reports the same way as we already handle
beacon-reports.

Signed-off-by: David Bauer <mail@david-bauer.net>
2022-04-04 14:50:34 +02:00
David Bauer
bb61f2a598 local-node: enable link-measurement capability
Request hostap to enable the link-measurement capability in the BSS
beacons. Otherwise, STAs might reject link-measurement requests despite
being capable of performing such.

Signed-off-by: David Bauer <mail@david-bauer.net>
2022-04-04 14:48:58 +02:00
David Bauer
f4e120c9a3 band-steering: add band-steering component
This adds a new band-steering component to usteer.

With band-steering enabled, usteer will attempt to move clients with a
consistently good SNR / signal from 2.4 GHz to the 5 GHz band.

In contrast to existing policies usteer tracks, band-steering is
non-invasive and will not lead to forceful connection termination.

Signed-off-by: David Bauer <mail@david-bauer.net>
2022-03-18 21:46:29 +01:00
David Bauer
648c6f3bc3 policy: make roam-steers client-rejectable
While usteer tries it's best to determine the availability of a better
node for a certain client, it might still attempt to direct the client
to a unsuitable AP.

Transition away from using BSS-Transition-Requests with the
disassoc-imminent bit set and instead unset this bit.

This way, the client can inform the AP it will not transition to a
different BSS but instead wishes to remain connected to the current AP.

usteer will still kick clients in case they either accepted the
BSS-transition-request and do not roam or ignore the request completely.

Signed-off-by: David Bauer <mail@david-bauer.net>
2022-03-18 21:42:33 +01:00
David Bauer
98247d1eda usteer: track RRM and BSS-TM support per connection
BSS transition management as well as RRM capabilities have to be
considered not for the STA but per STA connection.

Most prominently, a STA might not support BSS-TM when connected without
PMF.

Signed-off-by: David Bauer <mail@david-bauer.net>
2022-02-19 16:10:49 +01:00
David Bauer
f462de04e4 local-node: fetch bss-transition-management support
Signed-off-by: David Bauer <mail@david-bauer.net>
2022-02-19 16:10:34 +01:00
David Bauer
0dd47b1434 local-node: convert kick-dely to absolute time
Signed-off-by: David Bauer <mail@david-bauer.net>
2022-02-16 22:59:59 +01:00
David Bauer
6aebb75cec local-node: check correct field
This causes segfaults on OpenWrt 21.02 which is missing the op-class
field.

Reported-by: John Crispin <john@phrozen.org>
Signed-off-by: David Bauer <mail@david-bauer.net>
2022-02-06 23:44:57 +01:00
David Bauer
3c0cd982d5 local-node: save latest bss-transition-response
Save the latest BSS-transition management response received from a STA.
This information can later be used to prevent kicking STAs when they
rejected a transition request.

Signed-off-by: David Bauer <mail@david-bauer.net>
2022-02-04 23:34:25 +01:00
David Bauer
04ef308f8c local-node: save beacon-reports
Add received beacon-reports from STAs to the measurement database.

Signed-off-by: David Bauer <mail@david-bauer.net>
2022-02-03 22:56:22 +01:00
David Bauer
b0dab90887 measurement: add handling of measurements
Add logic for saving measurement-reports from STAs.

This commit does not yet save the measurement-reports received from
clients but adds the necessary code to do so. Currently the codes can
only handle beacon-reports, but link measurements can be added to it in
the future.

It also adds the new config-key measurement_report_timeout which
controls how long measurements are saved upon they are received by a
STA.

Signed-off-by: David Bauer <mail@david-bauer.net>
2022-02-03 22:50:13 +01:00
David Bauer
76ccae62df node: add methods to access nodes by bssid
Add methods which returns a given node for a provided BSSID. This is
required to retrieve the node object from information available with
a neighbor report.

Signed-off-by: David Bauer <mail@david-bauer.net>
2022-02-03 22:44:14 +01:00
David Bauer
3b51bfbaf6 local-node: obtain channel + op-class
In order to send passive beacon-requests, channel and op-class of nodes
are required. Obtain this information per local-node from hostapd.

Signed-off-by: David Bauer <mail@david-bauer.net>
2022-02-03 22:43:37 +01:00
David Bauer
e36967f219 local-node: handle BSS transition queries
Make usteer handle incoming BSS-transition requests. Update with the
most active roaming neighbors like we already do for imminent
disassociations.

Create a new ubus method which calls hostapds bss_transition_request
method. This does not set the disassoc imminent bit, thus will not
automatically disassoc the requesting STA.

Signed-off-by: David Bauer <mail@david-bauer.net>
2022-01-31 23:40:52 +01:00
David Bauer
55e98d852c sta: uniform disconnect state handling
Logic for handling STA transition to disconnected state is
present multiple times. Create a new method to remove
duplicate code.

Signed-off-by: David Bauer <mail@david-bauer.net>
2022-01-09 01:59:53 +01:00
David Bauer
806e647cbc sta: remove duplicate code
Move the sta frequency-seen logic to usteer_sta_info_update.

This method is called on every occurence the seen frequency
is set now, thus removing the duplicate code.

Signed-off-by: David Bauer <mail@david-bauer.net>
2022-01-09 01:57:32 +01:00
David Bauer
e51ea7ac1a node: move roam-events to dedicated struct
Move the roam event counters to a dedicated struct.

Update the ubus output to represent this new organization.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-11-28 13:47:53 +01:00
David Bauer
abc6fe047f local-node: update STA RRM capabilites
Save the RRM capabilities of STAs when updating clients from hostapd.

This is required to determine which measurement modes a STA supports.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-11-25 23:04:48 +01:00
David Bauer
d0cd65b762 node: save created time for node
Save the timestamp of the node creation. This is required to optimize
the selection of most-roamed to neighbors relative to their creation
time.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-11-25 22:28:41 +01:00
David Bauer
532a48d23e local-node: prioritize neighbor candidates
Prioritize neighbor candidates installed to hostapd. Add a new config
option to set a limit for neighbor reports installed to hostapd. This is
due to the fact, most devices will only evaluate a certain amount of
neighbor reports. Furthermore, the number of neighbor reports possible
is limited by the maximum frame size.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-11-25 22:28:04 +01:00
David Bauer
4862080de7 node: keep track of roam-sources and roam-destinations
Keep track of STA journeys between multiple nodes. When a new STA is
reported from a foreign node, check whether this STA was previously
associated with a local node.

Vice versa, check upon association whether or not the STA was previously
associated with a foreign node.

Keep track of these roaming transactions using two new (local) fields of
the node struct.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-11-25 22:26:08 +01:00
David Bauer
6a20591b20 sta-info: add last_connected field
Add a last_connected field to the sta_info struct. This field can be
used to determine, if and when a client was last connected to a given
node. This way, other nodes can determine where a client roamed to or
from.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-11-25 22:24:33 +01:00
David Bauer
d3ff0d59da sta: add sta_connection_state enum
Make the connection state of a sta-info more readable by introducing an
enum for the STA connection state.

Also switch come comparison cases to use the explicit enum values to
make the code more readable.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-10-15 15:50:25 +02:00
David Bauer
8c35c8e6a0 local-node: don't read pointer after clear
The name pointer provided by ubus get's cleared after the first call to
ubus_register_subscriber in usteer_get_node. The leads to an incorrect
ifindex returned by if_nametoindex due to the 0 characters long string.

Work around this issue by reusing the interface name already stored in
the local node struct.

Fixes querying the wrong interface with netlink, resulting in incorrect
SSIDs used for the nodes.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-09-21 19:46:05 +02:00
Felix Fietkau
e685db7fa7 add support for defining global host info
Change the '*' in the node info update cmd to refer to host info instead

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-07-06 19:44:02 +02:00
Felix Fietkau
8be33b596b remote: track remote hosts as a separate data structure
Will be used to track host info

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-07-06 19:14:40 +02:00
Felix Fietkau
e9641c4657 rename script_data to node_info
It's a more descriptive name, and we will have host_info later as well

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-07-06 14:35:40 +02:00
Felix Fietkau
831b46a705 ubus: add api for modifying node script data
This is replicated across nodes

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-07-06 11:10:47 +02:00
Felix Fietkau
0e2538d685 config: check for empty ssid list
Without this check, an empty ssid list array results in a config with no nodes

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-07-06 11:10:15 +02:00
Felix Fietkau
0aab299c54 make list of steering-enabled SSIDs configurable
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-05-13 16:09:29 +02:00
Felix Fietkau
2b1c740ce3 rework log handling
- make logging events more structured
- add fine grained control over log events
- make it possible to receive more detailed events via ubus

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-04-16 14:55:57 +02:00
Felix Fietkau
d10731f806 usteer: Initial import
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-11-12 15:37:10 +01:00