slow wifi connection on ubuntu 13.04 with rtl8723ae realtek wireless driver

so i have installed ubuntu four days ago on my toshiba SATELLITE-C855-2CF and everything is going well, but i noticed that my wifi connection is slow and when i did a speed test online i found that i have only 0.9 Mbps and when i did the speed test on windows i have 4Mbps so can someone tell me how can i fix this problem ? if don't find any solution for this problem i'll have to go back to windows and leave ubuntu.

$ iwconfig
eth0      no wireless extensions.

lo        no wireless extensions.

wlan0     IEEE 802.11bgn  ESSID:"SAGEM"  
      Mode:Managed  Frequency:2.437 GHz  Access Point: 4C:17:EB:3E:C4:0C   
      Bit Rate=18 Mb/s   Tx-Power=20 dBm   
      Retry  long limit:7   RTS thr=2347 B   Fragment thr:off
      Power Management:off
      Link Quality=34/70  Signal level=-76 dBm  
      Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
      Tx excessive retries:0  Invalid misc:6967   Missed beacon:0

$ lsmod | grep rtl
rtl8723ae              86459  0 
rtlwifi                79673  1 rtl8723ae
mac80211              606457  1 rtlwifi
cfg80211              510937  2 mac80211,rtlwifi


$ lspci | grep RTL
02:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8723AE PCIe Wireless Network Adapter
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 05)

$ sudo lshw -class network
  *-network               
   description: Wireless interface
   product: RTL8723AE PCIe Wireless Network Adapter
   vendor: Realtek Semiconductor Co., Ltd.
   physical id: 0
   bus info: pci@0000:02:00.0
   logical name: wlan0
   version: 00
   serial: 2c:d0:5a:3e:ee:bb
   width: 64 bits
   clock: 33MHz
   capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
   configuration: broadcast=yes driver=rtl8723ae driverversion=3.8.0-27-generic firmware=N/A ip=192.168.1.6 latency=0 link=yes multicast=yes wireless=IEEE 802.11bgn
   resources: irq:17 ioport:3000(size=256) memory:c2400000-c2403fff
 *-network
   description: Ethernet interface
   product: RTL8101E/RTL8102E PCI Express Fast Ethernet controller
   vendor: Realtek Semiconductor Co., Ltd.
   physical id: 0
   bus info: pci@0000:03:00.0
   logical name: eth0
   version: 05
   serial: 70:54:d2:d6:d0:2b
   size: 10Mbit/s
   capacity: 100Mbit/s
   width: 64 bits
   clock: 33MHz
   capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
   configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl_nic/rtl8105e-1.fw latency=0 link=no multicast=yes port=MII speed=10Mbit/s
   resources: irq:41 ioport:2000(size=256) memory:c0004000-c0004fff memory:c0000000-c0003fff

Solution 1:

You have a pretty marginal connection (quality 34/70), 6967 invalid misc packets, and your connection speed has dropped back to 18Mb/sec from the max of 54 for g networking. Try improving your signal by moving your machine relative to the access point. Another thing to check is the outside interference on your channel. Use

sudo iwlist scan

To see all the nearby access points and their channels/ strengths. If you see many others on your channel (and really only 1 6 and 11 do not overlap, so nearby ones interfere too), try changing your channel.

Solution 2:

I believe that there are conflicts with the driver, so you can try installing the Official drivers for the WLAN NIC.

This answer should help you [but, a newer version of the driver can be downladed from here Other steps remain the same.]. I'm pasting the answer below:

Realtek is making the official Linux driver available unofficially (via Dropbox)

Support for the RTL8273AE-BT has been added by Realtek in the 92-series driver, version 0006.0514.2012. For unknown reasons, neither the Windows nor Linux drivers are available on their website (yet). But Realtek tech support has been providing a Dropbox link with the source code/firmware tarball which numerous users have reported as working.

Where do I get it? Is it safe?

  • The driver can be downloaded via this Dropbox link.
  • I can confirm that this file is what it claims to be, with this content listing, provided it has the following MD5 or SHA1 hashes: (which you can verify with md5sum or sha1sum)

    MD5: fd10e9a347c6447f649324d6bdab53de
    SHA1: 1ccd6ae73878d8bf65bd7c0384e333b121606230
    

How do I build and install the driver on Ubuntu?

  1. Open a terminal with Ctrl+Alt+T.
  2. You'll need to install these packages first to build the driver:

    sudo apt-get install build-essential linux-headers-generic linux-headers-`uname -r`
    
  3. Paste the below line to download and extract the driver archive in one single step:

    wget -O- http://dl.dropbox.com/u/57056576/DRIVERS/REALTEK/rtl_92ce_92se_92de_8723ae_linux_mac80211_0006.0514.2012.tar.gz | tar -xz
    
  4. Change to the extracted driver's directory, build and install the driver:

    cd rtl_92ce_92se_92de_8723ae_linux_mac80211_0006.0514.2012
    make
    sudo make install
    
  5. Test the driver by loading it (this is a one-time step; after you reboot once, the driver should automatically load on every boot):

    sudo modprobe rtl8723e