Project

General

Profile

Actions

Protocol core-core Version 3 » History » Revision 26

« Previous | Revision 26/73 (diff) | Next »
Greg Burri, 07/09/2009 11:24 AM


Protocols

This page describes the protocols used by Aybabtu for network communication between cores and between core and GUI.

Core <-> Core

Notes pour plus tards

  • Le message HaveChunks doit être multicast et la réponse est un datagramme UDP. Il n'est pas possible de maintenir N-1 connexion TCP en permanence ou N est le nombre de peer. (à mesurer). DU coup ce message peut remplacer le IMAlive

See source:protos/network_protocol.proto for message details.

There is no more than one downloading from B to A. A peer which a download is active is setted as not free.

There is NbDownloadThread thread T. Each thread will choose a free chunk and download it. Here is the thread loop.

take the first file not finished -> f
for each chunk not download or not being downloaded takes the best one :
   c has a free peer -> p and p.downloadRate is the best.
   If there is some equals chunk, T will choose randomly among theses.
   If there is no free chunk then go to the next file.
   If the hash chunks of a file are unknown then the hashes are asked to the source, see the message _GetHashes _.

Parameters

Most parameters will be stored as constants in their component.

Name Value Unit Explanation/Comments
IMAliveFrequency 0.1 [Hz] The message IMAlive is sent each 10s.
ChunkSize 33554432 [Byte] (32 MB)
LanSpeed 52428800 [Byte/s] (50 MB/s)
TimeRecheckChunkFactor 4 - If the time to download a chunk exceeds TimeRecheckChunkFactor * ChunkSize / LanSpeed the peers are rescanned to choose a better one (better download rate). For example : 4 * 32 / 50 = 2.6 second
SwitchToAnotherPeerFactor 1.5 - During the recheck of the peers to choose a better one the other download rate must be above the current * 1.5.
DownloadRateValidTime 1500 / LanSpeed = 300 s [s] (5 min). The download rate of a peer is only valid during this time after its last update. After that its rate is set to the maximum.
TimeBetweenChunksUpdate 500 / LanSpeed = 10 s [s] Each 10 s a daemon will scan the NumberOfChunkToUpdate first chunks from the first queued downloads to know which peer has which chunk.
NumberOfChunkToUpdate 100 * LanSpeed / ChunkSize = 156 - The first 156 hash chunks (3 kB) will by send periodically to each peer. See message HaveChunks in the proto file.
FindTimeout 15 [s] A search request is abandoned after 15 seconds from the start of the request. See message Find.
GetHashesTimeout 200 [s] Timeout for the message GetHashes.
GetChunkTimeout 10 [s] Timeout for the message GetChunk.
HaveChunksTimeout TimeBetweenChunksUpdate = 10 [s] Timeout for the message HaveChunks.
GetEntriesTimeout 10 [s] Timeout for the message GetEntries.
NbDownloadThread 3 - Number of concurrent downloading thread.
BufferSize 1048576 [Byte] (1MB). This buffer is user when reading or writing a file.
TCPSocketBufferSize 33554432 [Byte] (32Mo). Used when data are received. See QAbstractSocket::setReadBufferSize.

Core <-> GUI

Updated by Greg Burri over 15 years ago · 26 revisions