The netplumbing protocol allows running a program on a different machine in a secure manner. It functions somewhat like 'rsh', but encrypts all communications and allows replicating named pipes and unix-domain sockets as well as the traditional stdin/stdout/stderr.
A distributed backup program needs some way of running components on other systems. The netplumbing protocol was created in order to do this. We use Unix-style components (i.e., that communicate in a stream oriented manner and can be invoked and tested from the command line), and use 'plumb' and the 'netplumb' service to run components that happen to be on another system. We encrypt network communications in order to protect against hackers, and we replicate local domain sockets and named pipes in order to allow additional communications channels other than stdin/stdout/stderr.
Check out:
Some of the ideas involved originated with SSH and the OpenSSH project, and some are based on reading the 'rsh' source code (and barfing) and coming up with a better way of doing things.
Definitions will go here.
The environment in which the widget runs. We assume certain things about it.
We assume that:
We do *NOT* assume that:
The entire network backup pudding relies upon netplumb.
plumb machinename { -recipe=/some/path/name } { -user=username } { -infifo=/some/path/name } {-outfifo=/some/path/name } { -socket=/some/path/name } {-export=namelist }command
Where:
A recipe file is a (possibly labeled) list of commands. It has the format of:
where >%label: will send its output to the input of the command preceded by label3, and 2>%label3: will send its stderr to the stdin of the command labeled with 'label3:'. A plain old | will pipe its output to the stdin of the next command. The normal >file, 2>file, »file, 2»file, and 2>&1 redirections are also supported, but this scheme allows rather complicated pipelines that are more like a pudding than a pipeline, when you toss in named pipes into the mix. Please note that the >file etc. default to being created in /var/lib/tapioca/tmp on Linux if you leave out the path name (which is recommended, because Windows path names look nothing like Unix pathnames and this is supposed to be cross-platform). In reality, about the only thing of interest there are the named pipes.
All pipes are opened and readied for use prior to the recipe actually executing. The commands are then executed sequentially, one after the other. If a '&' or '|' is at the end of the command, it will spawn off that command then immediately spawn the next command without waiting for the first command to complete (what is normally expected in a Unix-style pipeline).
All binary numbers in packet headers are in big-endian (Internet) format.
All packets start with the characters 'TAP1', then a 4 byte number which represents the size of the packet. This is followed by a 32-bit CRC checksum of the remainder of the packet. Then a a 4-byte sequence number (rolls over at 32767), This is followed by a 1-byte packet type, which currently has the following values:
All packets from #10 upwards are encrypted. #10 uses a signed ( MD5 signature encrypted w/private key, encrypted by public key of recipient ) encryption using the recipient's public key and the originator's private key, and #20 upwards use the symetric key negotiated by the sessionkey command.
Some packets have a response packet in return. This response packet will use the same packet type, but may have a different payload, depending upon what the particular class processing the packet expects.
Virtually all of these are a list of name/value pairs, of format
with the last entry being:
All entries are null-terminated. There are no illegal values in entries, other than the null character (note: This means that binary data containing zeros should be sent in hex or some other encoded format such as base64). Trailing spaces are *NOT* stripped off, so be careful if you are encoding a packet by hand.
The START packet has this format:
The other end then sends back either a 99 *(
Basically, we have some unique requirements that are not met by SSL. The biggest one is transmission of one-time keys.
If there are specific operations that can be performed, describe them here.
How do we keep from corrupting data or databases?
Specify how we address reliability.
Specify how we address security and privacy issues.
If the software could cause safety issues (e.g., could make a robot arm tatoo the Ford logo on a lineman's rear), address those here.
How we will make it work right.
How we will make it work fast.
Any other stuff related to implementation that we need to mention
What could make this part of project fall behind schedule.