<<

JOURNAL OF NETWORKS, VOL. 9, NO. 7, JULY 2014 1721

Optimal Rate Allocation for ISP-friendly P2P VoD Systems

Yun He, Zhongyang Xiong, and Xiaolin Tan Department of Computer Science, Chongqing University, Chongqing 400044, Email: {heyun, zyxiong, allen_txl}@cqu.edu.cn

Abstract—The rapid growth of Peer-to-Peer (P2P) -on- down P2P applications [7], in turn leading P2P content Demand (VoD) applications has posed significant pressure providers into an arms race to evade restrictions. on both content providers and Internet Service Providers To alleviate the aforementioned tussle, several recent (ISPs). In this paper, we focus on rate allocation algorithms studies [8-13] have proposed locality-aware neighbor which not only improve the streaming performance of P2P selection to make P2P systems more ISP-friendly. The VoD systems but also cut down on inter-ISP traffic. We first propose two centralized rate allocation algorithms which basic idea is to direct peers to select adjacent neighbors in serve as the benchmarks: one is Server-First Optimal (SFO) the same ISP domain when the overlay connections are algorithm that takes minimum server load as the first order established. Although locality-aware neighbor selection objective, and the other is Locality-First Optimal (LFO) has been shown to be effective in reducing inter-ISP algorithm that takes minimum inter-ISP traffic as the first traffic, it may prevent peers from utilizing idle upload order objective. By introducing network flow theory, SFO bandwidth resource at the remote peers. Such resource is and LFO can be solved as a series of maximum or min-cost usually critical to the streaming performance of P2P VoD flow problems. Then we propose a distributed rate systems, as it helps the peers maintain smooth playback allocation algorithm which utilizes a novel hybrid neighbor and combat user churn. selection strategy and models the design goals as a multi- objective optimization problem. Through simulation studies, For most network environments, the peers’ upload we show that our algorithms substantially outperform bandwidth is the most important resource due mainly to traditional and state-of-the-art approaches. the widespread deployment of asymmetric access links, such as ADSL and cable modem connections [14, 15]. In Index Terms—P2P, Video-on-Demand, Rate Allocation, ISP- P2P VoD systems, it is difficult for younger peers to friendly reciprocate older peers who have started watching the same video earlier because of the lack of playback synchronization among users [16]. A recent measurement I. INTRODUCTION study [17] has shown that more than half of the video Following the flourish of P2P live streaming, large- chunks may still need to be supplied from the media scale P2P VoD streaming has become one of the most server. If the locality-aware neighbor selection popular Internet applications. There are a number of P2P mechanism is employed, the case may be further VoD systems that have been successfully deployed over exacerbated as the server burden will increase. the Internet, such as PPLive VoD [1], [2] and Therefore, an ideal traffic control mechanism is needed Funshion [3]. The major advantage of the P2P for P2P VoD systems to achieve the tradeoffs between architecture is that by utilizing the distributed resource of the inter-ISP traffic and streaming performance. In this participating peers, the system achieves better robustness paper, we propose several rate allocation algorithms that and scalability than the traditional client-server fulfill the following design goals and achieve the architecture. As recently reported in [4, 5], more than tradeoffs among them if there is any conflict. hundreds of thousands of users can be simultaneously  Low server load: From the viewpoint of content participating in these P2P systems. providers, the system with low server burden has Although P2P solutions can provide highly efficient great scalability and cost benefits. content distribution services, they have posed  Low inter-ISP traffic: From the viewpoint of ISPs, unprecedented pressure on ISPs by generating a P2P applications should be carefully designed to tremendous amount of inter-ISP traffic. According to an constrain traffic within ISPs’ boundaries. Internet study report by IPOQUE [6], P2P applications  High peer prefetching: To improve user perceived account for approximately 73% of total Internet traffic service quality, upload bandwidth of peers should worldwide. There exists a serious topology mismatch be fully utilized to allow VoD users to download problem between the P2P overlay network and the faster and cache video content for future use. physical underlay network, which significantly increases Note that optimizing the three goals simultaneously is ISPs’ operational costs. It is not surprising that a number a difficult task. For example, reducing the inter-ISP of ISPs have attempted to detect, throttle, suppress or shut traffic of the system may make the download rates of some peers drop below their required playback rates. This

© 2014 ACADEMY PUBLISHER doi:10.4304/jnw.9.7.1721-1731 1722 JOURNAL OF NETWORKS, VOL. 9, NO. 7, JULY 2014

may increase the server load as these peers have to selection strategy is proposed in [11], where each peer download video data from the media server directly. Thus, chooses the majority of its neighbors from the same ISP we make a general assumption that reducing server load domain, and only a few from other ISP domains. Li et al. and inter-ISP traffic are more important than increasing [12] propose a novel neighbor selection algorithm called peer prefetching when the required playback rate is UTAPS, in which each peer selects neighbors based on satisfied, as peers gain little utility from having a round trip time (RTT) and hop count information by download speed much higher than the necessary to utilizing the knowledge of underlying topology. In preserve stream continuity [18]. Precisely, the TopBT [13], each peer utilizes lightweight pings or contributions of this paper can be summarized as follows: traceroute probes to its connected neighbors periodically 1) To minimize server load, minimize inter-ISP to obtain corresponding link hops or AS hops. The above traffic and maximize peer prefetching in a mechanisms have been shown to be effective in reducing sequential manner, we propose two centralized inter-ISP traffic and beneficial for the ISPs. However, the rate allocation algorithms: one is Server-First pure locality-aware neighbor selection prevents peers Optimal (SFO) algorithm which takes minimum from utilizing idle upload bandwidth resources at the server load as the first order objective, and the remote peers, and hence may degrade the streaming other is Locality-First Optimal (LFO) algorithm performance of P2P VoD systems. which takes minimum inter-ISP traffic as the first A simple random neighbor selection scheme is likely order objective. By introducing network flow to stress the older peers and waste network bandwidth in theory [19], we show that SFO and LFO can be the P2P VoD service. To alleviate the server load, some solved as a series of maximum or min-cost flow researchers have suggested that the design of neighbor problems. The two centralized algorithms serve selection mechanism should consider the load balance of as benchmarks for our later comparison study. peers in the system. The iPASS [20] adopts a neighbor 2) We then propose a distributed rate allocation selection strategy based on the buffering progresses of algorithm called Improved Weighted Sum with peers to obtain high peer bandwidth utilization with low Hybrid Neighbor selection (IWSHN), which maintenance cost. Moraes et al. [21] proposes a lifetime- utilizes a novel hybrid neighbor selection strategy based neighbor selection mechanism, where each peer and models the tradeoffs among the server load, chooses other peers with close lifetimes as its neighbors inter-ISP traffic and peer prefetching as a multi- to increase the probability of finding chunks of interest. objective optimization problem. The objective Wen et al. [22] propose an efficient request peer selection function of the optimization problem is the mechanism called CPF (Closest Playback-point First), in weighted sum of the above three design goals. which each peer sends the download request to the 3) We conduct simulation studies on our centralized neighbor that has the smallest playback-point difference and distributed algorithms, and compare them with itself. A similar request peer selection mechanism with traditional and state-of-the-art approaches. called LPP (Least Loaded Peer) is proposed in [23]. In The simulation results confirm the effectiveness this method, each peer sends the download request to the of our proposed algorithms. neighbor with the shortest queen size, among those that The rest of this paper is organized as follows. In have the needed chunk. However, the above four studies Section 2, we survey the related works and present a do not take inter-ISP traffic into consideration. preliminary description of network flow theory. Then, we Among others, the studies by Yu et al. [24] and Wang present the centralized rate allocation algorithms in et al. [25] are closely related to ours. In [24], the authors Section 3 and the distributed algorithm in Section 4. In propose a centralized rate allocation framework for P2P Section 5, illustrative simulation results are presented. VoD systems to achieve server stress minimization when Finally, the paper is summarized in Section 6. the playback continuities of users are guaranteed. Their framework is also based on the network flow theory and II. RELATED WORK AND PRELIMINARIES the maximum network flow problem. However, the centralized algorithm that they propose in the study aims A. Related Work only at minimizing server load, whereas our SFO and In recent years, ISP-friendly P2P applications have LFO algorithms are proposed to achieve the three design attracted lots of research activities. Aggarwal et al. [8] goals mentioned in Section 1. propose a cooperative solution where ISPs help P2P In [25], the authors propose a distributed rate systems by offering a service called “oracle”. The oracle allocation algorithm called Weighted Sum (WS) to assists in the neighbor selection of joining peers by minimize inter-ISP traffic for P2P VoD systems without ranking potential neighbors according to certain criteria, much impact on streaming performance. They formulate such as AS hops or geographical information. Xie et al. the problem using an optimization framework that allows [9] propose a similar solution called P4P, where each ISP a flexible tradeoff between server load and inter-ISP deploys “iTracker” as portals operated by network traffic. However, there are three main differences providers to advertise preferred paths to P2P applications. between their work and ours. First, they do not design the The Ono plugin [10] utilizes a locality-aware neighbor centralized heuristic algorithms that can serve as selection strategy based on the information collected from benchmarks for comparison. Second, their WS algorithm existing Content Delivery Networks (CDNs). To enhance is based on random neighbor selection and only achieves traffic locality of BitTorrent systems, a biased neighbor

© 2014 ACADEMY PUBLISHER JOURNAL OF NETWORKS, VOL. 9, NO. 7, JULY 2014 1723

very coarse tradeoff tuning, whereas our IWSHN peer j obtains from peer i. Then the aggregate download algorithm utilizes a hybrid neighbor selection and can rate peer j obtains from other peers can be expressed as provide much finer tradeoff tuning. Third, their work xxj i i, j . does not take into account the inter-ISP traffic from the j We assume that the dedicated media servers have media server to peers, which may lead to high server unlimited upload capacity and can guarantee the real-time burden in some cases. streaming requirements of all peers. If a peer cannot In [26], the authors propose an upload bandwidth obtain adequate download rate from other peers, it will allocation mechanism to achieve the tradeoff between download content from the media server directly to make inter-ISP traffic and P2P streaming performance by using up for the deficit. Therefore, minimizing server load of the Goal Attainment method [27]. However, the authors the system can be expressed as the following do not consider the dynamics of their algorithm and only optimization problem: apply it to optimize a quite small system with less than 20 peers. Therefore, how efficient of their algorithm for a min   max 0, Rx   jN  j  large dynamic system is unknown. xij, (3) s.t. x U ,  i  N .  j i, j i B. Preliminaries i According to the network flow theory, a network is a directed graph G = (V, E) where V is the set of vertices Peers participating in the P2P system may reside in and E is the set of edges. There are two distinguished different ISP domains. Let  be the set of peers that vertices, s and t of G, called the source and sink, j reside in the same ISP domain as peer j and can upload respectively. The source has no incoming edges and the sink has no outgoing edges. Each edge e has at least one the requested content to peer j. Let j be the set of peers weight, the capacity c(e), which means the bound on that reside in the same ISP domain as peer j and can amount of flow that can go through this edge. download their needed content from peer j. It is clear that A flow f for the network flow graph is an assignment j j, jj and ij jj. of a value f(e) to each edge e that satisfies the capacity Note that the P2P content provider may deploy rule and conservation rule [19]. The value of a flow f, distributed media servers in more than one ISP domain. denoted by | f |, is the total flow from the source, which is Let NG be the set (nG be the number) of peers whose local the same as the total flow into the sink. That is, ISP deploys the media server. Similarly, let NB be the set (nB be the number) of peers whose local ISP does not f f()() e f e (1) deploy the media server. We make a simple assumption e E()() t e E s that N= NG + NB and n= nG + nB. where E−(v) and E+(v) are the incoming and outgoing The inter-ISP traffic caused by the download process edges of vertex v, respectively. A flow for a network flow of peer j can be expressed as graph is said to be maximum if its value is the largest of  x w max 0, R  x W (4) all flows. ji i,, j i j j j j In some network flow graphs, each edge e may have another weight, the unit cost h(e), which means the cost where wi, j and Wj represent the cost of getting each unit per unit of flow on this edge. The cost of a flow f is of rate from peer i to peer j and from the media server to defined as peer j, respectively. Since the concern of this paper is the inter-ISP traffic, not the transmission delay between peers H()()() f f e h e (2) eE or other latency-based metrics, we simply set wi, j =0 if peer i and peer j reside in the same ISP domain and wi, j A min-cost maximum flow of a network flow graph is =1 otherwise. We also set Wj=0 if peer jNG and Wj=1 if a maximum flow with the smallest cost. peer jNB. In this case, minimizing inter-ISP traffic of the III. CENTRALIZED ALGORITHMS system can be expressed as The P2P VoD system considered in this paper consists min  x w  max 0, R  x j N  i i,, j i j  j  N  j  of n participating peers and a (or more than one) xij, jB (5) dedicated media server. Denote N={1, 2,…, n} as the set s.t. x U ,  i  N .  j i, j i i of peers and Uj as the upload capacity of peer j. Without loss of generality, we only consider the upload bandwidth Similarly, maximizing peer prefetching of the system limitation in this paper. The media server stores a can be expressed as the following optimization problem: repository of to be streamed on demand with a constant playback rate R. max   max 0, xRj x  jN   When a peer decides to request the content, it can ij, (6) s.t. x U ,  i  N . download the content from other peers or the media  j i, j i i server. Let Φj be the set of peers that can upload the requested content to peer j, and j be the set of peers that A. Analysis for SFO Algorithm can download their needed content from peer j. We There are three design goals that SFO algorithm should clearly have iΦ j . Let x be the download rate j i i, j achieve:

© 2014 ACADEMY PUBLISHER 1724 JOURNAL OF NETWORKS, VOL. 9, NO. 7, JULY 2014

1. Minimizing server load of the system, which is 2 3 where {}xij, is an optimal solution of (8) and xij, is the the first order objective. download rate peer j obtains from peer i at the third stage 2. Minimizing inter-ISP traffic of the system, while of SFO. keeping the minimum server load unaffected. 1) First Stage of SFO This is the second order objective. We introduce the network flow theory to obtain the 3. Maximizing peer prefetching of the system, while optimal solution for SFO. Since any peer can serve other keeping the first two objectives unaffected. peers and get served from other peers at the same time, We will use network flow theory to solve SFO in three we split each peer i into two logical entities: a supplier l stages. Each stage achieves one objective by introducing i which only uploads content, and a consumer m which a maximum or min-cost flow problem. i only downloads content from suppliers. The first stage of SFO is to minimize server load of the At the first stage of SFO, we construct a network flow system. According to (3), we obtain that Θ is non- graph G1=(L, M, {s, t}, E1), where the vertex set L= {l1, decreasing in xi, j, i, jN when xj ≥R. Therefore, the l ,…, l } is the set of suppliers, vertex set M={m , solutions to 2 n 1 m2,…,mn} is the set of consumers, vertex s denotes the min  nR  x1 source, vertex t denotes the sink, and edge set E1 1 j N i  ij, j xij, (7) represents the edges connecting vertices. According to (7), s.t. x11 R ,  j  N ; x  U ,  i  N . the edges are constructed as follows: iji,, j  i j i ji 1. There exists an edge from s to each li (iN) with are a subset of those to (3) that minimize server load. capacity c(,) s lii U , which means the upload 1 capacity of peer i. Here, xij, is the download rate peer j obtains from peer i at the first stage of SFO. The difference between (3) and 2. There exists an edge from each mj (jN) to t with (7) lies in the constraints on aggregate download rate of capacity c( mj , t )  R , which means the each peer. This implies that the aggregate download rate maximum aggregate download rate of peer j at of each peer obtains from other peers cannot exceed the this stage. playback rate at the first stage. 3. If peer iΦj, there exists an edge from li to mj Denote Θmin as the minimum server load computed by with capacity c(,) lij m   , which means peer (7). By adding Θ as an additional constraint, min j can download the needed data from peer i with minimizing inter-ISP traffic for SFO at the second stage arbitrary rate. can be expressed as follows: Fig. 1 and Fig. 2(a) show an example of constructing min  w x22  w  1 x  n R the network flow graph G1 based on a system with 4 2  i,,,, j i j    i j i j B xij, j NG i  j j  N B i  j peers, 2 ISP domains and a media server residing in ISP 1.  22 Given the G1, a maximum flow f1 can be determined s.t. xi,, j R ,  j  N ; x i j  U i ,  i  N ; (8) ijji  by SAP algorithm [19]. We have the following result. 2 Proposition 1: The minimum server load for SFO is nR xij,   min . j N i  j  min nR  || f 1 . where x2 is the download rate peer j obtains from peer i  ij, Proof: Since is a maximum flow of G1, f1 (,) lij m  after the first two stages of SFO. is a solution to the following problem: Note that, because of the strict constraint on aggregate download rate of each peer, the upload capacities of peers max f f (,) m t f (,) l m j Nj  j  N  i  i j are not fully utilized after the second stage of SFO. By f(,) lij m j (10) s.t. f ( l , m ) R ,  j ; f ( l , m )  U ,  i relaxing this strict constraint, we can seek to maximize iji j  i j i ji peer prefetching while keeping the minimum server load and minimum inter-ISP traffic unaffected. Denote Гmin as which is equivalent to the minimum inter-ISP traffic computed by (8). By min nR f ( l , m ) adding Г as an additional constraint, maximizing peer j N i  ij min f(,) lij m j prefetching for SFO can be expressed as follows: (11) s.t. f ( l , m ) R ,  j ; f ( l , m )  U ,  i iji j  i j i ji max   x3 3 j N i  ij, j xij, By regarding f(,) lij m as , (7) and (11) are s.t. x23 x  U ,  i  N ;  j  i,, j i j i i equivalent, implying that is a solution of (7). 23 max 0,R xi, j  x i , j    min ; (9) Therefore, the minimum server load for SFO is j N i  j   nR  f( l , m )  nR  | f |. 23 minj N i  1ij 1 j wi,,, j x i j x i j  j N i  j 2) Second Stage of SFO  At the second stage of SFO, we construct a graph 23 max 0,R  x  x   . G2=(L, M, {s, t}, E2) by setting the unit cost as the second  i, j i , j  min j NBj i 

© 2014 ACADEMY PUBLISHER JOURNAL OF NETWORKS, VOL. 9, NO. 7, JULY 2014 1725

weight to each edge in E1 of graph G1. According to (8), 3) Third Stage of SFO the unit costs of edges are set as follows: At this stage, we construct a graph G3=(L, M, {s, t}, 1. The unit cost of the edge from s to li is set to E3), where E3 represents the edges connecting vertices.

h( s , li ) 0 . According to (9), the edges are constructed as follows: 2. The unit cost of the edge from mj to t is set to 1. There exists an edge from s to each li (iN) with capacity  , which means h( mj , t ) 0 . c32(,)(,) s li U i f s l i the surplus upload capacity of peer i. 3. If peer jNG and peer iΦj, the unit cost of the 2. There exists an edge from each mj (jN) to t with edge from li to mj is set to h(,) li m j w i, j . Note capacity c(,) m t   . This implies that the that up to playback rate R, every unit of 3 j bandwidth that peer j obtains from other peers is a aggregate download rate of peer j has no upper unit of bandwidth the media server can save. As limit at this stage.

jNG means that the residing ISP of peer j 3. If peer ij (jN), there exists an edge from li to deploys the media server, we set . mj with capacity c3 (,) lij m   . This implies that each peer can only download from upstream 4. If peer jNB and peer iΦj, the unit cost of the edge from l to m is set to h( l , m ) w 1 . neighbors residing in the same ISP domain to i j i j i, j avoid unnecessary inter-ISP traffic at this stage. Note that jNB means that inter-ISP traffic will Fig. 2(c) shows an example of constructing the be generated when peer j download content from  network flow graph G . A maximum flow f of G can the media server, thus we set . 3 3 3 be determined by SAP algorithm. Fig. 2(b) shows an example of constructing the graph Proposition 3: The maximum peer prefetching for G . By applying Cycle-canceling algorithm [19], the  2 SFO is  ||f when the server load and inter-ISP  max 3 maximum flow f1 determined at the first stage can be traffic are limited to Θmin and Γmin respectively.  transformed into a min-cost maximum flow f2 . Due to space limit, we omit the proof of this Proposition 2: The minimum inter-ISP traffic for SFO proposition. It is similar to the proof of Propositions 1.  In summary, if we set x f(,)(,) x y f x y as is min H() f 2  nB R when the server load is Θmin. i, j 2 i j 3 i j

Proof: As is a min-cost maximum flow of G1, the download rate peer j obtains from peer i, all of the  three aforementioned objectives of SFO can be achieved.  f2 (,) lij m  is a solution to the following problem:

min H ( f ) f ( l , m ) h ( l , m ) j N i  i j i j f(,) lij m j s.t. f ( l , m ) R ,  j ; f ( l , m )  U ,  i ; (12) iji j  i j i ji  nR  f( l , m ). min j N i  ij j

Since nBR is a constant, (12) is equivalent to

min  f ( li , m j ) w i,, j   f ( l i , m j )( w i j  1)  n B R f(,) lij m j NG i  j j  N B i  j s.t. f ( l , m ) R ,  j ; f ( l , m )  U ,  i ; (13) iji j  i j i ji  nR  f(,) l m min j N i  ij j

2 By regarding f(,) lij m as xij, , (8) and (13) are equivalent, implying that is a solution of (8). Therefore, the minimum inter-ISP traffic for SFO Figure 2. The network flow graphs for SOA: (a) G1, (b) G2, (c) G3. algorithm is . B. Analysis for LFO Algorithm There are three design goals that LFO should achieve: 1) Minimizing inter-ISP traffic of the system, which is the first order objective. 2) Minimizing server load, while keeping the minimum inter-ISP traffic unaffected. This is the second order objective. 3) Maximizing peer prefetching, while keeping the first two objectives unaffected.

Figure 1. The system with 4 peers and 2 ISP domains.

© 2014 ACADEMY PUBLISHER 1726 JOURNAL OF NETWORKS, VOL. 9, NO. 7, JULY 2014

We use network flow theory to solve LFO in three 5 6 where {}xij, is an optimal solution of (17) and xij, is the stages. Each stage achieves one objective by introducing download rates peer j obtains from peer i at the third a maximum flow problem. stage of LFO. The first stage of LFO is to minimize the inter-ISP 1) First Stage of LFO traffic of the system. According to (5), Γ is non- At this stage, we construct a graph G4=(L, M, {s, t}, decreasing in xi, j, i, jN when xj ≥R, and in xi, j, jNG, E4), where E4 represents the edges connecting vertices. ij and jNB, ij-j. Thus, the solutions to According to (14), these edges are constructed as follows:

441. There exists an edge from s to each li (i∈N) with min  xi,,,, j w i j  w i j  1 x i j  n B R x       ij, j N i  j  N i  capacity c(,) s l U , which means the upload G j B j (14) 4 ii s.t. x44 R ,  j  N ; x  U ,  i  N ; capacity of peer i.. iji,, j  i j i ji 2. There exists an edge from each mj (j∈N) to t with

capacity c4 (,) mj t R , which means the x4  0,  j  N ,  i  ; (15) i, j G j maximum aggregate download rate of peer j at the this stage. 4 xi, j0,  j  N B ,  i  j  j . (16) 3. If j∈NB and i∈j, there exists an edge from li to m with capacity c(,) l m   . This implies are a subset of those to (5) that minimize inter-ISP traffic. j 4 ij that only the peers in N can only download Here, x4 is the download rate peer j obtains from peer i B ij, content from the upstream neighbors residing in at the first stage of LFO. Equation (15) implies that each the same ISP domain at this stage. peer in NG cannot downloads content from other peers at  A maximum flow f4 of G4 can be determined by SAP this stage. Equation (16) implies that each peer in NB cannot download content from the upstream peers algorithm. We have the following result: residing in other ISP domains at this stage. In this case, Proposition 4: The minimum inter-ISP traffic for LFO  unnecessary inter-ISP traffic can be avoided. is min nB R  | f 4 |. Due to space limit, we omit the proof of this Denote min as he minimum inter-ISP traffic for LFO computed by (14). By adding it as an additional proposition. It is similar to the proof of Propositions 1. constraint, minimizing server load for LFO can be 2) Second Stage of LFO expressed as follows: At this stage, we construct a graph G5=(L, M, {s, t}, E5) where E5 represents the edges connecting vertices. 45 According to (17), these edges are constructed as follows: min  R  xi,, j  x i j  5 j N i  j  xij, 1. There exists an edge from s to each li (iN) with 4 5 4 5 (17)  s.t. xi,,,, j x i j  R ,  j ; x i j  x i j  U i ,  i ; ijji  capacity c54(,)(,) s li U i f s l i .

 2. There exists an edge from each mj (jN) to t with 4 5 4 5  xi, j x i , j w i , j   R    x i , j  x i , j    min   capacity c54 mjj,, t R f m t . j N i j j  N B i  j    

4 5 3. If jNG and ij, there exists an edge from li to mj where {}xij, is an optimal solution of (14) and xij, is the with capacity c5 (,) lij m   . download rate peer j obtains from peer i at the second 4. If jN and iΦ , there exists an edge from l tom stage of LFO. B j i j By relaxing this strict constraint on aggregate with capacity .  download rate of each peer, we can seek to maximize A maximum flow f5 of G5 can be determined by SAP peer prefetching for LFO while keeping the minimum algorithm. We have the following result: inter-ISP traffic and minimum server load unaffected. Proposition 5: The minimum server load for LFO is Denote  as the minimum server load of LFO  min min nR  | f 4 |  | f 5 | when the inter-ISP traffic is computed by (17). By adding as an additional min . constraint, maximizing peer prefetching for LFO can be Due to space limit, we omit the proof of this expressed as follows: proposition. It is similar to the proof of Propositions 1. max   x6 3) Third Stage of LFO 6 j N i  ij, j xij, At this stage, we construct a graph G6=(L, M, {s, t}, E6) s.t. x4 x 5  x 6  U ,  i  N ; where E6 represents the edges connecting vertices.  j  i,,, j i j i j i i According to (18), these edges are constructed as follows: 4 5 6 (18) max 0,R xi, j  x i , j  x i , j    min ; 1. There exists an edge from s to each li (iN) with j N i  j   4 5 6 capacity c6(,)(,)(,) s li U i  f 4 s l i  f 5 s l i .  xi,,,, j x i j x i j w i j j N i  j 2. There exists an edge from each mj (jN) to t with  capacity c6 (,) mj t   . max 0, R  x4  x 5  x 6    i, j i , j i , j  min j NBj i 

© 2014 ACADEMY PUBLISHER JOURNAL OF NETWORKS, VOL. 9, NO. 7, JULY 2014 1727

3. If ij (jN), there exists an edge from li to mj It is clear that F(xj) is a concave function. We adopt primal decomposition [28] to solve this convex with capacity c6 (,) lij m   . optimization problem with linear constraints. Denote Z as A maximum flow  of G can be determined by SAP i f6 6 the set of downstream neighbors of peer i. Then for peer i, algorithm. Then we have the following result. xi, j is initialized as Ui /|Zi| for j∈Zi and 0 otherwise. At Proposition 6: The maximum peer prefetching for each step, xi, j is updated as LFO is  ||f  when the inter-ISP traffic and server max 6   load are limited to  and  respectively.  min min xi,, j( T 1)  x i j ( T )   F x j ( T ) (21) Due to space limit, we omit the proof of this xij, proposition. It is similar to the proof of Propositions 1. where T is the iteration index, α>0 is the step size, and In summary if we set x f(,)(,) x y f x y i, j 4 i j 5 i j []  represents the nonnegative projection onto a feasible   f6 (,) xij y as the download rate peer j obtains from peer set. Because of the symmetry of the linear constraints, i, all of the three objectives of LFO can be achieved. projection onto the feasible set can be implemented as follows: C. The Performance of SFO and LFO Algorithms while x ( T ) U {  jZ i, j i Since the SAP algorithm for solving the maximum  i  z ( T ) number of downstream neighbors with x ( T ) 0; flow problem is ONM()2 and the Cycle-canceling i i, j foreach (jZ i ) algorithm for solving the min-cost flow problem can be x() T U  jZ i, j i 2 i if  xi,,,, j ( T ) 0 x i j ( T )  x i j ( T )  min x i j ( T ), ; } reduced to O( NM log N ) , where N is the number of zT() i vertices and M is the number of edges in the network Note that the objective function of (20) is either flow graph. Let n be the number of peer and m be the increasing or decreasing in xi, j depending on the values of number of links that established between the peers. Since parameters A and C. Intuitively, setting C>A will result in m≥n if every peer has at least one upstream neighbor, we a pure ISP-friendly solution that eliminates inter-ISP can assure that the time complexities of SFO and LFO traffic completely, and setting A>C will eliminate server 2 2 algorithms are O( nm log n ) and O() n m , respectively. load completely. No tradeoff point between the two extreme points exists. In order to make our distributed IV. CENTRALIZED ALGORITHMS algorithm to achieve a range of wide tradeoff points, we Given the complete knowledge of the system, SFO and will present hybrid neighbor selection in the next LFO algorithms can work well to minimize server load, subsection. minimize inter-ISP traffic and maximize peer prefetching B. Hybrid Neighbor Selection in a sequential manner. However in practice, we do not have a central server that can provide a global Early P2P VoD systems usually utilize random computation resource, which is implicitly assumed by the neighbor selection, where peers select and update their two centralized algorithms. Thus, we propose IWSHN, a neighbors at random. This method is inefficient due to the distributed rate allocation algorithm for P2P VoD systems. lack of playback synchronization among VoD peers [16]. In order to improve the performance of P2P VoD A. Improved Weighted Sum Algorithm systems, various biased neighbor selection mechanisms We first define a utility function F(xj) for any peer j in have been proposed, which can be broadly classified into terms of the aggregate rate obtained from all its upstream two categories. One is the locality-based neighbor neighbors. We put forward the linear weighting method selection [11-13], which directs peers to select adjacent to F(xj) based on the concept of multi-objective neighbors in the same ISP, aiming at reducing inter-ISP programming: traffic. The other is the load-balancing neighbor selection [20-22], aiming at achieving load balancing of peers and F( xj )  A  max 0, R  x j  B  max 0, x j  R thereby alleviating server load. However, neither the pure (19) locality-based neighbor selection nor the pure load- C  xi,, j w i j  max 0, R  x j W j i j  balancing neighbor selection can achieve the tradeoff between ISP-traffic and server load. where A, B and C are positive constants representing the Therefore, we propose a hybrid neighbor selection unit cost of server load, unit value of peer prefetching and mechanism which integrates the strength of both network unit cost of inter-ISP traffic, respectively. As mentioned locality and load balance. In this mechanism, each peer before, reducing server load and inter-ISP traffic are more selects upstream neighbors with the closest buffering important than increasing peer prefetching. We can progress with probability p, and selects upstream simply set A>B and C>B. To this end, the multi-objective neighbors in the same ISP domain with probability 1-p. optimization problem for rate allocation can be expressed That is, some neighbors are selected utilizing buffering as follows: progress-based neighbor selection, while the rest are max Fx ( ) determined utilizing locality-aware neighbor selection.  jN j xij, (20) s.t. x U ,  i  N .  j i, j i i

© 2014 ACADEMY PUBLISHER 1728 JOURNAL OF NETWORKS, VOL. 9, NO. 7, JULY 2014

C. Implementation Concerns capacity 600 Kbps, and high-bandwidth peers with In real implementation, our IWSHN algorithm can be upload capacity 1,200 Kbps. The fractions of low- solved by peers and ISPs together in a distributed manner. bandwidth, medium-bandwidth and high-bandwidth peers The key for peer i to carry out the update step is to are set to 60%, 30% and 10%, respectively. In our simulations, peers come from 15 different ISP receive the information about xj, Wj and wi, j for any peer j domains. Recent measurement study [29] has shown that ∈Zi. Since in P2P VoD systems two neighboring peers often exchange control information between each other, the ISP popularity (i.e., peer populations residing in different ISPs) follows the Mandelbrot-Zipf (MZipf) the information about xj can be transmitted from peer j to peer i in their periodic communications. If the ISP-P2P distribution in real-deployed systems. In our simulations, cooperation services such as oracle [8] or P4P [9] are we use MZipf distribution with skewness factor β1=1.33 and plateau factor β2=10 to simulate the ISP popularity: deployed, the information about Wj and wi, j can easily be 1/ (j   )1 obtained from ISPs. popular() j  2 1 1/ (j  2 ) D. Compared with Other Methods  1j 15 1) Baseline Method where j is the ID of ISP. In the default case, we assume In the baseline method, each peer utilizes random that the ISP 1 and ISP 2 deploy the media server, while neighbor selection mechanism and evenly divides its other ISPs do not. upload capacity among all downstream neighbors. Thus, the baseline method cannot achieve the tradeoffs among the three design goals. This is a typical design widely used in most P2P VoD systems. 2) WS Algorithm In study [25], the authors propose the Weighted Sum (WS) algorithm for distributed rate allocation:

 max B xj  ( A  B )  min( R , x j )  C  x i,, j w i j xij,  j N i  j (22) s.t. x U ,  i  N .  j i, j i i

However, their work has some drawbacks. First, the (a) WS algorithm utilizes the random neighbor selection and can only achieve very coarse tradeoffs among the three design goals. Second, the WS algorithm does not consider the inter-ISP traffic from the media server to peers. Setting C>A for this algorithm makes peers always download the content directly from the media server, which may lead to high server load.

V. SIMULATIONS In this section, we carry out a series of simulations to evaluate the performance of our proposed algorithms with the baseline and WS algorithms. These simulations are at the flow level as opposed to the packet level, which (b) means that we do not consider chunk scheduling and delays in packet transmission. A. Simulation Settings We simulate a viewing scenario where the parameters correspond to a typical VoD setting. At time 0, peers start joining the system according to a Poisson process with an arrival rate of 0.5 peers per second. The duration length and playback rate of the video are set to 1,800 seconds and R=500 Kbps, respectively. The sojourn time (in seconds) of peers staying in the system follows a uniform distribution on the interval [0, 1800]. Therefore, there are about 450 peers in the system at steady state. (c) To build a heterogeneous system, we use a 3-class bandwidth distribution: low-bandwidth peers with upload Figure 3. (a) Server load under default settings; (b) Inter-ISP traffic under default settings; (c) Peer prefetching under default settings capacity 300 Kbps, medium-bandwidth peers with upload

© 2014 ACADEMY PUBLISHER JOURNAL OF NETWORKS, VOL. 9, NO. 7, JULY 2014 1729

To evaluate the performance of IWSHN and WS system, respectively. From these figures, we have the algorithms, we consider two cases on the values of following results: parameters A, B and C. In the first case, we set A=2,  As the centralized algorithms, LFO algorithm B=0.5 and C=1, which means that the server load is more achieves minimum inter-ISP traffic and SFO costly than the inter-ISP traffic. In the second case, we set algorithm achieves minimum serve load. These A=1, B=0.5 and C=2, which means that the inter-ISP are the expected results. traffic is more costly than server load. Each peer typically  Among all distributed algorithms our proposed has no more than 6 upstream and 10 downstream IWSHN algorithm achieves the best performance, neighbors, and carries out the update step for distributed as it leads to lower server load and lower inter- rate allocation once per 30 seconds. For our IWSHN ISP traffic than the baseline and WS algorithms. algorithm, we set the hybrid probability p=0.5 as the  For the WS and IWSHN algorithms, setting A>C default value. leads to lower server load and setting C>A leads to lower inter-ISP traffic. Particularly, setting C>A for WS algorithm is inefficient as it does not take into account the inter-ISP traffic from the media server to peers. We find that WS(A=1, C=2) even results in higher server load than the baseline algorithm.

(a)

(a)

(b)

(b)

(c) Figure 4. (a) Server load under different values of p; (b) Inter-ISP traffic under different values of p; (c) Peer prefetching under different values of p

B. Simulations Results (c) First, we study the performance of different algorithms under the default settings. Fig. 3(a), (b) and (c) show the Figure 5. (a) Server load under different system sizes; (b) Inter-ISP traffic under different system sizes; (c) Peer prefetching under different server load, inter-ISP traffic and peer prefetching of the system sizes

© 2014 ACADEMY PUBLISHER 1730 JOURNAL OF NETWORKS, VOL. 9, NO. 7, JULY 2014

Next, we evaluate the performance of our IWSHN [7] J. Yan and X. Fan, “HFBP: Identifying P2P Traffic by algorithm under different values of the hybrid probability Host Level and Flow Level Behavior Profiles”, Journal of p. Fig. 4(a), (b) and (c) show the server load, inter-ISP Networks, vol. 8, no. 8, August 2013. traffic and peer prefetching of the system, respectively. [8] V. Aggarwal, A. Feldmann, and C. Scheideler, “Can ISPs By increasing this parameter, IWSHN gradually increases and P2P Users Cooperate for Improved Performance?”, SIGCOMM Computer Communication Review, vol. 37, no. inter-ISP traffic and decreases server load and peer 3, pp. 29–40, July 2007. prefetching, which shows its ability to achieve the [9] H. Xie, Y. R. Yang, A. Krishnamurthy, Y. Liu, and A. tradeoffs among the three design goals. Silberschatz, “P4P: Provider Portal for Applications”, In fact, we also evaluate WS algorithm with B=0.5 and ACM SIGCOMM 2008. varying values of A and C. When setting C=1, the server [10] D. R. Choffnes and F. E. Bustamante, “Taming the Torrent: load and inter-ISP traffic are respectively around 76 A Practical Approach to Reducing Inter-ISP traffic in P2P Mbps and 149 Mbps with the fluctuations of less than 5% Systems”, ACM SIGCOMM 2008. when the value of A varies from 1.5 to 10. Similarly, [11] R. Bindal, P. Cao, W. Chan, J. Medved, G. Suwala, T. when setting A=1, the server load and inter-ISP traffic are Bates and A. Zhang, “Improving traffic locality in bittorrent via biased neighbor selection”, IEEE ICDCS respectively around 157 Mbps and 125 Mbps with the 2006. fluctuations of less than 4% when the value of C varies [12] W. Li, S. Chen and T. Yu, “UTAPS: An underlying from 1.5 to 10. The simulation results show that WS topology-aware peer selection algorithm in BitTorrent”, algorithm can only achieve very coarse tradeoff tuning. International Conference on Advanced Information Finally, we vary the system size from 0 to 1,200 by Networking and Applications, 2008. adjusting the extern arrival rate of peers. Fig. 5(a), (b) and [13] S. Ren, E. Tan, T. Luo, S. Chen, L. Guo and X. Zhang, (c) respectively show the server load, inter-ISP traffic and “TopBT: A Topology-Aware and Infrastructure- peer prefetching of the system under different system Independent BitTorrent Client”, IEEE INFOCOM 2010. [14] Y. Huang, T. Z. J. Fu, D.-M. Chiu, J. C. S. Lui and C. sizes. Although the three performance metrics gradually Huang, “Challenges, Design and Analysis of a Large-scale increase as the system size increases for all algorithms, P2P-VoD System”, ACM SIGCOMM 2008. the server load and inter-ISP traffic for our algorithms [15] B. Cheng, X. Liu, Z. Zhang, H. Jin, L. Stein, and X. Liao, (IWSHN, SFO and LFO) increase at the slower rates than “Evaluation and Optimization of a Peer-to-Peer Video-on- those of the baseline and WS methods, which confirms Demand System”, Journal of Systems Architecture, 54(7) the effectiveness of our algorithms. pp. 651–663, 2008. [16] N. Parvez, C. Williamson, A. Mahanti and N. Carlsson, VI. CONCLUSION “Analysis of bittorrent-like protocols for on-demand stored In this paper, we focus on rate allocation algorithms media streaming”, ACM SIGMETRICS, 2008. [17] B. Cheng, X. Liu, Z. Zhang and H. Jin, “A Measurement for P2P VoD systems to fulfill three design goals and Study of a Peer-to-Peer Video-on-Demand System”, achieve the tradeoffs among them if there is any conflict: IPTPS 2007. minimizing the server load, minimizing the inter-ISP [18] L. D’Acunto, N. Andrade, J. Pouwelse and H. Sips, “Peer traffic and maximizing the peer prefetching. We first selection strategies for improved QoS in heterogeneous propose two centralized optimal algorithms: SFO that BitTorrent-like VoD systems”, IEEE ISM 2010. takes minimum server load as the first order objective, [19] M. T. Goodrich and R. Tamassia, “Algorithm Design: and LFO that takes minimum inter-ISP traffic as the first Foundations, Analysis and Internet Examples”, John Wiley order objective. By introducing network flow theory, we & Sons, 2002. show that SFO and LFO can be solved as a series of [20] C. Liang, Z. Fu, Y. Liu and C. W. Wu, “Incentivized Peer- Assisted Streaming for On-Demand Services”, IEEE maximum or min-cost flow problems. Next, we propose Transactions on Parallel and Distribution Systems, 21(9), IWSHN, a distributed rate allocation algorithm which September 2010. utilizes the hybrid neighbor selection and models the [21] I. M. Moraes and O. C. M. B. Duarte, “A lifetime-based tradeoffs among the three design goals as a multi- peer selection mechanism for peer-to-peer video-on- objective optimization problem. The simulation results demand systems”, IEEE ICC, 2010. show that our proposed algorithms substantially [22] Z. Wen, N. Liu, K. L. Yeung and Z. Lei, “Closest outperform the traditional and state-of-the-art approaches. Playback-Point First: A New Peer Selection Algorithm for P2P VoD Systems”, IEEE GLOBECOM, 2011. [23] Y. Yang, A. L. H. Chow, L. Golubchik and D. Bragg, REFERENCES “Improving QoS in bittorrent-like VoD systems”, IEEE [1] PPLive . INFOCOM, 2010. [2] Joost . [24] Q. Yu and D. Chen. Optimal Data Scheduling for P2P [3] Funshion . VoD Streaming Systems. In: IEEE ICPADS, 2010. [4] X. Hei, C. Liang, J. Liang, Y. Liu, and K. W. Ross, “A [25] J. Wang, C. Huang and J. Li, “On ISP-friendly rate Measurement Study of a Large-scale P2P IPTV System”, allocation for peer-assisted VoD”, ACM international IEEE Transactions on Multimedia, vol. 9, no. 8, pp. 1672– conference on Multimedia, October 2008. 1687, December 2007. [26] P. Yang and L. Xu, “On tradeoffs between cross-ISP P2P [5] R. Li, G. Gao, W. Xiao, and Z. Xu, “Measurement Study traffic and P2P streaming performance”, Computer on PPLive Based on Channel Popularity”, the Ninth Networks, 55(18):4033–4042, 2011. Annual Communication Networks and Services Research [27] F. Gembicki and Y. Haimes, “Approach to performance Conference (CNSR), 2011. and sensitivity multiobjective optimization: the goal [6] IPoque .

© 2014 ACADEMY PUBLISHER JOURNAL OF NETWORKS, VOL. 9, NO. 7, JULY 2014 1731

attainment method”, IEEE Transactions on Automatic he is pursuing his Doctoral degree at the Department of Control 20(6): 769–771, 1975. Computer Science in Chongqing University, Chongqing, China. [28] D. P. Palomar and M. Chiang, “Alternative distributed His current research interests include peer-to-peer networks, algorithms for network utility maximization: framework multimedia systems and cloud computing. and applications”, IEEE Transactions on Automatic Control, vol. 52, no. 12, pp. 2254–2269, December 2007. Zhongyang Xiong is a professor in computer architecture and [29] H. Wang, J. Liu and K. Xu, “On the Locality of vice president at the department of computer science, BitTorrent-based Video File Swarming”, USENIX IPTPS, Chongqing University, China. His research interests are data April 2009. mining, information security and parallel computing.

Xiaolin Tan received his B.E. degree at 2005 and M.E degree at 2010 in Chongqing University respectively. He is pursuing Yun He received his B.E. degree in electrical and computer his Ph.D at the Department of Computer Science in Chongqing engineering from Tianjin University, 2003, and his M.E. degree University now. His research interests are multicast security, in computer science from Nankai University, 2006, respectively. key management and ad hoc networks.

© 2014 ACADEMY PUBLISHER