2011-09-11 01:11:38

by Steven A. Falco

[permalink] [raw]
Subject: [Question] Realtek USB 0bda:8176 as AP?

I am attempting to use a Realtek USB dongle as an access point on
a PC running Fedora 15, with hostapd as the user-layer SW.

The USB ID is 0bda:8176, which makes this an rtlwifi:rtl8192cu
device.

It works fine in station mode - I can connect to a WPA network.
It also works fine as an AP, but only with security disabled.
As soon as I enable WPA in the hostapd config file, I can no
longer connect.

I've logged both the hostapd and wpa_supplicant sides of the
conversation. I'm using the same type of Realtek dongle for
both sides.

On the hostapd side, I see "sending 1/4 msg of 4-Way Handshake"

On the wpa_supplicant side, I see "RX message 1 of 4-Way Handshake"
followed by "Sending EAPOL-Key 2/4".

However, this message is not received by the hostapd side. Instead
I see "WPA: EAPOL-Key timeout" and the association drops.

I went to the IRC group, and got the suggestion to sniff the
traffic from a third PC. I've done that, and can make the trace
available if anyone wants to see it. Basically, I can see the
EAPOL-Key 2/4 in Wireshark, but the packet as received on the AP
looks a bit garbled.

Here is what wireshark shows (and it decodes it as msg 2/4):

0000 00 00 1a 00 2f 48 00 00 84 c4 a2 82 00 00 00 00 ..../H.. ........
0010 10 6c 71 09 c0 00 d9 01 00 00 08 01 00 00 00 e0 .lq..... ........
0020 4c 05 d6 1f 00 e0 4c 05 de d6 00 e0 4c 05 d6 1f L.....L. ....L...
0030 90 01 aa aa 03 00 00 00 88 8e 01 03 00 75 02 01 ........ .....u..
0040 0a 00 00 00 00 00 00 00 00 00 01 03 92 92 c7 23 ........ .......#
0050 6b 98 cb b3 05 a0 3a a3 28 4a 73 25 49 d7 2a bb k.....:. (Js%I.*.
0060 b1 e5 0c d0 7c 4a d9 b7 af 21 bc 00 00 00 00 00 ....|J.. .!......
0070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
0080 00 00 00 00 00 00 00 00 00 00 00 03 35 84 ee 8c ........ ....5...
0090 17 d3 83 13 e0 40 80 ca 96 c3 6e 00 16 30 14 01 .....@.. ..n..0..
00a0 00 00 0f ac 02 01 00 00 0f ac 04 01 00 00 0f ac ........ ........
00b0 02 00 00 95 52 78 36 ....Rx6

and here is what hostapd sees (but it prints EAPOL-Key timeout):

00000000: 00 00 0d 00 04 80 02 00 6c 00 00 00 00 08 02 34
00000010: 00 00 e0 4c 05 de d6 00 e0 4c 05 d6 1f 00 e0 4c
00000020: 05 d6 1f e0 05 aa aa 03 00 00 00 88 8e 02 03 00
00000030: 5f 02 00 8a 00 10 00 00 00 00 00 00 00 01 3f 42
00000040: f6 a8 72 f2 68 22 e8 f4 4f 3f 44 21 7a 82 01 34
00000050: fb 99 dd f0 60 dc f3 28 81 7e d4 ca 6f 35 00 00
00000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

A lot of the data match up, but a lot don't. I believe I have
synchronized the wireshark and hostapd logs, because the messages
before and after this one do match. Also, wireshark shows four
attempts at EAPOL-Key 2/4, and hostapd shows four of these
strange frames.

Has anyone been successful with these chips in AP mode with security?

Any suggestions on things to try? It was suggested to turn off HW
crypto, but that doesn't appear to be possible in the rtl8192cu driver,
although other rtl8192 devices do support it.

Or should I use a different chipset altogether? Realtek Semi appears
to have helped the community, so I don't want to abandon them, but I
also need this to work. :-)

Steve


2011-09-11 16:23:51

by Steven A. Falco

[permalink] [raw]
Subject: Re: [Question] Realtek USB 0bda:8176 as AP?

On 09/10/2011 11:51 PM, Larry Finger wrote:
> On 09/10/2011 08:11 PM, Steven A. Falco wrote:
>> I am attempting to use a Realtek USB dongle as an access point on
>> a PC running Fedora 15, with hostapd as the user-layer SW.
>>
>> The USB ID is 0bda:8176, which makes this an rtlwifi:rtl8192cu
>> device.
>
> What kernel are you running? The latest is in wireless-testing, but that will be difficult to clone as long as kernel.org is out of commission. In addition, there are two patches that were sent on 9/3, but have not yet been incorporated due to the k.o problems. They are attached.
>

I'm using kernel-3.1.0-0.rc3.git0.0.fc16.src.rpm from Fedora 16.
I'll apply the patches you provided and test a bit later today.

Steve

> I just got a Powermac G4 and I'm fixing the big-endian issues, but that is clearly not your problem.
>
> Larry
>


2011-09-11 03:51:44

by Larry Finger

[permalink] [raw]
Subject: Re: [Question] Realtek USB 0bda:8176 as AP?

On 09/10/2011 08:11 PM, Steven A. Falco wrote:
> I am attempting to use a Realtek USB dongle as an access point on
> a PC running Fedora 15, with hostapd as the user-layer SW.
>
> The USB ID is 0bda:8176, which makes this an rtlwifi:rtl8192cu
> device.

What kernel are you running? The latest is in wireless-testing, but that will be
difficult to clone as long as kernel.org is out of commission. In addition,
there are two patches that were sent on 9/3, but have not yet been incorporated
due to the k.o problems. They are attached.

I just got a Powermac G4 and I'm fixing the big-endian issues, but that is
clearly not your problem.

Larry


Attachments:
0001-rtlwifi-rtl8192cu-Fix-problem-connecting-to-HT-enabl.patch (1.67 kB)
0002-rtlwifi-Fix-problem-when-switching-connections.patch (1.44 kB)
Download all attachments

2011-09-11 21:18:54

by Steven A. Falco

[permalink] [raw]
Subject: Re: [Question] Realtek USB 0bda:8176 as AP?

On 09/11/2011 11:53 AM, Steven A. Falco wrote:
> On 09/10/2011 11:51 PM, Larry Finger wrote:
>> On 09/10/2011 08:11 PM, Steven A. Falco wrote:
>>> I am attempting to use a Realtek USB dongle as an access point on
>>> a PC running Fedora 15, with hostapd as the user-layer SW.
>>>
>>> The USB ID is 0bda:8176, which makes this an rtlwifi:rtl8192cu
>>> device.
>>
>> What kernel are you running? The latest is in wireless-testing, but that will be difficult to clone as long as kernel.org is out of commission. In addition, there are two patches that were sent on 9/3, but have not yet been incorporated due to the k.o problems. They are attached.
>>
>
> I'm using kernel-3.1.0-0.rc3.git0.0.fc16.src.rpm from Fedora 16.
> I'll apply the patches you provided and test a bit later today.

I tried the patches. They do not make a difference. Actually,
that is not surprising, because the first patch relates to 802.11n
but I am using 802.11g, and the second patch has to do with switching
networks, but I am coming up cold on this network.

I should receive some USB dongles with different chipsets tomorrow.
Hopefully one of them will be better behaved. But if there is more
data I can gather to help figure this out, I am happy to do so.

Steve

>> I just got a Powermac G4 and I'm fixing the big-endian issues, but that is clearly not your problem.
>>
>> Larry
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>


2012-01-01 13:44:26

by John Williams

[permalink] [raw]
Subject: Re: [Question] Realtek USB 0bda:8176 as AP?

Hello list,

I see there was a discussion on this list about three months ago about
using an RTL8192CU (usb 0bda:8176) in access point mode. I've just
bought one and I've got the same problem: hostapd just prints this in a
loop until it gives up:

WPA: 00:24:23:0c:9c:2f WPA_PTK entering state PTKSTART
wlan0: STA 00:24:23:0c:9c:2f WPA: sending 1/4 msg of 4-Way Handshake
WPA: Send EAPOL(version=2 secure=0 mic=0 ack=1 install=0 pairwise=8
kde_len=0 keyidx=0 encr=0)
IEEE 802.1X: 00:24:23:0c:9c:2f TX status -version=2 type=3
length=95 - ack=1
wlan0: STA 00:24:23:0c:9c:2f
WPA: EAPOL-Key timeout

This is with the driver from compat_wireless as of 2011-12-29.

It works fine with the driver downloaded from the realtek website
(provided that I also use their patched version of hostapd), so it's
not a hardware problem.

If anyone could point me to the area in the driver where it is supposed
to receive the missing message, I would be happy to have a go at
debugging it.

Regards,
John Williams

2012-01-03 19:49:17

by Larry Finger

[permalink] [raw]
Subject: Re: [Question] Realtek USB 0bda:8176 as AP?

On 01/01/2012 07:00 AM, John Williams wrote:
> Hello list,
>
> I see there was a discussion on this list about three months ago about
> using an RTL8192CU (usb 0bda:8176) in access point mode. I've just
> bought one and I've got the same problem: hostapd just prints this in a
> loop until it gives up:
>
> WPA: 00:24:23:0c:9c:2f WPA_PTK entering state PTKSTART
> wlan0: STA 00:24:23:0c:9c:2f WPA: sending 1/4 msg of 4-Way Handshake
> WPA: Send EAPOL(version=2 secure=0 mic=0 ack=1 install=0 pairwise=8
> kde_len=0 keyidx=0 encr=0)
> IEEE 802.1X: 00:24:23:0c:9c:2f TX status -version=2 type=3
> length=95 - ack=1
> wlan0: STA 00:24:23:0c:9c:2f
> WPA: EAPOL-Key timeout
>
> This is with the driver from compat_wireless as of 2011-12-29.
>
> It works fine with the driver downloaded from the realtek website
> (provided that I also use their patched version of hostapd), so it's
> not a hardware problem.
>
> If anyone could point me to the area in the driver where it is supposed
> to receive the missing message, I would be happy to have a go at
> debugging it.

I do not know what the problem with using the kernel versions of
rtl8192{ce,cu,se,de} as an AP. I have been going through the differences between
the version available on the Realtek web site and the kernel sources. Sorting
out the differences is mind numbing, and will take a while to complete.

Patches will be posted on the wireless ML when I get a fix.

Larry