Score:0

Intermittently unable to connect to certain hosts when browsing the internet in Ubuntu 22.04

ch flag

I recently upgraded from Ubuntu 18.04 to 22.04, and I've since been experiencing a strange issue with my internet connection, specifically when browsing the net.

Short description:

When browsing a certain host, the browser will randomly (and repeatedly) be unable to connect to it for a short period of time, until the ability is regained.

Detailed example:

To better describe it I'll illustrate with a common example: I might be browsing YouTube correctly and without issue, when eventually, I clink on a video and the browser fails to load the page altogether. Instead of showing an error page of any kind, it just remains loading for quite some time (e.g. a minute or more), until eventually something expires and the tab remains completely blank.

During this time, any attempt to load a page from the same server (e.g., another YouTube video, in this case) will also fail. Eventually (sometimes, in fact, right after the loading stops and fails), retrying will load the page properly and fast; although sometimes the process requires several retries.

As I mentioned, YouTube is only an example. This phenomenon seems to be able to happen on any server I might be browsing, specially after some time.

Clarifications:

Here are a few important notes to rule out potential problems:

  1. The internet connection itself does not seem to be the problem. Indeed, while the browser is in this state, unable to connect to the problematic host (e.g. YouTube), any other request to a different server will work just fine, any other page will load correctly, and browsing will work normally (unless, of course, the issue coincidentally happens for another server simultaneously as well).

  2. It does not seem to be specific to any browser. The problem is reproduced in both Firefox and Chrome, which are the two browser I use regularly.

  3. That being said, whenever the issue happens, switching browser will typically fix it. That is, if say Firefox is failing to load YouTube for a few minutes, opening Chrome and attempting to load the same page there will often be successful, and viceversa, even while the other browser remains unable to do so. This also rules out the possibility that it's the server itself going down.

  4. Likewise, restarting the same browsing will usually fix it as well. If Firefox is failing to talk to YouTube, a restart often corrects this problem, which will nevertheless replicate later.

Conclusion:

It seems as though perhaps there's some misconfiguration with the way webpages, or DNS's, are being cached. It also seems to be specific to each process, since restarting the browser or opening another one fixes it. As I said, it happens randomly yet systematically.

Any ideas?

Edit 1):

Output of lspci -knn | grep Eth -A3 is:

25:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 15)
    Subsystem: Micro-Star International Co., Ltd. [MSI] RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [1462:7a38]
    Kernel driver in use: r8169
    Kernel modules: r8169
29:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] [1002:67df] (rev ef)

On the other hand, pinging the router did not reveal any problems, although the issue is not taking place right now; I'll repeat the test when it's happening:

--- 192.168.1.1 ping statistics ---
101 packets transmitted, 101 received, 0% packet loss, time 102314ms
rtt min/avg/max/mdev = 0.239/0.397/3.271/0.335 ms
Pilot6 avatar
cn flag
Please [edit] your question and add output of `lspci -knn | grep Eth -A3` terminal command.
Pilot6 avatar
cn flag
And also ping you router or whatever gateway you are connected to. Is there packet loss?
Pilot6 avatar
cn flag
No packet loss, but try to install `r8168-dkms`. I have the same rev 15 of this NIC and it works OK with `r8169`. But it's worth trying. When there is a problem with the driver, you have intermittent packet loss. But it also can be a problem with the router or the ISP too.
F.Webber avatar
ch flag
Installed and rebooted the machine. Since the issue arises sporadically, I'll report back when/if it happens again (I'll try another ping then as well). Thanks for your help.
Pilot6 avatar
cn flag
Check which driver performs better and leave it.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.