Among all peer-to-peer (P2P) systems, BitTorrent seems to be the most prevalent one. This success has drawn a great deal of research interest on the system. In particular, there have been many lines of research studying its scalability, performance, efficiency, and fairness. However, despite the large body of work, there has been no attempt mathematically to model, in a heterogeneous (and hence realistic) environment, what is perhaps the most important performance metric from an end user’s point of view: the average file download delay. In this paper we propose a mathematical model that accurately predicts the average file download delay in a heterogeneous BitTorrent-like system. Our model is quite general, has been derived with minimal assumptions, and requires minimal system information. Then, we propose a flexible token-based scheme for BitTorrent-like systems that can be used to tradeoff between overall system performance and fairness to high bandwidth users, by properly set...