LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 03-10-2012, 10:52 AM   #1
karolis
LQ Newbie
 
Registered: Jul 2004
Posts: 11

Rep: Reputation: 0
Very poor WPA performance with RTL8187 (Alfa AWUS036H)


I've been playing with this card for so long that to be honest I don't know where to start…

OK, I want to make myself a linux based wireless router. I also want to have a powerful wifi adapter in it.

I didn't have a wireless adapter, so I googled around to find out which chipset has good linux support. RTL8187 was mentioned more than once and recommended in some places. So I bought AWUS036H usb adapter. It is powerful and seems to be very popular, so can't go wrong with it… right?

The adapter arrived after some days, I decided to test how it works. It had windows, linux and osx drivers. To make long story short, this adapter is VERY nice and powerful on windows. Installing it on OSX was a bit more complicated, as I had to load kernel extensions manually… but it also works, and performance is similar to windows.

With linux things are a bit more complicated though.
I downloaded latest stable Debian and installed it in a virtual machine (Parallels 6 for OSX) for testing. RTL8187 drivers were already included in the kernel tree, so there was nothing for me to do, just plug the device and play.

I didn't test the performance with WEP networks very thoroughly, but for the couple of tests I did, it seemed to work OK. Nothing unusual.

The problems started when I tried to connect to a WPA network.

From the beginning:
Code:
root@debian:~# uname -a
Linux debian 2.6.32-5-686 #1 SMP Mon Jan 16 16:04:25 UTC 2012 i686 GNU/Linux
root@debian:~# cat /etc/issue
Debian GNU/Linux 6.0
tail -f /var/log/messages

=> plug usb in

Code:
Mar 10 11:13:46 debian kernel: [   41.188293] usb 1-1: new high speed USB device using ehci_hcd and address 2
Mar 10 11:13:46 debian kernel: [   41.329128] usb 1-1: New USB device found, idVendor=0bda, idProduct=8187
Mar 10 11:13:46 debian kernel: [   41.329132] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Mar 10 11:13:46 debian kernel: [   41.329136] usb 1-1: Product: RTL8187_Wireless
Mar 10 11:13:46 debian kernel: [   41.329143] usb 1-1: Manufacturer: Manufacturer_Realtek_RTL8187_
Mar 10 11:13:46 debian kernel: [   41.329145] usb 1-1: SerialNumber: E84E06021C5E
Mar 10 11:13:46 debian kernel: [   41.329234] usb 1-1: configuration #1 chosen from 1 choice
Mar 10 11:13:47 debian kernel: [   41.494536] cfg80211: Using static regulatory domain info
Mar 10 11:13:47 debian kernel: [   41.494538] cfg80211: Regulatory domain: US
Mar 10 11:13:47 debian kernel: [   41.494539]   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
Mar 10 11:13:47 debian kernel: [   41.494542]   (2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)
Mar 10 11:13:47 debian kernel: [   41.494544]   (5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
Mar 10 11:13:47 debian kernel: [   41.494546]   (5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
Mar 10 11:13:47 debian kernel: [   41.494548]   (5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
Mar 10 11:13:47 debian kernel: [   41.494550]   (5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
Mar 10 11:13:47 debian kernel: [   41.494552]   (5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)
Mar 10 11:13:47 debian kernel: [   41.495345] cfg80211: Calling CRDA for country: US
Mar 10 11:13:47 debian kernel: [   41.976626] phy0: hwaddr e8:4e:06:02:1c:5e, RTL8187vB (default) V1 + rtl8225z2, rfkill mask 2
Mar 10 11:13:47 debian kernel: [   42.005829] rtl8187: Customer ID is 0x00
Mar 10 11:13:47 debian kernel: [   42.006225] Registered led device: rtl8187-phy0::tx
Mar 10 11:13:47 debian kernel: [   42.006366] Registered led device: rtl8187-phy0::rx
Mar 10 11:13:47 debian kernel: [   42.008381] rtl8187: wireless switch is on
Mar 10 11:13:47 debian kernel: [   42.008407] usbcore: registered new interface driver rtl8187
The device seems to be recognized…

Code:
root@debian:~# iwconfig

wlan0     IEEE 802.11bg  ESSID:off/any
          Mode:Managed  Access Point: Not-Associated   Tx-Power=0 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
I save this config into /tmp/ws.cfg:

Code:
network={
  ssid="XXXX"
  psk="YYYY"
  proto=WPA
  key_mgmt=WPA-PSK
}
And run:

Code:
wpa_supplicant -c /tmp/ws.cfg -i wlan0 -d
wpa_supplicant gives a lot of output, but it seems to work, as:

Code:
root@debian:~# iwconfig

wlan0     IEEE 802.11bg  ESSID:"xxxxxxxxxx"
          Mode:Managed  Frequency:2.417 GHz  Access Point: F4:3E:61:0F:38:69
          Bit Rate=1 Mb/s   Tx-Power=27 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=54/70  Signal level=-56 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0
Note that it will sometimes connect at 1Mb/s, sometimes at 36 Mb/s, sometimes at 54 Mb/s, but the connection is never reliable.

Code:
root@debian:~# dhclient -v wlan0

Listening on LPF/wlan0/e8:4e:06:02:1c:5e
Sending on   LPF/wlan0/e8:4e:06:02:1c:5e
Sending on   Socket/fallback
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 12
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 16
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 17
DHCPOFFER from 192.168.1.1
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPACK from 192.168.1.1
Reloading /etc/samba/smb.conf: smbd only.
bound to 192.168.1.37 -- renewal in 33048 seconds.
ifconfig says:

Code:
wlan0     Link encap:Ethernet  HWaddr e8:4e:06:02:1c:5e
          inet addr:192.168.1.37  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::ea4e:6ff:fe02:1c5e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:73 errors:0 dropped:0 overruns:0 frame:0
          TX packets:66 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:5091 (4.9 KiB)  TX bytes:9841 (9.6 KiB)
OK so it seems that I have a connection. Problem is… it sucks
Ping usually looses around 80% of packets, download speed is …. almost zero, not usable.

When I disconnect this adapter from linux and connect to either windows or osx system, I get <5% ping loss and download speed of around 2mbps (same antenna, same adapter position, same workstation, same wifi network).

I tried installing compat-wireless drivers and increasing txpower to 30… which didn't help much.

Any ideas?

Would appreciate any help with this.

Karolis
 
Old 03-11-2012, 03:59 AM   #2
karolis
LQ Newbie
 
Registered: Jul 2004
Posts: 11

Original Poster
Rep: Reputation: 0
Also, would be very interested to get recommendations for a good wireless adapter, with the following features:

- high sensitivity and tx power
- connects through mini-pci or usb
- ..... has good linux drivers

Karolis
 
Old 03-11-2012, 11:37 AM   #3
karolis
LQ Newbie
 
Registered: Jul 2004
Posts: 11

Original Poster
Rep: Reputation: 0
Since parallels is creating its own virtual interface that linux uses as eth0, I thought It may be conflicting with wpa_supplicant in some way (not sure really).
I disabled eth0 on guest OS completely and only worked directly with usb adapter.

Anyway, after another day of testing:
- I can connect to wpa network
- ping to router is OK, around 3ms, very low packet loss <2%.

However, when I try to download some larger file (say a couple MB), it starts OK and then the speed gradualy slows down to zero until it disconnects. After that, pinging router also fails, about 80% packet loss.

Killing wpa_supplicant and starting it again would fix the link, it starts to work again.
Downloading file kills the link again and it stops working.

repeated ~ 10-20 times to be sure.

I tried this with Debian 2.6.32 kernel and Centos 2.6.18 kernel, results are very much the same. In both cases, used rtl8187 driver bundled with the official kernel.

On the other hand the same device works stable on OSX and can download large files without problems and link stays alive for days.

Not sure if this could be related to Parallels, maybe I'll try with vmware.

Karolis
 
Old 03-11-2012, 02:15 PM   #4
karolis
LQ Newbie
 
Registered: Jul 2004
Posts: 11

Original Poster
Rep: Reputation: 0
Same behavior on Debian 6.32.5 installed on VirtualBox, so most likely not a parallels issue.

works when wpa_supplicant gets a connection, stops working on higher activity such as file download.

Am I the only one with RTL8187 stability issues?
 
Old 03-20-2012, 06:50 PM   #5
erlend
LQ Newbie
 
Registered: Feb 2004
Distribution: Gentoo Linux
Posts: 20

Rep: Reputation: 0
I get similar problems with AWUS036H. The card has become more and more unstable for me over the past couple of years, I'm considering scrapping it and getting a PCI wireless card.

I've used my Alfa with MacOSX too, and I didn't have these problems. The RTL8187 drivers are supposed to be very good though, so I don't understand what's going on.
 
Old 04-03-2012, 06:55 AM   #6
WizadNoNext
Member
 
Registered: Nov 2009
Posts: 140

Rep: Reputation: 9
Maybe try more recent kernel. I am running 3.2.12 on both server. Both of them have RaLink based ieee802.11 cards (one is RT2561 (RT2561 + RT2661s) 802.11g NIC and the other is RT3070). I have no problems with them. Both are running as AP (master mode with bridge). Actually both have multiple passphrases and both were tested with more then AP - working.
I do recommend ALFA AWUS036NH. It is actually something like 350-500mW with 5dBi antenna (virtually boosting it to 2W). Signal seams to be weaker, then my PCI RaLink RT2561 card. I am using AWUS036NH with 18dBi antenna (huge beast - 38cm if I am not wrong).

P.S. Actually Realtek 802.11 cards are known to be quite bad with Linux - I do not know who did recommend such crap.
 
Old 10-27-2012, 01:24 PM   #7
toketin
LQ Newbie
 
Registered: Dec 2007
Location: Italy
Distribution: Archlinux
Posts: 5

Rep: Reputation: 0
Hi, i've your same problem Karolis, my Alfa awus036h works better under Windows 7 than Archlinux (or Fedora), because i can connect to a wifi hotspot correctly but like Karolis when i start a download the speed decreases until 0kb/s and then i lose the connection. With W7 the connection instead works fine for some days with no problem. I've tried also with this commands:

Quote:
sudo iwconfig wlan0 rate 5.5M fixed
sudo iwconfig wlan0 frag 2346
sudo iwconfig wlan0 rts 2347
but i earn just some minutes and then i lose the connection. So you aren't alone Karolis

Last edited by toketin; 10-27-2012 at 01:25 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Alfa Awus036H LinuxNoobX Linux - Newbie 3 01-09-2012 07:50 AM
Software Raid 6 - poor read performance / fast write performance Kvothe Linux - Server 0 02-28-2011 03:11 PM
alfa awus036h slackware current dhcpcd wont connect matters Slackware 9 02-25-2011 06:13 AM
ALFA AWUS036H n compatability? t0rtr3ss Linux - Hardware 0 12-23-2010 04:26 AM
Alfa AWUS036h rtl8187 adapter not working on Slackware 13.1 anon209 Slackware 6 10-16-2010 03:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 10:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration