next up previous contents
Next: 2. Stream Format Up: I. Tapio RFCs Previous: I. Tapio RFCs   Contents

Subsections

1. Plumbing Protocol

1.1 Executive Summary

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.

1.2 Introduction

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.

1.3 References

Check out:

  1. OpenSSL ( http://www.openssl.org ).

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.

1.4 Definitions

Definitions will go here.

1.5 Requirements

  1. netplumb will accept connections only from explicitly authorized clients.
  2. netplumb may have different ``gluepots'' (lists of commands that are authorized to be run) for each client.
  3. netplumb will be secure. Only an RSA-authenticated central controller node can tell it what commands to run

  4. netplumb will be able to accept data from non-authorized nodes if properly told to do so by a central controller node. Thus netplumb can accept ``one time keys'' from a central controller node that can be used once then are no longer valid, along with a token dictating what command shall be run by that key.

  5. netplumb will not require any infrastructure to be running in order to properly operate, so that it can be used on recovery disks etc. to do network-based recovery of data.

1.6 Assumptions

The environment in which the widget runs. We assume certain things about it.

We assume that:

  1. We are using IP-based networking. This doesn't work via other types of networking.
  2. We have some way of getting a list of authorized control nodes to clients, along with (hopefully) their public keys (or at least the fingerprint of those public keys).
  3. We can contact the clients from the control node(s).

We do *NOT* assume that:

  1. We do not assume that we can contact the control node(s) from the clients. They may be on opposite side of a firewall.

1.7 Relationships

The entire network backup pudding relies upon netplumb.

1.8 User Interface

1.8.1 plumb command

plumb machinename { -recipe=/some/path/name } { -user=username } { -infifo=/some/path/name } {-outfifo=/some/path/name } { -socket=/some/path/name } {-export=namelist }command

Where:

1.8.2 Recipes

A recipe file is a (possibly labeled) list of commands. It has the format of:


\begin{verb}
\par [label:] command [>\%label2:] [2>\%label3:] [\vert] [\&]
\par\end{verb}

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).

1.9 Interfaces/Protocols

1.9.1 General packet format

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.

1.9.2 General format of non-DATA packets

Virtually all of these are a list of name/value pairs, of format


\begin{verb}
NAME=VALUE
\end{verb}

with the last entry being:


\begin{verb}
\par ==END==
\par\end{verb}

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.

1.9.3 START packet

The START packet has this format:


\begin{verb}
\par YOUARE=<name of system we're contacting>
IAM=<myname>
MYCHAT=<128-bit salt string>
==END==
\par\end{verb}

The other end then sends back either a 99 *(

1.9.4 Why not SSL?

Basically, we have some unique requirements that are not met by SSL. The biggest one is transmission of one-time keys.

1.10 Procedure/Transaction Definitions

If there are specific operations that can be performed, describe them here.

1.11 Data/System Integrity Considerations

How do we keep from corrupting data or databases?

1.12 Reliability and availability issues

Specify how we address reliability.

1.13 Security and Privacy issues

Specify how we address security and privacy issues.

1.14 Safety 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.

1.15 Quality Assurance

How we will make it work right.

1.16 Performance Issues

How we will make it work fast.

1.17 Implementation Methods

Any other stuff related to implementation that we need to mention

1.18 Risks

What could make this part of project fall behind schedule.


next up previous contents
Next: 2. Stream Format Up: I. Tapio RFCs Previous: I. Tapio RFCs   Contents
The Unknown Hacker 2001-07-06