Project

General

Profile

General approach » History » Version 5

Greg Burri, 04/05/2011 11:19 PM

1 1 Greg Burri
h1. General approach
2
3 5 Greg Burri
h2. Generalities 
4
5
6 1 Greg Burri
Each file the user want to share is cut sequentially in pieces called _chunk_. Each chunk has the same size except the last one which can be smaller.
7
8 2 Greg Burri
For each chunk there is a footprint called _hash_ which identify the chunk. We admit that two chunks with the same hash contains the same data. The hash is computed with a cryptographic hash function like SHA-1.
9
10 1 Greg Burri
11 5 Greg Burri
h2. To know who are the other peers
12
13
Each peer sends periodically a message to tell to the other peers that it exists. This message can contain different information like the peer name, the amount of sharing data etc. Multicast UDP is use to broadcasting the message to all other peers simultaneously.
14
15
16
h2. Browsing 
17
18
Remote entries can be browsed by asking the content of a given remote directory. A listed file can contain one or more of its hashes.
19
20
There is a special case which the peer doesn't know about remote entries and wants to retrieve the root directories.
21
22
23
h2. Search for entries (by terms)
24
25
A multicast UDP datagram is sent to all other peer with the searched terms. The remote peers which have one or more matched entry will send them back with a unicast UDP datagram.
26
27
A file result can contain on or more of its hashes.
28
29
30
h2. Download
31
32
A chunk can only be downloaded if we know its hash. The hashes associated to a specific file can be explicitly asked. If the remote peer doesn't know the hashes of one of its file when they are asked it will compute these hashes on the fly and send them one by one as soon as possible.
33
34 3 Greg Burri
The list of the files to download is ordered by the user, thus the top files must be downloaded first. We will try to know first the hashes of the top files. As soon as we know a hash we can try to download the associated chunk. There can be many parallel downloads but only from different remote peers. The number of parallel downloads is limited.
35 4 Greg Burri
36 3 Greg Burri
To choose a chunk to download we will take the first file having at least one un-downloaded chunk which has at least one free peer, then among theses chunks we will choose the one which have the minimum number of peer (rarest part first), if there is some eligible chunk we choose randomly.
37 4 Greg Burri
38 3 Greg Burri
To known which remote peer has which wanted chunk we asked periodically to all remote peers if they have the next chunks we want to download by sending them the corresponding hashes. The number of hash sent is limited. This can be achieved with with multicast UDP.
39 1 Greg Burri
40 5 Greg Burri
To initiate a download we ask a remote peer by sending a hash and an offset relative to the beginning of the chunk.
41 1 Greg Burri
42 5 Greg Burri
43
h2. Communicate by chatting
44
45 3 Greg Burri
h2. Glossary
46 1 Greg Burri
47 5 Greg Burri
Remote <thing>: 
48
An entry:
49 3 Greg Burri
A file:
50 1 Greg Burri
A peer:
51 3 Greg Burri
A free peer:
52 5 Greg Burri
A peer:
53 3 Greg Burri
A chunk:
54
A hash: