Edit: after getting the hint to try creating a new SSID on my WiFi router, I now resolved the problem by just connecting to the same router but with a separate SSID. I still have no idea what the problem was, and the solution now is also completely unrelated to Android. I guess I'll never know what the problem was, but there's no reason anymore for others to try and diagnose the issue.
I know that remotely diagnosing WiFi issues can be very difficult, but I'm running out of ideas (and time) what I could try to identify the cause of the issue I'm having. Therefore, I'm trying to give as much detail as possible and the main advice I'm asking for is what I can do to diagnose the issue.
Since approximately last weekend (I didn't notice right away), I have a very annoying WiFi connection issue on Pixel 3a, Android 11. Android tells me that I have no internet connection through the WiFi network, but in Google Chrome (or Firefox), any pages not related to Google load just fine. google.com for example, and abc.xyz do not load. ourworldindata.org, android.stackexchange.com and superuser.com do also not load (details below, this is because they load stuff from fonts.googleapis.com or similar URLs). duckduckgo.com loads.
This issue is extremely annoying since apps by Google are also not working, so I don't get new e-mails, the calendar does not synchronize and I cannot use Google Play, for example. I do only have very limited mobile data available which I use when I do not have access to WiFi, so I don't want to simply switch to using mobile data (which works fine). I tried restarting the phone in safe mode (it first seemed to work, but the issue now also persists in safe mode) and uninstalling different apps from my phone, but while the issue disappeared sometimes for a few minutes, it came back every time.
I restarted the phone a lot of times, I deleted the WiFi network and reconnected, I tried setting the network rating provider to none and in general turning different WiFi settings off and on, and I slowly run out of ideas. WiFi works fine on my laptop connected to the same network. Resetting the router seemed to help first, but again the issue reappeared after a few minutes (just like after some of the restarts: sometimes it works for a few minutes but mostly it says no connection right after the device powered up). Connecting through a hotspot created using my laptop which uses the same WiFi network works. Unfortunately, this is not a long-term solution. Also, the router is not easily accessible for me, so it's difficult to debug router issues if this is a router issue. But the issue concerns only my phone (not the printer, not the laptop, nor devices of other users of the same network; it's not a public WiFi network if anyone was wondering). Any ideas what else I could try?
I'm not 100% sure that this is an issue with the Android phone alone, but since the WiFi network works with all other devices and since only Google-related URLs seem to be affected, I think it is highly likely that the root issue is indeed caused by Android.
Below you can find an extended log of attempts to get to the root of the problem:
I did now get access to the router (a FritzBox) and captured network traffic. I had a look at it in Wireshark: to me, it looks like my phone goes silent / doesn't get or process the TCP syn ack after the initial TCP syn when running a request for google.com. Not sure why...
Head requests to duckduckgo.com and google.com using curl on my phone during a short period when everything was working (white bars = my phone's IP address):
Head requests to duckduckgo.com and google.com using curl on my phone while the issue was present (duckduckgo.com works, google.com doesn't):
Using PCAPdroid (Google Play Link, I don't want to root my device) seems to suggest that the TCP syn ack never reaches the app / phone...
Here are some screenshots made using chrome://inspect from trying to load different pages:
(issue here is jquery.min.js from ajax.googleapis.com)
Some screenshots of how it looks on the phone (in German):
Loading duckduckgo.com, trying to load google.com (see address bar), and the same issue in safe mode:
***>adb shell ping google.com PING google.com (184.108.40.206) 56(84) bytes of data. 64 bytes from muc11s03-in-f14.1e100.net (220.127.116.11): icmp_seq=1 ttl=118 time=49.8 ms 64 bytes from muc11s03-in-f14.1e100.net (18.104.22.168): icmp_seq=2 ttl=118 time=761 ms 64 bytes from muc11s03-in-f14.1e100.net (22.214.171.124): icmp_seq=3 ttl=118 time=473 ms 64 bytes from muc11s03-in-f14.1e100.net (126.96.36.199): icmp_seq=4 ttl=118 time=627 ms ^C ***>adb shell ping superuser.com PING superuser.com (188.8.131.52) 56(84) bytes of data. 64 bytes from 184.108.40.206: icmp_seq=1 ttl=59 time=2003 ms 64 bytes from 220.127.116.11: icmp_seq=2 ttl=59 time=1000 ms 64 bytes from 18.104.22.168: icmp_seq=3 ttl=59 time=499 ms 64 bytes from 22.214.171.124: icmp_seq=4 ttl=59 time=981 ms 64 bytes from 126.96.36.199: icmp_seq=5 ttl=59 time=273 ms 64 bytes from 188.8.131.52: icmp_seq=6 ttl=59 time=1544 ms ^C
for comparison, this is how it looks if I ping directly from my laptop:
***>ping -4 google.com Ping wird ausgeführt für google.com [184.108.40.206] mit 32 Bytes Daten: Antwort von 220.127.116.11: Bytes=32 Zeit=6ms TTL=118 Antwort von 18.104.22.168: Bytes=32 Zeit=7ms TTL=118 Antwort von 22.214.171.124: Bytes=32 Zeit=7ms TTL=118 Antwort von 126.96.36.199: Bytes=32 Zeit=7ms TTL=118 Ping-Statistik für 188.8.131.52: Pakete: Gesendet = 4, Empfangen = 4, Verloren = 0 (0% Verlust), Ca. Zeitangaben in Millisek.: Minimum = 6ms, Maximum = 7ms, Mittelwert = 6ms
Output of curl using Termux:
If I do a ping using Termux terminal, I get the same result as for
adb shell ping
PS: since you can see the Avast icon on the last two screenshots: I had it uninstalled for quite some time without any improvement.
On Termux, directly connected to the WiFi network:
traceroute -b www.google.com 1: fritz.box ([IPv6 address]) 2.692ms 1: fritz.box ([IPv6 address]) 3.035ms 2: [IPv6 address] ([IPv6 address]) 8.353ms 3: no reply 4: no reply ...
Same on my laptop:
***>tracert www.google.com Routenverfolgung zu www.google.com [2a00:1450:4016:803::2004] über maximal 30 Hops: 1 2 ms 3 ms 1 ms fritz.box [same IPv6 address as for Termux hop 1] 2 8 ms 10 ms 6 ms [same IPv6 address as for Termux hop 2] 3 * * * Zeitüberschreitung der Anforderung. [<- timeout] 4 7 ms 6 ms 8 ms [IPv6 address] 5 6 ms 7 ms 8 ms [IPv6 address] 6 6 ms 6 ms 8 ms [IPv6 address] 7 6 ms 7 ms 6 ms [IPv6 address] 8 143 ms * * [IPv6 address] 9 6 ms 6 ms 8 ms [IPv6 address] 10 6 ms 6 ms 5 ms muc12s04-in-x04.1e100.net [2a00:1450:4016:803::2004] Ablaufverfolgung beendet.
On Termux, connected to the WiFi network via mobile hotspot on my laptop:
traceroute -b www.google.com 1: [...] ([IPv4 address]) 75.818ms 1: [...] ([IPv4 address]) 2.957ms 2: no reply 3: fritz.box ([IPv4 address]) 142.428ms asymm 2 4: [IPv4 address] ([IPv4 address]) 1018.851ms asymm 3 4: [IPv4 address] ([IPv4 address]) 134.135ms asymm 3 5: [ISP server address] ([IPv4 address]) 103.956ms asymm 8 6: [IPv4 address] ([IPv4 address]) 182.587ms asymm 9 7: no reply 8: no reply ...
Same on my laptop:
***>tracert -4 www.google.com Routenverfolgung zu www.google.com [184.108.40.206] über maximal 30 Hops: 1 3 ms 3 ms 1 ms fritz.box [same IPv4 address as for Termux hop 3] 2 52 ms 6 ms 6 ms [same IPv4 address as for Termux hop 4] 3 7 ms 55 ms 6 ms [ISP server address] [same IPv4 address as for Termux hop 5] 4 32 ms 6 ms 6 ms [same IPv4 address as for Termux hop 6] 5 9 ms 54 ms 7 ms [IPv4 address] 6 8 ms 47 ms 7 ms [IPv4 address] 7 7 ms 6 ms 50 ms muc11s03-in-f4.1e100.net [220.127.116.11] Ablaufverfolgung beendet.