BarterCast
BarterCast is a protocol to exchange the altruism levels of peers. Altruism is defined as the amount of uploading versus downloading of a person.
Build on top of BarterCast is the BitCounting algorithm which divides the world into good and bad peers. Good peers have Video on Demand, bad peers do not.
Algorithms
The various parts:
- LocalCounters accounting of exchanged bytes
- ExchangeStore storages in a database
- BarterCast exchange of this information
- BitCounting combine the LocalCounters? info with BarterCast info
- TopPeers a list of the most active peers in the past month
- SuperTrust? determine if there are conflicts in the BitCounting information; thus good/bad peers
LocalCounters store the number of bytes uploaded to and downloaded from every encountered Tribler peer. The PermID of a peer encountered during a BitTorrent transfer is determined using an IP2Permid reverse lookup table. The local counters are fully implemented in /abc/branches/michel/tribler-4.0.3rc3-bartercast.
ExchangeStore are the three Berkley DB's for permanent storage. First is the IP2Permid lookup table. Second is the MyBarterHistory? table which stores the exchanges between you and others, e.g. LocalCounters info. Third, is the BarterHistory? table which stores what other tell you about exchanges. This third database is easily polluted. The timestamp is used to keep track of the last time this information was updated. The BarterHistory? database can easily grow huge. To keep this database from exploding we use a simple approach for Tribler V4.1: remove entries older then 1 month. For easy implementation the database is sorted by time and upo a write any old records are purged. MyBarterHistory has no size limit, as only very active Tribler users will have both a large history and large hard disk.
MyBarterHistory :
timestamp barter partner Uploaded traffic Downloaded traffic
Unix format PermID Amount in KBytes Amount in KBytes
BarterHistory :
timestamp from peer towards peer Uploaded traffic Downloaded traffic
Unix format PermID PermID Amount in KBytes Amount in KBytes
BarterCast is the algorithm which is closely tied to BuddyCast3 to exchange this information. Each peer exchanges the information from MyBarterHistory after a BuddyCast message has been exchanged and both peers support the BarterCast extension; Tribler V4.1 and higher. Thus information is exchanged with a peer at BuddyCast3 speed, between once every 5 and 60 seconds.
BarterCast message consists of at most 20 entries. The first 10 entries are the peers with the most Upload+Download traffic. The other 10 entries are the latest encountered Tribler peers. For each 20 entries we exchange the following information:
barter partner Uploaded traffic Downloaded traffic
PermID Amount in KBytes Amount in KBytes
Note that no difference exists in the wire protocol for the top 10 most active peers and the top 10 most recent peers (in the past hour ?). This idea from Jie hopefully simplifies implementation.
Upon receiving such a BarterCast message, a peer replies with it's own BarterCast info. Thus this is a two-way information exchange. The peer who initiated the BuddyCast message is also the one to send the BarterCast message. All traffic is measured in absulute amounts since Tribler was installed, thus existing information from one peer about another peer can be overwritten. BarterHistory only stores information which is directly obtained communicating with from peer. This table thus contains information as told and experienced by others directly.
BitCounting algorithm reads the information from both MyBarterHistory and BarterHistory to calculate aggregate amounts of exchanged bytes. This is simply a summation of all traffic and filtering of double sided information. Double sided info means that BasterHistory.db contains the info from both the sender and receiver.
SuperTrust? is the envisioned algorithm for checking the integrity of the BarterHistory info. By forming a graph of exchanges it is possible to detect inconsistencies. For Tribler V4.1 there will be no security checking for pollution. For Tribler V4.2 perhaps the IP subnet of the from peer should be added to BarterHistory? to detect white whashing.
TopPeers is the visualization of BitCounting in the GUI. Perhaps in the profile screen of Tribler we show the MyBarterHistory? and in another screen the most active peers of the past month.
Implementation
Current stage: BarterCast framework with BitCounting, messaging and bartercast db management is implemented. It has to be tested and can then be considered to include in production code.
Attachments
- bartercast.pdf (105.6 kB) - added by pouwelse on 01/30/08 19:59:31.
