Re: 11n in adhoc mode

2012-12-12 Thread Adrian Chadd
Here's what I have trimmed this down to so far:

http://people.freebsd.org/~adrian/ath/20121212-11n-ibss-and-other-stuff-3.diff

Please disable ampdu for now (ifconfig wlanX -ampdu) as it just plain
doesn't work.
I'll figure out why once I figure out the cleanest way to get this 11n
IBSS stuff working.

I've tested this between two 11n nodes and a third 11a only node.
So far it works out ok. But it obviously could do with a lot more
thorough testing.

I'd appreciate feedback!



Adrian
___
freebsd-wireless@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-wireless
To unsubscribe, send any mail to freebsd-wireless-unsubscr...@freebsd.org


Re: 11n in adhoc mode

2012-12-12 Thread Adrian Chadd
.. hey, scratch that. 11n aggregation works in IBSS mode with my
patch, at least on ath(4).

I bet there's all kinds of weird subtle crap going on that we need to
fix, but the basics are working.




Adrian
___
freebsd-wireless@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-wireless
To unsubscribe, send any mail to freebsd-wireless-unsubscr...@freebsd.org


Re: 11n in adhoc mode

2012-12-12 Thread Johann Hugo
On Wednesday, December 12, 2012 01:58:38 AM Adrian Chadd wrote:
 Here's what I have trimmed this down to so far:
 
 http://people.freebsd.org/~adrian/ath/20121212-11n-ibss-and-other-stuff-3.di
 ff
 
 Please disable ampdu for now (ifconfig wlanX -ampdu) as it just plain
 doesn't work.
 I'll figure out why once I figure out the cleanest way to get this 11n
 IBSS stuff working.
 
 I've tested this between two 11n nodes and a third 11a only node.
 So far it works out ok. But it obviously could do with a lot more
 thorough testing.
 
 I'd appreciate feedback!
 

No luck. Maybe I'm missing some settings ?

mesh-2870:~ # uname -a
FreeBSD mesh-2870 10.0-CURRENT FreeBSD 10.0-CURRENT #15: Wed Dec 12 11:38:06

rc.conf
create_args_wlan1=wlanmode adhoc country ZA
ifconfig_wlan1=10.50.50.2/24 ssid testADHOC channel 28:ht/40 -ampdu bssid 
02:8c:ca:fe:ca:10

mesh-2870:~ # ifconfig wlan1
wlan1: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST metric 0 mtu 1500
ether 00:0c:42:6c:63:20
inet 10.50.50.2 netmask 0xff00 broadcast 10.50.50.255 
inet6 fe80::20c:42ff:fe6c:6320%wlan1 prefixlen 64 scopeid 0x8 
nd6 options=21PERFORMNUD,AUTO_LINKLOCAL
media: IEEE 802.11 Wireless Ethernet autoselect mode 11na adhoc
status: running
ssid testADHOC channel 28 (5140 MHz 11a ht/40-) bssid 
02:8c:ca:fe:ca:10
regdomain NONE country ZA ecm authmode OPEN privacy OFF txpower 17
mcastrate 6 mgmtrate 6 scanvalid 60 -ampdu ampdulimit 8k
ampdudensity 8 shortgi wme burst

mesh-2870:~ # ifconfig wlan1 list chan
Channel   1 : 2412  MHz 11g ht   Channel  52 : 5260* MHz 11a ht   
Channel   2 : 2417  MHz 11g ht   Channel  56 : 5280* MHz 11a ht   
Channel   3 : 2422  MHz 11g ht   Channel  60 : 5300* MHz 11a ht   
Channel   4 : 2427  MHz 11g ht   Channel  64 : 5320* MHz 11a ht   
Channel   5 : 2432  MHz 11g ht   Channel 100 : 5500* MHz 11a ht   
Channel   6 : 2437  MHz 11g ht   Channel 104 : 5520* MHz 11a ht   
Channel   7 : 2442  MHz 11g ht   Channel 108 : 5540* MHz 11a ht   
Channel   8 : 2447  MHz 11g ht   Channel 112 : 5560* MHz 11a ht   
Channel   9 : 2452  MHz 11g ht   Channel 116 : 5580* MHz 11a ht   
Channel  10 : 2457  MHz 11g ht   Channel 120 : 5600* MHz 11a ht   
Channel  11 : 2462  MHz 11g ht   Channel 124 : 5620* MHz 11a ht   
Channel  12 : 2467* MHz 11g ht   Channel 128 : 5640* MHz 11a ht   
Channel  13 : 2472* MHz 11g ht   Channel 132 : 5660* MHz 11a ht   
Channel  24 : 5120* MHz 11a ht   Channel 136 : 5680* MHz 11a ht   
Channel  28 : 5140* MHz 11a ht   Channel 140 : 5700* MHz 11a ht   
Channel  32 : 5160* MHz 11a ht   Channel 149 : 5745* MHz 11a ht   
Channel  36 : 5180* MHz 11a ht   Channel 153 : 5765* MHz 11a ht   
Channel  40 : 5200* MHz 11a ht   Channel 157 : 5785* MHz 11a ht   
Channel  44 : 5220* MHz 11a ht   Channel 161 : 5805* MHz 11a ht   
Channel  48 : 5240* MHz 11a ht   Channel 165 : 5825* MHz 11a ht

mesh-2870:~ # ifconfig wlan1 list sta
ADDR   AID CHAN RATE RSSI IDLE  TXSEQ  RXSEQ CAPS FLAG   
00:0c:42:6c:63:200   28   0M 18.0  300 21  0 IA  
00:0c:42:6c:61:910   28  54M 17.50122   1552 IAQ  HTCAP 
WME

mesh-2870:~ # athratestats -i ath1 -m 00:0c:42:6c:61:91
static_rix (-1) ratemask 0x0
[ 250] cur rate 54  Mb since switch: packets 1 ticks 142385
[ 250] last sample (6  Mb) cur sample (0 ) packets sent 122
[ 250] packets since sample 1 sample tt 0

[1600] cur rate 54  Mb since switch: packets 1 ticks 93578
[1600] last sample (6  Mb) cur sample (0 ) packets sent 3
[1600] packets since sample 3 sample tt 0

   TX Rate TXTOTAL:TXOK   EWMA  T/   F avg last xmit
[36  Mb: 250]1:1(100.0%)1/   0   464uS 6977
[36  Mb:1600]1:1(100.0%)1/   0   764uS 93021
[54  Mb: 250]  121:121  (100.0%)  121/   0   444uS 142385
[54  Mb:1600]2:2(100.0%)2/   0   644uS 93578

Johann
___
freebsd-wireless@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-wireless
To unsubscribe, send any mail to freebsd-wireless-unsubscr...@freebsd.org


Re: 11n in adhoc mode

2012-12-12 Thread Adrian Chadd
Let me do some more digging. If you set the channel like that you run
through a different code path to if you do it via scanning.

Also, I did tidy up and remove some code before I posted that diff.
Maybe some of it was needed.

mesh-2870:~ # athratestats -i ath1 -m 00:0c:42:6c:61:91
static_rix (-1) ratemask 0x0

See that? The ratemask is all wrong, even for an 11a/11bg node. Maybe
how it learnt about the second node was via a different code path..



Adrian

On 12 December 2012 04:29, Johann Hugo jh...@meraka.csir.co.za wrote:
 On Wednesday, December 12, 2012 01:58:38 AM Adrian Chadd wrote:

 Here's what I have trimmed this down to so far:




 http://people.freebsd.org/~adrian/ath/20121212-11n-ibss-and-other-stuff-3.di

 ff



 Please disable ampdu for now (ifconfig wlanX -ampdu) as it just plain

 doesn't work.

 I'll figure out why once I figure out the cleanest way to get this 11n

 IBSS stuff working.



 I've tested this between two 11n nodes and a third 11a only node.

 So far it works out ok. But it obviously could do with a lot more

 thorough testing.



 I'd appreciate feedback!





 No luck. Maybe I'm missing some settings ?



 mesh-2870:~ # uname -a

 FreeBSD mesh-2870 10.0-CURRENT FreeBSD 10.0-CURRENT #15: Wed Dec 12 11:38:06



 rc.conf

 create_args_wlan1=wlanmode adhoc country ZA

 ifconfig_wlan1=10.50.50.2/24 ssid testADHOC channel 28:ht/40 -ampdu bssid
 02:8c:ca:fe:ca:10



 mesh-2870:~ # ifconfig wlan1

 wlan1: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST metric 0 mtu 1500

 ether 00:0c:42:6c:63:20

 inet 10.50.50.2 netmask 0xff00 broadcast 10.50.50.255

 inet6 fe80::20c:42ff:fe6c:6320%wlan1 prefixlen 64 scopeid 0x8

 nd6 options=21PERFORMNUD,AUTO_LINKLOCAL

 media: IEEE 802.11 Wireless Ethernet autoselect mode 11na adhoc

 status: running

 ssid testADHOC channel 28 (5140 MHz 11a ht/40-) bssid 02:8c:ca:fe:ca:10

 regdomain NONE country ZA ecm authmode OPEN privacy OFF txpower 17

 mcastrate 6 mgmtrate 6 scanvalid 60 -ampdu ampdulimit 8k

 ampdudensity 8 shortgi wme burst



 mesh-2870:~ # ifconfig wlan1 list chan

 Channel 1 : 2412 MHz 11g ht Channel 52 : 5260* MHz 11a ht

 Channel 2 : 2417 MHz 11g ht Channel 56 : 5280* MHz 11a ht

 Channel 3 : 2422 MHz 11g ht Channel 60 : 5300* MHz 11a ht

 Channel 4 : 2427 MHz 11g ht Channel 64 : 5320* MHz 11a ht

 Channel 5 : 2432 MHz 11g ht Channel 100 : 5500* MHz 11a ht

 Channel 6 : 2437 MHz 11g ht Channel 104 : 5520* MHz 11a ht

 Channel 7 : 2442 MHz 11g ht Channel 108 : 5540* MHz 11a ht

 Channel 8 : 2447 MHz 11g ht Channel 112 : 5560* MHz 11a ht

 Channel 9 : 2452 MHz 11g ht Channel 116 : 5580* MHz 11a ht

 Channel 10 : 2457 MHz 11g ht Channel 120 : 5600* MHz 11a ht

 Channel 11 : 2462 MHz 11g ht Channel 124 : 5620* MHz 11a ht

 Channel 12 : 2467* MHz 11g ht Channel 128 : 5640* MHz 11a ht

 Channel 13 : 2472* MHz 11g ht Channel 132 : 5660* MHz 11a ht

 Channel 24 : 5120* MHz 11a ht Channel 136 : 5680* MHz 11a ht

 Channel 28 : 5140* MHz 11a ht Channel 140 : 5700* MHz 11a ht

 Channel 32 : 5160* MHz 11a ht Channel 149 : 5745* MHz 11a ht

 Channel 36 : 5180* MHz 11a ht Channel 153 : 5765* MHz 11a ht

 Channel 40 : 5200* MHz 11a ht Channel 157 : 5785* MHz 11a ht

 Channel 44 : 5220* MHz 11a ht Channel 161 : 5805* MHz 11a ht

 Channel 48 : 5240* MHz 11a ht Channel 165 : 5825* MHz 11a ht



 mesh-2870:~ # ifconfig wlan1 list sta

 ADDR AID CHAN RATE RSSI IDLE TXSEQ RXSEQ CAPS FLAG

 00:0c:42:6c:63:20 0 28 0M 18.0 300 21 0 I A

 00:0c:42:6c:61:91 0 28 54M 17.5 0 122 1552 I AQ HTCAP WME



 mesh-2870:~ # athratestats -i ath1 -m 00:0c:42:6c:61:91

 static_rix (-1) ratemask 0x0

 [ 250] cur rate 54 Mb since switch: packets 1 ticks 142385

 [ 250] last sample (6 Mb) cur sample (0 ) packets sent 122

 [ 250] packets since sample 1 sample tt 0



 [1600] cur rate 54 Mb since switch: packets 1 ticks 93578

 [1600] last sample (6 Mb) cur sample (0 ) packets sent 3

 [1600] packets since sample 3 sample tt 0



 TX Rate TXTOTAL:TXOK EWMA T/ F avg last xmit

 [36 Mb: 250] 1:1 (100.0%) 1/ 0 464uS 6977

 [36 Mb:1600] 1:1 (100.0%) 1/ 0 764uS 93021

 [54 Mb: 250] 121:121 (100.0%) 121/ 0 444uS 142385

 [54 Mb:1600] 2:2 (100.0%) 2/ 0 644uS 93578



 Johann
___
freebsd-wireless@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-wireless
To unsubscribe, send any mail to freebsd-wireless-unsubscr...@freebsd.org


Re: 11n in adhoc mode

2012-12-11 Thread Adrian Chadd
.. so now I have 11n IBSS working, but the performance is pretty
shocking. I bet there's some timers that are just not programmed
correctly.
I see massive numbers of long retries and CRC errors.

In any case, there are a few odd things out:

* ieee80211_ies_expand() doesn't parse HTINFO, only HTCAP. I don't
know why - Bernhard, any ideas?
* Taught ieee80211_sta_join() about the HT setup, so it sets up HT
information based on the probe response.
 *  The problem here is that the STA code sets up the HT information
based on the association response, rather than the probe response; but
there's no association request/response with IBSS. So if you don't
capture it during probe response, you're short of luck;
 * .. and when doing an initial scan, the probe response goes to the
scan module; it doesn't make it through to the normal probe response
code that follows and thus it can't possibly be used to upgrade
things.
* Then some ancillary stuff - mostly processing beacon frames from
peers and handling HT IE changes correctly.

So with this, I have what looks like a working 802.11n IBSS - at least
there are MCS rates negotiated on both sides. I don't like it one bit
though; I'd like to sit down with Bernhard and anyone else who knows
net80211 well enough to see whether things are right.

But.. it seems quite plausible to make work now. I don't think I have
the time / brain cycles to debug some of the more stranger behaviour
(and I can't ignore that the driver/HAL is missing a whole heap of 11n
chipset IBSS fixes, let along the IBSS  data path needing some TX and
RX AMPDU fixes) but I'll definitely see if I can just get the basics
up and running.

Thanks,


Adrian
___
freebsd-wireless@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-wireless
To unsubscribe, send any mail to freebsd-wireless-unsubscr...@freebsd.org


Re: 11n in adhoc mode

2012-12-11 Thread Adrian Chadd
Hm, you may be right; but I disabled HT protection entirely and stuck
it on a very quiet channel.

It's possible both ends were colliding with each other though.

I did add some HT update code to the adhoc beacon processing, though.
It's just not entirely clear how to handle that given the nature of
IBSS - ie, every peer may have some different idea of what the
protection mode is.

It's possible that it should be learnt once when you join the BSS,
much like how the adhoc scan pick code checks for a few things
matching before it joins that BSS.


Adrian
___
freebsd-wireless@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-wireless
To unsubscribe, send any mail to freebsd-wireless-unsubscr...@freebsd.org


Re: 11n in adhoc mode

2012-12-10 Thread Adrian Chadd
Ok, I've started digging into this a bit more. I need to get 11n adhoc
working so I can get 11n ahdemo working, so we can actually do 11n
TDMA at some point in the near future.

There's a whole lot of missing stuff:

* ieee80211_add_neighbor() and ieee80211_init_neighbor() don't know
about HT at all; they don't populate the HT IEs or 11n rates;

* when scanning and choosing a channel to create a BSS on, there are two things:
  + if it doesn't find an IBSS, it creates one
  + if it doesn't find an IBSS, it joins that IBSS initially, via
whatever is in the scan cache, using the scan cache channel results.

Now, I fixed the primary so it does correctly populate the
HTINFO/HTCAP IEs; so now the IBSS 11n beaconing does indeed include
the TX/RX MCS configuration necessary to do HT/MCS.

But the second is the problem - namely, it looks in the scan cache,
selects the matched entry (that used a legacy channel, as scanning is
done using legacy channels!) then it just calls ieee80211_sta_join()
using that. So it always creates a non-HT channel configuration and
associates as a non-HT node.

Now, if I change adhoc_pick_bss() to adjust the channel to be a HT
channel before it goes off and calls ieee80211_sta_join(), it will
successfully setup the channel to be an 11n channel and it'll do MCS
rates with an 11n peer fine. (traffic throughput sucks and panics
though; so it's not all smooth sailing here.) But that raises a big
problem:

If the first node that a new IBSS device sees is non-11n, will it just
assume the BSS is legacy, or will it magically promote itself to
11n/ht20 or 11n/ht40 and continue along merrily?

It'd be nice to figure out what the behaviour there should be.

Anyway. I'm making a little progress. I'll see if I can figure out why
I'm getting panics and crappy throughput when doing traffic tests - I
bet the adhoc RX and TX data path doesn't have some 11n related fixes
in there and it's messing things up.



Adrian
___
freebsd-wireless@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-wireless
To unsubscribe, send any mail to freebsd-wireless-unsubscr...@freebsd.org


Re: 11n in adhoc mode

2012-12-10 Thread Adrian Chadd
Ok, wow. I think I finally understand the level of huh? going on here.

When a new BSS is created, everything now works out great. It creates
a BSS, the channel is promoted to 11n correctly, it gets the 11n IE's
populated, etc.

When you're joining a BSS however, it doesn't do any of this.
adhoc_pick_bss() calls ieee80211_sta_join() to the BSS, which
populates a vap node to that peer with a very, very bare minimum
config. There's no HT info there at all. But since it's done the basic
node setup, the normal discovery path (ie, BSS RX, BSS beacon RX)
doesn't see this particular node as a 'new' node.

Now, I hacked up the HT rate and node setup into adhoc_pick_bss() to
setup the BSS node like this and it works; enough to have both sides
setup the MCS rate tables and negotiate 11n right. They don't
successfully negotiate ADDBA, but that's some funny race crap I'll
deal with later (I'm doing it all on a single laptop with two ath
NICs, using vimage. Yes, evil.)

Anyway. I think I'm getting slightly closer to making 11n adhoc mode
work. I may need some help (Bernhard?) on figuring out a cleaner way
to join an existing BSS, instead of how it's currently done.

Also, Bernhard - why don't we do all the IE setup in ieee80211_sta_join() ?

Thanks,



Adrian
___
freebsd-wireless@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-wireless
To unsubscribe, send any mail to freebsd-wireless-unsubscr...@freebsd.org