Research on fountain codes for rendezvous in censorship circumvention.

See <https://github.com/net4people/bbs/issues/591>.

## Setup

The project uses the
[raptorq](https://pypi.org/project/raptorq/) Python module.
One way to install it is with a Python
[virtual environment](https://docs.python.org/3/library/venv.html):

```
python3 -m venv venv
. venv/bin/activate
venv/bin/pip3 install raptorq
```

## Usage

There are two pairs of demonstration programs.
One is offline (encode.py and decode.py),
and one is online (receive.py and send.py).

The offline programs are encode.py and decode.py.
Run encode.py to generate a sequence of files
packet.0, packet.1, …, packet.<var>n</var>
from an input message in message.txt,
with each chunk being 100 bytes in size:

```
python3 encode.py 100 5 packet message.txt
```

Run decode.py on a subset of the packet.\* files.
decode.py need to be informed of the chunk size and the size of the original message (the `stat` call).
If enough packets are provided to reconstruct the original message,
the program writes the message to standard output and exits with return code 0.
If not, the program exits with return code 1.

```
python3 decode.py 100 $(stat --printf %s message.txt) packet.5 packet.3 packet.2 ...
```

The online programs are receive.py and send.py.
They use UDP datagrams over network sockets rather than files on disk.
Run receive.py, giving it an IP:port address, a chunk size, and the total size of the message
to be received:

```
python3 receive.py 127.0.0.1:5000 100 $(stat --printf %s message.txt)
```

Then run send.py, giving it the IP:port of the receiver,
the chunk size, and the filename of the message to be sent:

```
python3 send.py 127.0.0.1:5000 100 message.txt
```

send.py sends the chunks of the message, one at a time, with a delay in between.
When receive.py has gotten enough chunks to decode the message,
it converts the message to uppercase (to simulate some sort of server-side computation)
and sends it back to the sender.
send.py, on getting this message, stops sending chunks and terminates.
