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

Comparing gvpe/doc/gvpe.protocol.7.pod (file contents):
Revision 1.1 by pcg, Fri Jun 11 15:56:13 2004 UTC vs.
Revision 1.2 by pcg, Tue Mar 15 19:23:33 2005 UTC

1=head1 The GNU-VPE Protocol 1=head1 The GNU-VPE Protocols
2
3=head1 Overview
4
5GVPE can make use of a number of protocols. One of them is the GNU VPE
6protocol which is used to authenticate tunnels and send encrypted data
7packets. This protocol is described in more detail the second part of this
8document.
9
10The first part of this document describes the transport protocols which
11are used by GVPE to send it's data packets over the network.
12
13=head1 PART 1: Tansport protocols
14
15=head2 RAW IP
16
17=head2 ICMP
18
19=head2 UDP
20
21=head2 TCP
22
23=head2 DNS
24
25=head1 PART 2: The GNU VPE protocol
26
27This section, unfortunately, is not yet finished, although the protocol
28is stable (until bugs in the cryptography are found, which will likely
29completely change the following description). Nevertheless, it should give
30you some overview over the protocol.
2 31
3=head2 Anatomy of a VPN packet 32=head2 Anatomy of a VPN packet
4 33
5The exact layout and field lengths of a VPN packet is determined at 34The exact layout and field lengths of a VPN packet is determined at
6compiletime and doesn't change. The same structure is used for all 35compiletime and doesn't change. The same structure is used for all
7protocols, be it rawip or tcp. 36transort protocols, be it RAWIP or TCP.
8 37
9 +------+------+--------+------+ 38 +------+------+--------+------+
10 | HMAC | TYPE | SRCDST | DATA | 39 | HMAC | TYPE | SRCDST | DATA |
11 +------+------+--------+------+ 40 +------+------+--------+------+
12 41
13The HMAC field is present in all packets, even if not used (e.g. in auth 42The HMAC field is present in all packets, even if not used (e.g. in auth
14request packets), in which case it is set to all zeroes. The checksum 43request packets), in which case it is set to all zeroes. The checksum
15itself is over the TYPE, SRCDST and DATA fields in all cases. 44itself is calculated over the TYPE, SRCDST and DATA fields in all cases.
16 45
17The TYPE field is a single byte and determines the purpose of the packet 46The TYPE field is a single byte and determines the purpose of the packet
18(e.g. RESET, COMPRESSED/UNCOMPRESSED DATA, PING, AUTH REQUEST/RESPONSE, 47(e.g. RESET, COMPRESSED/UNCOMPRESSED DATA, PING, AUTH REQUEST/RESPONSE,
19CONNECT REQUEST/INFO etc.). 48CONNECT REQUEST/INFO etc.).
20 49
21SRCDST is a three byte field which contains the source and destination 50SRCDST is a three byte field which contains the source and destination
22node ids (12 bits each). The protocol does not yet scale well beyond 30+ 51node ids (12 bits each). The protocol does not yet scale well beyond 30+
23hosts, since all hosts connect to each other on startup. But if restarts 52hosts, since all hosts must connect to each other once on startup. But if
24are rare or tolerable and most connections are on demand, larger networks 53restarts are rare or tolerable and most connections are on demand, much
25are possible. 54larger networks are feasible.
26 55
27The DATA portion differs between each packet type, naturally, and is the 56The DATA portion differs between each packet type, naturally, and is the
28only part that can be encrypted. Data packets contain more fields, as 57only part that can be encrypted. Data packets contain more fields, as
29shown: 58shown:
30 59
35RAND is a sequence of fully random bytes, used to increase the entropy of 64RAND is a sequence of fully random bytes, used to increase the entropy of
36the data for encryption purposes. 65the data for encryption purposes.
37 66
38SEQNO is a 32-bit sequence number. It is negotiated at every connection 67SEQNO is a 32-bit sequence number. It is negotiated at every connection
39initialization and starts at some random 31 bit value. VPE currently uses 68initialization and starts at some random 31 bit value. VPE currently uses
40a sliding window of 512 packets to detect reordering, duplication and 69a sliding window of 512 packets/sequence numbers to detect reordering,
41reply attacks. 70duplication and reply attacks.
42 71
43=head2 The authentification protocol 72=head2 The authentification protocol
44 73
45Before hosts can exchange packets, they need to establish authenticity of 74Before hosts can exchange packets, they need to establish authenticity of
46the other side and a key. Every host has a private RSA key and the public 75the other side and a key. Every host has a private RSA key and the public
59hash and the id, which will expire after 120 seconds), it will start to 88hash and the id, which will expire after 120 seconds), it will start to
60accept data packets from the destination host. 89accept data packets from the destination host.
61 90
62This means that a host can only initate a simplex connection, telling the 91This 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 92other 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. 93reply is only used to set the current IP address of the other side and
94protocol parameters.
65 95
66The protocol here is completely symmetric, so to be able to send packets 96This protocol is completely symmetric, so to be able to send packets the
67the destination host must send a challenge in the exact same way as 97destination host must send a challenge in the exact same way as already
68already described (so, in essence, two simplex connections are created per 98described (so, in essence, two simplex connections are created per host
69host pair). 99pair).
70 100
71=head2 Retrying 101=head2 Retrying
72 102
73When there is no response to an auth request, the host will send auth 103When there is no response to an auth request, the host will send auth
74requests in bursts with an exponential backoff. After some time it will 104requests in bursts with an exponential backoff. After some time it will
75resort to PING packets, which are very small (8 byte) and lightweight (no 105resort to PING packets, which are very small (8 bytes) and lightweight
76RSA operations). A host that receives ping requests from an unconnected 106(no RSA operations required). A host that receives ping requests from an
77peer will respond by trying to create a connection. 107unconnected peer will respond by trying to create a connection.
78 108
79In addition to the exponential backoff, there is a global rate-limit on 109In addition to the exponential backoff, there is a global rate-limit on
80a per-ip base. It allows long bursts but will limit total packet rate to 110a per-IP base. It allows long bursts but will limit total packet rate to
81something like one control packet every ten seconds, to avoid accidental 111something like one control packet every ten seconds, to avoid accidental
82floods due to protocol problems (like a rsa key file mismatch between two 112floods due to protocol problems (like a RSA key file mismatch between two
83hosts). 113hosts).
84 114
85=head2 Routing and Protocol translation 115=head2 Routing and Protocol translation
86 116
87The gvpe routing algorithm is easy: there isn't any routing. GVPE always 117The gvpe routing algorithm is easy: there isn't any routing. GVPE always

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines