ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/doc/vpe.protocol.7.pod
(Generate patch)

Comparing gvpe/doc/vpe.protocol.7.pod (file contents):
Revision 1.2 by pcg, Tue Apr 15 04:54:44 2003 UTC vs.
Revision 1.3 by pcg, Mon Oct 6 12:47:58 2003 UTC

8 8
9 +------+------+--------+------+ 9 +------+------+--------+------+
10 | HMAC | TYPE | SRCDST | DATA | 10 | HMAC | TYPE | SRCDST | DATA |
11 +------+------+--------+------+ 11 +------+------+--------+------+
12 12
13The HMAC field is present in all packets, even if not used (e.g. in 13The HMAC field is present in all packets, even if not used (e.g. in auth
14authentification packets), in which case it is set to all zeroes. The 14request packets), in which case it is set to all zeroes. The checksum
15checksum itself is over the TYPE, SRCDST and DATA fields in all cases. 15itself is over the TYPE, SRCDST and DATA fields in all cases.
16 16
17The TYPE field is a single byte and determines the purpose of the packet 17The TYPE field is a single byte and determines the purpose of the packet
18(e.g. RESET, COMPRESSED/UNCOMPRESSED DATA, PING, AUTH REQUEST/RESPONSE, 18(e.g. RESET, COMPRESSED/UNCOMPRESSED DATA, PING, AUTH REQUEST/RESPONSE,
19CONNECT REQUEST/INFO etc.). 19CONNECT REQUEST/INFO etc.).
20 20
23hosts, since all hosts connect to each other on startup. But if restarts 23hosts, since all hosts connect to each other on startup. But if restarts
24are rare or tolerable and most connections are on demand, larger networks 24are rare or tolerable and most connections are on demand, larger networks
25are possible. 25are possible.
26 26
27The DATA portion differs between each packet type, naturally, and is the 27The DATA portion differs between each packet type, naturally, and is the
28only part that can be encrypted encrypted. Data packets contain more 28only part that can be encrypted. Data packets contain more fields, as
29fields, as shown: 29shown:
30 30
31 +------+------+--------+------+-------+------+ 31 +------+------+--------+------+-------+------+
32 | HMAC | TYPE | SRCDST | RAND | SEQNO | DATA | 32 | HMAC | TYPE | SRCDST | RAND | SEQNO | DATA |
33 +------+------+--------+------+-------+------+ 33 +------+------+--------+------+-------+------+
34 34
35RAND is a sequence of fully random bytes, used to increase the entropy of the data 35RAND is a sequence of fully random bytes, used to increase the entropy of
36for encryption purposes. 36the data for encryption purposes.
37 37
38SEQNO is a 32-bit sequence number. It is negotiated at every connection 38SEQNO is a 32-bit sequence number. It is negotiated at every connection
39initialization and starts at some random value. 39initialization and starts at some random 31 bit value. VPE currently uses
40a sliding window of 512 packets to detect reordering, duplication and
41reply attacks.
40 42
41=head2 The authentification protocol 43=head2 The authentification protocol
42 44
43Before hosts can exchange packets, they need to establish authenticity of 45Before hosts can exchange packets, they need to establish authenticity of
44the other side and a key. Every host has a private RSA key and the public 46the other side and a key. Every host has a private RSA key and the public
45RSA keys of all other hosts. 47RSA keys of all other hosts.
46 48
47A host establishes a simplex connection by sending the other host a RSA 49A host establishes a simplex connection by sending the other host a
48challenge containing the random digest and encryption keys (different) 50RSA encrypted challenge containing a random challenge (consisting of
49to use when sending packets, plus more randomness plus some PKCS1_OAEP 51the encryption key to use when sending packets, more random data and
50padding plus a random 16 byte id. The destination host will respond by 52PKCS1_OAEP padding) and a random 16 byte "challenge-id" (used to detect
53duplicate auth packets). The destination host will respond by replying
51replying with an (unencrypted) RIPEMD160 hash of the decrypted data, which 54with an (unencrypted) RIPEMD160 hash of the decrypted challenge, which
52will authentify that host. The destination host will also set the outgoing 55will authentify that host. The destination host will also set the outgoing
53encryption parameters as given in the packet. 56encryption parameters as given in the packet.
54 57
55When the source host receives a correct auth reply (by verifying the 58When the source host receives a correct auth reply (by verifying the
56hash and the id, which will expire after 20 seconds). it will start to 59hash and the id, which will expire after 120 seconds), it will start to
57accept data packets from the destination host. The protocol is completely 60accept data packets from the destination host.
58symmetric, so to be able to send packets the destination host must send a 61
59challenge in the exact same way as already described. 62This means that a host can only initate a simplex connection, telling the
63other side the key it has to use when it sends packets. The challenge
64reply is only used to set the current IP address and protocol parameters.
65
66The protocol here is completely symmetric, so to be able to send packets
67the destination host must send a challenge in the exact same way as
68already described (so, in essence, two simplex connections are created per
69host pair).
60 70
61=head2 Retrying 71=head2 Retrying
62 72
63When there is no response to an auth request, the host will send auth 73When there is no response to an auth request, the host will send auth
64requests in bursts with an exponential backoff. After some time it will 74requests in bursts with an exponential backoff. After some time it will

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines