seemoo-lab / nexmon_csi

Channel State Information Extraction on Various Broadcom Wi-Fi Chips
304 stars 121 forks source link

Support for CSI extraction for latest intel Wi-Fi is available in Linux kernel #207

Open atlury opened 3 years ago

atlury commented 3 years ago

Dear Friends,

Thank you all for the fantastic work that you guys are doing with Nexmon-csi. I will like to bring to your attention the following interesting CSI support in intel Linux wireless drivers. If you get time please do look into it and integrate them.

[08/21] iwlwifi: mvm: implement CSI reporting

https://patchwork.kernel.org/project/linux-wireless/patch/20190127101908.6428-9-luca@coelho.fi/

IWL_MVM_VENDOR_CMD_CSI_EVENT: CSI event, use as a command to enable unicast reporting to the calling socket

https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/backport-iwlwifi.git/tree/drivers/net/wireless/intel/iwlwifi/iwl-vendor-cmd.h?h=release/core59

struct iwl_csi_chunk_notification

https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/backport-iwlwifi.git/tree/drivers/net/wireless/intel/iwlwifi/fw/api/location.h?h=release/core59

There are two papers published that actually use the latest Intel Wi-Fi chips for CSI

  1. The "On Phase Offsets of 802.11ac Commodity WiFi - Anatolij Zubow, Piotr Gawlowicz, Falko Dressler" uses the modern commodity 802.11ac chips like Intel 9260. More precisely they backported the release/core46 to Linux 5.5.1 kernel. 
  1. The "Sensor-Aided Learning for Wi-Fi Position With Beacon Channel State Information J Choi Intel" paper uses the latest AX200 series Wi-Fi chip apparently with a custom tool from intel themselves.

I hope this will benefit the community a lot if someone who has time can take it up and integrate it with Nexmon.

atlury commented 3 years ago

Further to the above

There is a iw: add command to register and dump mgmt frames below

https://patchwork.kernel.org/project/linux-wireless/patch/20171118182052.15515-1-sergey.matyukevich.os@quantenna.com/

https://patchwork.kernel.org/project/linux-wireless/patch/20171014210036.29556-1-sergey.matyukevich.os@quantenna.com/

Also we could disable the securing of the management frames by setting the respective flag in the client to false (Management Frame Protection Required flat)

atlury commented 3 years ago

Adding more information. As per the discussion here https://www.spinics.net/lists/linux-wireless/msg167153.html

"The CSI data has variable length mostly depending on the bandwidth but it's fundamentally always tied to a specific frame and as such we've always attached it to that frame using a radiotap vendor namespace.

You can easily implement that in a mac80211 driver since it has support for that via RX_FLAG_RADIOTAP_VENDOR_DATA and the associated struct ieee80211_vendor_radiotap that you put into the skb's head"

quantumhub commented 3 years ago

Interesting to see this news! Thanks for sharing! @atlury

jlinktu commented 3 years ago

thank you for the detailed listing, @atlury

however, I'm not sure what you'd like to integrate with nexmon here the nexmon_csi patch forwards CSI to the host via UPD frames, a generic solution that allows receiving CSI by any application that can listen to a socket without any further driver modifications - why would you want to introduce additional Management frames with Radiotap headers and involve netlink?

atlury commented 3 years ago

@jlinktu

Some more observations

Intel allows csi (channel state information) reporting as per which used to be attached per frame. [08/21] iwlwifi: mvm: implement CSI reporting https://patchwork.kernel.org/project/linux-wireless/patch/20190127101908.6428-9-luca@coelho.fi/

However it was moved out of band (no longer tied to any packet/frame so things like radiotap etc wont work) as per below https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/backport-iwlwifi.git/commit/?id=3d380b6b301f504c8f3aa2f64d1cef60821acb77

However MVM firmware vendor-cmd.c still captures csi (apparently without attaching it to any frame) https://github.com/intel/backport-iwlwifi/blob/e3a6af8dfaebc0be3d05099459d5a643bd438931/iwlwifi-stack-dev/drivers/net/wireless/intel/iwlwifi/mvm/vendor-cmd.c#L1887

So yes probably you are right, both are completely different and hence not as straightforward. Just posting this info if its useful for others. I will take up the work sometime when I get free.

Thanks

jiangzp commented 3 years ago

PicoScenes CSI platform now supports the MVM-based Intel Wi-Fi 6AX200 NIC, which can report 802.11ax-format 1992x2x2 CSI values in the 160 MHz 2x2 MIMO case. For more information, you may refer to https://ps.zpj.io.

atlury commented 3 years ago

Congrats! It should now be easily extendable to other series from Intel. Nexmon could also benefit from this work.

jiangzp commented 3 years ago

Yes, it can also extend to AC9260 or even AC7260 models. However, these models are relatively old and only with 11ac support.

So, I focus on developing CSI support for AX200 and the upcoming AX210.

2021年10月9日 23:23,Rahul Atlury @.***> 写道:

Congrats! It should now be easily extendable to other series from Intel. Nexmon could also benefit from this work.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/seemoo-lab/nexmon_csi/issues/207#issuecomment-939313958, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB7FVNQ25OU3LKVIZXEBZWDUGBM7PANCNFSM43P4GAXA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

jiangzp commented 3 years ago

I am not sure if Nexmon can benefit from PicoScenes, as they are with quite different design.

Actually, I had tried to integrate the Nexmon into PicoScenes, however, too much jobs force me quit.

2021年10月9日 23:31,Zhiping Jiang @.***> 写道:

Yes, it can also extend to AC9260 or even AC7260 models. However, these models are relatively old and only with 11ac support.

So, I focus on developing CSI support for AX200 and the upcoming AX210.

2021年10月9日 23:23,Rahul Atlury @. @.>> 写道:

Congrats! It should now be easily extendable to other series from Intel. Nexmon could also benefit from this work.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/seemoo-lab/nexmon_csi/issues/207#issuecomment-939313958, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB7FVNQ25OU3LKVIZXEBZWDUGBM7PANCNFSM43P4GAXA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

atlury commented 3 years ago

I am happy to help but yeaa we can leave it to Nexmon to see how they can do it as they better understand it and let me try out the picoscenes integration work. I will write to you.