Project

General

Profile

Protocols » History » Version 6

Greg Burri, 11/09/2009 09:57 AM

1 1 Greg Burri
h1. Protocols
2
3 4 Greg Burri
* [[Protocol core-core]]
4
* [[Protocol core-GUI]]
5
6 2 Greg Burri
There is two main protocols, one between cores and one between GUI and core. Both used "protocol buffers":http://code.google.com/p/protobuf/ for describing the exchanged messages.
7 1 Greg Burri
8 5 Greg Burri
Each data sent over the network (using TCP or UDP) are formatted like this :
9 3 Greg Burri
10
<pre>
11
<messageType:uint32><size:uint32><serializedMessage>
12
</pre>
13
14
Where :
15
* _messageType_ is a number which determine the message type, more information in the proto files.
16 1 Greg Burri
* _size_ is the size of the following serialized message.
17
* _serializedMessage_ is the data serialized by protocol buffer.
18 6 Greg Burri
19
20
h2. Links to resource
21
22
Links can be shared across peers. It locates a remote resource like folder or file from a specific peer. It doesn't contain any chunk hash, thus the peer must be online to download a file or a folder.
23
24
_ayb://[<peer name>][:<file id>][:<shared id>/<folder>/<file>]_
25
26
* <file id> : its the n first group of 4 bits of the m first chunk.
27
** 20,87cace382f7371cd3fab3cb0a53b93b7cd9719f6 : 20 chunks of 2 groups.
28
** 8,05649bcbf065e0d032ada540d4a749d98db055cf : 8 chunks of 5 groups.
29
* <peer name> : Not used to locate the resource, just an information for the user.
30
* <shared id> : Like peer id, contains only the beginning of the hash.
31
32
33
h3. Character encoding
34
35
TODO..
36
37
h3. Examples
38
39
40
* _ayb://pierre:238e8634@dac4f75c/my%20movies/LOLCat.avi_
41
* _ayb://pierre:238e8634@dac4f75c/my%20movies_
42
* _ayb://2:2:4:d:3:2:4:2/LOLCat.avi_