public inbox for nncp-devel@lists.cypherpunks.ru
Atom feed
From: Sergey Matveev <stargrave@stargrave•org>
To: nncp-devel@lists.cypherpunks.ru
Subject: Re: Suggestions to make ACK easier
Date: Sun, 13 Aug 2023 23:30:15 +0300	[thread overview]
Message-ID: <ZNk9VxMc2P8cOS4y@stargrave.org> (raw)
In-Reply-To: <875y5nsl4g.fsf@complete.org>

[-- Attachment #1: Type: text/plain, Size: 2547 bytes --]

Greetings!

*** John Goerzen [2023-08-09 21:04]:
>> If "nncp-xfer -rx" will generate ACK packet, then what if something will
>> go wrong and outbound ACK packet could not be saved? We loose that ACK
>> and our running nncp-toss can already toss retrieved packet. -xfer +
>
>That makes sense.  Though if -seen is in use, I guess it will just cause
>a harmless retransmission.

Problem here is that ACK won't be generated at all, because packet is
already tossed. Duplicate ACKs is not a problem indeed, but completely
lost (non-generated) ones are bad of course.

>But there is the problem that toss may run before -ack.  Basically if
>anything at all on the system is going to use -ack, then you can't use
>-autotoss, or nncp-toss with -cycle, because that then means a race
>condition -- packets may be tossed before nncp-ack is run.  You
>basically have to ensure that nothing at all might run toss when you're
>loading stuff up for -ack, and that means some outside-of-NNCP locking
>in some cases.

Everything is right. ACK-based workflow was not compatible with autotossing.

>Maybe the thing to do here is extend nncp.hjson to add an "autoack"
>feature to a given node?  That way, nncp-toss could generate an ack for
>it at toss time.

As with -xfer/-bundle commands, you have to store the knowledge of
packets who carry ACKs. It was made by printing their identifiers to
stdout by nncp-ack command itself. With tossers (that are not only
-toss, but -daemon and -caller) you will have to create some kind of
atomically commitable database of those ACKs. It can be a directory with
just empty files, whose names will be ACK-packets identifiers.

I made ability to automatically generate ACKs during tossing in 8.9.0
release. nncp-toss -gen-ack, nncp-* -autotoss-gen-ack. Although I did
only quick testing if it works fine. It saves knowledge about ACK
packets in spool/tx/ack/PKT empty files. nncp-rm -ack will remove them
and corresponding spool/tx/PKT packets.

>One other thing I've been pondering: end-to-end ACKs.  So if you send
>from node A to node D via B and C, what happens if B receives the packet
>and then its disk dies?

Something badly unexpected will happen :-)
Well, end-to-end acknowledgments is more complicated, because
recipient's node does not know identity of the very first packet that
was sent. Something much more complicated must be done to deal with it.

-- 
Sergey Matveev (http://www.stargrave.org/)
OpenPGP: 12AD 3268 9C66 0D42 6967  FD75 CB82 0563 2107 AD8A

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2023-08-13 20:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-11 14:28 Suggestions to make ACK easier John Goerzen
2023-07-11 15:55 ` John Goerzen
2023-07-30  7:47 ` Sergey Matveev
2023-08-09 12:04 ` Sergey Matveev
2023-08-10  2:04   ` John Goerzen
2023-08-13 20:30     ` Sergey Matveev [this message]
2023-09-13 17:29       ` John Goerzen