Discussion:
[Madwifi-devel] Random disconnects
Nejc Škoberne
2011-07-20 23:31:26 UTC
Permalink
Hello,

I have UBNT NanoStation 2 (with Atheros 802.11b/g), which also uses
wpa_supplicant and madwifi. I set wpa_supplicant up like this:

eapol_version=1
ap_scan=1
fast_reauth=1
network={
ssid="eduroam"
proto=RSN
key_mgmt=WPA-EAP
pairwise=CCMP
scan_ssid=1
bssid=00:17:DF:2C:xx:xx
priority=1
eap=TTLS
identity="xxx"
anonymous_identity="***@xxx"
password="xxx"
phase2="auth=MSCHAPV2"
}

And this works. However, I get random disconnects:

1310857012.150280: CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys

The station then reconnects (sometimes it takes a few timeouts) and
reauthenticates. What could be the problem? The signal level is about
-80 dBi.

The whole wpa_supplicant debug log is here:

http://pastebin.com/AM7LP4Yz

The madwifi debug kernel log (athdebug 0xffffffff) is here:

http://pastebin.com/ePTdqh1C

At time Jul 20 23:18:28 in this log you will see the wpa_supplicant's
disconnect, and all "around" it is madwifi's debug stuff, which I cannot
understand.

Can anyone give me a clue?

Thanks,
Nejc
Pavel Roskin
2011-07-21 14:51:23 UTC
Permalink
Hello, Nejc!

Sorry for a duplicate message. I sent the previous copy from a wrong
address, so it didn't make it to the list.

Please don't cross post to many mailing lists.
Post by Nejc Å koberne
Hello,
I have UBNT NanoStation 2 (with Atheros 802.11b/g), which also uses
eapol_version=1
ap_scan=1
fast_reauth=1
network={
ssid="eduroam"
proto=RSN
key_mgmt=WPA-EAP
pairwise=CCMP
scan_ssid=1
bssid=00:17:DF:2C:xx:xx
priority=1
eap=TTLS
identity="xxx"
password="xxx"
phase2="auth=MSCHAPV2"
}
1310857012.150280: CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
The station then reconnects (sometimes it takes a few timeouts) and
reauthenticates. What could be the problem? The signal level is about
-80 dBi.
http://pastebin.com/AM7LP4Yz
http://pastebin.com/ePTdqh1C
My understanding is that wpa_supplicant doesn't like something about the
AP because it adds the AP's MAC to the blacklist before the disconnect.

I think the disconnects are initiated by wpa_supplicant. However, I
don't see any message from wpa_supplicant explaining the reason for
blacklisting.

I believe it would be better to ask in the hostap list
(***@lists.shmoo.com)

You may want to add extra wpa_printf() calls in the code calling
wpa_blacklist_add() and maybe see the backtrace in gdb so that you see
what is going on. Perhaps wpa_supplicant could provide better information.

I don't think the driver plays any significant role here.
--
Regards,
Pavel Roskin
Nejc Škoberne
2011-07-21 15:16:24 UTC
Permalink
Hey,
Post by Pavel Roskin
I don't think the driver plays any significant role here.
well, the guy from HostAP doesn't think so:

------
That is a disconnection event from the driver:

1310857012.148471: Wireless event: cmd=0x8b15 len=20
1310857012.148635: Wireless event: new AP: 00:00:00:00:00:00
1310857012.148974: Setting scan request: 0 sec 100000 usec
1310857012.149966: Added BSSID 00:17:df:2c:c9:e2 into blacklist
1310857012.150280: CTRL-EVENT-DISCONNECTED - Disconnect event - remove
keys

wpa_supplicant does not control this behavior, so you would need to take
a look at the driver to figure out why it is reporting the connection to
be lost.
------

This is why I sent this to madwifi list in the first place.

What do you think?

I will forward your comments to HostAP list, obviously. :)

Thanks,
Nejc
Pavel Roskin
2011-07-21 15:43:17 UTC
Permalink
Post by Nejc Å koberne
Hey,
Post by Pavel Roskin
I don't think the driver plays any significant role here.
------
1310857012.148471: Wireless event: cmd=0x8b15 len=20
1310857012.148635: Wireless event: new AP: 00:00:00:00:00:00
1310857012.148974: Setting scan request: 0 sec 100000 usec
1310857012.149966: Added BSSID 00:17:df:2c:c9:e2 into blacklist
1310857012.150280: CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
wpa_supplicant does not control this behavior, so you would need to take
a look at the driver to figure out why it is reporting the connection to
be lost.
------
This is why I sent this to madwifi list in the first place.
What do you think?
I will forward your comments to HostAP list, obviously. :)
Sure, the disconnect events come from the driver. But blacklisting the
BSSID is done by wpa_supplicant.

I've seen cases when some other software (usually another copy of
wpa_supplicant) tries to reconfigure the card and causes it to
disconnect. But there are messages in the log that show that
wpa_supplicant itself detects a timeout.

For example:

1310857024.464978: Authentication with 00:17:df:2c:c9:e2 timed out.
1310857024.468330: BSSID 00:17:df:2c:c9:e2 blacklist count incremented to 2
1310857024.468723: No keys have been configured - skip key clearing
1310857024.468881: State: ASSOCIATING -> DISCONNECTED

And then:

1310857498.784927: Authentication with 00:17:df:2c:c9:e2 timed out.
1310857498.786611: BSSID 00:17:df:2c:c9:e2 blacklist count incremented to 2
1310857498.786967: No keys have been configured - skip key clearing
1310857498.787117: State: 4WAY_HANDSHAKE -> DISCONNECTED

Maybe the connection is unreliable and some packets are lost. Or maybe
the wpa_supplicant configuration is wrong.

You may want to try some other configuration, such as WPA-PSK, which is
harder to get wrong. Check that you don't have another wpa_supplicant
running. Check that you have no other scripts that may be controlling
the device.
--
Regards,
Pavel Roskin
Nejc Škoberne
2011-07-23 10:39:32 UTC
Permalink
Hey again,
the reason was would be to look at driver debug information (or
potentially a capture file from a sniffer).
The driver debug information is here:

http://pastebin.com/ePTdqh1C
This one would need a sniffer to see what exactly was transmitted.. It
looks like there could be mismatch in association state between the AP
and the station and reassociation not being reported to wpa_supplicant
or just some other odd frame loss that could end up with the station not
receiving all the frames. The AP seems to stop sending EAPOL-Key frames
(or well, at least they are not indicated all the way to
wpa_supplicant), but there is no disconnection event which should show
up if the maximum retry attempt is reached.
Since the CPE is on a tree I am unable to sniff the packets with my
laptop (I get no signal from AP on the ground). Is there any other way
to sniff in 802_11 mode?

Thanks,
Nejc

Loading...