You are not logged in.

#1 2014-03-30 17:59:34

gizzard
Member
Registered: 2010-08-21
Posts: 25

[Solved] Hostapd / 802.11n with two spatial streams

I am trying to configure a TP-Link WDN4800 PCIe wireless adapter for a software access point.  I followed the wiki and created a bridge using netctl and I am able to connect to hostapd from a macbook pro using this hostapd.conf:

[root nebakanezer /etc/hostapd] cat hostapd.conf  | grep -Ev '(#.*$)|(^$)'
interface=wlp1s0
bridge=br0
driver=nl80211
logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
ssid=MySSID
hw_mode=g
channel=7
beacon_int=100
dtim_period=2
max_num_sta=255
rts_threshold=2347
fragm_threshold=2346
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wmm_enabled=1
wmm_ac_bk_cwmin=4
wmm_ac_bk_cwmax=10
wmm_ac_bk_aifs=7
wmm_ac_bk_txop_limit=0
wmm_ac_bk_acm=0
wmm_ac_be_aifs=3
wmm_ac_be_cwmin=4
wmm_ac_be_cwmax=10
wmm_ac_be_txop_limit=0
wmm_ac_be_acm=0
wmm_ac_vi_aifs=2
wmm_ac_vi_cwmin=3
wmm_ac_vi_cwmax=4
wmm_ac_vi_txop_limit=94
wmm_ac_vi_acm=0
wmm_ac_vo_aifs=2
wmm_ac_vo_cwmin=2
wmm_ac_vo_cwmax=3
wmm_ac_vo_txop_limit=47
wmm_ac_vo_acm=0
ieee80211n=1
ht_capab=[HT40+][SHORT-GI-40][TX-STBC][RX-STBC2][DSSS_CK-40][LDPC]
eapol_key_index_workaround=0
eap_server=0
own_ip_addr=127.0.0.1
wpa=3
wpa_passphrase=SuperSecretPhrase
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

The bridge seems to work fine and clients can obtain an IP from my router.  The problem is the speed is limited to 144 Mbps, which I think is because hostapd is only providing one spatial stream.  This is supported by iw list (note the RX STBC 1-stream for either band):

[root nebakanezer /] iw list
Wiphy phy0
        max # scan SSIDs: 4
        max scan IEs length: 2257 bytes
        Coverage class: 0 (up to 0m)
        Device supports RSN-IBSS.
        Device supports T-DLS.
        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 0x7 RX 0x7
        Configured Antennas: TX 0x7 RX 0x7
        Supported interface modes:
                 * IBSS
                 * managed
                 * AP
                 * AP/VLAN
                 * WDS
                 * monitor
                 * mesh point
                 * P2P-client
                 * P2P-GO
        Band 1:
                Capabilities: 0x11ef
                        RX LDPC
                        HT20/HT40
                        SM Power Save disabled
                        RX HT20 SGI
                        RX HT40 SGI
                        TX STBC
                        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-23
                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
                Frequencies:
                        * 2412 MHz [1] (17.0 dBm)
                        * 2417 MHz [2] (16.0 dBm)
                        * 2422 MHz [3] (16.0 dBm)
                        * 2427 MHz [4] (16.0 dBm)
                        * 2432 MHz [5] (16.0 dBm)
                        * 2437 MHz [6] (16.0 dBm)
                        * 2442 MHz [7] (16.0 dBm)
                        * 2447 MHz [8] (16.0 dBm)
                        * 2452 MHz [9] (16.0 dBm)
                        * 2457 MHz [10] (16.0 dBm)
                        * 2462 MHz [11] (16.0 dBm)
                        * 2467 MHz [12] (disabled)
                        * 2472 MHz [13] (disabled)
                        * 2484 MHz [14] (disabled)
        Band 2:
                Capabilities: 0x11ef
                        RX LDPC
                        HT20/HT40
                        SM Power Save disabled
                        RX HT20 SGI
                        RX HT40 SGI
                        TX STBC
                        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-23
                Bitrates (non-HT):
                        * 6.0 Mbps
                        * 9.0 Mbps
                        * 12.0 Mbps
                        * 18.0 Mbps
                        * 24.0 Mbps
                        * 36.0 Mbps
                        * 48.0 Mbps
                        * 54.0 Mbps
                Frequencies:
                        * 5180 MHz [36] (16.0 dBm) (no IR)
                        * 5200 MHz [40] (16.0 dBm) (no IR)
                        * 5220 MHz [44] (16.0 dBm) (no IR)
                        * 5240 MHz [48] (16.0 dBm) (no IR)
                        * 5260 MHz [52] (13.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 2500 sec)
                        * 5280 MHz [56] (14.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 2500 sec)
                        * 5300 MHz [60] (14.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 2500 sec)
                        * 5320 MHz [64] (13.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 2500 sec)
                        * 5500 MHz [100] (disabled)
                        * 5520 MHz [104] (disabled)
                        * 5540 MHz [108] (disabled)
                        * 5560 MHz [112] (disabled)
                        * 5580 MHz [116] (disabled)
                        * 5600 MHz [120] (disabled)
                        * 5620 MHz [124] (disabled)
                        * 5640 MHz [128] (disabled)
                        * 5660 MHz [132] (disabled)
                        * 5680 MHz [136] (disabled)
                        * 5700 MHz [140] (disabled)
                        * 5745 MHz [149] (disabled)
                        * 5765 MHz [153] (disabled)
                        * 5785 MHz [157] (disabled)
                        * 5805 MHz [161] (disabled)
                        * 5825 MHz [165] (disabled)
        Supported commands:
                 * new_interface
                 * set_interface
                 * new_key
                 * start_ap
                 * new_station
                 * new_mpath
                 * set_mesh_config
                 * set_bss
                 * authenticate
                 * associate
                 * deauthenticate
                 * disassociate
                 * join_ibss
                 * join_mesh
                 * remain_on_channel
                 * set_tx_bitrate_mask
                 * frame
                 * frame_wait_cancel
                 * set_wiphy_netns
                 * set_channel
                 * set_wds_peer
                 * tdls_mgmt
                 * tdls_oper
                 * probe_client
                 * set_noack_map
                 * register_beacons
                 * start_p2p_device
                 * set_mcast_rate
                 * 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 0x                                                   a0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0x                                                   b0 0xc0 0xd0 0xe0 0xf0
                 * AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0x                                                   a0 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 0xa                                                   0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * P2P-device: 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
                 * P2P-device: 0x40 0xd0
        software interface modes (can always be added):
                 * AP/VLAN
                 * monitor
        valid interface combinations:
                 * #{ managed, WDS, P2P-client } <= 2048, #{ AP, mesh point, P2P                                                   -GO } <= 8,
                   total <= 2048, #channels <= 1, STA/AP BI must match
                 * #{ IBSS, AP } <= 1,
                   total <= 1, #channels <= 1, STA/AP BI must match, radar detec                                                   t widths: { 20 MHz (no HT), 20 MHz }

        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.
        Device supports low priority scan.
        Device supports scan flush.
        Device supports AP scan.

but this card is advertised to achieve 450 Mbps using three spatial streams, and a scattering of posts (http://blog.kylemanna.com/linux/2013/04 … i-hostapd/, https://plus.google.com/103751003220038 … 7o5TfBxN9Y, http://www.amazon.com/review/R12V73W0R5HDU3) on the web suggest that this card can achieve ~300 Mbps as an AP.

I tried adjusting the ht_capab line with [RX-STBC12] or [RX-STBC123] but hostapd would not start:

[root nebakanezer /etc/hostapd] journalctl -xn
-- Logs begin at Sat 2014-02-15 21:43:31 EST, end at Sun 2014-03-30 13:42:08 EDT. --
Mar 30 13:42:06 nebakanezer kernel: br0: port 2(wlp1s0) entered disabled state
Mar 30 13:42:06 nebakanezer hostapd[1024]: Configuration file: /etc/hostapd/hostapd.conf
Mar 30 13:42:06 nebakanezer hostapd[1024]: Driver does not support configured HT capability [RX-STBC*]
Mar 30 13:42:06 nebakanezer hostapd[1024]: wlp1s0: Unable to setup interface.
Mar 30 13:42:06 nebakanezer hostapd[1024]: hostapd_free_hapd_data: Interface wlp1s0 wasn't started
Mar 30 13:42:06 nebakanezer systemd[1]: hostapd.service: control process exited, code=exited status=1
Mar 30 13:42:06 nebakanezer systemd[1]: Failed to start Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator.
-- Subject: Unit hostapd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit hostapd.service has failed.
--
-- The result is failed.
Mar 30 13:42:06 nebakanezer systemd[1]: Unit hostapd.service entered failed state.
Mar 30 13:42:08 nebakanezer ntpd[543]: Deleting interface #11 wlp1s0, fe80::6666:b3ff:fe24:bad7#123, interface stats: received=0, s
Mar 30 13:42:08 nebakanezer ntpd[543]: peers refreshed

Any ideas?  I might be misunderstanding what hostapd and / or this card can do.

Last edited by gizzard (2014-04-04 23:27:31)

Offline

#2 2014-04-04 23:27:09

gizzard
Member
Registered: 2010-08-21
Posts: 25

Re: [Solved] Hostapd / 802.11n with two spatial streams

I'll mark the thread Solved since this "problem" actually represents normal function.  I'll explain what I figured out just for future reference in case someone experiences a similar issue.

Essentially when I connected at 144 Mbps I was connecting using two streams of 20 MHz in the 2.4 GHz band.  This particular MBP (mid-2010) has a BCM4322 2 × 2 chipset, which allows only two streams.  In comparison, my Nexus 5 connected at 72 Mbps due to its single WiFi antenna.

Despite the ht_capab=[HT40+][SHORT-GI-40][TX-STBC][RX-STBC2][DSSS_CK-40][LDPC] code in hostapd.conf, the AP was only negotiating 20 MHz channels rather than 40 MHz because the 2.4 GHz space around my house was too crowded with other APs. This link has a nice explanation of this issue.  The MBP also happens to be "fat channel intolerant."

I had tried forcing hostapd to use a 5 GHz channel instead of 2.4 GHz but hostapd would not start, because those channels were disabled per iw list (see my previous post).  I could never figure out what "no-IR" meant.  Eventually I figured out that the regulatory domain was still set to world (or whatever the default condition was) rather than to the US.  Setting the country code to US in hostapd.conf did not help.  I installed crda, which got me this:

[root nebakanezer /] iw reg get
country US: DFS-FCC
	(2402 - 2472 @ 40), (N/A, 30)
	(5170 - 5250 @ 80), (N/A, 17)
	(5250 - 5330 @ 80), (N/A, 23), DFS
	(5735 - 5835 @ 80), (N/A, 30)
	(57240 - 63720 @ 2160), (N/A, 40)

and then iw list changed to:

	Band 2:
		Capabilities: 0x11ef
			RX LDPC
			HT20/HT40
			SM Power Save disabled
			RX HT20 SGI
			RX HT40 SGI
			TX STBC
			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-23
		Bitrates (non-HT):
			* 6.0 Mbps
			* 9.0 Mbps
			* 12.0 Mbps
			* 18.0 Mbps
			* 24.0 Mbps
			* 36.0 Mbps
			* 48.0 Mbps
			* 54.0 Mbps
		Frequencies:
			* 5180 MHz [36] (17.0 dBm)
			* 5200 MHz [40] (17.0 dBm)
			* 5220 MHz [44] (17.0 dBm)
			* 5240 MHz [48] (17.0 dBm)
			* 5260 MHz [52] (23.0 dBm) (no IR, radar detection)
			  DFS state: usable (for 429015 sec)
			* 5280 MHz [56] (23.0 dBm) (no IR, radar detection)
			  DFS state: usable (for 429015 sec)
			* 5300 MHz [60] (23.0 dBm) (no IR, radar detection)
			  DFS state: usable (for 429015 sec)
			* 5320 MHz [64] (23.0 dBm) (no IR, radar detection)
			  DFS state: usable (for 429015 sec)
			* 5500 MHz [100] (disabled)
			* 5520 MHz [104] (disabled)
			* 5540 MHz [108] (disabled)
			* 5560 MHz [112] (disabled)
			* 5580 MHz [116] (disabled)
			* 5600 MHz [120] (disabled)
			* 5620 MHz [124] (disabled)
			* 5640 MHz [128] (disabled)
			* 5660 MHz [132] (disabled)
			* 5680 MHz [136] (disabled)
			* 5700 MHz [140] (disabled)
			* 5745 MHz [149] (30.0 dBm)
			* 5765 MHz [153] (30.0 dBm)
			* 5785 MHz [157] (30.0 dBm)
			* 5805 MHz [161] (30.0 dBm)
			* 5825 MHz [165] (30.0 dBm)

So, channels 36 - 44 became available in the 5GHz band.  Configuring hw_mode=a and channel=36 in hostapd.conf allowed dual 40 MHz bands in 5GHz and the MBP speed increased to 300 Mbps and the Nexus 5 to 150 Mbps.  I actually don't have any 3 X 3 devices to see if it will negotiate 450 Mbps, but I guess it probably will.

So to summarize, if you want to use dual or triple streams you wil probably need 5 GHz unless you live in the boonies, and if you can't connect in the 5 GHz range, try installing crda (at least in the US).

Offline

Board footer

Powered by FluxBB