chiark / gitweb /
new max_batch_down protocol, define
[hippotat.git] / PROTOCOL
1 Server maintains a queue of outbound packets for each user
2
3 Packets which are older than the applicable max_queue_time are discarded
4
5 Each incoming request to the server takes up to max_batch_down bytes
6 from the queue and returns them as the POST response body payload
7
8 Each incoming request contains up to max_batch_up bytes of payload.
9 It's a multipart/form-data.
10
11 Authentication: clock-based lifetime-limited bearer tokens.
12
13 Encryption and integrity checking: none.  Use a real VPN over this!
14
15 Routing assistance: none in hippotat; can be requested on client
16  from userv-ipif via `vroutes' parameter.  Use with secnet polypath
17  ideally uses the special support in secnet 0.4.x.
18
19 Client form parameters (multipart/form-data):
20  m              metadata, newline-separated list (text file) of
21                         client ip address (textual)
22                         token
23                         target_requests_outstanding
24                         http_timeout
25                         max_batch_down
26  d              data (SLIP format, with SLIP_ESC and `-' swapped)
27
28
29 Authentication token is:
30         <time_t in hex with no leading 0s> <hmac in base64>
31 (separated by a single space).  The hmac is
32         HMAC(secret, <time_t in hex>)
33 and the hash function is SHA256
34
35
36 Possible future nonce-based authentication:
37
38 server keeps big nonce counter for each client
39 meaning is:
40  nonce counter is most recent nonce client has sent
41 also server keeps bitmap of the previous ?64 nonces,
42  whether client has sent them
43
44 difficult because client-generated nonces would have to never go
45 backwaards which basically means never-rewinding state on the client.