WLAN-Pi / wlanpi-profiler

Wi-Fi client capabilities analyzer tool built for the WLAN Pi
BSD 3-Clause "New" or "Revised" License
25 stars 8 forks source link

Fix supported channel detection logic #58

Closed joshschmelzle closed 3 years ago

joshschmelzle commented 3 years ago

When profiling the Hololens 2, profiler (dev v1.0.6) reported 37 supported channels. I think the logic for parsing channel sets is incorrect in a certain scenario presented by this device.

Profiler results:

---------------------------------------------
 - Client MAC: 76:17:61:9b:e8:b2
 - OUI manufacturer lookup: Randomized MAC
 - Frequency band: 5 GHz
 - Capture channel: 157
---------------------------------------------
802.11k              Not reported* - treat with caution, many clients lie about this
802.11r              Not reported*       
802.11v              Supported           
802.11w              Supported           
802.11n              Supported (2ss)     
802.11ac             Supported (2ss), MCS 0-9, [ ] 160 MHz, [ ] SU BF, [ ] MU BF
802.11ax             Not supported       
Max Power            25 dBm              
Supported Channels   1-1, 2-2, 3-3, 4-4, 5-5, 6-6, 7-7, 8-8, 9-9, 10-10, 11-11, 12-12, 13-13, 36-64, 100-140, 149-165**
Number of Channels   37                  

Key: [X]: Supported, [ ]: Not supported
* Reported client capabilities are dependent on available features at the time of client association.
** Reported channels do not factor local regulatory domain. Detected channel sets are assumed contiguous.

Exert from pcap:

Tag: Supported Channels
    Tag Number: Supported Channels (36)
    Tag length: 50
    Supported Channels Set #1 First: 1, Range: 13 
    Supported Channels Set #2 First: 36, Range: 1 
    Supported Channels Set #3 First: 40, Range: 1 
    Supported Channels Set #4 First: 44, Range: 1 
    Supported Channels Set #5 First: 48, Range: 1 
    Supported Channels Set #6 First: 52, Range: 1 
    Supported Channels Set #7 First: 56, Range: 1 
    Supported Channels Set #8 First: 60, Range: 1 
    Supported Channels Set #9 First: 64, Range: 1 
    Supported Channels Set #10 First: 100, Range: 1 
    Supported Channels Set #11 First: 104, Range: 1 
    Supported Channels Set #12 First: 108, Range: 1 
    Supported Channels Set #13 First: 112, Range: 1 
    Supported Channels Set #14 First: 116, Range: 1 
    Supported Channels Set #15 First: 120, Range: 1 
    Supported Channels Set #16 First: 124, Range: 1 
    Supported Channels Set #17 First: 128, Range: 1 
    Supported Channels Set #18 First: 132, Range: 1 
    Supported Channels Set #19 First: 136, Range: 1 
    Supported Channels Set #20 First: 140, Range: 1 
    Supported Channels Set #21 First: 149, Range: 1 
    Supported Channels Set #22 First: 153, Range: 1 
    Supported Channels Set #23 First: 157, Range: 1 
    Supported Channels Set #24 First: 161, Range: 1 
    Supported Channels Set #25 First: 165, Range: 1 

Hex + ASCII Dump:

0000   24 32 01 0d 24 01 28 01 2c 01 30 01 34 01 38 01   $2..$.(.,.0.4.8.
0010   3c 01 40 01 64 01 68 01 6c 01 70 01 74 01 78 01   <.@.d.h.l.p.t.x.
0020   7c 01 80 01 84 01 88 01 8c 01 95 01 99 01 9d 01   |...............
0030   a1 01 a5 01                                       ....
joshschmelzle commented 3 years ago

This client appears to send both 2G and 5G supported channel sets when connecting to a 5G Wi-Fi channel.

4d41c83bcdfa27fea3605ae808b8366505a3b6b1 cleans up the text report.