Showing posts with label atheros. Show all posts
Showing posts with label atheros. Show all posts

Friday, November 26, 2021

Getting IEEE 802.11s (mesh) and 802.11r (fast transition) working on some old hardware in OpenWRT 21.02.1

OpenWRT has got to be one of my favorite Linux distributions of all time. It is small, efficient, simple, and well-thought-out. I've been running OpenWRT (and LEDE, and OpenWRT) for a very long time on TP-Link hardware, which can often be scored off of eBay for $20 -- and even less -- at the Goodwill Store (imagine my incredible glee when I scored a WDR3500 for $6).

The TP-Link WDR4300, 3600, and 3500 all use Atheros system-on-chip and offer 802.11g/n and 802.11an, which, for my modest home use, has been satisfactory since 2012. What's really interesting is that OpenWRT *still* is still supported on these devices. 

Making a more "modern" network consisting of mesh networking and fast transitioning has been a challenge because of how many iterations the software has gone through. For some time, I have wanted to walk through the house and roam across APs with minimal service interruption. After tinkering, I finally have mostly everything working.

I will now dispel old Internet lore regarding these devices:

  1. 802.11s mesh networking works "out of the box." You do NOT need to install wpad-mesh-wolfssl any more. However, on my hardware, 802.11s does NOT work with encryption. SAE encryption is supported in the LuCI UI, but when this is attempted, the devices refuse to talk to one another. Perhaps this will be fixed in a later version of OpenWRT.

  2. 802.11r fast transition requires identical SSIDs and encryption on all APs you want to roam between, which should seem obvious. What is not obvious is that all APs must have the same user-specified mobility domain, and "Generate PMK locally" must be checked. Options involving PMK, R0 and R1 keys do not need to be specified and are automatically managed by OpenWRT. I have read documentation stating that mobility domains are automatically generated by OpenWRT but what I have found is that if they are not specified, then fast transition does not work correctly.

  3. I have found that a lot of IoT devices do not enjoy dissociation on low acknowledgement at all. As soon as the AP dissociates them, they immediately re-associate. Even my Windows 10 laptop seems to do this. So I figured that I would disable this option (it is enabled by default). This seems to make things a little less bumpy for these low-cost devices.

Below, I have included /etc/config/wireless from my "gateway" AP which serves as the central point of access:

config wifi-device 'radio0'
	option type 'mac80211'
	option hwmode '11g'
	option path 'platform/ahb/18100000.wmac' # There will be some default here, don't change it 
	option htmode 'HT40'
	option channel '9'
	option cell_density '0'

config wifi-device 'radio1'
	option type 'mac80211'
	option hwmode '11a'
	option path 'pci0000:00/0000:00:00.0' # There will be some default here, don't change it
	option htmode 'HT40'
	option channel '36'
	option cell_density '0'
	option noscan '1'

config wifi-iface 'mesh'
	option ifname 'mesh0'
	option network 'mesh lan'
	option device 'radio1'
	option mode 'mesh'
	option mesh_id 'YourSSIDMesh'
	option key 'your_secret_key'
	option mesh_fwding '1'
	option mesh_rssi_threshold '0'
	option encryption 'none' # maybe 'SAE' will work one day

config wifi-iface 'wifinet0'
	option device 'radio0'
	option network 'lan'
	option mode 'ap'
	option ssid 'YourSSID'
	option encryption 'psk2+ccmp'
	option key 'your_secret_key'
	option auth_cache '1'
	option skip_inactivity_poll '1'
	option ieee80211r '1'
	option ft_over_ds '1'
	option ft_psk_generate_local '1'
	option mobility_domain '3137' # four digits, same across all interfaces
	option max_inactivity '20'
	option disassoc_low_ack '0'

config wifi-iface 'wifinet1'
	option device 'radio1'
	option network 'lan'
	option mode 'ap'
	option ssid 'YourSSID'
	option encryption 'psk2+ccmp'
	option key 'your_secret_key'
	option auth_cache '1'
	option skip_inactivity_poll '1'
	option ieee80211r '1'
	option ft_over_ds '1'
	option ft_psk_generate_local '1'
	option mobility_domain '3137' # four digits, same across all interfaces
	option disassoc_low_ack '0'
	option max_inactivity '30' 

Similarly, the following is the configuration from a mesh "repeater" node.

config wifi-device 'radio0'
	option type 'mac80211'
	option hwmode '11g'
	option path 'platform/ahb/18100000.wmac' # There will be some default here, don't change it 
	option htmode 'HT40'
	option channel '3'
	option cell_density '0'

config wifi-device 'radio1'
	option type 'mac80211'
	option hwmode '11a'
	option path 'pci0000:00/0000:00:00.0' # There will be some default here, don't change it
	option htmode 'HT40'
	option channel '36'
	option noscan '1'
	option cell_density '0'

config wifi-iface 'mesh'
	option ifname 'mesh0'
	option network 'mesh lan'
	option device 'radio1'
	option mode 'mesh'
	option mesh_id 'YourSSIDMesh'
	option key 'your_secret_key'
	option mesh_fwding '1'
	option mesh_rssi_threshold '0'
	option encryption 'none' # maybe 'SAE' will work one day

config wifi-iface 'wifinet0'
	option device 'radio0'
	option network 'lan'
	option mode 'ap'
	option ssid 'YourSSID'
	option encryption 'psk2+ccmp'
	option key 'your_secret_key'
	option auth_cache '1'
	option skip_inactivity_poll '1'
	option ieee80211r '1'
	option ft_over_ds '1'
	option ft_psk_generate_local '1'
	option mobility_domain '3137' # four digits, same across all interfaces
	option disassoc_low_ack '0'
	option max_inactivity '20'

config wifi-iface 'wifinet1'
	option device 'radio1'
	option network 'lan'
	option mode 'ap'
	option ssid 'YourSSID'
	option encryption 'psk2+ccmp'
	option key 'your_secret_key'
	option auth_cache '1'
	option skip_inactivity_poll '1'
	option ieee80211r '1'
	option ft_over_ds '1'
	option ft_psk_generate_local '1'
	option mobility_domain '3137' # four digits, same across all interfaces
	option disassoc_low_ack '0'
	option max_inactivity '20'


 
 

Saturday, May 29, 2010

ath5k: Orinoco ComboCard 11A/B/G in Linux (Mint 9 'Isadora,' Ubuntu 10.04 'Lucid')

I discovered that my Orinoco ComboCard no longer worked when I upgraded from Ubuntu 9.10 to Linux Mint 9. The reason for this is that the ath5k kernel module does not recognize the ComboCard's PCI device ID. According to lcpci -nn:

03:00.0 Ethernet controller [0200]: Atheros Communications Inc. Device [168c:0200] (rev 01)

As of Linux kernel version 2.6.32, the ath5k driver does not seem to support 802.11g on the Orinoco ComboCard 11A/B/G. However, 802.11A works splendidly with this card, assuming that the driver is told to recognize it as a valid target.

In order to convince the Atheros driver to work with my card, I created the file /etc/modprobe.d/ath5k.conf :
install ath5k /sbin/modprobe --ignore-install ath5k && { echo '168c 0200' > /sys/bus/pci/drivers/ath5k/new_id ; }
I performed the following to append ath5k to the list of modules to be loaded at start-up:
echo ath5k >> /etc/modules
This is so much easier than modifying the kernel module code to recognize the PCI device ID of the card!