High latency wired connection

Hello,

My mother’s laptop, which was previously running Trisquel, with ethernet cable connected to router, had excellent up and down speed and low latency.

The other day I installed PureOS on it and now the ethernet connection has over 8,000 ms latency. Nothing else has changed. Same ethernet cable. Same laptop. Same location. No new rf devices nearby, nothing.

I disconnected the wired connection and connected using wifi. Excellent internet, low latency. Switch back to ethernet, it’s terrible.

I could, obviously, just set the computer to use wifi, but there are many devices in the house already using wifi and since this laptop is next to the router, I’d prefer it to use ethernet, especially since the laptop never moves.

I have no idea what could be causing this. Any help would be much appreciated.

Thank you!

Seth

PureOS works best on Purism hardware. On randomly chosen hardware, there may or may not be issues e.g. hardware that requires blackbox software in order to work at all or in order to work well.

What make and model of laptop is this?

Since this problem seems to be specific to the ethernet, can you provide more detailed information regarding the ethernet hardware?

How are you measuring the latency? If this is ping then I am surprised that you can get such a high latency because normally it would timeout. 8 seconds latency is terrible.

What are you measuring the latency to? Router? First hop on ISP network? Random host on the internet?

It’s always a good idea to confirm what the ethernet negotiated to i.e. half duplex or full duplex, 1000 Mbit/s or 100 Mbit/s or 10 Mbit/s, flow control.

dmesg | grep interfacename

or look at the lights on the router/switch if appropriate.

I would check ifconfig output, preferably comparing the laptop running the original OS with the laptop running PureOS.

I suppose it would be appropriate to confirm that the original OS is running only IPv4 and that PureOS is likewise - or if it is IPv4/IPv6 dual stack, that there isn’t anything funny going on there.

You would want to confirm that there isn’t something else running that is thrashing the network.

If you make no progress then a workaround may be to use a USB-to-ethernet dongle e.g. Terrible WiFi performance with Librem13, Librem15

Thanks for the reply.

The laptop is a Think Penguin, which is a company that sells hardware specifically tailored not to need any proprietary software, at least at the OS level. PureOS functions flawlessly on another laptop of mine that is a Think Penguin.

I measured the latency on speedof.me which failed to even start the speed test the first time, but produced the 8s latency the second time.

I don’t know what it means for the ethernet to be “negotiated to” anything. I don’t know what half duplex, full duplex, etc. are. But when I go to Network in PureOS, the wired connection does say 1000 Mbits/s IIRC.

The laptop is no longer running the "original OS (i.e. Trisquel). It’s only running PureOS, so I cannot compare the two.

Thanks for the help!

Yes, better than average chance of a good user experience with Linux.

In that case, are you actually experiencing any network performance problems? Honestly, if the answer is “no” then I would a) ignore that speed test site and b) ignore almost all of my previous post.

I tested my own connection with that speed test site. That speed test gave a latency that is 10x what I think my real latency is. The second test gave a latency that is 3x what I think my real latency is. Leaves me questioning the validity of the test. (The upload and download speeds were reasonably in the ballpark.)

This could reflect problems in the web browser - rather than problems with the network - or it could be problems with the speed test itself. It is vaguely possible that this web site has been a victim of the Spectre (Intel CPU bug) mitigation in the browser.

In any case, you should note which browser and version you are using and you should try different browsers for the speed test. (I understand that you may not be able to report what browser and version you were using with Trisquel.)

Over the decades the ethernet standard has improved in many ways. The way in which newer devices successfully communicate with older devices is that, when you plug in ethernet, the two ends tell each other what they are capable of and then agree to communicate using the best available options that both ends are capable of.

No network problems. Just when web browsing, web pages take forever to load anything at all, and then it all loads very quickly once it does. So, it’s not a slow load of text and images, but instead a very long pause of nothingness, then a quick load of everything.

Using Firefox-esr 68.7

Old OS was Abrowser (Firefox) 64

Just a guess: an issue with resolving names to IPs?

You could try to get an IP using the commandline:

someuser@pureos:~$ time host www.sample.org
www.sample.org has address 64.99.80.121

real	0m0,020s
user	0m0,008s
sys	0m0,000s

If this lags somehow for requesting hosts that shouldn’t be cached already it could point in the right direction to find the solution.

2 Likes

Or specifically an issue with IPv6?

That didn’t get answered above (is it dual stack with working IPv6 end-to-end?) but if IPv6 is either basically not available or not desired then in Firefox the magic config item is

network.dns.disableIPv6

or I dare say IPv6 can be disabled completely in the Network settings. (I prefer not to do this.)

The best solution would depend on knowing whether your router does IPv6, whether your ISP does IPv6, whether you need IPv6 on the local network, and what your DNS setup is.

1 Like

Okay, just ran this test on my personal laptop using the same wifi as my mother’s laptop.

I got results similar to your on my laptop, which is running wifi, so maybe not a fair comparison.

But running my mother’s laptop through the ethernet got much worse results.

I tried a couple of different sites that I know were not cached on my mother’s computer.

She got roughly 6 + seconds for the real. 0.017s for user. And 0.009s for sys.

Hope that helps. Not sure what to do at this point.

Thanks!

Kieran,

Thanks for the help. I’m afraid I do not know how to answer any of your questions. Is there some terminal command I can run or somewhere in the settings I can look? Or something I can look for on the router?

If I do not misinterpret what you describe (a cut’n’paste quotation as preformated text as demonstrated above would always be helpful :wink: ) you’re moms computer needs a lot of time to resolve a fqdn (fully qualified domain name) to an IP address.

This step is always needed if you reference some host by its fqdn instead of its IP address. You could try to open a webpage using the hosts IP address to double check, but this often does not work using a browser: the webserver on the other side of the connection expects a hostname being transmitted inside the request header.

Take e.g. the page http://wiki.puri.sm/ . The host resolves (at the time of writing) to 138.201.228.42, but you get a different content if you try http://138.201.228.42/ .

For your test the nginx testpage should be sufficient. If you call http://138.201.228.42/ from the browser on your moms it should show without any delay.

You can check on your resolvers configuration by looking at the configuration:

someuser@pureos:~$ cat /etc/nsswitch.conf 
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         files
group:          files
shadow:         files
gshadow:        files

hosts:          files mdns4_minimal [NOTFOUND=return] dns myhostname
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

The file contains information for the system how to resolve requests for human readable names. The line you’re looking for is the one starting hosts:. Mine should be the default after installation and as you can see there are some sources to try to resolve a host to an IP.

files is described in man nsswitch.conf as using /etc/hosts - a static ascii file. If not found there, the lookup via multicast dns is tried (mdns4_minimal).

The [NOTFOUND=return] is a bit tricky - I hope I got it right: It translates to "if the result of the two preceding services (files and mdns4_minimal) is “not found” (as in “I answered, but the name you’re asking for is unknown to me”) then return this result.

Otherwise if multicast dns could not answer the request go on asking dns. Sadly I didn’t find any documentation on how libnss_dns.so is supposed to work, so I’ll speculate. Any reference to fill the gab is welcome.

Simply put asking dns means to ask whatever server(s) are provided in /etc/resolv.conf. You can look at that file:

someuser@pureos:~$ cat /etc/resolv.conf
# Generated by resolvconf
search my.local.domain
nameserver 127.0.0.1

Probably your file will look different and will not contain 127.0.0.1, because the default installation usually does not contain a local nameserver.

To get closer to the root of your problem it would be nice to have a look at your nsswitch.conf and resolv.conf. If you’re willing to follow this path put them here (“follow the white rabbit” :wink: ).

2 Likes

That’s progress then.

Please post output from ifconfig for the ethernet interface. The name of the ethernet interface will presumably start with ‘e’ (whereas the name of the wireless interface will presumably start with ‘w’, and you can ignore the loopback interface, ‘lo’).

1 Like

Maybe. Maybe not. Mine contains 127.0.0.53 because that’s the way systemd-resolved sets it up i.e. the logic of managing all the different name server possibilities, with interfaces bouncing up and down like yoyos, makes it easiest in fact to run a local nameserver, and that nameserver manages the upstream DNS servers to try - rather than hack interface up/down scripts try to edit /etc/resolv.conf or something similar.

Add for clarity: But that’s Ubuntu, not PureOS, so YMMV.

Anyway, we definitely need to see the contents of /etc/resolv.conf

Interesting. Are you sure that is the default in your PureOS and are you on Amber or Byzanthin?

I’m using PureOS Amber and I thought I’d remember that I had to change it to run a local dnsmasq:

someuser@pureos:~$ cat /etc/NetworkManager/conf.d/dns.conf 
[main]
dns=dnsmasq

I’m using dnsmasq, because this way the different network connections can setup nameservers for different subdomains - e.g. local network connection with a nameserver for all, but a vpn connection with another nameserver for a bunch of certain domains like e.g. company.private.

1 Like

kieran said he was on ubuntu not PureOS

Yes, but I edited that in afterwards in order to avoid confusion (and thereby caused more) :slight_smile: .