4

Description of problem:

Ethernet connection gets disconnected at random apparently without any reason. I have tried the following command to restart my ethernet connection,

sudo service network-manager restart

though it never solved the issue. Every time I have to restart my system to get the connection back.

Details of my Ethernet card:

$ lspci -nnk | grep -iA2 net
06:00.0 Network controller [0280]: Qualcomm Atheros AR9285 Wireless Network Adapter (PCI-Express) [168c:002b] (rev 01)
        Subsystem: Lenovo Device [17aa:30a1]
        Kernel driver in use: ath9k<br>
07:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller [10ec:8136] (rev 02)
        Subsystem: Lenovo Device [17aa:392e]
        Kernel driver in use: r8169

My system: Ubuntu 14.04 LTS 64bit on Lenovo ideapad z560.

OBSERVATION: It happens more frequently when I make calls in skype or hangout. It seems that heavy usage of Ethernet is causing the disconnection.

Debug steps tried so far:

I found a post Wired Network is not stable in ubuntu 13.04 (64-bit) have something similar problem description as mine but not exactly. Following the solution given in that post, I installed and tried to use an older kernel linux-image-3.5.0-27-generic. But the same problem persisted there.

At the same time I am not sure if it is a hardware related issue as this never happened with Windows 7 which I was using before. I did a lot of googling but could not find a solution except a few about older versions and bug report.

As a hint to look into dmesg [ thanks to @noleti ], I found the following:

$ dmesg -T | grep eth0
[Sat May  2 19:52:37 2015] r8169 0000:07:00.0: eth0: RTL8102e at 0xffffc90000348000, 88:ae:1d:3a:ec:ff, XID 04e00000 IRQ 41
[Sat May  2 19:52:45 2015] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[Sat May  2 19:52:51 2015] r8169 0000:07:00.0: eth0: link down
[Sat May  2 19:52:51 2015] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[Sat May  2 19:52:51 2015] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[Sat May  2 19:52:56 2015] r8169 0000:07:00.0: eth0: link up
[Sat May  2 19:52:56 2015] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[Sat May  2 20:09:01 2015] NETDEV WATCHDOG: eth0 (r8169): transmit queue 0 timed out
[Sat May  2 20:09:01 2015] r8169 0000:07:00.0: eth0: link up
[Sat May  2 20:09:13 2015] r8169 0000:07:00.0: eth0: link up
[Sat May  2 20:09:19 2015] r8169 0000:07:00.0: eth0: link up
[Sat May  2 20:09:31 2015] r8169 0000:07:00.0: eth0: link up
[Sat May  2 20:10:13 2015] r8169 0000:07:00.0: eth0: link up
[Sat May  2 20:10:55 2015] r8169 0000:07:00.0: eth0: link up
[Sat May  2 20:12:07 2015] r8169 0000:07:00.0: eth0: link up
[Sat May  2 20:13:49 2015] r8169 0000:07:00.0: eth0: link up

After the event as shown in dmesg output my connection is lost.

NETDEV WATCHDOG: eth0 (r8169): transmit queue 0 timed out
Sooraj S
  • 1,101
  • it's unclear to me if you're using ethernet or wifi – MrVaykadji May 01 '15 at 10:57
  • @MrVaykadji ethernet using LAN cable – Sooraj S May 01 '15 at 10:58
  • @MrVaykadji I tried the kernel given here: http://askubuntu.com/questions/287779/wired-network-is-not-stable-in-ubuntu-13-04-64-bit.....But did not solve the problem. Its unstable as before. – Sooraj S May 01 '15 at 11:01
  • Have you tried re-installing the drivers? – Ron May 01 '15 at 11:35
  • @Ron I reinstalled ubuntu once......but nothing changed – Sooraj S May 01 '15 at 12:01
  • I have the same ethernet controller; except it's rev 05. It's working fine. You need to find out if it's a hardware problem, driver problem or higher tcp/ip stack problem. You can first try some other OS like freebsd to test the hardware. – solsTiCe May 01 '15 at 12:38
  • @solsTiCe i was using windows few months before ..... but this never happened. – Sooraj S May 01 '15 at 13:57
  • After such a disconnect, will dmesg yield any related error? Do you have LEDs indicating physical connection, and what do they say after a disconnect? – noleti May 01 '15 at 15:19
  • @sssss Well if you don't want make some test.... You could try the realtek driver – solsTiCe May 01 '15 at 16:36
  • @noleti it gives lot of things. how do i know there is an error? – Sooraj S May 02 '15 at 10:21
  • @solsTiCe I have no idea what higher tcp/ip stack problem is. I will try the realtek driver soon. – Sooraj S May 02 '15 at 15:37
  • @solsTiCe @noleti :Since all efforts failed. I have removed Ubuntu 14.04 LTS and installed Ubuntu 12.04.
    Kernel version:3.2.0-83-generic Internet connection is very stable. It never got disconnected after I switched to 12.04. But it is still not a solution to the problem.
    – Sooraj S May 14 '15 at 17:35

3 Answers3

2

First of all, I tried to replace r8169 with r8168 which happens to be a bug for many users having Realtek Ethernet Controller, but never solved the problem, even now almost an year after posting this. I face the same problem even with the latest kernel update 4.2.0-30-generic.

Solution:

Replace the current kernel with a stable older kernel version, in my case I installed kernel version 3.2.0-83-generic manually in 14.04 LTS. Now the Ethernet connection is stable and the problem is solved.

Download the following .deb packages from 1, 2, 3, 4 and install it:

sudo dpkg -i linux-headers-3.2.0-83_3.2.0-83.120_all.deb
sudo dpkg -i linux-headers-3.2.0-83-generic_3.2.0-83.120_i386.deb
sudo dpkg -i linux-image-3.2.0-83-generic_3.2.0-83.120_i386.deb

You can change the boot order by editing GRUB_DEFAULT=0 in /etc/default/grub as given here. Then

sudo update-grub
sudo reboot

I think you can try to install other latest v3.2 kernels which too may be stable, Ex: 3.2.0-98-generic

Note: I have tested it for both 32bit and 64bit Ubuntu 14.04 LTS

Sooraj S
  • 1,101
  • Thanks for documenting your journey through all of this. I have a Cenovo Mini PC 2 which contains a Realtek r8152 ethernet adapter and had very very similar problems to yours when running Ubuntu 16.04—dropping the network connection when high load occurred. I tried everything under the sun until I read your issue here and tried installing Ubuntu 12.04 (with kernel 3.13). It's worked perfectly ever since. As you say though... hardly a solution. – jeff-h Aug 29 '16 at 06:45
  • @jeff-h you said 3.13 works fine with 12.04. try installing 14.04 or 16.04 and manually replace the kernel with 3.13. – Sooraj S Aug 30 '16 at 09:53
  • Thanks for your followup. Unfortunately I'm not deep enough into Ubuntu to know how or why to do that, although it sounds interesting. Luckily all I need to do is run Docker, nothing else. I realise there are numerous lighter distros for that but I had no luck with any of them on this Cherry Trail PC (but that's a side issue.) – jeff-h Aug 31 '16 at 00:36
0

May be you could try to limit the speed of the ethernet adapter ? Try:

sudo ethtool -s eth0 speed 100 duplex half

Or if this does not help, try https://unix.stackexchange.com/questions/37727/solving-ethernet-watchdog-timer-deadlocks

solsTiCe
  • 9,231
0

as from dmesg -T | grep eth0 output, you are using r8169 driver which has been unstable for few network cards try manually downgrading driver to r8168

hope this helps

Waqas
  • 789
  • 3
  • 11
  • 19