Project

General

Profile

Protocols » History » Revision 14

Revision 13 (Greg Burri, 12/11/2010 01:12 AM) → Revision 14/26 (Greg Burri, 02/27/2011 04:35 PM)

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><senderId:20*uint8><serializedMessage> <messageType:uint32><size:uint32><senderId:28*uint8><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. 
 * _senderId_ is the sender id. 
 * _serializedMessage_ is the data serialized by protocol buffer. 

 The first three items is the header and is exactly 36 bytes long. 



 h2. Links to resource (DRAFT) 

 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. 

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

 * <peer name> : Not required and not used to locate the resource, just an information for the user. 
 * <file id> : its the n first group of nibble of the m first chunk where _n * m = 40 nibbles_ (20 octets). 
 ** 20,87cace382f7371cd3fab3cb0a53b93b7cd9719f6 : 20 chunks of 2 nibbles. 
 ** 8,05649bcbf065e0d032ada540d4a749d98db055cf : 8 chunks of 5 nibbles. 
 * <shared id> : Contains only the beginning of the hash. 


 h3. Character encoding 

 TODO.. 

 h3. Examples 

 * _ayb://20,87cace382f7371cd3fab3cb0a53b93b7cd9719f6_ 
 * _ayb://pierre:20,87cace382f7371cd3fab3cb0a53b93b7cd9719f6_ 
 * _ayb://pierre:20,87cace382f7371cd3fab3cb0a53b93b7cd9719f6:dac4f75c/my%20movies/LOLCat.avi_ 
 * _ayb://pierre:dac4f75c/my%20movies/LOLCat.avi_ 
 * _ayb://pierre:dac4f75c/my%20movies_