Subject: Confirmation of Received Packets

From: John Goerzen <[email-masked]>
Date: Wed, 23 Feb 2022 07:17:18 -0600

Hi folks,

I am working to set up a fully airgapped system.  It will exchange data
with another system solely by using nncp-xfer and USB sticks.  This is
data I really wouldn't want to lose.

This brings to mind a thought...

With nncp-caller/daemon, there is a confirmation of correct receipt of
packets (including checksum).  The sending side doesn't delete the
packet until it's received this confirmation from the receiver.

With nncp-xfer/bundle, we don't have that mechanism.  We can choose to
either leave packets on the disk after transmission, or not.  If we
leave packets on the disk after transmission, that implies that they
will be transmitted over and over.  (We can use seen on the receiver
side to prevent multiple processing, but it won't prevent multiple
transmissions.)

If we don't keep the packets on the sender side, then we risk data loss
due to issues such as USB stick failure, loss of the USB stick, etc.

It seems it may be useful to have "something" on the receiver side
(toss, xfer, or bundler) be able to create a reply packet saying "I am
node X, and here is a list of packets I have successfully received and
checksummed."  This packet could go back to the sender over whatever
method is used (xfer/bundle/etc).

There is perhaps a workaround (untested):

The sender machine can have a script around nncp-bundle that generates
bundles with unique filenames, placed into a particular "for node X"
directory on the USB stick.

The receiver can process these with nncp-bundle -check -rx.  Assuming
that this command exits with code 0 if all packets are successfully
received and checked and nonzero if not (I couldn't find documentation
if this is indeed the case), then if all packets are successfully
received and checked, it could move the bundle into "verified by node X"
directory.

The next time the sender runs, it can run nncp-bundle -rx -delete over
everything in the "verified by node X" directory.

I think it would be nice to be able to handle this within NNCP, however.
It would mean lower storage requirement (just a few bytes to indicate
successful reception instead of keeping the entire bundle around), and
also a lot easier automation.

I would hope it wouldn't be too difficult to implement?

Thanks!

- John