Slow connection android

Syncing with my phone is very slow now that I can’t rely on Local Discovery anymore. Is the only workaround available using DynDNS or static IP addresses?

I mean, it is very slow both with only NAT and only Global Discovery enabled.

Could you check which kind of connection is established in the web UI?

Syncthing is now ignoring whatever I set in the connection type on Android, so I can’t really tell what works and what doesn’t anymore, but it seems it just remembers what worked last time. The only thing I know for sure is bandwhich shows the Android device connected as my external IP address, whereas for my other Linux laptop, I see my internal IP address, as expected. I also see the netlinkrib: permission denied error for IPv4.

The logs in the laptop show:

2021-05-05 15:36:10 Detected 1 NAT service
2021-05-05 15:36:19 quic://0.0.0.0:22000 detected NAT type: Port restricted NAT
2021-05-05 15:36:19 quic://0.0.0.0:22000 resolved external address quic://186.206.77.210:61807 (via stun.syncthing.net:3478)
2021-05-05 15:37:22 Joined relay relay://187.103.248.226:22067
***I change connection settings and restart on Android***
2021-05-05 15:41:37 Established secure connection to DKUZS6X-FN2CWYJ-DLR4XUN-NWEUZ4V-DOUUYDI-BJSOU7Y-BSEUWYM-FKTSMAV at [::]:22000-186.206.77.210:62070/quic-client/TLS1.3-TLS_CHACHA20_POLY1305_SHA256
2021-05-05 15:41:37 Device DKUZS6X-FN2CWYJ-DLR4XUN-NWEUZ4V-DOUUYDI-BJSOU7Y-BSEUWYM-FKTSMAV client is "syncthing v1.15.1" named "samsung" at [::]:22000-186.206.77.210:62070/quic-client/TLS1.3-TLS_CHACHA20_POLY1305_SHA256

And in the Android device, I have:

I’ve moved this to a separate topic, as using an old thread that is about something else to debug issues is not great.

You should check why it’s not able to connect using TCP, there should be something about that in the logs.

I thought the thread was a continuation on the conversation from Android 11 local discovery not working · Issue #735 · Catfriend1/syncthing-android · GitHub - the major issue I have is with the netlinkrib: permission denied error and hence local discovery not working.

Now regarding the speed without Local Discovery, I don’t know what should it be, or what is the best workaround, because all these years I’ve used only Local Discovery. I have nothing else useful in current logs (I restarted Syncthing multiple times).

I suggest you provide the full log in that case, from both sides, as cherry-picking what you think is relevant sometimes misses what we are after.

Your laptop is still on v1.12.1. You should update and check if that helps.

Laptop: https://pastebin.com/raw/L8Zy9rmc

2021-05-05 17:16:50 My ID: UNQTERH-XUWAJP4-PYSDALN-AGWYVHI-253T4HU-Y3GUBWH-5BPJAZK-KRTB6QJ
2021-05-05 17:16:51 Single thread SHA256 performance is 515 MB/s using minio/sha256-simd (435 MB/s using crypto/sha256).
2021-05-05 17:16:51 Hashing performance is 410.88 MB/s
2021-05-05 17:16:51 Overall send rate is unlimited, receive rate is unlimited
2021-05-05 17:16:51 Relay listener (dynamic+https://relays.syncthing.net/endpoint) starting
2021-05-05 17:16:51 Using discovery mechanism: global discovery server https://discovery.syncthing.net/v2/?noannounce&id=LYXKCHX-VI3NYZR-ALCJBHF-WMZYSPK-QG6QJA3-MPFYMSO-U56GTUK-NA2MIAW
2021-05-05 17:16:51 Using discovery mechanism: global discovery server https://discovery-v4.syncthing.net/v2/?nolookup&id=LYXKCHX-VI3NYZR-ALCJBHF-WMZYSPK-QG6QJA3-MPFYMSO-U56GTUK-NA2MIAW
2021-05-05 17:16:51 Using discovery mechanism: global discovery server https://discovery-v6.syncthing.net/v2/?nolookup&id=LYXKCHX-VI3NYZR-ALCJBHF-WMZYSPK-QG6QJA3-MPFYMSO-U56GTUK-NA2MIAW
2021-05-05 17:16:51 Using discovery mechanism: IPv4 local broadcast discovery on port 21027
2021-05-05 17:16:51 Using discovery mechanism: IPv6 local multicast discovery on address [ff12::8384]:21027
2021-05-05 17:16:51 ...
2021-05-05 17:16:51 Ready to synchronize dcim-2 (sendreceive)
2021-05-05 17:16:51 QUIC listener ([::]:22000) starting
2021-05-05 17:16:51 Ready to synchronize dcim-3 (sendreceive)
2021-05-05 17:16:51 TCP listener ([::]:22000) starting
2021-05-05 17:16:51 Ready to synchronize laptops (sendreceive)
2021-05-05 17:16:51 Ready to synchronize documentos (sendonly)
2021-05-05 17:16:51 Ready to synchronize notas (sendonly)
2021-05-05 17:16:51 Ready to synchronize screenshots-moto (sendreceive)
2021-05-05 17:16:51 Ready to synchronize carteiras (sendonly)
2021-05-05 17:16:51 Ready to synchronize compartilhado (sendreceive)
2021-05-05 17:16:51 Completed initial scan of sendreceive folder dcim-3
2021-05-05 17:16:51 Completed initial scan of sendonly folder carteiras
2021-05-05 17:16:51 Ready to synchronize compartilhado-samsung (sendreceive)
2021-05-05 17:16:51 Completed initial scan of sendonly folder notas
2021-05-05 17:16:51 Ready to synchronize dcim-moto (sendreceive)
2021-05-05 17:16:51 Completed initial scan of sendreceive folder compartilhado-samsung
2021-05-05 17:16:51 Ready to synchronize dcim-samsung (sendreceive)
2021-05-05 17:16:51 Completed initial scan of sendreceive folder dcim-2
2021-05-05 17:16:51 Completed initial scan of sendreceive folder screenshots-moto
2021-05-05 17:16:51 Completed initial scan of sendreceive folder dcim-samsung
2021-05-05 17:16:51 GUI and API listening on 127.0.0.1:8384
2021-05-05 17:16:51 Access the GUI via the following URL: http://127.0.0.1:8384/
2021-05-05 17:16:51 My name is "ideapad-s540"
2021-05-05 17:16:51 Device DKUZS6X-FN2CWYJ-DLR4XUN-NWEUZ4V-DOUUYDI-BJSOU7Y-BSEUWYM-FKTSMAV is "samsung" at [dynamic]
2021-05-05 17:16:51 Device M3SB5MJ-LR55S5K-SMK3WSI-VEXNFC3-DAKGYML-5V5FUHM-QDOVRFZ-PAFJ4AT is "moto-g8" at [dynamic]
2021-05-05 17:16:51 Device PPOBQY4-WQZDZ4E-FLR6MZP-6HW6ZN2-BTX2NJE-EM7QLYY-FRIADUK-DY4RSQ5 is "asus" at [dynamic]
2021-05-05 17:16:51 Device PUBYEQQ-TFQBREM-TE353XL-GPWF3WA-HJIUDJB-GHCGILI-DKMEOSQ-AJG6ZQ4 is "lenovo-g40" at [dynamic]
2021-05-05 17:16:51 Completed initial scan of sendreceive folder laptops
2021-05-05 17:16:51 Completed initial scan of sendreceive folder dcim-moto
2021-05-05 17:16:51 Completed initial scan of sendreceive folder compartilhado
2021-05-05 17:16:52 Completed initial scan of sendonly folder documentos
2021-05-05 17:17:01 Detected 1 NAT service
2021-05-05 17:17:03 Established secure connection to PUBYEQQ-TFQBREM-TE353XL-GPWF3WA-HJIUDJB-GHCGILI-DKMEOSQ-AJG6ZQ4 at 192.168.0.200:22000-192.168.0.204:52430/tcp-server/TLS1.3-TLS_AES_128_GCM_SHA256
2021-05-05 17:17:03 Device PUBYEQQ-TFQBREM-TE353XL-GPWF3WA-HJIUDJB-GHCGILI-DKMEOSQ-AJG6ZQ4 client is "syncthing v1.3.4" named "lenovo-g40" at 192.168.0.200:22000-192.168.0.204:52430/tcp-server/TLS1.3-TLS_AES_128_GCM_SHA256
2021-05-05 17:17:11 quic://0.0.0.0:22000 detected NAT type: Port restricted NAT
2021-05-05 17:17:11 quic://0.0.0.0:22000 resolved external address quic://186.206.77.210:61807 (via stun.syncthing.net:3478)
2021-05-05 17:17:32 Established secure connection to DKUZS6X-FN2CWYJ-DLR4XUN-NWEUZ4V-DOUUYDI-BJSOU7Y-BSEUWYM-FKTSMAV at [::]:22000-186.206.77.210:62070/quic-client/TLS1.3-TLS_CHACHA20_POLY1305_SHA256
2021-05-05 17:17:32 Device DKUZS6X-FN2CWYJ-DLR4XUN-NWEUZ4V-DOUUYDI-BJSOU7Y-BSEUWYM-FKTSMAV client is "syncthing v1.15.1" named "samsung" at [::]:22000-186.206.77.210:62070/quic-client/TLS1.3-TLS_CHACHA20_POLY1305_SHA256

Android: https://pastebin.com/raw/MzjuBgQ1

17:17:20 [DKUZS] INFO: Hashing performance is 932.57 MB/s
17:17:20 [DKUZS] INFO: Overall send rate is unlimited, receive rate is unlimited
17:17:20 [DKUZS] INFO: QUIC listener ([::]:22000) starting
17:17:20 [DKUZS] INFO: TCP listener ([::]:22000) starting
17:17:20W/SyncthingNativeCode 2021/05/05 20:17:20 failed to determine receive buffer size: doesn't have a SyscallConn. See https://github.com/lucas-clemente/quic-go/wiki/UDP-Receive-Buffer-Size for details.
17:17:20 [DKUZS] INFO: Ready to synchronize "carteiras" (carteiras) (receiveonly)
17:17:20 [DKUZS] INFO: GUI and API listening on 127.0.0.1:8384
17:17:20 [DKUZS] INFO: Access the GUI via the following URL: https://127.0.0.1:8384/
17:17:20 [DKUZS] INFO: My name is "samsung"
17:17:20 [DKUZS] INFO: Device UNQTERH-XUWAJP4-PYSDALN-AGWYVHI-253T4HU-Y3GUBWH-5BPJAZK-KRTB6QJ is "ideapad" at [dynamic]
17:17:20 [DKUZS] INFO: Ready to synchronize "compartilhado" (compartilhado) (sendreceive)
17:17:20 [DKUZS] INFO: Ready to synchronize "compartilhado-samsung" (compartilhado-samsung) (sendreceive)
17:17:20 [DKUZS] INFO: Ready to synchronize "dcim-samsung" (dcim-samsung) (sendreceive)
17:17:20 [DKUZS] INFO: Completed initial scan of receiveonly folder "carteiras" (carteiras)
17:17:20 [DKUZS] INFO: Completed initial scan of sendreceive folder "compartilhado-samsung" (compartilhado-samsung)
17:17:20 [DKUZS] INFO: Ready to synchronize "documentos" (documentos) (receiveonly)
17:17:20 [DKUZS] INFO: Ready to synchronize "notas" (notas) (receiveonly)
17:17:20 [DKUZS] INFO: Completed initial scan of receiveonly folder "notas" (notas)
17:17:20 [DKUZS] INFO: Completed initial scan of sendreceive folder "dcim-samsung" (dcim-samsung)
17:17:20 [DKUZS] INFO: Completed initial scan of sendreceive folder "compartilhado" (compartilhado)
17:17:23 [DKUZS] INFO: Completed initial scan of receiveonly folder "documentos" (documentos)
17:17:23 [DKUZS] INFO: Puller (folder "documentos" (documentos), item "filename.jpg"): syncing: no connected device has the required version of this file
***removed 200+ file names***
17:17:23 [DKUZS] INFO: "documentos" (documentos): Failed to sync 287 items
17:17:23 [DKUZS] INFO: Folder "documentos" (documentos) isn't making sync progress - retrying in 1m0s.
17:17:32 [DKUZS] INFO: Established secure connection to UNQTERH-XUWAJP4-PYSDALN-AGWYVHI-253T4HU-Y3GUBWH-5BPJAZK-KRTB6QJ at [::]:22000-186.206.77.210:61807/quic-server/TLS1.3-TLS_CHACHA20_POLY1305_SHA256
17:17:32 [DKUZS] INFO: Device UNQTERH-XUWAJP4-PYSDALN-AGWYVHI-253T4HU-Y3GUBWH-5BPJAZK-KRTB6QJ client is "syncthing v1.12.1" named "ideapad-s540" at [::]:22000-186.206.77.210:61807/quic-server/TLS1.3-TLS_CHACHA20_POLY1305_SHA256

I guess upgrading the binary is not the best approach, but should be enough… My distro has no newer Syncthing, so I just replaced the current binary with v1.16.1. It doesn’t seem to have any problems, and I see “Detected upgrade from v1.12.1 to v1.16.1”. The speeds are as slow as before, though.

You can add Syncthing APT repo if you’re using a Debian based distribution.

Your main problem is that Syncthing is only able to establish a QUIC connection. Is the TCP port open on your laptops firewall?

root@laptop ~# ufw status
Status: active

To                         Action      From
--                         ------      ----
22000/tcp                  ALLOW       Anywhere                  
21027/udp                  ALLOW       Anywhere                  
22000/tcp (v6)             ALLOW       Anywhere (v6)             
21027/udp (v6)             ALLOW       Anywhere (v6)

I have enabled UPnP in the modem too, if that makes any difference.

I get why the app isn’t able to publish its own addresses because of Android 11 restrictions but i’m a bit puzzled why it’s not able to establish an outgoing TCP connection to your laptop.

The laptop should publish its LAN address which should be enough for the app to connect.

Does this screenshot help? This time with pairing failed (Local Discovery only set):

Is the tcp ip address hard coded?

Because if it is, it’s incorrect, as per error message.

No, I don’t use static IP addresses.

Can you provide the ip addresses (and subnet masks) of both devices?

Based on what I see the addresses it finds are not routable, which means they are on different subnets/networks or there is some firewall involved.

  • Laptop: IP 192.168.0.200, mask 255.255.255.0
  • Android: IP 192.168.0.203, mask 255.255.255.0

My other Android 10 device can communicate with the laptop just fine using the internal IP address.

Right, I think the routing is somehow broken on the phone, as it could not route to that ip somehow before.

You could try to configure a static tcp address for the other device to avoid it having to go via quic etc.

Shouldn’t specifying static internal IP addresses work? I thought the mentioned bug was for local discovery only, but I get “no route to host” with static addresses too… Just to make sure I wasn’t doing it wrong, I tested and it works fine on Android 10.

I can get reliable TCP connections on Android 11 by using the external IP and forwarding the ports in my router, but I can’t rely on being able to mess with whatever router I am connected to (I use Syncthing mostly when I’m out).