On Sun, Jan 03 2021, Grant Taylor wrote:
> On 1/3/21 6:06 PM, John Goerzen wrote:
> Hi John,
>
>> Well I just discovered this group still exists (sweet!) so I thought I would
>> share a little bit.
>
> The group existing is one thing. Active discussion in the group is another.
> I'm showing 57 messages in the last ~2 years. So, just enough to keep the
> lights on. ;-)
Hey, the posts are outnumbering the spam (at least on Google Groups [yeah, I
know, don't shoot me]) so I took that as a positive sign for Usenet :-)
> Aside: I've found *MANY* things on your blog to be well worth the time to
> read
> and understand them. Thank you for your content.
>
Thank you!
>> There are some things that set it apart:
>>
>> First of all is modern security. Every message packet is encrypted and
>> authenticated.
>
> Am I correct in assuming that the authentication that you speak of is based on
> the purported source needing to have the private key that is associated with
> the
> configured public key for said source?
So a quick disclaimer that applies to all of my answers here: I'm not the author
of NNCP, so I can speak to my understanding of it, but not necessarily with
authority. There is a mailing list at
https://lists.cypherpunks.ru/pipermail/nncp-devel/ and the author is active
there.
With that out of the way, yes, that is indeed my understanding.
>> Routing via other hosts is done with Tor-style onion routing (so intermediate
>> hosts can see neither the content nor the ultimate destination of the packet
>> unless it is their neighbor). Communication is done securely or not at all.
>> (And NNCP supports a pervasive "nice" concept, similar to the UUCP grade,
>> that
>> can be used in both ordering of packets in a call and in deciding which
>> packets to transmit during a call.)
>>
>> NNCP has uucico-style daemon and caller,
>
> What is the role of the daemon?
>
> I may not completely grok my UUCP configuration, but there isn't a daemon
> running. (UUCP-over-SSH) My understanding is that things are mainly spawned
> by
> cron and / or reactively to what the cron jobs kick off when connecting to
> other
> systems.
The NNCP usage of the word "daemon" is a little loose. So in UUCP, there is
uucico, which is both the outbound caller and the inbound listener/daemon. In
NNCP, these roles are split into three separate programs:
nncp-daemon - the listener (roughly uucico -l)
nncp-call - an on-demand caller (uucico -S)
nncp-caller - the caller with scheduling rules (uucico -s if memory serves?)
The "daemon" can be run as a daemon (I run it under systemd [again, don't shoot
me!] quite easily). But it also has an -inetd option that, of course, can run
under inetd... but is really just a "speak the protocol on stdin/stdout" so it
could just as easily be run under ssh as with uucico.
>> but also some other modes: nncp-xfer (designed to facilitate easy airgapped
>> transfer on a mountable device such as USB stick) and nncp-bundle (emits a
>> tar-style stream that can be, eg, broadcasted on radio, burned to CD, even
>> sent via uucp).
>
> Perhaps I'm mistaken, but I thought that it was possible to transplant files
> from one UUCP queue to another UUCP queue, possibly via tape, flash drive,
> floppy, etc.
>
> I wonder if nncp-{xfer,bundle} are meant to simplify this transplanting or
> make
> it more of a first class operation.
I think that would be an accurate characterization, yes. I mean, both programs
fundamentally store packets in regular files, so as long as you are careful not
to trip over race conditions in either direction, it should be reasonably
simple. (I wonder if sequence numbers make it at all more complicated on the
UUCP side?
This is one article about doing something similar with UUCP:
https://www.dumain.com/posts/Forward_to_the_1970s_with_UUCP.../ and it wasn't
super simple. TBH I've never tried it. The NNCP tools for this also have
built-in support for grades/nice, preventing duplicate packets (I can't remember
if UUCP does this anymore; I seem to recall not?).
>> Some things it doesn't do that UUCP does:
>>
>> NNCP requires a clean link and doesn't have any special logic for serial port
>> handling.
>
> I personally feel like requiring an 8-bit clean connection is probably fairly
> safe these days.
Generally yes, but I play with long-distance low-power radios (think 20 miles
with 500mW or less) so it isn't ALWAYS that way even now!
>> However, it can run over a pipe so a program like socat, getty, etc. could
>> invoke it over a clean link.
>
> If you're speaking to (near) feature parity, I think that there should
> probably
> be some documentation of how to get NNCP to work over a serial / dial-up
> connection. Even if it's piping into something like cu. Having the getty on
> the
> far side invoke what's necessary to answer the call is probably sufficient.
> Though it should also be documented.
True, though TBH I don't think anybody has tried NNCP over raw serial lines yet.
Must put that on my list...
>
>> Authentication is done using public keypairs so no specific usernames are
>> needed.
>
> The credentials aren't needed for NNCP, but they probably are still needed to
> placate the getty on the remote side. ;-)
True, if it's in use.
>> By the nature of its encryption, you cannot (for instance) send email to a
>> node that you don't know the key for.
>
> How is this surfaced / exposed to end user? Would the MTA detect this as a
> failure in the mailer (Sendmail parlance) and return a DSN to the (purported)
> sender?
So I made an inartful simplification there.
One could, in both UUCP and NNCP worlds, handle multi-hop mail routing by
either:
1) Having the MTA do it (presumably via a smarthost for leaf nodes) - in a
manner similar to how things happen over the Internet now
2) Doing this at the UUCP/NNCP protocol level
So basically if you are going to have the MTA on node1 execute something like
"nncp-exec -via node2,node3,node4 node5 rmail janedoe" (aka uux
node2!node3!node4!node5!rmail janedoe) then the sending node needs to have the
keys for all four of those nodes since it needs to prepare all of the onion
encryption layers.
If, on the other hand, node1 knows that "meh, I just send all my mail to node2
and it figures it out", then it would be doing "nncp-exec node2 rmail
janedoe@node5" or something similar; node2 presumably would know to route that
via node3 and so forth.
I have never set up an MTA with full bang-path routing (my UUCP uses were all
late enough to be essentially Internet leaf sites with RFC822-style addressing
routed over UUCP) so TBH I don't quite know how the MTAs handled that, but my
understanding is that is was pretty much on the user to know the full bang path
from the local system to the recipient and it just handed this over to uux.
NNCP's config file actually lets you specify a default route to a known node, so
there would be no need for explicit routing at the MTA level if you just do it
all at the NNCP level. Doing it at the NNCP level would have a security benefit
as well, since it would be neither necessary nor possible to decrypt it at MTAs
along the way.
Exim has an example config where you could send things to, eg,
jan...@node5.UUCP and it could have a routing lookup table -- or just pass this
to the lower level. With NNCP's default "via" settings available in the config,
the routing can be invisible to both the MTA and the user (but of course, the
keys are needed).
If the MTA were to call nncp-exec to a node that nncp-exec doesn't know about,
it would get an immediate command failure from the pipe to nncp-exec and that
would presumably turn into an immediate DSN. The difference is that with uux,
the local system would only need to know about node2 and if, say, node3 doesn't
know about node4, then that's an issue that surfaces later. (Technically this
could still happen in NNCP; you could know about all those nodes but then node3
might not know about node4, but I'd think it would be more rare)
>> You also need to know the public key of every intermediate hop along the way.
>> But, the NNCP -via option is the exact same concept as UUCP bang paths.
>
> Is there a way to have NNCP query nodes for the public keys of the other nodes
> that it knows about?
No. It would probably take an NNCP mapping project for this.
> Is there any plan to have any sort of discovery / coordination / learning /
> ???
> of public keys? Perhaps DNS record(s) of some sort (TLSA, TXT, PTR, SRV,
> etc.);
> _nncp._tcp.$NODE...
Also no.
> Aside: Are NNCP node names unqualified or fully qualified?
They are essentially whatever you want them to be. Unlike with UUCP, an NNCP
node name is essentially a convenience alias for the node's public key (akin to
a hostname being a convenience alias for an IP address). A node doesn't have to
be known by the same name on every host, either, since the spool directories and
all internal structures are based off the node's public key rather than its
name.
> Further aside: Has there been any thought to federating a la. MX records?
I don't think so. NNCP was designed primarily as a sort of private network of
nodes - which is what I've most commonly seen UUCP evolved into (as there is no
longer any global UUCP network) - but there is no particular reason it couldn't
evolve in that direction.
>> And finally, some of the more esoteric uux invocations, for instance uux
>> 'diff
>> -c sys1!~user1/file1 sys2!~user2/file2 >!file.diff' as in the Taylor UUCP
>> manpage, aren't supported. However, by the time I started using UUCP in the
>> 90s, I had never seen uux used for anything but rmail and rnews.
>
> I've personally run multiple other commands via uux within the last year.
This makes me happy somehow :-)
>> It begins with an exploration of why airgapped backups could be valuable,
>> then
>> talks about why we tend to reach for synchronous tools like ssh even when
>> asynchronous like UUCP or NNCP would be better,
>
> Nitpick: I think you're alluding to store-and-forward networking vs.
> end-to-end
> networking. I've found SSH between nodes to be quite effective communications
> mechanism for store-and-forward UUCP-over-SSH even when end-to-end
> UUCP-over-SSH
> is not possible.
>
> 1) UUCP-over-SSH between source and an intermediate notebook
> 2) The intermediate notebook travels in the back of a station wagon
> 3) UUCP-over-SSH between the intermediate notebook and destination.
Fair nitpick, yes.
>> demonstrates sending mail across NNCP using bsmtp rather than rmail mode (the
>> same could be done over UUCP, of course),
>
> I'm not overly familiar with Batch SMTP [1], but my skim of the RFC causes me
> some indigestion. Though, I'm not sure what similar assumptions that UUCP /
> rmail make. In particular, how does UUCP deal with the receiving system
> rejecting an incoming message? Does this require a more complex BSMTP client
> /
> gateway that has the ability to generate a bounce that goes back through UUCP
> (NNCP)?
To be sure, I did bsmtp in that example because there weren't examples of doing
it with UUCP already out there :-) rmail examples, otoh, are readily available.
I am not a total expert on either, but let's just say that email has security
issues and both of those methods do also, particularly relating to spoofing.
>> then develops the ZFS backups over NNCP.
>
> I too *REALLY* like the idea of sending ZFS backups over a store-and-forward
> network to a remote system. Though I see a lot of unknowns there. Do you
> /blindly/ "receive" the "send" directly into a target pool or do you queue it
> as
> a file somewhere first? What if the pool is not in the proper state to
> receive
> what is sent, possibly because of an outstanding send that hasn't been
> received
> yet? Or are there implicit assumptions. -- I'd love to chat more (perhaps
> elsewhere).
Do I blindly receive? Pretty much yes :-)
I've done both nncp-exec (uux) and nncp-file (uucp), actually. NNCP doesn't
guarantee order of execution of packets. This happens to be fine for zfs
receive, because it will detect when the incremental source makes a packet be
un-receivable and exit with an error. nncp-toss (uuxqt) handles the error exit
code as "try this again on the next run" so it will eventually converge on the
appropriate solution even with a large backlog of packets to process.
I switched to using nncp-file (uucp) with a cron job to process it because I
discovered nncp-exec stores the stdin in RAM on the sending system (Sergey is
planning to fix that shortly). I encode the dataset to receive as part of the
filename (with s,/,@,g basically) and use the date as the leading part of the
filename. So I can minimize, but not eliminate, instances of out-of-order
execution there.
A non-ZFS backup is more complicated and will probably need to use something
like a sequence number to ensure incrementals are applied in the correct order.
An exception may be for setups that just send a full backup every day and dump
them into a deduplicating store (borgbackup, for instance) but that is probably
not super practical for most.
>> I have several more installments planned as well - tuning the ZFS
>> installation
>> and then progressing into non-ZFS backups, which are rather more tricky to
>> get
>> right (both sync and async, but especially async).
>
> I suspect that NNCP has quite similar use cases as UUCP. One just needs to be
> creative in how it's done.
>
> ~chuckle~ Broadcasting NNCP xfer / batch into a Usenet newsgroup for the
> recipient to collect elsewhere.
Hey, there've been worse uses of Usenet :-)
> I think that some thought, and comments / documentation should probably be
> given
> to why NNCP /needs/ it's own transport. What if NNCP was the next thing to
> use
> uux via rnncp. ;-) Meaning add the authentication on top of the existing
> UUCP
> instead of outright replacing it.
Oh I actually pointed out on the mailing list that it would be quite possible
for those that need robust error handling (protocol g, for instance) to run NNCP
over uucp.
nncp-bundle -delete -tx node2 | uux node2!nncp-bundle -rx
would pretty much do it :-)
The NNCP protocol is documented at
http://www.nncpgo.org/Sync.html#Sync but I'm
not immediately familiar enough with the low-level details of both it and UUCP's
to have an effective conversation on their relative merits.
I guess I could say that the NNCP protocol is designed to be self-securing and
reasonably delay-tolerant, even on half-duplex links. It also does integrity
checks of the whole of received packets. Of course you can run uucico over SSH,
but SSH is rather difficult to get running over some high-latency links; it
strongly wants a full-duplex link and has handshake timeouts that don't work
well with some of them. NNCP also has a mode where the connection is held open
reasonably indefinitely, and new packets queued for the remote would then be
transmitted essentially immediately.
Some messing with window sizes in UUCP protocols can get some decent performance
out of half-duplex links, but I haven't made a comparison. Of course UUCP has
far better support for noisy lines and modems and things.
> I do think that NNCP is a very interesting idea. I feel like there are a LOT
> of
> unknowns. Almost as if it's a solution in search of a problem. But that may
> just be observation bias.
So the things that drew me to NNCP are:
1) Pervasive encryption
2) First-class support for alternative transports
I started using it, and my feeling was pretty much, "hey! This is UUCP 2.0! I
like this!"
In fact, 19 years ago I wrote a long-forgotten tool called grunt that was
designed to be layered atop uux. grunt permitted both file sending and remote
execution. It used gpg for both encryption and authentication. My last commit
on it, though, was in 2006. I mean, it worked, but it was a bit of a pain and
completely ruled out most of uux's intelligence.
I guess I would put it this way, in a very rough sense: NNCP is to UUCP what
ssh is to rsh.
I feel like neighbor-level transport security in UUCP is solved reasonably
easily (uucico over ssh, etc.) But in the example above, node5 can't really
tell that the packet originated on node1 and arrived at node5 unmodified with
any degree of certainty. NNCP exposes the origin node's public key via an
environment variable so it's all right there. Basically you get end-to-end
encryption with NNCP, as a fundamental part of the protocol. Intermediate hops
can't even tell what the ultimate destination of a packet is, let alone what
command it's going to run.
It also makes some things easier (nncp-xfer/nncp-bundle). But it's not a
drop-in replacement like ssh was for rsh.
So it's not my intent to drop into a UUCP group and go "hey y'all should be
using something else". That would not be cool, and would not be accurate
anyhow. UUCP's still got its place too. I'm just trying to say "hey, there's
another UUCP-ish thing out there now, you might be interested."
- John