Analysis of Load Balancing Algorithms in P2P Streaming Yongzhi Wang, Tom Z. J. Fu and Dah-Ming Chiu Dept. of Information Engineering The Chinese University of Hong Kong {wyz107, zjfu6, dmchiu}@ie.cuhk.edu.hk Abstract— In unstructured P2P content distribution systems, the most important algorithms to ensure optimal flow of content along multiple dynamically created distribution trees are piece selection algorithms and load balancing algorithms. This paper models practical load balancing algorithms and derive a number of insights. I. INTRODUCTION Peer-to-peer (P2P) content distribution, whether streaming or file downloading, relies on one or more (explicit or implicit) distribution trees from the source to all the receivers (peers). By distributing the content via multiple trees, all peers can contribute to the process which is the secret of why P2P systems scale. Of course, this is based on the assumption that the bottleneck of the distribution system is at the peers’ access links rather than in the transit network, a reasonable assumption up to certain scale. The difference between streaming and downloading is that the former needs to achieve a given playback rate whereas the latter means best-effort. In steaming, the content has deadlines to meet, so the delivery system needs to take that into consideration. Other than that, streaming is an easier problem than downloading when the total bandwidth capacity of the multiple distribution trees is abundant (or at least adequate) compared to the playback rate. In this paper, we focus on the P2P streaming problem. Broadly speaking, there are two types of P2P systems: structured versus unstructured. These refer to the two dif- ferent approaches of building and maintaining the multiple distribution trees from the source to all the peers. In the structured approach, the trees are built explicitly - each peer knows its role (or position) in each tree it belongs to. Since peers come and go, maintaining these trees becomes complicated. In the unstructured approach, trees are not built explicitly, but rather from an on-demand basis. Each peer keeps track of a subset of other peers as neighbors. At any moment, each peer tries to stream a chunk of content from a subset of neighbors who have this chunk. The local peer can request different pieces of the chunk from different neighbors at the same time. Thus, each piece travels through potentially a different tree to reach all peers. While building distribution trees in this manner seem rather chaotic, it works incredulously well in many practical systems (such as BitTorrent [1] and PPLive [3]). Theoretically, the throughput limit of such multiple-tree P2P content distribution systems can be established via fluid approximation. Namely, the pieces are assumed to be small so that each peer is doing cut-through forwarding, without wasting any bandwidth in the process. If all peers form a full mesh so that there is no constraint on what trees to build, the throughput must be limited by R min(C 0 , n i=0 C i n ) where C 0 is the uplink bandwidth of the source, and C i ,i> 0, is the uplink bandwidth of each peer respectively [7], [8]. When there are constraints to the distribution trees, e.g. when the peers do not form a full mesh, or when there is degree bounds to each node of the tree, the problem is addressed in [15], [14]. In practice, the performance of a multiple-tree P2P con- tent distribution system depends on the algorithms used to implement tree construction and transmission scheduling. Such algorithms are distributed, involving the following subalgorithms at each peer: 1) find a set of neighbors, typically with the help of a tracker server and some randomization; 2) determine a chunk to download, typically based on knowledge of neighbors’ content and what is missing locally; 3) request one or more neighbors for different pieces of the selected chunk These algorithms have already been engineered in various P2P systems (such as BT, PPlive and others) through re- peated experimentation and tuning. The question is, can we build reasonably simple models of these algorithms to help understand why they work and how to optimize them and make them more robust. Intuitively, optimal throughput can be achieved if the subalgorithms can maintain these two invariants: a) A peer’s neighbors have chunks the local peer needs b) A peer’s neighbors have enough uplink bandwidth to satisfy the local peer’s playback rate. Roughly speaking, the first invariant is achieved by chunk selection; whereas the second invariant achieved by load balancing. The chunk selection algorithm has been studied in [1], [12], [13]. The key insight is to give sufficient priority to distributing the rare chunks which are those that have not propagated far along the multiple trees yet. In the streaming case, chunks also have urgency, so the priority should be set taking both rarity and urgency into consideration [12].