558-hostapd-add-README-MULTI-AP.patch 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. From bd733055a22c8ca3bcd7648bf716da2713b3d9f1 Mon Sep 17 00:00:00 2001
  2. From: "Arnout Vandecappelle (Essensium/Mind)" <[email protected]>
  3. Date: Mon, 21 Jan 2019 16:44:06 +0100
  4. Subject: [PATCH] hostapd: add README-MULTI-AP
  5. Document what hostapd and wpa_supplicant do for Multi-AP.
  6. This is only included in hostapd, since a Multi-AP device is always an
  7. access point so it should have hostapd.
  8. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <[email protected]>
  9. ---
  10. v4: wps_pbc has multi_ap as a parameter instead of config option.
  11. ---
  12. hostapd/README-MULTI-AP | 160 ++++++++++++++++++++++++++++++++++++++++
  13. 1 file changed, 160 insertions(+)
  14. create mode 100644 hostapd/README-MULTI-AP
  15. --- /dev/null
  16. +++ b/hostapd/README-MULTI-AP
  17. @@ -0,0 +1,160 @@
  18. +hostapd, wpa_supplicant and the Multi-AP Specification
  19. +======================================================
  20. +
  21. +This document describes how hostapd and wpa_supplicant can be configured to
  22. +support the Multi-AP Specification.
  23. +
  24. +Introduction to Multi-AP
  25. +------------------------
  26. +
  27. +The Wi-Fi Alliance Multi-AP Specification is the technical specification for
  28. +Wi-Fi CERTIFIED EasyMesh(TM) [1], the Wi-Fi Alliance® certification program for
  29. +Multi-AP. It defines control protocols between Wi-Fi® access points (APs) to
  30. +join them into a network with centralized control and operation. It is targeted
  31. +only at routers (repeaters, gateways, ...), not at clients. Clients are not
  32. +involved at all in the protocols.
  33. +
  34. +Most of the Multi-AP specification falls outside of the scope of
  35. +hostapd/wpa_supplicant. hostapd/wpa_supplicant is only involved for the items
  36. +summarized below. The rest of the protocol must be implemented by a separate
  37. +daemon, e.g. prplMesh [2]. That daemon also needs to communicate with hostapd,
  38. +e.g. to get a list of associated clients, but this can be done using the normal
  39. +hostapd interfaces.
  40. +
  41. +hostapd/wpa_supplicant needs to be configured specifically to support:
  42. +- the WPS onboarding process;
  43. +- configuring backhaul links.
  44. +
  45. +The text below refers to "Multi-AP Specification v1.0" [3].
  46. +
  47. +
  48. +Fronthaul and backhaul links
  49. +----------------------------
  50. +
  51. +In a Multi-AP network, the central controller can configure the SSIDs on the
  52. +devices that are joined into the network. These are called fronthaul SSIDs.
  53. +From the point of view of hostapd, there is nothing special about these
  54. +fronthaul SSIDs.
  55. +
  56. +In addition to fronthaul SSIDs, the controller can also configure backhaul
  57. +links. A backhaul link is a link between two access point devices, giving
  58. +internet access to access point devices that don't have a wired link. The
  59. +Multi-AP specification doesn't dictate this, but typically the backhaul link
  60. +will be bridged into a LAN together with (one of) the fronthaul SSID(s) and the
  61. +wired Ethernet ports.
  62. +
  63. +A backhaul link must be treated specially by hostapd and wpa_supplicant. One
  64. +side of the backhaul link is configured through the Multi-AP protocol as the
  65. +"backhaul STA", i.e. the client side of the link. A backhaul STA is like any
  66. +station and is handled appropriately by wpa_supplicant, but two additional
  67. +features are required. It must send an additional information element in each
  68. +(Re-)Association Request ([3], section 5.2, paragraph 4). In addition, it must
  69. +use 4-address mode for all frames sent over this link ([3], section 14).
  70. +Therefore, wpa_supplicant must be configured explicitly as the backhaul STA
  71. +role, by setting 'multi_ap_backhaul_sta=1' in the network configuration block
  72. +or when configuring the SSID through the client socket. When
  73. +'multi_ap_backhaul_sta=1', wpa_supplicant includes the Multi-AP IE in
  74. +(Re-)Association Request messages and verifies that it is included in the
  75. +(Re-)Association Response. If it is not, association fails. If it is,
  76. +wpa_supplicant sets 4-address mode for this interface through a driver
  77. +callback.
  78. +
  79. +The AP side of the backhaul link is called a "backhaul SSID". Such an SSID must
  80. +be handled specially by hostapd, because it must add an additional information
  81. +element in each (Re-)Association Response, but only to stations that have
  82. +identified themselves as backhaul stations ([3], section 5.2, paragraph 5-6).
  83. +This is important because it is possible to use the same BSS and SSID for
  84. +fronthaul and backhaul at the same time. The additional information element must
  85. +only be used for frames sent to a backhaul STA, not to a normal STA. Also,
  86. +frames sent to a backhaul STA must use 4-address mode, while frames sent to a
  87. +normal STA (fronthaul, when it's a fronthaul and backhaul SSID) must use
  88. +3-address mode.
  89. +
  90. +An SSID is configured in Multi-AP mode in hostapd by setting the 'multi_ap'
  91. +configuration option to 1 (backhaul SSID), 2 (fronthaul SSID) or 3
  92. +(simultaneous backhaul and fronthaul SSID). If this option is set, hostapd
  93. +parses the Multi-AP information element in the Association Request. If the
  94. +station is a backhaul STA and the SSID is configured as a backhaul SSID,
  95. +hostapd sets up 4-address mode. Since there may be multiple stations connected
  96. +simultaneously, and each of them has a different RA (receiver address), a VLAN
  97. +is created for each backhaul STA and it is automatically added to a bridge.
  98. +This is the same behavior as for WDS, and the relevant option ('bridge' or
  99. +'wds_bridge') applies here as well.
  100. +
  101. +If 'multi_ap' is 1 (backhaul SSID only), any station that tries to associate
  102. +without the Multi-AP information element will be denied.
  103. +
  104. +If 'multi_ap' is 2 (fronthaul SSID only), any station that tries to associate
  105. +with the Multi-AP information element will be denied. That is also the only
  106. +difference with 'multi_ap' set to 0: in the latter case, the Multi-AP
  107. +information element is simply ignored.
  108. +
  109. +In summary, this is the end-to-end behaviour for a backhaul BSS (i.e.,
  110. +multi_ap_backhaul_sta=1 in wpa_supplicant on STA, and multi_ap=1 or 3 in
  111. +hostapd on AP). Note that point 1 means that hostapd must not be configured
  112. +with WPS support on the backhaul BSS (multi_ap=1). hostapd does not check for
  113. +that.
  114. +
  115. +1. Backhaul BSS beacons do not advertise WPS support (other than that, nothing
  116. + multi-ap specific).
  117. +2. STA sends authentication req (nothing multi-ap specific).
  118. +3. AP sends authentication resp (nothing multi-ap specific).
  119. +4. STA sends association req with Multi-AP IE.
  120. +5. AP send association resp with Multi-AP IE.
  121. +6. STA and AP both use 4-address mode for data.
  122. +
  123. +
  124. +WPS support
  125. +-----------
  126. +
  127. +WPS requires more special handling. WPS must only be advertised on fronthaul
  128. +SSIDs, not on backhaul SSIDs, so WPS should not be enabled on a backhaul-only
  129. +SSID in hostapd.conf. The WPS configuration purely works on the fronthaul SSID.
  130. +When a WPS M1 message has an additional subelement that indicates a request for
  131. +a multi-AP backhaul link, hostapd must not respond with the normal fronthaul
  132. +SSID credentials; instead, it should respond with the (potentially different)
  133. +backhaul SSID credentials.
  134. +
  135. +To support this, hostapd has the 'multi_ap_backhaul_ssid',
  136. +'multi_ap_backhaul_wpa_psk' and 'multi_ap_backhaul_wpa_passphrase' options.
  137. +When these are set on an SSID with WPS, they are used instead of the normal
  138. +credentials when hostapd receives a WPS M1 message with the Multi-AP IE. Only
  139. +WPA2 Personal is supported in the Multi-AP specification, so there is no need
  140. +to specify authentication or encryption options. For the backhaul credentials,
  141. +per-device PSK is not supported.
  142. +
  143. +If the SSID is a simultaneous backhaul and fronthaul SSID, there is no need to
  144. +specify the backhaul credentials, since the backhaul and fronthaul credentials
  145. +are identical.
  146. +
  147. +To enable the Multi-AP backhaul STA feature when it performs WPS, a new
  148. +parameter has been introduced to the WPS_PBC control interface call.
  149. +When this option is set, it adds the multi-AP backhaul subelement to
  150. +the association and M1 messages. It then configures the new SSID with
  151. +'multi_ap_backhaul_sta=1'. Note that this means that if the AP does not
  152. +follow the Multi-AP specification, wpa_supplicant will fail to
  153. +associate.
  154. +
  155. +In summary, this is the end-to-end behaviour for WPS of a backhaul link (i.e.,
  156. +multi_ap=1 option is given in the wps_pbc call on the STA side, and multi_ap=2
  157. +and multi_ap_backhaul_ssid and either multi_ap_backhaul_wpa_psk or
  158. +multi_ap_backhaul_wpa_passphrase are set to the credentials of a backhaul SSID
  159. +in hostapd on registrar AP).
  160. +
  161. +1. Fronthaul BSS beacons advertise WPS support (nothing multi-ap specific).
  162. +2. Enrollee sends authentication req (nothing multi-ap specific).
  163. +3. AP sends authentication resp (nothing multi-ap specific).
  164. +4. Enrollee sends association req with Multi-AP IE.
  165. +5. AP send association resp with Multi-AP IE.
  166. +6. Enrollee sends M1 with additional Multi-AP subelement
  167. +7. AP sends M8 with backhaul instead of fronthaul credentials.
  168. +8. Enrollee sends Deauth.
  169. +
  170. +
  171. +References
  172. +----------
  173. +
  174. +[1] https://www.wi-fi.org/discover-wi-fi/wi-fi-easymesh
  175. +[2] https://github.com/prplfoundation/prplMesh
  176. +[3] https://www.wi-fi.org/file/multi-ap-specification-v10
  177. + (requires registration)