Friday, December 28, 2007

Bittorrent Principle

Over the last few days i have been downloading quite a bit using bittorrent and optimally using my Home 500 plan of BSNL. Now i was rather intrigued by how this whole thing works. They have various parameters which are displayed but what constitute the fundamental means of co-operation in torrent. Though i did not see any one paper on that, i have run through lot of comments and opinions in different discussion sites. So this is my finding.

Bittorrent works on tit-for-tat scheme. That is, the more willing you are to upload the more download is allowed. It has an inbuilt mechanism for randomizing the selection so that there is no one congested seed or peer. Another concept which is in vogue in bittorrent is the concept of upload to download ratio. Ideally this should be one. But this is just a parameter to find how altruistic you are nothing to do with how much you can download or what the average download speed is. If it was that way, then all the ADSL2+ guys like BSNL Home 500 plan.

In actual scenario, depending on the distance of your DSL modem to the central DSLAM (DSL access multiplexer), technology allows for 24 Mbps download and 8 Mbps upload. So even the best altruistic guy in a unlimited plan with no restriction of upload, download speeds can best achieve a ratio of 25%. So ratio cannot be a means of the altruistic nature.

So if you do not restrict your upload speed you can get a better download speed. And all other parameters in bit torrent is useless as far as you download rate are concerned.

Tit-for-Tat- Is it the best strategy?
As a foot note i would like to add how this strategy is considered best by Nature.

Is this the best strategy? It is seen that nature also have converged on a tit-for-tat strategy for many of the natural phenomena. For example, how many times you have seen two dogs screaming at each other but never attacking, as an attack can hurt both. On the other hand, there can be some other advantages like getting a finite amount of food (if shared then both will die) or getting a mate. So if there is a clash in aspirational values compared to survival value, nature have hardwired all the living being to select the latter. So it may be fine to fight for food but may not be for mate. Also through your experience (which is seeing the opponent in action over a period of time) you can just repeat the strategy your opponent did last time and that can be a optimal strategy. This is also hard wired as an optimal strategy else the poor mate would be alone!!

So this assumes my strategy is dependent on the opponent and vice versa, but then this is a chicken and egg problem!! How do you break it? Randomly!! and the one who breaks this vicious circle is a leader (up to the leader to decide if he has to be good or bad) and then the opponent is a follower. As leader randomizes the algorithm, his strategy is always risky and hence there are very few leaders and lots of followers (all the peers and leachers in torrent)!! Followers are nature configured, leader is the randomizer in that. So leader (as in the original seed in bittorrent) is the initiator and then based on his start the whole cycle may end up in a good or bad state.

For more on this may be spend some time with the fascinating world of game theory!!

No comments: