Project

General

Profile

Protocol core-core Version 3 » History » Version 63

Greg Burri, 04/05/2011 10:03 PM

1 47 Greg Burri
h1. Protocol core-core
2 1 Greg Burri
3 62 Greg Burri
This page describes the protocol used by D-LAN for network communication between cores.
4 1 Greg Burri
5 49 Greg Burri
See source:application/Protos/core_protocol.proto for message details.
6 1 Greg Burri
7 21 Greg Burri
!network_protocol.png!
8 43 Greg Burri
9 46 Greg Burri
h2. Parameters
10 8 Greg Burri
11 54 Greg Burri
Most parameters will be stored as constants in their component. The given values below are just for illustrate with an example, they will be defined in a empiric manner later.
12 10 Greg Burri
13 9 Greg Burri
|_.Name|_.Value |_.Unit|_.Explanation/Comments|
14 60 Greg Burri
| _ChunkSize_ | 67108864 | [Byte] | (64 MB) |
15 1 Greg Burri
| _LanSpeed_ | 52428800 | [Byte/s] | (50 MB/s) |
16 60 Greg Burri
| _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 * 64 / 50 = 5 second |
17 61 Greg Burri
| _SwitchToAnotherPeerFactor_ | 1.5 | - | During the recheck of the peers to choose a better one the download rate of the candidate must be above the current * 1.5. |
18 58 Greg Burri
| _DownloadRateValidTime_ | 1500 / _LanSpeed_ = 30 s | [s] | 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. | 
19 57 Greg Burri
| _IMAliveFrequency_ | 10 s | [s] | The message _IMAlive_ is sent each 10s. |
20 1 Greg Burri
| _NbDownloadThread_ | 3 | - | Number of concurrent downloading thread. |
21
| _BufferSize_ | 65535 | [Byte] | (64 KiB). This buffer is used when reading or writing a file. |
22 59 Greg Burri
| _TCPSocketBufferSize_ | 65535 | [Byte] | (64 KiB). Used when data are received. See _QAbstractSocket::setReadBufferSize_. |
23
| _TCPPeerConnectionKeepAlive_ | 60 | [s] | (1 min). There's can be one or more connection to a certain peer, these connections are kept alive for a period of time. For each known peer there is a pool of connection.  |