Protocols » History » Version 11
Greg Burri, 09/15/2010 12:55 PM
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 | 11 | Greg Burri | <messageType:uint32><size:uint32><senderId:20*uint8><serializedMessage> |
12 | 3 | Greg Burri | </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 | 9 | Greg Burri | h2. Links to resource (DRAFT) |
21 | 6 | Greg Burri | |
22 | 10 | Greg Burri | Links can be shared across peers. It locates a remote resource like folder or file from a specific peer. It can contain chunk hashes, thus the source peer doesn't need to be online to download a file or a folder. |
23 | 6 | Greg Burri | |
24 | _ayb://[<peer name>][:<file id>][:<shared id>/<folder>/<file>]_ |
||
25 | |||
26 | 7 | Greg Burri | * <peer name> : Not required and not used to locate the resource, just an information for the user. |
27 | * <file id> : its the n first group of nibble of the m first chunk where _n * m = 40 nibbles_ (20 octets). |
||
28 | ** 20,87cace382f7371cd3fab3cb0a53b93b7cd9719f6 : 20 chunks of 2 nibbles. |
||
29 | ** 8,05649bcbf065e0d032ada540d4a749d98db055cf : 8 chunks of 5 nibbles. |
||
30 | * <shared id> : Contains only the beginning of the hash. |
||
31 | 6 | Greg Burri | |
32 | |||
33 | h3. Character encoding |
||
34 | 1 | Greg Burri | |
35 | 6 | Greg Burri | TODO.. |
36 | |||
37 | h3. Examples |
||
38 | |||
39 | 8 | Greg Burri | * _ayb://20,87cace382f7371cd3fab3cb0a53b93b7cd9719f6_ |
40 | * _ayb://pierre:20,87cace382f7371cd3fab3cb0a53b93b7cd9719f6_ |
||
41 | 7 | Greg Burri | * _ayb://pierre:20,87cace382f7371cd3fab3cb0a53b93b7cd9719f6:dac4f75c/my%20movies/LOLCat.avi_ |
42 | * _ayb://pierre:dac4f75c/my%20movies/LOLCat.avi_ |
||
43 | * _ayb://pierre:dac4f75c/my%20movies_ |