[PATCH 0/8] wifi_stats: WBA Connect-Info in RADIUS

Iegor Sergieienkov iegor at nova-labs.com
Thu Aug 27 07:16:17 PDT 2026


This series adds optional per-station link statistics collection to
hostapd and uses the result to populate the RADIUS Connect-Info
attribute (RFC 2869) in the format defined by
draft-grayson-connectinfo-10, "Connect-Info Attribute for Wi-Fi
Networks" (Grayson, Redmore, 6 July 2026), published by the Wireless
Broadband Alliance.

RFC 2869 leaves the contents of Connect-Info as free text, so the
attribute today carries whatever each vendor chooses. The draft defines
a grammar for it so that an identity provider can read link quality -
signal level, bit rates, frame loss and retry rates - alongside the
connection parameters already reported. hostapd currently emits
"CONNECT 54Mbps 802.11a", which the draft's grammar does not accept.

An eloop timer polls hostapd_drv_read_sta_data() for each associated
station and folds the samples into a per-station accumulator. Five
metrics are aggregated with a configurable algorithm (MIN, MAX, AVG-LIN,
AVG-EXP, ACC or NONE) over a span that is either the period since the
last accounting report, which is the default, or a fixed sliding window.

Everything is behind CONFIG_WIFI_STATS, which is not enabled by default.
With it built and wifi_stats_wba_enabled=1, an 802.11n station changes
from

  CONNECT 72Mbps 802.11n

to

  CONNECT 72.00 Mbps 802.11n Channel:1 RSSI:-42(AVG-LIN 27S)
  TxBitRate:52.0(MAX 27S) RxBitRate:52.0(MAX 27S) Global-OC:81

(one line on the wire). Setting wifi_stats_wba_enabled=0 keeps the
existing string. A metric whose value the driver does not report is
omitted rather than sent as zero.

The patches are:

  1  the collection and aggregation module
  2  build rules
  3  configuration parameters
  4  hostapd lifecycle integration
  5  use in the RADIUS Connect-Info attribute
  6  control interface and hostapd_cli commands
  7  a strict ABNF validator for the format
  8  hwsim tests

Known gaps:

 - RATE, used by TxBitRate and RxBitRate, is limited by the draft's
   grammar to four integer digits and so cannot express a link above
   9999.9 Mbps. Such rates are reachable on 802.11be. MAXSPEED, used by
   the leading CONNECT rate, has five and is not affected.

 - The draft permits an AP MLD to report one Global-OC per link but
   gives no ordering and no way to bind an instance to a link, so a
   single operating class is reported.

 - The maximum rate is taken from a per-spatial-stream table rather than
   computed from the MCS set, and quotes the shortest guard interval
   each amendment permits. The draft does not fix the guard interval.

Testing: the hwsim tests in patch 8 pass 31 of 31 against
mac80211_hwsim. The validator in patch 7 accepts every example string in
the draft and rejects counterexamples for each production. Without
wmediumd the simulated radio never reports a TX retry, so the FrameLoss
and FrameRetry assertions check shape only; this is noted in the test
module.

Iegor Sergieienkov (8):
  wifi_stats: Add per-STA statistics collection and aggregation module
  wifi_stats: Add build rules for hostapd
  wifi_stats: hostapd configuration parameters
  wifi_stats: Integration into hostapd
  wifi_stats: Use WBA Connect-Info format in RADIUS attributes
  wifi_stats: hostapd control interface and hostapd_cli commands
  tests: Add a Connect-Info ABNF validator
  tests: wifi_stats WBA Connect-Info

 hostapd/Makefile                   |    5 +
 hostapd/config_file.c              |  116 ++
 hostapd/ctrl_iface.c               |  374 ++++++
 hostapd/defconfig                  |    4 +
 hostapd/hostapd.conf               |   71 +
 hostapd/hostapd_cli.c              |  117 ++
 src/Makefile                       |    1 +
 src/ap/accounting.c                |   23 +-
 src/ap/ap_config.c                 |    8 +
 src/ap/ap_config.h                 |   15 +
 src/ap/hostapd.c                   |   73 ++
 src/ap/hostapd.h                   |    8 +
 src/ap/ieee802_1x.c                |   32 +-
 src/ap/sta_info.c                  |   10 +-
 src/ap/sta_info.h                  |    8 +
 src/wifi_stats/Makefile            |    8 +
 src/wifi_stats/wifi_stats.c        | 1941 ++++++++++++++++++++++++++++
 src/wifi_stats/wifi_stats.h        |  101 ++
 tests/hwsim/connectinfo_abnf.py    |  443 +++++++
 tests/hwsim/dictionary.radius      |    6 +
 tests/hwsim/example-hostapd.config |    2 +
 tests/hwsim/test_ap_wifi_stats.py  | 1183 +++++++++++++++++
 22 files changed, 4542 insertions(+), 5 deletions(-)
 create mode 100644 src/wifi_stats/Makefile
 create mode 100644 src/wifi_stats/wifi_stats.c
 create mode 100644 src/wifi_stats/wifi_stats.h
 create mode 100644 tests/hwsim/connectinfo_abnf.py
 create mode 100644 tests/hwsim/test_ap_wifi_stats.py

-- 
2.43.0




More information about the Hostap mailing list