1 1.1.1.1.4.2 perseant Wi-Fi Aware unsynchronized service discovery (NAN USD) 2 1.1.1.1.4.2 perseant ====================================================== 3 1.1.1.1.4.2 perseant 4 1.1.1.1.4.2 perseant This document descibes how the unsynchronized service discovery defined 5 1.1.1.1.4.2 perseant in the Wi-Fi Aware specification v4.0 can be used with wpa_spplicant. 6 1.1.1.1.4.2 perseant 7 1.1.1.1.4.2 perseant More information about Wi-Fi Aware is available from this Wi-Fi 8 1.1.1.1.4.2 perseant Alliance web page: 9 1.1.1.1.4.2 perseant https://www.wi-fi.org/discover-wi-fi/wi-fi-aware 10 1.1.1.1.4.2 perseant 11 1.1.1.1.4.2 perseant Build config setup 12 1.1.1.1.4.2 perseant ------------------ 13 1.1.1.1.4.2 perseant 14 1.1.1.1.4.2 perseant The following parameters must be included in the config file used to 15 1.1.1.1.4.2 perseant compile hostapd and wpa_supplicant. 16 1.1.1.1.4.2 perseant 17 1.1.1.1.4.2 perseant wpa_supplicant build config 18 1.1.1.1.4.2 perseant --------------------------- 19 1.1.1.1.4.2 perseant 20 1.1.1.1.4.2 perseant Enable NAN USD in wpa_supplicant build config file 21 1.1.1.1.4.2 perseant 22 1.1.1.1.4.2 perseant CONFIG_NAN_USD=y 23 1.1.1.1.4.2 perseant 24 1.1.1.1.4.2 perseant Control interface commands and events 25 1.1.1.1.4.2 perseant ------------------------------------- 26 1.1.1.1.4.2 perseant 27 1.1.1.1.4.2 perseant Following control interface commands can be used: 28 1.1.1.1.4.2 perseant 29 1.1.1.1.4.2 perseant NAN_PUBLISH service_name=<name> [ttl=<time-to-live-in-sec>] [freq=<in MHz>] [freq_list=<comma separate list of MHz>] [srv_proto_type=<type>] [ssi=<service specific information (hexdump)>] [solicited=0] [unsolicited=0] [fsd=0] 30 1.1.1.1.4.2 perseant 31 1.1.1.1.4.2 perseant If ttl=0 or the parameter is not included, only one Publish message is 32 1.1.1.1.4.2 perseant transmitted. 33 1.1.1.1.4.2 perseant 34 1.1.1.1.4.2 perseant If freq is not included, the default frequency 2437 MHz (channel 6 on 35 1.1.1.1.4.2 perseant the 2.4 GHz band) is used. 36 1.1.1.1.4.2 perseant 37 1.1.1.1.4.2 perseant If freq_list is included, publisher iterates over all the listed 38 1.1.1.1.4.2 perseant channels. A special freq_list=all value can be used to generate the 39 1.1.1.1.4.2 perseant channel list automatically based on the list of allowed 2.4 and 5 GHz 40 1.1.1.1.4.2 perseant channels. 41 1.1.1.1.4.2 perseant 42 1.1.1.1.4.2 perseant srv_proto_type values are defined in the Service Protocol Types table in 43 1.1.1.1.4.2 perseant the Wi-Fi Aware specification. 44 1.1.1.1.4.2 perseant 45 1.1.1.1.4.2 perseant This command returns the assigned publish_id value or FAIL on failure. 46 1.1.1.1.4.2 perseant 47 1.1.1.1.4.2 perseant This command maps to the Publish() method in the NAN Discovery Engine. 48 1.1.1.1.4.2 perseant 49 1.1.1.1.4.2 perseant NAN_CANCEL_PUBLISH publish_id=<id from NAN_PUBLISH> 50 1.1.1.1.4.2 perseant 51 1.1.1.1.4.2 perseant This command maps to the CancelPublish() method in the NAN Discovery 52 1.1.1.1.4.2 perseant Engine. 53 1.1.1.1.4.2 perseant 54 1.1.1.1.4.2 perseant NAN_UPDATE_PUBLISH publish_id=<id from NAN_PUBLISH> [ssi=<service specific information (hexdump)>] 55 1.1.1.1.4.2 perseant 56 1.1.1.1.4.2 perseant This command maps to the UpdatePublish() method in the NAN Discovery 57 1.1.1.1.4.2 perseant Engine. 58 1.1.1.1.4.2 perseant 59 1.1.1.1.4.2 perseant NAN_SUBSCRIBE service_name=<name> [active=1] [ttl=<time-to-live-in-sec>] [freq=<in MHz>] [srv_proto_type=<type>] [ssi=<service specific information (hexdump)>] 60 1.1.1.1.4.2 perseant 61 1.1.1.1.4.2 perseant If ttl=0 or the parameter is not included, operation is terminated once 62 1.1.1.1.4.2 perseant the first matching publisher is found. 63 1.1.1.1.4.2 perseant 64 1.1.1.1.4.2 perseant If freq is not included, the default frequency 2437 MHz (channel 6 on 65 1.1.1.1.4.2 perseant the 2.4 GHz band) is used. 66 1.1.1.1.4.2 perseant 67 1.1.1.1.4.2 perseant srv_proto_type values are defined in the Service Protocol Types table in 68 1.1.1.1.4.2 perseant the Wi-Fi Aware specification. 69 1.1.1.1.4.2 perseant 70 1.1.1.1.4.2 perseant This command returns the assigned subscribe_id value or FAIL on failure. 71 1.1.1.1.4.2 perseant 72 1.1.1.1.4.2 perseant This command maps to the Subscribe() method in the NAN Discovery Engine. 73 1.1.1.1.4.2 perseant 74 1.1.1.1.4.2 perseant NAN_CANCEL_SUBSCRIBE subscribe_id=<id from NAN_SUBSCRIBE> 75 1.1.1.1.4.2 perseant 76 1.1.1.1.4.2 perseant This command maps to the CancelSubscribe() method in the NAN Discovery Engine. 77 1.1.1.1.4.2 perseant 78 1.1.1.1.4.2 perseant NAN_TRANSMIT handle=<id from NAN_PUBLISH or NAN_SUBSCRIBE> req_instance_id=<peer's id> address=<peer's MAC address> [ssi=<service specific information (hexdump)>] 79 1.1.1.1.4.2 perseant 80 1.1.1.1.4.2 perseant This command maps to the Transmit() method in the NAN Discovery Engine. 81 1.1.1.1.4.2 perseant 82 1.1.1.1.4.2 perseant Following control interface events are used: 83 1.1.1.1.4.2 perseant 84 1.1.1.1.4.2 perseant NAN-DISCOVERY-RESULT subscribe_id=<own id> publish_id=<peer's id> address=<peer MAC address> fsd=<0/1> fsd_gas=<0/1> srv_proto_type=<type> ssi=<service specific information (hexdump)> 85 1.1.1.1.4.2 perseant 86 1.1.1.1.4.2 perseant This event maps to the DiscoveryResult() event in the NAN Discovery 87 1.1.1.1.4.2 perseant Engine. 88 1.1.1.1.4.2 perseant 89 1.1.1.1.4.2 perseant NAN-REPLIED publish_id=<own id> address=<peer MAC address> subscribe_id=<peer id> srv_proto_type=<ype> ssi=<service specific information (hexdump)> 90 1.1.1.1.4.2 perseant 91 1.1.1.1.4.2 perseant This event maps to the Replied() event in the NAN Discovery Engine. 92 1.1.1.1.4.2 perseant 93 1.1.1.1.4.2 perseant NAN-PUBLISH-TERMINATED publish_id=<own id> reason=<timeout/user-request/failure> 94 1.1.1.1.4.2 perseant 95 1.1.1.1.4.2 perseant This event maps to the PublishTerminated() event in the NAN Discovery 96 1.1.1.1.4.2 perseant Engine. 97 1.1.1.1.4.2 perseant 98 1.1.1.1.4.2 perseant NAN-SUBSCRIBE-TERMINATED subscribe_id=<own id> reason=<timeout/user-request/failure> 99 1.1.1.1.4.2 perseant 100 1.1.1.1.4.2 perseant This event maps to the SubscribeTerminate() event in the NAN Discovery 101 1.1.1.1.4.2 perseant Engine. 102 1.1.1.1.4.2 perseant 103 1.1.1.1.4.2 perseant NAN-RECEIVE id=<own id> peer_instance_id=<peer id> address=<peer MAC adress> ssi=<service specific information (hexdump)> 104 1.1.1.1.4.2 perseant 105 1.1.1.1.4.2 perseant This event maps to the Receive() event in the NAN Discovery Engine. 106 1.1.1.1.4.2 perseant 107 1.1.1.1.4.2 perseant 108 1.1.1.1.4.2 perseant Example operation 109 1.1.1.1.4.2 perseant ----------------- 110 1.1.1.1.4.2 perseant 111 1.1.1.1.4.2 perseant Start Subscribe and Publish functions: 112 1.1.1.1.4.2 perseant 113 1.1.1.1.4.2 perseant dev0: NAN_SUBSCRIBE service_name=_test srv_proto_type=3 ssi=1122334455 114 1.1.1.1.4.2 perseant --> returns 7 115 1.1.1.1.4.2 perseant 116 1.1.1.1.4.2 perseant dev1: NAN_PUBLISH service_name=_test srv_proto_type=3 ssi=6677 117 1.1.1.1.4.2 perseant --> returns 5 118 1.1.1.1.4.2 perseant 119 1.1.1.1.4.2 perseant Subscriber notification of a discovery: 120 1.1.1.1.4.2 perseant 121 1.1.1.1.4.2 perseant event on dev0: <3>NAN-DISCOVERY-RESULT subscribe_id=7 publish_id=5 address=02:00:00:00:01:00 fsd=1 fsd_gas=0 srv_proto_type=3 ssi=6677 122 1.1.1.1.4.2 perseant 123 1.1.1.1.4.2 perseant Publisher notification of a Follow-up message with no ssi (to enter 124 1.1.1.1.4.2 perseant paused state to continue exchange with the subscriber): 125 1.1.1.1.4.2 perseant 126 1.1.1.1.4.2 perseant event on dev1: <3>NAN-RECEIVE id=5 peer_instance_id=7 address=02:00:00:00:00:00 ssi= 127 1.1.1.1.4.2 perseant 128 1.1.1.1.4.2 perseant Subscriber sending a Follow-up message: 129 1.1.1.1.4.2 perseant 130 1.1.1.1.4.2 perseant dev0: NAN_TRANSMIT handle=7 req_instance_id=5 address=02:00:00:00:01:00 ssi=8899 131 1.1.1.1.4.2 perseant 132 1.1.1.1.4.2 perseant Publisher receiving the Follow-up message: 133 1.1.1.1.4.2 perseant 134 1.1.1.1.4.2 perseant event on dev1: <3>NAN-RECEIVE id=5 peer_instance_id=7 address=02:00:00:00:00:00 ssi=8899 135 1.1.1.1.4.2 perseant 136 1.1.1.1.4.2 perseant Publisher sending a Follow-up message: 137 1.1.1.1.4.2 perseant 138 1.1.1.1.4.2 perseant dev1: NAN_TRANSMIT handle=5 req_instance_id=7 address=02:00:00:00:00:00 ssi=aabbccdd 139 1.1.1.1.4.2 perseant 140 1.1.1.1.4.2 perseant Subscriber receiving the Follow-up message: 141 1.1.1.1.4.2 perseant 142 1.1.1.1.4.2 perseant event on dev0: <3>NAN-RECEIVE id=7 peer_instance_id=5 address=02:00:00:00:01:00 ssi=aabbccdd 143 1.1.1.1.4.2 perseant 144 1.1.1.1.4.2 perseant Stop Subscribe and Publish functions: 145 1.1.1.1.4.2 perseant 146 1.1.1.1.4.2 perseant dev0: NAN_CANCEL_SUBSCRIBE subscribe_id=7 147 1.1.1.1.4.2 perseant dev1: NAN_CANCEL_PUBLIST publish_id=5 148