Skip to content

Commit

Permalink
Docs at CacheTorrent.
Browse files Browse the repository at this point in the history
  • Loading branch information
danalex97 committed Jun 20, 2018
1 parent 308dbed commit 07d89c7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions docs/cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,22 @@

![ ](pics/cache.png)

The general idea of the **CacheTorrent** protocol is assigning the role of leaders to a percent of the peers. Each Leader will act as a unidirectional cache for downloading in each autonmous system. On one hand, a Follower will have to connect to a Leader in order to download a piece. On the other hand, a Follower can upload directly to another Leader in a different autonmous system.
The general idea of the **CacheTorrent** protocol is assigning the role of leaders to a percent of the peers. Each Leader will act as a unidirectional cache for downloading in each autonomous system. On one hand, a Follower will have to connect to a Leader in order to download a piece. On the other hand, a Follower can upload directly to another Leader in a different autonomous system.

### Implementation

We extend the BitTorrent protocol by adding components on top of it. We decorate a BitTorrent **Peer** as follows:
- **Peer** - a CacheTorrent wrapper over a BitTorrent peer
- **Peer** - a CacheTorrent wrapper over a BitTorrent peer; it has a *node* filed
- **Leader** - a wrapper over a BitTorrent peer and it can sit on top of a *node* field
- **Follower** - a wrapper over a BitTorrent peer and it can sit on top of a *node* field

The **Follower** does not have many modifications, having less capabilities. The **Leader** replaces has the following components:
- **CacheDownload** - a Download components which forwards uses a **Forwarder** and a **Picker**
- **CacheUpload** - an upload component which uploads only if it has the piece
- **Picker** - a wrapper over a BitTorrent Picker which selects a piece for a Leader by taking into consideration the requests made by Followers
- **Forwarder** - a structure which forwards messages received by a Leader towards its followers

To see more implementation details, take a look at the **godoc**.

### Message Types

Expand Down

0 comments on commit 07d89c7

Please sign in to comment.