Project

General

Profile

Protocols » History » Revision 6

Revision 5 (Greg Burri, 11/06/2009 04:24 PM) → Revision 6/26 (Greg Burri, 11/09/2009 09:57 AM)

h1. Protocols 

 * [[Protocol core-core]] 
 * [[Protocol core-GUI]] 

 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. 

 Each data sent over the network (using TCP or UDP) are formatted like this : 

 <pre> 
 <messageType:uint32><size:uint32><serializedMessage> 
 </pre> 

 Where : 
 * _messageType_ is a number which determine the message type, more information in the proto files. 
 * _size_ is the size of the following serialized message. 
 * _serializedMessage_ is the data serialized by protocol buffer. 


 h2. Links to resource 

 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. 

 _ayb://[<peer name>][:<file id>][:<shared id>/<folder>/<file>]_ 

 * <file id> : its the n first group of 4 bits of the m first chunk. 
 ** 20,87cace382f7371cd3fab3cb0a53b93b7cd9719f6 : 20 chunks of 2 groups. 
 ** 8,05649bcbf065e0d032ada540d4a749d98db055cf : 8 chunks of 5 groups. 
 * <peer name> : Not used to locate the resource, just an information for the user. 
 * <shared id> : Like peer id, contains only the beginning of the hash. 


 h3. Character encoding 

 TODO.. 

 h3. Examples 


 * _ayb://pierre:238e8634@dac4f75c/my%20movies/LOLCat.avi_ 
 * _ayb://pierre:238e8634@dac4f75c/my%20movies_ 
 * _ayb://2:2:4:d:3:2:4:2/LOLCat.avi_