My Pogoplug Thinks its in China?

I think I have to set a regulatory domain for my usb ath9k module because it appears to think it is in CN, which I’m assuming is China.

[   43.313192] usb 1-1: ath9k_htc: Firmware htc_9271.fw requested
[   43.331335] usbcore: registered new interface driver ath9k_htc
[   43.588793] cfg80211: World regulatory domain updated:
[   43.593951] cfg80211:  DFS Master region: unset
[   43.599250] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   43.607671] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[   43.615102] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[   43.622493] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm)
[   43.629915] usb 1-1: ath9k_htc: Transferred FW: htc_9271.fw, size: 51272
[   43.637976] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz), (N/A, 2000 mBm)
[   43.645347] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm)
[   43.652887] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm)
[   43.860765] ath9k_htc 1-1:1.0: ath9k_htc: HTC initialized with 33 credits
[   44.106890] ath9k_htc 1-1:1.0: ath9k_htc: FW Version: 1.3
[   44.118169] ath: EEPROM regdomain: 0x809c
[   44.118191] ath: EEPROM indicates we should expect a country code
[   44.118204] ath: doing EEPROM country->regdmn map search
[   44.118215] ath: country maps to regdmn code: 0x52
[   44.118227] ath: Country alpha2 being used: CN
[   44.118236] ath: Regpair used: 0x52
[   44.199766] ieee80211 phy0: Atheros AR9271 Rev:1
[   44.204557] cfg80211: Calling CRDA for country: CN
[   44.365621] cfg80211: Regulatory domain changed to country: CN
[   44.402441] cfg80211:  DFS Master region: unset
[   44.414598] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   44.441649] cfg80211:   (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[   44.469124] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz), (N/A, 2300 mBm)
[   44.476498] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz), (N/A, 2300 mBm)
[   44.538122] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 3000 mBm)
[   44.545497] cfg80211:   (57240000 KHz - 59400000 KHz @ 2160000 KHz), (N/A, 2800 mBm)
[   44.614301] cfg80211:   (59400000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 4400 mBm)
[   44.638095] cfg80211:   (63720000 KHz - 65880000 KHz @ 2160000 KHz), (N/A, 2800 mBm)

This can be changed with /sbin/iw reg set US. Once I did that, I got a lot more features listed with iw list:

root@pogoplug:/etc/modprobe.d# iw list
Wiphy phy0
	Band 1:
		Capabilities: 0x116e
			HT20/HT40
			SM Power Save disabled
			RX HT20 SGI
			RX HT40 SGI
			RX STBC 1-stream
			Max AMSDU length: 3839 bytes
			DSSS/CCK HT40
		Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
		Minimum RX AMPDU time spacing: 8 usec (0x06)
		HT TX/RX MCS rate indexes supported: 0-7
		Frequencies:
			* 2412 MHz [1] (20.0 dBm)
			* 2417 MHz [2] (20.0 dBm)
			* 2422 MHz [3] (20.0 dBm)
			* 2427 MHz [4] (20.0 dBm)
			* 2432 MHz [5] (20.0 dBm)
			* 2437 MHz [6] (20.0 dBm)
			* 2442 MHz [7] (20.0 dBm)
			* 2447 MHz [8] (20.0 dBm)
			* 2452 MHz [9] (20.0 dBm)
			* 2457 MHz [10] (20.0 dBm)
			* 2462 MHz [11] (20.0 dBm)
			* 2467 MHz [12] (disabled)
			* 2472 MHz [13] (disabled)
			* 2484 MHz [14] (disabled)
		Bitrates (non-HT):
			* 1.0 Mbps
			* 2.0 Mbps (short preamble supported)
			* 5.5 Mbps (short preamble supported)
			* 11.0 Mbps (short preamble supported)
			* 6.0 Mbps
			* 9.0 Mbps
			* 12.0 Mbps
			* 18.0 Mbps
			* 24.0 Mbps
			* 36.0 Mbps
			* 48.0 Mbps
			* 54.0 Mbps
	max # scan SSIDs: 4
	max scan IEs length: 2257 bytes
	Coverage class: 0 (up to 0m)
	Supported Ciphers:
		* WEP40 (00-0f-ac:1)
		* WEP104 (00-0f-ac:5)
		* TKIP (00-0f-ac:2)
		* CCMP (00-0f-ac:4)
		* CMAC (00-0f-ac:6)
	Available Antennas: TX 0x1 RX 0x1
	Configured Antennas: TX 0x1 RX 0x1
	Supported interface modes:
		 * IBSS
		 * managed
		 * AP
		 * AP/VLAN
		 * monitor
		 * mesh point
		 * P2P-client
		 * P2P-GO
	software interface modes (can always be added):
		 * AP/VLAN
		 * monitor
	valid interface combinations:
		 * #{ managed, P2P-client } <= 2, #{ AP, mesh point, P2P-GO } <= 2,
		   total <= 2, #channels <= 1
	Supported commands:
		 * new_interface
		 * set_interface
		 * new_key
		 * new_beacon
		 * new_station
		 * new_mpath
		 * set_mesh_params
		 * set_bss
		 * authenticate
		 * associate
		 * deauthenticate
		 * disassociate
		 * join_ibss
		 * join_mesh
		 * remain_on_channel
		 * set_tx_bitrate_mask
		 * action
		 * frame_wait_cancel
		 * set_wiphy_netns
		 * set_channel
		 * set_wds_peer
		 * Unknown command (84)
		 * Unknown command (87)
		 * Unknown command (85)
		 * Unknown command (89)
		 * Unknown command (92)
		 * Unknown command (104)
		 * connect
		 * disconnect
	Supported TX frame types:
		 * IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * mesh point: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * Unknown mode (10): 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
	Supported RX frame types:
		 * IBSS: 0x40 0xb0 0xc0 0xd0
		 * managed: 0x40 0xd0
		 * AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
		 * AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
		 * mesh point: 0xb0 0xc0 0xd0
		 * P2P-client: 0x40 0xd0
		 * P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
		 * Unknown mode (10): 0x40 0xd0
	Device supports RSN-IBSS.
	HT Capability overrides:
		 * MCS: ff ff ff ff ff ff ff ff ff ff
		 * maximum A-MSDU length
		 * supported channel width
		 * short GI for 40 MHz
		 * max A-MPDU length exponent
		 * min MPDU start spacing
	Device supports TX status socket option.
	Device supports HT-IBSS.

Wow, that’s a lot better! But does it survive a restart? This post describes how to update crda (udev rules) and hostapd.conf.

Basically:

  1. add country_code=US to hostapd.conf.
  2. Edit /etc/default/crda so that REGDOMAIN=US
  3. Edit /etc/modules.d/cfg80211.conf and add “options cfg80211 ieee80211_regdom=US”

This is not a simple thing. I think I might have a busted regulatory.bin file?

Pogoplug now running hostapd

I was not anticipating it not being able to reach channel 11, so I set it to channel 1. Also, it cannot do 802.11n, so I set it to 802.11g. My cell phone seems to be able to use it.

Also, for some reason, my pogoplug syncs up to the same switch better than my laptop does. Using iperf on my laptop, I get a max of 95Mbps, yet on my pogoplug I get 180Mbps over the LAN. That is just too wierd.

TechSNAP 162 Question on WiFi Roaming

Dear Marlene, Allen and Chris, wifi testing image

Catching up on Episode 162 of TechSNAP I heard Marlene’s question. Doing conference style roaming on a small budget tends to be very frustrating, because there are a lot of moving parts that most WiFi-EAP (enterprise grade) systems are pre-assembled with. When you have to assemble your own components, you start taking your network design very carefully. Rather than recommending any particular products in this post, I will discuss the basic assemblies involved so that you can get a sense for what you would need to assemble.

Your everyday residential WiFi access point provides DHCP for handing out IP assignments. When planning for a wireless environment, consider that your average business or technical attendee will bring three wireless devices. This means three IP addresses. If you expect 200 people to attend (round up for safety) you will need capacity for a minimum of 600 IPs. This is beyond what a consumer AP can handle (which is typically 24-32 stations). Also throw in more headroom for IP leases that are timing out. Plan you lease length to free up your pool as attendees leave. You can increase the lease time if there is less walk through traffic.

We are now looking at a network address mask of /23 or 255.255.254.0. This provides for 510 hosts. You can play with this calculation with the ipcalc utility on any Linux commandline. If you want better roaming, consider setting up DHCP for your wireless network on a network server that is not itself an AP. A PFSense box would work well. If you have a DHCP server for each AP, you might get yourself into a big mess. Most channel hopping between APs does not actually trigger DHCP.

Another service that some people want is a Captive Portal. It is arguable that this is necessary. You do not want multiple captive portals. A captive portal service would be desired if you were obligated to issue Legal Warnings or TOS or other stuff. Rather silly for people using smartphones, because mobile browsers are still not great.

I’ve mentioned channel hopping. This is when a wifi station (a mobile phone or laptop) changes frequency. It will try to change to a stronger frequency with the same SSID with the same authentication scheme. That is, you cannot roam between SSID Burger and SSID Fries, nor could you roam between SSID Burger with WPA-Personal and SSID Burger with WAP-EAP. Effect frequency distribution is when you have middle-strength (not to hot) signal not overlapping with any other active adjacent frequency. So assign different frequencies using something like 12-75% signal power (12% can be plenty effective, you’re going for even coverage, not one large beacon) and move them around while using a mobile WiFi inspector app. At LinuxFestNW, there were about 27 APs setup across the conference hall. There were separate APs for each classroom. No two adjacent classrooms should share the same frequency, and discourage two adjacent frequencies from being next to each other if possible. Do as much in the 5Ghz range as possible. By having smaller wifi ranges, you reduce the transmit collisions per area and improve overall throughput.

Isn’t this a lot to take in? You bet. This is often why facilities invest in commercial WiFi installations and proprietary vendors. If you want to experiment from home, try looking at this nice post by Scott Hanelman on doing roaming with two APs.

Best of luck!
Jed Reynolds
PS If you are interested in enterprise WiFi or wired network testing, please check out Candela Technologies.