Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Iain Douglas <wireguard@1n6.org.uk>
To: wireguard@lists.zx2c4.com
Subject: Understanding Protocol / State Machine
Date: Fri, 21 Dec 2018 18:18:35 +0000	[thread overview]
Message-ID: <478b9a56-d09e-5908-f253-a32985898072@1n6.org.uk> (raw)

Hi,

I have been investigating what happens when a peer crashes/goes away for
some reason and the configuration is reset.

My test setup is quite simple, I have 2 peers and one is acting as a
gateway for the other for the remote address 8.8.8.8.
I can ping 8.8.8.8 and traffic goes over the WireGuard link as expected.
When I want to test I delete the key on the peer and add it again. 
Wireguard is te lates version from CentOS repo 0.0.20181218-1.

I see three different things happening depending on when the last
handshake took place.

1. Handshake < 119 seconds ago the link takes ~ 15 seconds to recover
2. Handshake between 120 and 179 seconds ago - 1st packet is lost then
link recovers
3. Handshake >=180 second ago - link just works as normal.

It is (2) that I don't understand. When I look at the packets sent I see

ping out
handshake out
handshake response

No reply to the ping

However for (3) above I see

handshake out
handshake response
ping
ping reply

So for (3) I guess that the ping is queued until after the handshake
occurs.
Having watched Jason's talk at the Linux Plumbers conference I was
expecting what happens at (3) to be at (2).
Can someone enlighten me as to why the first packet at (2) is sent
before the handshake?

Cheers


Iain 




_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

             reply	other threads:[~2019-01-02 18:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-21 18:18 Iain Douglas [this message]
2019-01-02 18:20 ` Jason A. Donenfeld

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=478b9a56-d09e-5908-f253-a32985898072@1n6.org.uk \
    --to=wireguard@1n6.org.uk \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).