From: Axel Neumann <neumann@cgws.de>
To: wireguard@lists.zx2c4.com
Subject: Re: WG: Need for HW-clock independent timestamps
Date: Mon, 21 May 2018 14:31:32 +0200 [thread overview]
Message-ID: <53200162-b2fa-8f32-c52a-aae5a15b1605@cgws.de> (raw)
In-Reply-To: <97874cad-ac60-5a88-a384-f036f9688668@cgws.de>
On 21.05.2018 13:52, Axel Neumann wrote:
> On 21.05.2018 13:22, Reto Brunner wrote:
>> On Mon, May 21, 2018 at 12:07:38PM +0200, Axel Neumann wrote:
>>> entirely superfluous. As discussed earlier [3] it can be achieved with
>>> essentially one file-system write operation each boot.
>>
>> You might as well achieve the same with the timestamp.
>> Just add a pre-shutdown hook, which touches a file.
>
> yes, can be an option, but would only work in "normal" soft-shut-down
> cases, not in case of a hard reset or power cycle. A not-so-uncommon
> scenario for embedded home-network devices and community-network
> deployments. Especially when considering the first choice of a normal
> user (desperately trying to fix its internet-via-WG tunnel connection):
> Power cycle the device.
>
> /axel
>
>> Restore the system clock to this upon boot (which may very well be off
>> but who cares).
>>
>> After the wg tunnel is back up, sync with any NTP server you trust and you
>> are back up and running.
>>
>> What is the advantage of doing it with a counter?
>> I fail to see the benefit.
Sorry, forgot to reply here: The advantage is that
you could save a counter value in advance that is to-be-used after the
NEXT reboot. It can be saved during boot or before WG starts (not during
shut-down), so you are safe against unexpected hard resets.
The (WG) boot procedure would be:
1) Read saved_counter from disk (take zero first time) and memorize it
as current_counter.
2) Write saved_counter + NextBootOffset to disk.
3) Use and incremented current_counter by +1 with each new WG handshake.
Considering NextBootOffset = (2^16 * 10^9):
With 1 WG handshake per ms the NextBootOffset would be exhausted every
~1800 years.
With 1 system reboot every ms the total 96bits counter range would
overlap in ~9000 years.
/axel
>> _______________________________________________
>> WireGuard mailing list
>> WireGuard@lists.zx2c4.com
>> https://lists.zx2c4.com/mailman/listinfo/wireguard
>>
>
> _______________________________________________
> WireGuard mailing list
> WireGuard@lists.zx2c4.com
> https://lists.zx2c4.com/mailman/listinfo/wireguard
>
next prev parent reply other threads:[~2018-05-21 12:30 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-11 22:07 Axel Neumann
2018-05-11 22:45 ` Kalin KOZHUHAROV
2018-05-12 0:05 ` Glen Bojsza
2018-05-12 19:29 ` Axel Neumann
2018-05-12 19:41 ` Aaron Jones
2018-05-15 20:21 ` Devan Carpenter
2018-05-15 20:49 ` Kalin KOZHUHAROV
2018-05-16 7:10 ` Matthias Urlichs
2018-05-16 19:32 ` Axel Neumann
2018-05-16 20:32 ` Steve Gilberd
2018-05-17 3:40 ` Paul
2018-05-17 5:03 ` Roman Mamedov
2018-05-17 5:53 ` Matthias Urlichs
2018-05-17 7:07 ` Axel Neumann
2018-05-17 8:28 ` Matthias Urlichs
2018-05-16 20:35 ` Kalin KOZHUHAROV
2018-05-12 22:10 ` Toke Høiland-Jørgensen
2018-05-12 23:05 ` Reuben Martin
2018-05-13 6:11 ` Matthias Urlichs
2018-05-13 12:37 ` Toke Høiland-Jørgensen
2018-05-16 7:01 ` Axel Neumann
2018-05-16 9:38 ` Toke Høiland-Jørgensen
2018-05-16 11:08 ` Matthias Urlichs
2018-05-16 11:12 ` Axel Neumann
2018-05-13 14:21 ` Wang Jian
2018-05-21 10:07 ` WG: " Axel Neumann
2018-05-21 11:22 ` Reto Brunner
2018-05-21 11:52 ` Axel Neumann
2018-05-21 12:31 ` Axel Neumann [this message]
2018-05-21 12:35 ` Reto Brunner
2018-05-21 13:53 ` Matthias Urlichs
2018-05-21 14:56 ` Bruno Wolff III
2018-05-21 15:34 ` Matthias Urlichs
2018-05-22 20:25 ` Ivan Labáth
2018-05-23 2:51 ` Matthias Urlichs
2019-02-04 14:56 ` Jason A. Donenfeld
2019-02-23 4:00 ` Axel Neumann
2019-02-23 12:35 ` Ivan Labáth
[not found] <1522499692.6109802.1526903933505.ref@mail.yahoo.com>
2018-05-21 11:58 ` reiner otto
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=53200162-b2fa-8f32-c52a-aae5a15b1605@cgws.de \
--to=neumann@cgws.de \
--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).