This page permanently redirects to gemini://gemini.complete.org/tunneling-nncp-over-other-transports/.

Tunneling NNCP over other transports

Background

NNCP[1] has built-in support for running over TCP, with nncp-daemon and nncp-call/caller. NNCP's own use cases[2] page talks about various use cases for NNCP. Some of them, such as the no link[3] page, cover use of nncp-xfer; others, such as the one-way broadcasting[4] page go over nncp-bundle.

=> 1: /nncp/ | 2: https://nncp.mirrors.quux.org/Use-cases.html | 3: https://nncp.mirrors.quux.org/UsecaseNoLink.html | 4: https://nncp.mirrors.quux.org/UsecaseBroadcast.html

Here I build on all of these tools (daemon, call, xfer, and bundle) to show how they can be used to build even more communication methods.

The tools

The NNCP commands[5] we'll be using are:

=> 5: https://nncp.mirrors.quux.org/Commands.html

nncp-daemon : Normally listens on a TCP port, but can also interact over stdin/stdout. We can use this, for instance, over ssh.

nncp-call / nncp-caller : Normally connects to a nncp-daemon on a TCP port, but can also use a program that can interact on stdin/stdout.

nncp-xfer : Reads and writes from a filesystem tree. Often used with USB sticks, but can also be used with various kinds of mountable/syncable directories and cloud storages.

nncp-bundle : Reads and writes streaming, tar-type archives. These need only a unidirectional pipe and can run over all sorts of transports, from FTP to UUCP.

The transports

Here are some things that can act as transports for NNCP.

Based on nncp-daemon/call

ssh

You can easily tunnel the nncp-daemon/call traffic over ssh. For instance, you could use this in the addrs[6] part of the neighbor configuration:

=> 6: https://nncp.mirrors.quux.org/CfgNeigh.html

addrs: {
  ssh: "|ssh remote.host nncp-daemon -ucspi"
}

This recipe is, in fact, even in the addrs documentation for NNCP. It of course requires configuration of public keys and authorized_hosts files. Now, you can use nncp-call/caller like usual.

sudo

You can talk between two NNCP instances on the same box, but running as different users, over sudo. See my NNCP with sudo[7] documentation for details.

=> 7: /using-nncp-with-sudo/

Yggdrasil

Yggdrasil[8] is a mesh network with a lot of compelling features. NNCP has built-in Yggdrasil support, or you can use the standalone Yggdrasil node software. See my page NNCP over Yggdrasil[9] for more details.

=> 8: /yggdrasil/ | 9: /nncp-over-yggdrasil/

Tor

Tor[10] is known for its efforts to preserve anonymity. It also makes it easy to run a server without having to muck with firewalls; that's called a "hidden service". You could establish a hidden service that connects to nncp-daemon, then use the Tor SOCKS proxy to access it. Your addrs section might look like this:

=> 10: https://www.torproject.org/

addrs: {
  tor: "|nc -X 5 -x 127.0.0.1:9050 akii45bolkchh5ulheaqip7amvy53ctt3crihzgzn3dgsk4jzj6ofuad.onion 5400"
}

This particular example comes from the quux.org NNCP public relay[11] documentation. Assuming your local Tor is listening on port 9050, it connects to the given hidden service on port 5400.

=> 11: /quux-org-nncp-public-relay/

socat

socat is a very interesting multi-tool that can pipe data from commands to/from things like sockets, SSL, proxies, UDP, and so forth. It can be used with nncp-call and nncp-daemon.

gensio

The gensio[12] library/program can be used to create a reliable pipe underneath nncp-call/nncp-daemon over things like unreliable serial links. Its relpkt mode will do just the trick here. See my Using gensio and ser2net[13] page for more details.

=> 12: https://github.com/cminyard/gensio | 13: /using-gensio-and-ser2net/

Radios

My lorapipe[14] and xbnet[15] projects both facilitate sending data over long-distance, low-bandwidth radios. The xbnet documentation[16], in particular, covers use of socat with radios, as well as UUCP and PPP.

=> 14: https://github.com/jgoerzen/lorapipe | 15: https://github.com/jgoerzen/xbnet | 16: https://github.com/jgoerzen/xbnet/blob/master/doc/xbnet.1.md

Based on nncp-xfer

nncp-xfer[17] copies packets to/from a directory tree. These commands are most useful for things that can be mounted (including FUSE mounting).

=> 17: https://nncp.mirrors.quux.org/nncp_002dxfer.html

Cloud Storage (AWS S3, WebDAV, Nextcloud, Owncloud, SFTP, FTP, etc)

There are various FUSE mountable tools for these different types of storages. One in particular is rclone[18], which has an extensive list of storage backends. If you can mount it in some way, you can likely use it as a relay point for nncp-xfer.

=> 18: https://rclone.org/

Using rclone in its syncing mode may be considerably more complicated, since it is a unidirectional sync.

Additional packages to investigate include: sshfs, davfs2, s3fs, curlftpfs

=> /syncthing/ 19: /syncthing/

#### Bi-directional Syncing Storage (Dropbox, Nextcloud, Owncloud, Syncthing[19], etc) 

These options aim to keep a local directory in sync with a remote.  They are a bidirectional sync, so should work well with nncp-xfer.  Basically, nncp-xfer on a given machine can move packets to/from the shared hierarchy as appropriate, but won't touch files that aren't relevant to it, so the process should be quite safe.

Syncthing[20], in particular, could make a great match for NNCP.  Since it is fully-distributed, serverless, and even runs on phones, it can be an interesting transport mechanism.  I have a blog article[21] about using Syncthing with NNCP.

=> /syncthing/ 20: /syncthing/
=> https://changelog.complete.org/archives/10219-a-simple-delay-tolerant-offline-capable-mesh-network-with-syncthing-optional-nncp 21: https://changelog.complete.org/archives/10219-a-simple-delay-tolerant-offline-capable-mesh-network-with-syncthing-optional-nncp

### Based on nncp-bundle 

nncp-bundle[22] emits a tar-style stream which can be piped across transports, stored in queue directories or services, etc.  Small bundles could conceivably be encoded and sent by email even (with procmail recipes to decode and process on the receiving end).  nncp-bundle is suitable for use with tape drives, other streaming transport, or anything that you can pipe to.

=> https://nncp.mirrors.quux.org/nncp_002dbundle.html 22: https://nncp.mirrors.quux.org/nncp_002dbundle.html

#### PPP 

NNCP's PPP[23] page covers basic setup of running an IP stack over a serial line.

=> https://nncp.mirrors.quux.org/PPP.html 23: https://nncp.mirrors.quux.org/PPP.html

#### uucp 

Perhaps you have a noisy serial line or something else that is a challenge to keep clean.  UUCP could still run over it -- yes, you can tunnel NNCP over UUCP!  All you need to do is use uux.  Something like this (untested) ought to do the trick:

nncp-bundle -tx -delete node2 | uux - 'node2!nncp-bundle' -rx -check

Proxy Information
Original URL
gemini://gemini.complete.org/tunneling-nncp-over-other-transports
Status Code
Success (20)
Meta
text/gemini; charset=utf-8; lang=en; size=10996
Capsule Response Time
866.998011 milliseconds
Gemini-to-HTML Time
1.523287 milliseconds

This content has been proxied by September (ba2dc).