Development discussion of WireGuard
 help / color / mirror / Atom feed
* Connection hangs over CGNAT (Starlink)
@ 2022-12-16  2:12 Nikolay Martynov
  2022-12-17 22:15 ` Szymon Nowak
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Nikolay Martynov @ 2022-12-16  2:12 UTC (permalink / raw)
  To: wireguard

Hi!

I'm experiencing strange behaviour with wireguard: from time to time
connection 'freezes'.
Most often I'm observing this on an Android phone when connected from
my home over Starlink.
Server: latest Openwrt, Client: latest Android app.
The connection establishes and works fine for some time. After some
time the client still shows connection is established, but no incoming
data is coming.
On a server side 'latest handshake' goes into hours/days.
The freeze happens randomly, for no apparent reason and I think only
over starlink. I do not think I have ever observed this problem on
cell networks.

Reconnection solves the problem immediately.
I did some tcpdumping when the problem was present and found the following:
* Server side sees incoming traffic from the client and sends responses.
* On my own router connected to Starlink (i.e. interface between my
router and Starlink router) I see data going from the client to the
server - but no packets coming back.

So my 'hypothesis' is that somehow Starlink's CGNAT 'forgets' one side
of the connection - and so data continues to go in one direction, but
it doesn't come back. The thing with the wireguard is that it looks
like it doesn't change the outgoing port when it attempts to do
another handshake. This means that it continues using the same 'half
broken' connection forever.

I think the same happens to me at least once on a Linux client - but
the difference with the phone is that the phone is always on and
therefore the duration of the connection is much longer.

I tried experimenting with keepalive messages - but it looks like they
make no difference. Once connection freezes I see keepalived arriving
onto the server, server sending reply - but that reply never arrives
to the client.

It looks like the solution to this problem would be for the client to
use a different outgoing port when sending a handshake but I was not
able to find an option for that.

Is this something that is possible to do?
Thanks!


-- 
Martynov Nikolay.
Email: mar.kolya@gmail.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-01-12  0:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-16  2:12 Connection hangs over CGNAT (Starlink) Nikolay Martynov
2022-12-17 22:15 ` Szymon Nowak
2023-01-10  9:44   ` reox
2022-12-18 13:24 ` Lonnie Abelbeck
2022-12-19  3:41 ` Dean Davis
2022-12-31  1:08   ` Nikolay Martynov
2023-01-10 10:55     ` Nikolay Kichukov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).