Alix3d2 + AR9280 wireless access point performance

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Alix3d2 + AR9280 wireless access point performance

Ján Kušniar
Hello,

I've set up a small wifi AP using alix 3d2 computer board and Mikrotik
R52nM mini PCI wireless adapter. Works great except for wireless
throughput. It's running 5.6 stable, usual AP setup (wifi adapter in
hostap mode, dhcpd, nat in pf). No sysctls or anything not mentioned in
FAQ was modified.

Adapter is:
athn0 at pci0 dev 12 function 0 "Atheros AR9280" rev 0x01: irq 9
athn0: AR9280 rev 2 (2T2R), ROM rev 21, address 4c:5e:0c:11:c3:5f


AP configuration:
# ifconfig athn0
athn0: flags=28843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,NOINET6> mtu
1500
        lladdr 4c:5e:0c:11:c3:5f
        priority: 4
        groups: wlan
        media: IEEE802.11 autoselect mode 11g hostap
        status: active
        ieee80211: nwid kusniarovci chan 11 bssid 4c:5e:0c:11:c3:5f
wpakey XXXXXXXXXXX wpaprotos wpa1,wpa2 wpaakms psk wpaciphers tkip,ccmp
wpagroupcipher tkip
        inet 192.168.188.1 netmask 0xffffff00 broadcast 192.168.188.255

# cat /etc/hostname.athn0
up media autoselect mediaopt hostap mode 11g chan 11 nwid kusniarovci \
wpakey XXXXXXXX
inet 192.168.188.1 255.255.255.0


Even though it's running 54Mbit 802.11g, I can't get over ~15Mbit/s. I'm
testing from Linux laptop with intel centrino wireless adapter (11abgn).
Tests are performeg using iperf:

linux_client$ iperf -c 192.168.188.1 -i 1 -t 60
ap# iperf -s                              
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  4] local 192.168.188.1 port 5001 connected with 192.168.188.32 port
48367
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-60.2 sec   111 MBytes  15.5 Mbits/sec



pf disabled during tests. Are there any pointers to tune wireless
subsystem to better performance? Did I reach hardware limits? Is it
athn driver issue? During network load there seems to be a lot of
interrupts on athn reported by systat vmstat. There is also 100Mbit
ehternet adapter on alix board (vr0). It perfrorms really well
(~95Mbit/s according to iperf).


Thanks for any pointers

Reply | Threaded
Open this post in threaded view
|

Re: Alix3d2 + AR9280 wireless access point performance

Stefan Sperling-5
On Wed, Jan 14, 2015 at 04:40:00PM +0100, Ján Kušniar wrote:

> Hello,
>
> I've set up a small wifi AP using alix 3d2 computer board and Mikrotik
> R52nM mini PCI wireless adapter. Works great except for wireless
> throughput. It's running 5.6 stable, usual AP setup (wifi adapter in
> hostap mode, dhcpd, nat in pf). No sysctls or anything not mentioned in
> FAQ was modified.
>
> Adapter is:
> athn0 at pci0 dev 12 function 0 "Atheros AR9280" rev 0x01: irq 9
> athn0: AR9280 rev 2 (2T2R), ROM rev 21, address 4c:5e:0c:11:c3:5f
>
>
> AP configuration:
> # ifconfig athn0
> athn0: flags=28843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,NOINET6> mtu
> 1500
>         lladdr 4c:5e:0c:11:c3:5f
>         priority: 4
>         groups: wlan
>         media: IEEE802.11 autoselect mode 11g hostap
>         status: active
>         ieee80211: nwid kusniarovci chan 11 bssid 4c:5e:0c:11:c3:5f
> wpakey XXXXXXXXXXX wpaprotos wpa1,wpa2 wpaakms psk wpaciphers tkip,ccmp
> wpagroupcipher tkip
>         inet 192.168.188.1 netmask 0xffffff00 broadcast 192.168.188.255
>
> # cat /etc/hostname.athn0
> up media autoselect mediaopt hostap mode 11g chan 11 nwid kusniarovci \
> wpakey XXXXXXXX
> inet 192.168.188.1 255.255.255.0
>
>
> Even though it's running 54Mbit 802.11g, I can't get over ~15Mbit/s. I'm
> testing from Linux laptop with intel centrino wireless adapter (11abgn).
> Tests are performeg using iperf:
>
> linux_client$ iperf -c 192.168.188.1 -i 1 -t 60
> ap# iperf -s                              
> ------------------------------------------------------------
> Server listening on TCP port 5001
> TCP window size: 16.0 KByte (default)
> ------------------------------------------------------------
> [  4] local 192.168.188.1 port 5001 connected with 192.168.188.32 port
> 48367
> [ ID] Interval       Transfer     Bandwidth
> [  4]  0.0-60.2 sec   111 MBytes  15.5 Mbits/sec
>
>
>
> pf disabled during tests. Are there any pointers to tune wireless
> subsystem to better performance? Did I reach hardware limits? Is it
> athn driver issue? During network load there seems to be a lot of
> interrupts on athn reported by systat vmstat. There is also 100Mbit
> ehternet adapter on alix board (vr0). It perfrorms really well
> (~95Mbit/s according to iperf).
>
>
> Thanks for any pointers

OpenBSD's implementation of rate adaptation is basic. It's possible
that you'll see the AP sending data frames at less than 54Mbit/s under
normal conditions. You'll probably see better results with other OSs
since they have better tuned wifi stacks. It's an interesting problem
to look into but nobody is doing that right now.

But how knows, there could also be a driver bug that prevents higher
rates from being used.

15Mbit/s sounds as if it maxes out at 18Mbit/s (the highest QPSK rate)
and never switches to OFDM rates (24 - 54 Mbit/s).

Try this on your AP:

# tcpdump -n -i athn0 -y IEEE802_11_RADIO -vvv | grep data

This shows a broadcast frame sent at 1 Mbit/s (which is normal for broadcast
since even old devices that only support 1 and 2 Mbit/s need to receive it):

17:19:44.890129 802.11 flags=42<PROTECTED>: data: 00:00:5e:00:01:01 sap 36 > 01:00:5e:00:00:12 sap 37 I (s=64,r=48,R) len=80, <radiotap v0, 1Mbit/s, chan 1, 11g>

This shows a ping sent at 1 Mbit/s and the reply received at 2 Mbit/s:

2:18.085924 802.11 flags=42<PROTECTED>: data: fe:e1:ba:d0:6a:df sap 00 > 00:13:02:03:a5:e7 sap 12 I (s=0,r=16,C) len=104, <radiotap v0, 1Mbit/s, chan 1, 11g>
17:22:18.091566 802.11 flags=41<PROTECTED>: data: 00:13:02:03:a5:e7 sap 00 > fe:e1:ba:d0:6a:df sap 17 I (s=0,r=16,C) len=108, <radiotap v0, tsf 502527151889, S
HORTPRE, 2Mbit/s, chan 1, 11g, sig 43dBm, antenna 1>

During bulk data transfer I see rates of up to 18Mbit/s being used.
Do you see any higher rates than that, and if so, over long intervals
of time or just occasionally?

This access point pretty much matches your setup.

athn0 at pci0 dev 17 function 0 "Atheros AR9280" rev 0x01: irq 15
athn0: AR9280 rev 2 (2T2R), ROM rev 16, address 00:0e:8e:24:52:7d

$ ifconfig athn0                                                                                                                    
athn0: flags=28943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,NOINET6> mtu 1500
        lladdr 00:0e:8e:24:52:7d
        priority: 4
        groups: wlan
        media: IEEE802.11 autoselect (autoselect mode 11g hostap)
        status: active
        ieee80211: nwid stsp.name chan 1 bssid 00:0e:8e:24:52:7d wpakey <not displayed> wpaprotos wpa1,wpa2 wpaakms psk wpaciphers tkip,ccmp wpagroupcipher tkip

Reply | Threaded
Open this post in threaded view
|

Re: Alix3d2 + AR9280 wireless access point performance

Christian Weisgerber
In reply to this post by Ján Kušniar
On 2015-01-14, Ján Kušniar <[hidden email]> wrote:

> Even though it's running 54Mbit 802.11g, I can't get over ~15Mbit/s.

Uh, what figures do you expect?  Those "54 Mbit/s" are raw modem
speed.  You'll never get throughput anywhere close to that.

I get ~20 Mbit/s between my OpenBSD laptop with iwn(4) and a D-Link
DAP-2310 access point; ifconfig shows "ODFM54 mode 11g", i.e., top
wireless speed.

--
Christian "naddy" Weisgerber                          [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Alix3d2 + AR9280 wireless access point performance

Christian Weisgerber
In reply to this post by Stefan Sperling-5
On 2015-01-14, Stefan Sperling <[hidden email]> wrote:

> 15Mbit/s sounds as if it maxes out at 18Mbit/s (the highest QPSK rate)
> and never switches to OFDM rates (24 - 54 Mbit/s).

IEEE 802.11 still uses a shared medium and CSMA/CA, right?  (Wikipedia
says so.)  So the transfer between two nodes is effectively
half-duplex.  The overhead from switching the transmission direction
back and forth will alone reduce your throughput substantially.
Leaving TCP ACKs aside, the 802.11 layer 2 protocol also acks data
frames, so even strictly unidirectional data transfers on a higher
layer will suffer from underlying carrier turnaround.

--
Christian "naddy" Weisgerber                          [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Alix3d2 + AR9280 wireless access point performance

Ján Kušniar
In reply to this post by Stefan Sperling-5
2015-01-14 17:41 GMT+01:00 Stefan Sperling <[hidden email]>

> OpenBSD's implementation of rate adaptation is basic. It's possible
> that you'll see the AP sending data frames at less than 54Mbit/s under
> normal conditions. You'll probably see better results with other OSs
> since they have better tuned wifi stacks. It's an interesting problem
> to look into but nobody is doing that right now.

Looks like I should start studying sources :-) I'll try to stick to OpenBSD,
since I like how great it is documented and the ease of setting it up.

> Try this on your AP:
>
> # tcpdump -n -i athn0 -y IEEE802_11_RADIO -vvv | grep data
>
> This shows a broadcast frame sent at 1 Mbit/s (which is normal for broadcast
> since even old devices that only support 1 and 2 Mbit/s need to receive it):
>
> 17:19:44.890129 802.11 flags=42<PROTECTED>: data: 00:00:5e:00:01:01 sap 36 > 01:00:5e:00:00:12 sap 37 I (s=64,r=48,R) len=80, <radiotap v0, 1Mbit/s, chan 1, 11g>
>
> This shows a ping sent at 1 Mbit/s and the reply received at 2 Mbit/s:
>
> 2:18.085924 802.11 flags=42<PROTECTED>: data: fe:e1:ba:d0:6a:df sap 00 > 00:13:02:03:a5:e7 sap 12 I (s=0,r=16,C) len=104, <radiotap v0, 1Mbit/s, chan 1, 11g>
> 17:22:18.091566 802.11 flags=41<PROTECTED>: data: 00:13:02:03:a5:e7 sap 00 > fe:e1:ba:d0:6a:df sap 17 I (s=0,r=16,C) len=108, <radiotap v0, tsf 502527151889, S
> HORTPRE, 2Mbit/s, chan 1, 11g, sig 43dBm, antenna 1>
>
> During bulk data transfer I see rates of up to 18Mbit/s being used.
> Do you see any higher rates than that, and if so, over long intervals
> of time or just occasionally?

I saw mostly 18Mbit/s during bulk data transfer. There were some
24Mbit and 36Mbit lines,
but only occasionally. Need to find out what I'm looking at, to understand it.

Since you have similar hardware, It looks like I've reached device's speed limit
on current OpenBSD. Hope there will be 11n soon, AR9280 supports it.

Reply | Threaded
Open this post in threaded view
|

Re: Alix3d2 + AR9280 wireless access point performance

Stefan Sperling-5
In reply to this post by Christian Weisgerber
On Wed, Jan 14, 2015 at 08:24:02PM +0000, Christian Weisgerber wrote:

> On 2015-01-14, Stefan Sperling <[hidden email]> wrote:
>
> > 15Mbit/s sounds as if it maxes out at 18Mbit/s (the highest QPSK rate)
> > and never switches to OFDM rates (24 - 54 Mbit/s).
>
> IEEE 802.11 still uses a shared medium and CSMA/CA, right?  (Wikipedia
> says so.)  So the transfer between two nodes is effectively
> half-duplex.  The overhead from switching the transmission direction
> back and forth will alone reduce your throughput substantially.
> Leaving TCP ACKs aside, the 802.11 layer 2 protocol also acks data
> frames, so even strictly unidirectional data transfers on a higher
> layer will suffer from underlying carrier turnaround.

That's right. Also, labels like "54Mbit/s" apply to the transmission
rate of the data part of a frame. There is still a preamble and header
which is always transmitted at 1Mbit/s for legacy compat.
Not all bits fly at the same speed in wifi.