You are not logged in.

#1 2017-12-27 14:44:51

Kolyunya
Member
Registered: 2017-12-27
Posts: 4

[SOLVED] Low Internet connection speed

Hi! I've got two computers with Arch Linux installed.

I connect both of them (one at a time) to the Internet using the very same Ethernet cable. Both of them have similar (same model, different versions, different firmware) network adapters.

      product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
      vendor: Realtek Semiconductor Co., Ltd.
      version: 0a
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       version: 15

My ISP provides me with a symmetric 60Mbit/s channel (declared speed). I measure the internet connection speed on both machines using the very same cable and the declared speed is available only on the first machine. On the second one only ~6Mbit/s download speed is available while upload speed is actually ~60Mbit/s.

I've also noticed a very weird thing - when I reattach the cable the download speed on the problematic machine can reach ~50Mbit/s then after a couple of minutes is degrades to ~6Mbit/s.

Another weird thing is that I've tried tweaking adapter configuration "ethtool -s enp2s0 autoneg on" and I'm getting an "Operation not supported" error while autoneg is listed as a supported feature.

Any ideas how to fix this? Is this version of the adapter/driver known as buggy? Does it seem like my hardware is faulty?

Detailed configuration (1st one works fine, the 2nd one does not):

      description: Ethernet interface
      product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
      vendor: Realtek Semiconductor Co., Ltd.
      physical id: 0.2
      bus info: pci@0000:04:00.2
      logical name: enp4s0f2
      version: 0a
      serial: 08:60:6e:11:e0:43
      size: 10Mbit/s
      capacity: 1Gbit/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 1000bt 1000bt-fd autonegotiation
      configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl8411-1_0.0.3 06/18/12 latency=0 link=no multicast=yes port=MII speed=10Mbit/s
      resources: irq:30 ioport:d000(size=256) memory:f2104000-f2104fff memory:f2100000-f2103fff
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: enp2s0
       version: 15
       serial: b0:6e:bf:5e:02:ff
       size: 100Mbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=off broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl8168h-2_0.0.2 02/26/15 ip=192.168.2.239 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
       resources: irq:126 ioport:e000(size=256) memory:f7104000-f7104fff memory:f7100000-f7103fff

Last edited by Kolyunya (2017-12-27 17:25:03)

Offline

#2 2017-12-27 16:09:02

lo1
Member
Registered: 2017-09-25
Posts: 584

Re: [SOLVED] Low Internet connection speed

I've tried tweaking adapter configuration "ethtool -s enp2s0 autoneg on" and I'm getting an "Operation not supported" error while autoneg is listed as a supported feature.

Regarding ethtool, probably you'd need to run it when the interface is down (or up but not connected to a network but I'm not sure) and of course run it as superuser.

I've also noticed a very weird thing - when I reattach the cable the download speed on the problematic machine can reach ~50Mbit/s then after a couple of minutes is degrades to ~6Mbit/s.

That's because your ISP equipment takes some moments to realize your exceeding the bandwith you've been paying for.

...
logical name: enp4s0f2
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl8411-1_0.0.3 06/18/12 latency=0 link=no multicast=yes port=MII speed=10Mbit/s
...
logical name: enp2s0
configuration: autonegotiation=off broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl8168h-2_0.0.2 02/26/15 ip=192.168.2.239 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s

If the second one (which is set to 100mbits autoneg off) doesn't work while the first one grants 60 mbits download speed, just shut down the interface and try to change both the speed and the autonegotiation with:

sudo ip link set enp2s0 down
sudo ethtool -s enp2s0 speed 10 duplex half
sudo ethtool -s enp2s0 autoneg on

If it works well, next thing you should consider is set both the NICs with speed 10 duplex full, hoping it doesn't mess things up. Otherwise stick with half duplex.

Offline

#3 2017-12-27 16:17:48

Kolyunya
Member
Registered: 2017-12-27
Posts: 4

Re: [SOLVED] Low Internet connection speed

lo1, thank you for your help!

lo1 wrote:

Regarding ethtool, probably you'd need to run it when the interface is down (or up but not connected to a network but I'm not sure) and of course run it as superuser.

That's exactly how I was doing that.

lo1 wrote:

That's because your ISP equipment takes some moments to realize your exceeding the bandwith you've been paying for.

I don't get it how I'm exceeding the bandwidth when I'm paying for sixty Mbit/s, but get only six Mbit/s on one of the PCs?

lo1 wrote:

If the second one (which is set to 100mbits autoneg off) doesn't work while the first one grants 60 mbits download speed, just shut down the interface and try to change both the speed and the autonegotiation with:

It's not working for some reason...

[kolyunya@archlinux ~]$ sudo ip link set enp2s0 down
[kolyunya@archlinux ~]$ sudo ethtool -s enp2s0 speed 10 duplex half
Cannot set new settings: Operation not supported
  not setting speed
  not setting duplex
[kolyunya@archlinux ~]$ sudo ethtool -s enp2s0 autoneg on
Cannot set new settings: Operation not supported
  not setting autoneg
[kolyunya@archlinux ~]$ sudo ip link set enp2s0 up

Last edited by Kolyunya (2017-12-27 16:25:03)

Offline

#4 2017-12-27 16:33:27

lo1
Member
Registered: 2017-09-25
Posts: 584

Re: [SOLVED] Low Internet connection speed

logical name: enp2s0
capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
[kolyunya@archlinux ~]$ sudo ip link set enp2s0 down
[kolyunya@archlinux ~]$ sudo ethtool -s enp2s0 speed 10 duplex half
Cannot set new settings: Operation not supported
  not setting speed
  not setting duplex
[kolyunya@archlinux ~]$ sudo ethtool -s enp2s0 autoneg on
Cannot set new settings: Operation not supported
  not setting autoneg
[kolyunya@archlinux ~]$ sudo ip link set enp2s0 up

It doesn't really makes sense, as "10bt" and "autonegotiation" are clearly listed in the capabilities of your NIC.
Could you try with mii-tool?

sudo mii-tool -F 10baseT-HD enp2s0
sudo mii-tool -r enp2s0   #to restart autonegotiation

(using mii-tool the interface must be up)

Last edited by lo1 (2017-12-27 16:33:43)

Offline

#5 2017-12-27 16:46:16

Kolyunya
Member
Registered: 2017-12-27
Posts: 4

Re: [SOLVED] Low Internet connection speed

This doesn't make any sense to me either. Seems like a broken hardware/firmware/driver to me.

[kolyunya@archlinux ~]$ sudo mii-tool -F 10baseT-HD enp2s0
[kolyunya@archlinux ~]$ sudo mii-tool -r enp2s0   #to restart autonegotiation
restarting autonegotiation...
[kolyunya@archlinux ~]$ sudo lshw -C network  *-network                 
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: enp2s0
       version: 15
       serial: b0:6e:bf:5e:02:ff
       size: 100Mbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8168h-2_0.0.2 02/26/15 ip=192.168.2.239 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
       resources: irq:127 ioport:e000(size=256) memory:f7104000-f7104fff memory:f7100000-f7103fff

As you can see the speed parameter didn't actually change but the autneg is now enabled and the download speed is now ~60Mbit/s.

Also would you be so kind to tell me what is the right way to make this configuration permanent? I believe adding those commands to .bashrc is not the best idea.

Offline

#6 2017-12-27 16:59:22

lo1
Member
Registered: 2017-09-25
Posts: 584

Re: [SOLVED] Low Internet connection speed

Restarting the autonegotiation should have been done as a "second step" if setting the speed didn't work, that's why the speed gets restored to 100mbits, I should have mentioned that.

Regarding making changes persisent, if you use netctl create a hook (/etc/netctl/interfaces/enp2s0) and use

ExecUpPost="sudo mii-tool -r enp2s0"

Otherwise https://wiki.archlinux.org/index.php/Sy … unit_files

Offline

#7 2017-12-27 17:12:43

Kolyunya
Member
Registered: 2017-12-27
Posts: 4

Re: [SOLVED] Low Internet connection speed

lo1 wrote:

Restarting the autonegotiation should have been done as a "second step" if setting the speed didn't work, that's why the speed gets restored to 100mbits

Oh, I see. I've tried it again and the speed is set correctly now using mii-tool.

I also figured it out why the ethtool was not working as expected. I'm using a KDE plasma desktop environment with GUI network manager. I was wondering if there is an autoneg option available in it. I've checked it and it turned out that the autoneg checkbox was unchecked. Seems like ethtool and the KDE network manager can't work together. I've just enabled the checkbox in GUI, restarted the machine and it seems like it's persistent, everything works as expected.

This seems like a very weird situation to me when the console tool is not working when the GUI does. What is even more weird is that the deprecated tool (mii-tool) works better than the new one (ethtool).

Regarding making changes persisent, if you use netctl create a hook (/etc/netctl/interfaces/enp2s0) and use
ExecUpPost="sudo mii-tool -r enp2s0"

Thank you for this tip, I'm going to use it when I'll deal with a machine without a desktop environment.

Many thanks to lo1 for helping me out!

Offline

#8 2017-12-27 17:23:43

lo1
Member
Registered: 2017-09-25
Posts: 584

Re: [SOLVED] Low Internet connection speed

Mmm seems legit, probably ethtool prefers a kinder approach and doesn't override anything set from other tools.
Anyway, you're welcome smile please remember to mark this thread as [SOLVED]

Offline

Board footer

Powered by FluxBB