[RFC v2 00/99] Initial NAN R2 support

Andrei Otcheretianski andrei.otcheretianski at intel.com
Tue Dec 23 03:51:04 PST 2025


This series is an RFC initial proposal for NAN R2 implementation in
wpa_supplicant.
This includes an implementation for NDP and NDL state machines including
the security negotiation, control interface, driver.h definitions
required for scheduling and the glue layer with wpa_supplicant.
 
These patches should be applied on top of the v2 of "Add initial
support for NAN synchronized discovery" patch series.
 
In this submission, we don't include nl80211 changes, as the
corresponding kernel side is not fully ready yet. This will be
resumbitted again, once it is available upstream.
 
Design summary:
NDP establishment is triggered using nan_handle_ndp_setup() function
which is called both for triggering NDP request and replying to an
incoming ndp request. nan_action_rx(), nan_tx_status() and send_naf()
callback are used to send and receive NAFs and their statuses in the NAN
module. ndp_action_notif() callback is used to notify about the incoming NDP
request/counter response events. ndp_[dis]connected() callbacks are
called upon completion of NDP and NDL establishment.
 
In the current design, NDP and NDL state machines are managed in the NAN
module. Note that NDL SM doesn't manage actual device scheduling and it
is assumed that the schedule is configured outside of NAN module and
provided as part of nan_ndp_params struct. Having said that, NAN module
manages NDL state transitions and decides internally whether to
accept/counter or reject the NDL establishment based on the configured
schedule, NDC, QoS parameters etc.
 
Upper layers (wpa_supplicant, ctrl_iface, driver) are responsible
to configure the underlying device with the provided schedule and
configure the corresponding peer schedule. The derived NDP parameters
(peer NDI address and keys) are either provided as part of NDP
notifications or can be queried via provided APIs. wpa_supplicant configures
this information to the underlying device.

As noted before, this submission doesn't include the corresponding
nl80211 implementation for local and peer schedule configuration.

In order to run and test with mac80211_hwsim:
NAN NDL/NDP state machines can be tested with wpa_supplicant module
test.
Running the data path tests in test_nan.py will be more challenging,
as it at least requires the NAN_DATA interface support in the kernel and
some trivial support for scheduling commands which may just be empty stubs for now.
NMI/NDI station / key management can be skipped in wpa_supplicant until the
kernel supports it.

Andrei Otcheretianski (39):
  drivers: Add initial APIs for NAN data path and scheduling
  wpa_supplicant: Support NAN local schedule configuration
  wpa_supplicant: Support NAN_DATA interface
  NAN: Add a function to get peer NDC channel
  wpa_supplicant: Support NAN_NDP_REQUEST command
  wpa_supplicant: Handle NAF tx status
  wpa_supplicant: Register NAN data path callbacks
  driver_nl80211: Register for NAFs
  wpa_supplicant: Receive NAFs
  wpa_supplicant: Implement nan_get_chans() callback
  wpa_supplicant: Add NAN data path events
  wpa_supplicant: Add support for NDP_RESPONSE command
  wpa_supplicant: Support NAN_NDP_TERMINATE command
  crypto: Add pbkdf2_sha256() and pbkdf2_sha384() functions
  NAN: Add ND-PMK derivation API in nan_crypto.c
  wpa_supplicant: Init NAN security configurations
  wpa_supplicant: Add security parameters to NAN DP request and response
  ctrl_iface: Add command to dump peer schedule
  ctrl_iface: Support dumping NAN peer capabilities
  wpa_supplicant: Configure reported NAN device capabilities
  NAN_DE: Add a callback for additional attributes
  NAN: Make nan_add_dev_capa_attr() available outside of NAN module
  wpa_supplicant: Implement NAN DE's add_extra_attrs() callback
  tests: Add NAN device support to HWSimRadio
  tests: Add get_iface_addr() to wpasupplicant.py
  wpa_supplicant: Support NDP setup with PMK
  wpa_supplicant: Add NAN config to disallow freqs and limit bandwidth
  wpa_cli: Add NAN data path commands
  NAN: Parse device attributes from SDF frames
  NAN: Make ndp_connected() callback return int
  NAN: Configure peer NMI station and schedule
  NAN: Add an API to convert nan_sched_chan struct to channel entry
  wpa_supplicant: Set chan_entry field in local NAN schedule
  wpa_supplicant: Implement NAN peer configuration and scheduling
  NAN: Indicate if new keys are derived or previous NDP exists
  NAN: Add API to get peer elements
  wpa_supplicant: Configure NAN data station
  nl80211: Report NAN scheduling capabilities
  tests: Add NAN data path tests

Daniel Gabay (3):
  wpa_supplicant: Set NAN schedule rx_nss from capability
  nl80211: use nl80211_cmd_msg in sta_add to support NAN interfaces
  nl80211: don't fill empty supported rates in sta_add for NAN

Ilan Peer (57):
  NAN: Rename a NAN attribute name
  NAN: Add Data path and scheduling definition
  NAN: Add Data path security definitions
  NAN: Change the return value of nan_de_rx_sdf()
  NAN: Keep a list of known peers and their attributes
  NAN: Add support for parsing NAN action frames
  NAN: Add a function to add device capability attribute
  NAN: Introduce NDP data structures
  NAN: Support handling NDP state machine and operations
  NAN: Define data structure to represent a NAN schedule.
  NAN: Add support for parsing NAN availability attribute
  NAN: Add support for parsing device capability attributes
  NAN: Add support for parsing element container attributes
  common: Add some helper functions
  utils: Add few more functions to bitfield module
  NAN: Add utility function to convert channel to bitmap
  NAN: Initial support for NDL state machine and operations
  NAN: Add support for building schedule related attributes
  NAN: Add Tx status notification to NDL
  NAN: Add support for adding availability attributes
  NAN: Add potential availability entries
  NAN: Add support for converting NAN schedule entries to availability
  NAN: Add utility functions for NAN schedule validation
  NAN: Add validation of peer availability
  NAN: Properly set the NDL status in a response and confirm
  NAN: Reject NDLs with overlapping time bitmaps
  NAN: Add an API to update the cluster ID
  NAN: Add send_naf() callback support
  NAN: Add a function to add element container attribute
  NAN: Add support for building a NAF
  NAN: Process NAN Action frame
  NAN: Add Tx status handling
  NAN: Add API to request/response/terminate an NDP
  NAN: Support handling NDP termination from peer in NDP SM
  NAN: Add support for terminating an NDP
  NAN: Add NAN cryptographic functions
  NAN: Add support for NDP security Rx flow
  NAN: Add support for adding security attributes
  NAN: Add handling of pre Tx security operations
  NAN: Support security processing on NDP done
  NAN: Handle security in NDP processing
  NAN: Add security configuration to NDP request/response
  NAN: Add security support in NAF transmit flow
  NAN: Extend the nan_ndp_action_notif() callback to include security
  NAN: Add a callback to allow verifying publish instance ID
  NAN: Add an API to get a peer device capabilities
  NAN: Add an API to retrieve TK
  NAN: Add an API to get committed/conditional schedule of a peer
  NAN: Add an API to get the potential availability of a peer
  NAN: Add an API to convert a schedule into a buffer
  NAN: Support parsing peer device capability extension attribute
  NAN: Add device capability extension attributes to NAFs
  NAN: Add test utility for NAN module
  NAN: Add crypto API tests
  NAN: Add NAN module testing for secure state machine
  NAN: Add testing coverage for multiple NDP setups
  NAN: Add an API to delete all NDPs of a specific peer

 src/common/ieee802_11_common.c     |  147 ++
 src/common/ieee802_11_common.h     |    5 +
 src/common/ieee802_11_defs.h       |   11 +
 src/common/nan_de.c                |  131 +-
 src/common/nan_de.h                |    5 +-
 src/common/nan_defs.h              |  469 +++++-
 src/common/wpa_ctrl.h              |    4 +
 src/crypto/crypto_openssl.c        |   30 +
 src/crypto/sha256.h                |    3 +-
 src/crypto/sha384.h                |    2 +
 src/drivers/driver.h               |  177 ++-
 src/drivers/driver_nl80211.c       |   45 +-
 src/drivers/driver_nl80211_capa.c  |   65 +-
 src/nan/Makefile                   |    8 +-
 src/nan/nan.c                      | 2204 ++++++++++++++++++++++++++
 src/nan/nan.h                      |  536 +++++++
 src/nan/nan_crypto.c               |  422 +++++
 src/nan/nan_i.h                    |  590 +++++++
 src/nan/nan_module_test_cases.c    |  810 ++++++++++
 src/nan/nan_module_tests.c         | 1519 ++++++++++++++++++
 src/nan/nan_module_tests.h         |  145 ++
 src/nan/nan_ndl.c                  | 1767 +++++++++++++++++++++
 src/nan/nan_ndp.c                  | 1015 ++++++++++++
 src/nan/nan_sec.c                  | 1210 ++++++++++++++
 src/nan/nan_util.c                 | 1725 ++++++++++++++++++++
 src/utils/bitfield.c               |  158 ++
 src/utils/bitfield.h               |   12 +
 src/utils/common.h                 |    2 +
 src/utils/module_tests.h           |    1 +
 src/utils/utils_module_tests.c     |   75 +-
 tests/hwsim/hwsim.py               |   14 +-
 tests/hwsim/test_nan.py            |  308 +++-
 tests/hwsim/wpasupplicant.py       |   18 +
 wpa_supplicant/Makefile            |    9 +
 wpa_supplicant/ctrl_iface.c        |   21 +
 wpa_supplicant/driver_i.h          |   24 +
 wpa_supplicant/events.c            |   29 +-
 wpa_supplicant/nan_supplicant.c    | 2342 ++++++++++++++++++++++++++--
 wpa_supplicant/nan_supplicant.h    |   23 +-
 wpa_supplicant/wpa_cli.c           |   45 +
 wpa_supplicant/wpa_supplicant.c    |    4 +-
 wpa_supplicant/wpa_supplicant_i.h  |   14 +-
 wpa_supplicant/wpas_module_tests.c |    5 +
 43 files changed, 15897 insertions(+), 252 deletions(-)
 create mode 100644 src/nan/nan_crypto.c
 create mode 100644 src/nan/nan_module_test_cases.c
 create mode 100644 src/nan/nan_module_tests.c
 create mode 100644 src/nan/nan_module_tests.h
 create mode 100644 src/nan/nan_ndl.c
 create mode 100644 src/nan/nan_ndp.c
 create mode 100644 src/nan/nan_sec.c
 create mode 100644 src/nan/nan_util.c

-- 
2.49.0




More information about the Hostap mailing list