From e17fdc17d583cc389b5f7b3e358e5d068d2f9dbf Mon Sep 17 00:00:00 2001 From: mmehari Date: Thu, 9 Jan 2020 14:07:15 +0100 Subject: [PATCH] Connecting a client to openwifi AP in 2.4GHz --- README.md | 24 ++++++++++++++++++++++++ user_space/driver_nl80211.patch | 19 +++++++++++++++++++ user_space/hostapd-openwifi.conf | 2 ++ 3 files changed, 45 insertions(+) create mode 100644 user_space/driver_nl80211.patch diff --git a/README.md b/README.md index 87a2683..41bb2e4 100644 --- a/README.md +++ b/README.md @@ -293,6 +293,30 @@ make ``` * Now you can connect openwifi hotspot from your phone/laptop and access the internet. +**Connecting a client to openwifi AP in 2.4GHz** + +Openwifi only applies OFDM as its modulation scheme and as a result, it is not backward compatible with 802.11b clients or modes of operation. This is usually the case during beacon transmission, connection establishment, and robust communication. + +As a solution to this problem, openwifi can be fully controlled only if communicating with APs/clients instantiated using hostapd/wpa_supplicant userspace programs respectively. + +For hostapd program, 802.11b rates can be suppressed using configuration commands (i.e. supported_rates, basic_rates) and an example configuration file is provided (i.e. hostapd-openwifi.conf). One small caveat to this one comes from fullMAC Wi-Fi cards as they must implement the *NL80211_TXRATE_LEGACY* NetLink handler at the device driver level. + +On the other hand, the wpa_supplicant program on the client side (commercial Wi-Fi dongle/board) cannot suppress 802.11b rates out of the box in 2.4GHz band, so there will be an issue when connecting openwifi (OFDM only). A patched wpa_supplicant should be used at the client side. + +``` +cd openwifi/user_space +wget http://w1.fi/releases/wpa_supplicant-2.1.tar.gz +tar xzvf wpa_supplicant-2.1.tar.gz +patch -d wpa_supplicant-2.1/src/drivers/ < driver_nl80211.patch +cd wpa_supplicant-2.1/wpa_supplicant/ +cp defconfig .config +sed -i 's/#CONFIG_LIBNL32.*/CONFIG_LIBNL32=y/g' .config +make -j16 +sudo make install +cd ../../ +rm -r wpa_supplicant-2.1/ wpa_supplicant-2.1.tar.gz +``` + ## cite openwifi project Any use of openwifi project which results in a publication should include a citation via (bibtex example): diff --git a/user_space/driver_nl80211.patch b/user_space/driver_nl80211.patch new file mode 100644 index 0000000..d3a1cdb --- /dev/null +++ b/user_space/driver_nl80211.patch @@ -0,0 +1,19 @@ +--- wpa_supplicant-2.1/src/drivers/driver_nl80211.c 2014-02-04 12:23:35.000000000 +0100 ++++ driver_nl80211.c 2020-01-09 09:11:35.943884000 +0100 +@@ -5903,6 +5903,8 @@ + wpa_driver_nl80211_set_mode(bss, nlmode) < 0) + return -1; + ++ nl80211_disable_11b_rates(drv, drv->ifindex, 1); ++ + retry: + msg = nlmsg_alloc(); + if (!msg) +@@ -8625,6 +8627,7 @@ + } + + nl80211_mark_disconnected(drv); ++ nl80211_disable_11b_rates(drv, drv->ifindex, 1); + + msg = nlmsg_alloc(); + if (!msg) diff --git a/user_space/hostapd-openwifi.conf b/user_space/hostapd-openwifi.conf index e5bfe26..c8f06da 100644 --- a/user_space/hostapd-openwifi.conf +++ b/user_space/hostapd-openwifi.conf @@ -4,6 +4,8 @@ country_code=BE ssid=openwifi hw_mode=a channel=44 +supported_rates=60 90 120 180 240 360 480 540 +basic_rates=60 90 120 180 #ieee80211d=1 #ieee80211h=1 #wpa=2