Peer-to-Peer Streaming of Layered Video: Efficiency, Fairness and Incentive

Hao Hu†, Yang Guo∗, and Yong Liu† †Electrical & Computer Engineering, Polytechnic Institute of NYU, Brooklyn, NY 11201 ∗ Corporate Research, Thomson, Princeton, NJ 08540

Abstract—Recent advance in scalable video coding (SVC) To adopt SVC into P2P streaming, two key design questions makes it possible for users to receive the same video with need to be answered: 1) layer subscription: how many layers different qualities. To adopt SVC in P2P streaming, two key each peer should receive; and 2) layer scheduling: how to design questions need to be answered: 1) layer subscription: how many layers each peer should receive? 2) layer scheduling: deliver to peers the layers they subscribed. From the system how to deliver to peers the layers they subscribed? From the point of view, the most efficient solution is to maximize the system point of view, the most efficient solution is to maximize aggregate video quality perceived by all peers, i.e, to optimize the aggregate video quality on all peers, i.e., the social welfare. the social welfare. From individual peer point of view, the From individual peer point of view, the solution should be fair. solution should be fair. However, in P2P streaming, due to Fairness in P2P streaming should additionally take into account peer contributions to make the solution incentive-compatible. In the dual server-consumer role of individual peers, the notion this paper, we develop utility maximization models to understand of fairness is much more subtle than that in traditional server- the interplay between efficiency, fairness and incentive in layered client systems, where clients are only considered as resource P2P streaming. We show that taxation mechanisms can be devised consumers. A solution allocating the same video quality to all to strike the right balance between social welfare and individual peers regardless of their contributions would not be considered peers’ welfare. We develop practical taxation-based P2P layered streaming designs, including layer subscription strategy, chunk as fair, and therefore would not provide incentives for peers to scheduling policy, and mesh topology adaptation. Through exten- contribute. A good layered P2P streaming solution has to strike sive trace-driven simulations, we demonstrate that the proposed the right balance between efficiency, fairness and incentive. designs can effectively drive layered P2P streaming systems to In this paper, we develop analytical models and practical converge to the desired operating points in a distributed fashion. streaming algorithms to understand and control the interplay between efficiency, fairness and incentive in layered P2P streaming. Specifically, we develop network-coding based util- I.INTRODUCTION ity maximization models to obtain the most efficient layered P2P live video streaming has recently emerged as a cost- streaming solution. The choice of peer utility function reflects efficient IPTV solution on the Internet. It has attracted sub- the target fairness among peers when they are considered only stantial attentions in research community and industry. Several as video consumers. To incorporate contribution-awareness, widely deployed commercial P2P live streaming systems [1]– we adopt taxation as a peer-incentive mechanism and augment [3] routinely attract hundreds of thousands of users to watch the utility maximization models to make the solution incentive- live video broadcast online. Extensive research [4]–[9] has compatible. studied various aspects of system design, ranging from P2P Taxation based incentive mechanism [14], [15] offers a overlay construction, data sharing strategy, adoption of ad- flexible framework that allows the tradeoff between users’ vanced video coding, to the application of network coding personal fairness/welfare and the system-wide social welfare technique. In-depth measurement [10]–[12] study further al- (see Fig. 1). Let ud be the upload bandwidth contributed by lows us to observe the working systems in the field. user d. Under a tax rate 0 ≤ t ≤ 1, the target received t PN The success of P2P computing hinges on the underlying video rate of user d is rd = (1 − t)ud + N i=1 ui, where principle that participants shall contribute their resources (in N is the total number of peers in the system. The received terms of bandwidth, storage space, or computational power) rate consists of two parts: a fraction of its own contribution, while enjoying the service. Most existing P2P streaming and a fair share from the pool of taxed bandwidth. The tax systems assume the cooperation of peers and deliver the same rate t adjusts the balance between individual peers’ welfare video quality to all peers. Recent advance in scalable video and the social welfare. As t approaches zero, the received coding (SVC) [13] makes it possible for users to receive video rate approach the contributed rate, mimicking the ‘tit- the same video with different qualities. SVC encodes video for-tat’ strategy. As t approaches one, the received video rate into correlated layers. The base layer can be independently is the same for all peers, thus achieve the social optimum as decoded, while higher layers are decodable only if layers described in Section II. beneath have been decoded. The video quality perceived by a Our contribution can be summarized as follows: user increases as the number of decoded layers increases. • We develop utility maximization models to study the 2

number of received substreams. The number of trees joined by a peer is dynamically adjusted to reflect the entitled video Service Substream differentiated Trading quality determined by the taxation policy. We analytically peer selection t study the tradeoff between efficiency, fairness and incentive in P2P streaming with SVC coding in general topology. We employ mesh-based designs to implement taxation in P2P t layered streaming.

Single rate SVC/MDC p2p II.MODELING LAYERED P2P STREAMING p2p streaming streaming In this section, we develop analytical models to study the interplay between the efficiency, fairness and incentive in layered P2P streaming. Fig. 1. Social welfare vs. personal welfare. interplay between efficiency, fairness and incentive in lay- A. Maximizing Efficiency ered P2P streaming. The models enable us to numerically When peers are cooperative, they are willing to contribute investigate the impact of peering strategies and chunk their upload bandwidth without any incentive. The design scheduling polices on the fundamental trade-offs between objective of the system is to maximize the aggregate video the three. quality on all peers. With layered coding, the perceived video • We adopt taxation mechanism to adjust the balance quality on a peer is an increasing function of the number between the social welfare and individual peer welfare. of video layers received. PSNR (Peak Signal-to-Noise Ratio) We develop practical taxation-based P2P layered stream- is the standard objective metric to evaluate the quality of ing designs, including layer subscription strategy, chunk a compressed video and thus can be adopted as the utility scheduling policy, and mesh topology adaptation. function in layered video streaming. PSNR of a video coded • Through extensive trace driven simulations, we demon- at rate rc can be approximated by a logarithmic function strate that the proposed layered streaming designs can β log(rc) [20], where β is a constant related to the video effectively drive P2P streaming systems to the desired feature. This approximation is also valid in the SVC case [13]. operating points in a distributed fashion. Let rd be the total rate of received video layers on peer The remaining of the paper is organized as follows. We d. If the aggregate uploading capacity of the server and briefly go through related work in the following section. all peers is U, the aggregate receiving rate on all peers is Utility-maximization models and numerical studies are pre- PN naturally bounded by d=1 rd ≤ U. Since log(·) is a concave sented in Section II. Taxation-based layered streaming designs function, the aggregate utility can be maximized when all peers are presented in Section III. The performance of the proposed U receive video at the same rate, i.e., rd = N . For single-layer designs are evaluated in Section IV. The paper is concluded video streaming, it was shown in [21] that, if peers are fully in Section V. connected, a two-hop relay streaming can achieve this optimal rate. The solution for layered video streaming naturally follows A. Related Work if we let all peers subscribe to the same number of video layers U The majority of existing P2P live streaming systems ignore allowed by the rate N and deliver each layer to all peers the fairness requirement and focus solely on maximizing the using the two-hop relay scheme. However, it is unrealistic to social welfare. For instance, [5] studies how to fully utilize have fully connected mesh in a large-scale streaming system. available upload bandwidth so as to maximize the video rate For arbitrary streaming topology, the utility maximization in that can be streamed. SVC stream is also employed to improve layered streaming deserves more study. the social welfare further in face of peer churn and fluctuation 1) Network Coding Model: We consider a SVC system of available bandwidth. Recently, [16] proposes a 3-stage where the source server encodes a video stream into L layers scheduling mechanism to achieve high and low with nested dependency. Layer l can be decoded if all the video quality jitter. Fairness issue is studied in [9], [17], [18]. layers below l are received. A peer can subscribe up to k, [17] proposes a service differentiated peer selection mecha- k ≤ L, layers. The server multicasts each layer to all peers nism for P2P media streaming systems. Higher contribution subscribed to it. There are L simultaneous multicast sessions, peers are offered more flexibility and choice in selecting peers, one for each layer, in the P2P overlay network. thus obtain better viewing quality. [9] proposes substream We allow the server and peers apply network coding to trading technique which allows peers contributing more sub- video blocks to reach the maximum multicast rate allowed streams to receive more in reciprocity. Taxation was recently by peer upload capacities and the peering topology. Network adopted to provide incentives and service differentiation in coding has been shown to achieve the maximum multicast rate multi-tree based P2P video streaming [14], [15], [19]. Video for single multicast session in general network topology [22]. is encoded into substreams using multiple descriptions coding For multiple multicast sessions, inter-session network coding (MDC). Each substream is distributed along a tree formed by might be needed to achieve the maximal multicast rates. peers. The video quality perceived by a peer increases with the However, the complexity of inter-session network coding is 3

TABLE I P1: Utility Maximization NOTATIONS Variables: Notation Description l,d gij continuous non-negative variable V set of nodes in the system fij continuous non-negative variable E set of overlay links xl binary variable S video source server d R = V \S receiving peers Objective: L number of layers L l X X l l r rate of layer l max log( xdr ) (1) l ~xd = {xd} layers received by peer d d∈R l=1 gl,d information flow of layer l on link hi, ji ij Constraints: to peer d ( l l l xdr , i = S fij bandwidth needed for layer l on link hi, ji X l,d X l,d l l gij − gji = −xdr , i = d Ud peer d’s uplink capacity hi,ji∈E hj,ii∈E 0, otherwise Fd( ~xd) utility function of peer d ∀d ∈ R, ∀l ≤ L (2a) generally too high to be justified by its additional performance l,d g ≤ f l , ∀l ≤ L, ∀d ∈ R, ∀hi, ji ∈ E (2b) gain on top of intra-session network coding. We only focus ij ij xl+1 ≤ xl , ∀l ≤ L, d ∈ R (2c) on intra-session network coding. The server and peers apply d d X X l network coding to video blocks in the same layer. fij ≤ Ui, ∀i ∈ V (2d) Let a directed graph G = (V,E) be the overlay topology l hi,ji∈E of the P2P streaming system under study. Let S be the video peers without considering their contributions. Within the fair- source server, and R = V \S be the set of peers interested ness context, it is straightforward to show that the solution of 1 2 L the utility maximization problem P1 achieves the proportional in receiving the video. Let ~xd = (xd, xd, ··· , xd ) represent l fairness [24] among peers under the given overlay topology G the set of layers received by peer d: xd equals to 1 if peer d received layer l, 0 otherwise. The video rate for layer l is and node upload capacity profile U. l l,d r . To model network coding, we introduce gij to denote the Another commonly used is the weighted information flow of layer l on link hi, ji ∈ E to destination fairness. In the context of layered streaming, because of the l,d peer d. For a given peer d and layer l, {gij , hi, ji ∈ E} form a layer dependency in SVC encoding, peers have to first retrieve legitimate flow with rate rl from the source S to d and satisfy lower layers. A solution achieving weighted fairness should the flow conservation on all nodes in the network. Denote by give priority to streaming lower layers to peers. Weighted fair l l,d fij , maxd gij the maximum information flow on hi, ji for streaming solution can be obtained by replacing the PSNR- all receivers of layer l. According to theory of intra-session rate utility function in P1 with a weighted-sum function. We network coding [22], [23], the multicast session for layer l is assign weights to layers in a decreasing order. Let wl be the l i j supportable if and only if a bandwidth of fij is allocated to weight assigned to layer l. We have w > w , if i < j. layer l on link hi, ji. Instead of using PSNR-rate model, the video experience of We are interested in seeking the optimal P2P streaming so- a peer is characterized by the summation of the weights of all PL l l lution to maximize the aggregate video experience of all peers. the received layers: Fd( ~xd) = l=1 xdw . The marginal gain By adopting the PSNR-Rate model, we quantify a user’s video of receiving a lower layer outweighs that of receiving higher PL l l layers. As a result, the optimal solution with the weighted- experience by a utility function: Fd( ~xd) = β log( l=1 xdr ). With notations summarized in Table I, the optimal streaming sum utility function will easily satisfy the constraint (2c). If l solution can be found by solving the utility maximization we further relax the binary variables xd in P1 to continuous problem P1. variables within [0, 1], the optimal solution will naturally have the property that xl > 0 only if xk = 1, ∀k < l. Formally, Constraint (2a) guarantees flow conservation for the infor- d d the original non-linear mixed integer programming problem is mation flows of each peer. The benefits brought by utilizing relaxed into the following linear programming problem. network coding are embedded in constraint (2b). In SVC bitstream, higher layers depend on lower layers, and so peer P2: Linear Approximation Variables: d may request l + 1 layer only if it has received all layers up gl,d continuous non-negative variable to l. Constraint (2c) captures this dependency among layers. ij f l continuous non-negative variable Finally, (2d) is uplink capacity constraint on all peers and the ij xl ∈ [0, 1], continuous variable server. d Objective: L B. Achieving Fairness X X l l max xdw (3) In classical resource allocation problems, utility maximiza- d∈R l=1 tion achieves different notions of fairness between competing Constraints: (2a), (2b), (2d) resource consumers. In P2P video streaming, each peer plays a dual-role of server and consumer. We ignore peer’s server role The solution of the linear programming problem P2 gives in contribution-oblivious utility maximization. The obtained weighted priority for peers to receive lower layer video. optimal solution can also be interpreted as fairness among Another commonly employed fairness criterion is the max-min 4 fairness. We also derived a model to achieve max-min fairness tax rate 0 < t ≤ 1, the utility maximization problem P2 can in layered streaming. Due to the space limit, interested readers be reformulated as follows. can refer to our technical report [25] for details. P3: Utility Maximization under Taxation Variables: l,d C. Providing Incentives gij continuous non-negative variable l fij continuous non-negative variable l In the previous efficiency and fairness study, we do not con- xd ∈ [0, 1], continuous variable sider any incentive issues. This could cause serious problem in Objective: reality. For example, if an Ethernet user with uplink capacity L X X l l of 2,000 Kbps and a DSL user with uplink capacity of 200 max xdw (5) Kbps both receive video at rate of 500 Kbps, why would the d∈R l=1 Ethernet user contribute more than 200 Kbps? If we assume Constraints: (xl rl, i = S all peers are strategic, then the bandwidth contributed by peers X X d gl,d − gl,d = −xl rl, i = d will decrease and everyone will get poor video quality. On the ij ji d 0, otherwise other hand, if the DSL user uploads video at its full capacity, hi,ji∈E hj,ii∈E he may deserve some “help” from Ethernet users to download ∀d ∈ R, ∀l ≤ L (6a) gl,d ≤ f l , ∀l ≤ L, ∀d ∈ R, ∀hi, ji ∈ E video at a rate higher than 200 Kbps. ij ij (6b) X X l 1) Taxation: It is well-known that, in social welfare theory, fij ≤ Ui, ∀i ∈ V (6c) taxation can help to improve the total utility of the whole l hi,ji∈E society while maintaining a certain level of fairness. An X l l X X l xdr ≥ (1 − t) fdj ∀d ∈ R (6d) optimal tax rate is usually non-linear and is complicated to l l hd,ji∈E determine given that taxes distort user behaviors. Here, we adopt the simple linear taxation method in [14], [15], that is Constraint (6d) guarantees that every peer should at least t X r = (1 − t)U + U , (4) receive a rate proportional to its uploading contribution. d d N i i where t is the tax rate, N is the total number of peers. Unlike D. Numerical Case Studies the definition in [15], we define (1 − t)Ud as peer d’s entitled To gain insights on the interplay between efficiency, fairness rate, and then map this rate to layers. All layers other than and incentive, we conducted numerical case studies on exam- the entitled layers are denoted as excess layers. The trade- ple systems with different topologies. For each system, we off between efficiency, fairness and incentive can be balanced solve P2 and P3 using AMPL [26]. The obtained numerical by adjusting the tax rate t. Higher tax rate introduces higher results allow us to study the impact of streaming topology on system utility and smaller tax rate moves closer to tit-for- the system performance. The results also serve as benchmarks tat type of fairness. When the tax rate equals 0, the taxation for the simulation evaluation of the streaming algorithms degrades to the “tit-for-tat” or “bit-for-bit” strategy. In such a proposed in Section III. system, the system utility is obviously the lowest. Some poor We first solve P2 with a 40-receiver topology under the peers can only receive a small portion of the video and thus identical settings.1 There is one server and three types of peers obtain a rather degraded quality even though they contribute with different upload bandwidth as summarized in Table II. all of their uplink bandwidth. At the opposite side, when tax TABLE II rate is 1, all peers retrieve the same video rate regardless of NODES’SETTINGS their contributions. Clearly, both scenarios are not desirable. Type Uplink Capacity Number 2) P2P Layered Streaming with Taxation: Two kinds of Server 8000 Kbps 1 Ethernet peer 4000 Kbps 3 P2P layered streaming designs can be considered under taxa- Cable peer 1000 Kbps 12 tion: Equal share and Biased share. DSL peer 400 Kbps 25 Equal share: In this case, the taxation pool is equally shared by all tax payers, i.e., participating peers in the system, which The server has degree of 8, and only connects to Ethernet is exactly following (4). To perfectly implement the taxation or Cable peers. We vary the degree of peers to investigate the scheme, one has to fully utilize upload bandwidth available impact of peer connectivity. The maximum peer degree is 10. in the system. A sophisticated scheduling design is needed to Peers can operate at two different modes to select neighbors. meet this requirement by avoiding the wasting bandwidth as One is the hierarchical mode in which a peer prefers to connect much as possible. to peers with the same type (with 70% probability). The Biased share: We only require a peer to receive all its other is the random mode in which peers randomly connect to other peers, regardless of their type. The video stream entitled layers, i.e., rd ≥ (1 − t)Ud. The bandwidth in the common taxation pool is distributed to maximize the system- is coded in 20 layers, each layer is encoded at rate of 50 Kbps. wide utility. Towards this goal, we augment the utility maxi- mization models studied in the previous sections by imposing 1Due to the computation complexity, we couldn’t get numerical results of an additional constraint on peer’s receiving rate. At a given P2 for systems with more than 40 peers. 5

1 1000 1000

900 900 0.98 800 800 0.96 ratio 700 700 DSL hierarchical DSL random

0.94 average bitrate average bitrate hierarchical 600 Cable hierarchical 600 Cable random random Ethernet hierarchical Ethernet random 0.92 500 500 2 3 4 5 6 7 2 3 4 5 6 7 2 3 4 5 average degree average degree average degree (a) Achieved Utility (b) Fairness in Hierarchical Topology (c) Fairness in Random Topology Fig. 2. Utility Maximization and Proportional Fairness in Hierarchical and Random Topologies

4 x 10 Fig. 2 shows the solutions of P2 under different average 8.5 4.75 DSL peering degree. Fig. 2(a) compares the aggregated utility in 8 Cable 4.74 hierarchical and random cases. The Y-axe value is obtained by 7.5 dividing the aggregated utility by the maximum possible utility 7 4.73 U 6.5 (here it is the case when every receiver gets ). The system 4.72 N 6

utility increases as peering degree increases. The random mode 5.5 Weighted Sum 4.71 gives better system wide utility. Fig. 2(b) and 2(c) compare 5 4.7 the average receiving rate for each type of peers under the two Average Received Useful Layers 4.5 4 4.69 peering modes. The hierarchical mode gives higher service 0.15 0.3 0.5 0.95 0.15 0.3 0.5 0.95 Tax Rate Tax Rate differentiation. (a) Received Useful Layers (b) System Utility To study the impact of taxation, we study a numerical Fig. 3. Impact of Taxation on Fairness and System Utility example as shown in Fig. 3. The system has 15 cable peers with uploading capacity of 1000 Kbps and 25 DSL peers with multicast efficiency in general overlay topology. However, the 400 Kbps and they are hierarchically connected with degree 3. gain of adopting network coding in real P2P systems is still The video source is coded in 10 layers, each with 100 Kbps. an open question [23]. In layered P2P streaming systems, The layer weight wl is set as 2(10−l). We vary the tax rate applying network coding to individual layers incurs extra from 0.15 to 0.95. coding/decoding overhead, increases video playback delays, As can be seen from Fig. 3(a), when the tax rate is small, and makes the protocol design more complex. Our design does Cable peers with higher upload capacity obtain more layers. not employ network coding. As will be demonstrated through The service differentiation provides good incentives for them simulations in Section IV, the efficiency of the proposed mesh- to participate in P2P sharing. As the tax rate increases, the based P2P streaming design is very close to the optimum differences between Cable peers and DSL peers decrease. On efficiency allowed by network coding. the other hand, the system wide utility increases with tax rate. A. Dynamic Layer Subscription III.LAYERED P2P STREAMING PROTOCOL DESIGN In real P2P streaming systems, due to peer churn and In this section, we present a mesh-based layered P2P network dynamics, it is unrealistic to calculate static layer- streaming design with the taxation based incentive mechanism. subscriptions for all peers in a centralized fashion based on Peers form a mesh over which the video is distributed. A P3. We thus develop a distributed algorithm that dynamically tracker or a rendezvous point serves as the bootstrapping node adjusts peers’ layer subscriptions to approach the utility max- for the system. The key design issues for such a layered P2P imization under taxation. streaming protocol are layer subscription, chunk scheduling, Let Li denote peer i’s entitled layers. At a given time t, l and mesh topology adaptation. Multiple virtual overlays, one let Oi(t) be a binary constant indicating whether peer i has for each SVC video layer, are formed among participating layer l. The layer subscription problem for peer i consists of peers. Due to the dependency among video layers, the upper two sub-problems: 1) what layers should peer i subscribe to? virtual overlay must have fewer peers than lower overlays. A 2) which peers should peer i download a subscribed layer l peer uses layer subscription scheme to determine how many from? The decision for the first sub-problem is represented l layers to subscribe to. The chunk scheduling algorithms on by the layer subscription variables {xi}. For the second sub- l l peers allocate bandwidth among different overlays to balance problem, we introduce new decision variables {sij}, with sij the streaming needs of different layers. Finally, the mesh denotes the fraction of layer l peer i downloads from peer j. topologies need to be dynamically adjusted to adapt to the Without networking coding, the optimal layer subscription is changing layer subscription due to peer churn and/or other governed by the low-level optimization problem P4. network dynamics. Constraint (8a) guarantees that all peers receive their entitled In the theoretic framework developed in Section II, network layers. Constraint (8b) defines how peer i retrieves layer l from coding is an essential component to achieve the optimum its neighbors. Constraint (8c) is uplink capacity constraint on 6

P4: Flow Formulation for Dynamic Layer Subscription Objective: L X X l X l l max w sij Oj (t) (7) sl ,xl ij i i∈V l=Li+1 hi,ji∈E Constraints: l xi = 1, ∀l < Li (8a) X l l sij = xi, ∀i ∈ V, ∀l ≤ L (8b) hj,ii∈E

X l X l r sij ≤ Uj , ∀j ∈ V (8c) l hj,ii∈E all peers. P4 turns out to be a minimum cost flow problem, which can be solved by centralized algorithms in polynomial time. It can also be solved by distributed approximation Fig. 4. Peer serves neighbors algorithms, such as the TCP-like algorithm proposed in [27]. belonging to the entitled layers are equally important. This We propose a distributed algorithm with Additive Increase is reasonable because the available upload bandwidth in the Additive Decrease (AIAD) and exponential backoff for peers to system is sufficient to deliver the entitled layers to all peers. dynamically adjust their layer subscriptions. Upon joining the There is no need to distinguish different entitled layers. The streaming session, peer i sets its initial layer subscription, li, chunks are requested in the order of their importance: from to be Li, the number of its entitled layers. It also starts a retry entitled layer chunks to excess layer chunks. A peer selects timer, ti = rand(1,T ), where T is the retry time period. Upon one neighbor peer that owns the missing chunk to request the expiration of the retry timer, if all currently subscribed for the chunk. The probability of choosing a specific peer is layers can be received and at least one neighbor peer possesses proportional to its serving rate to the requesting peer. chunks of layer li + 1, peer i increases subscribed layer by 2) Chunk serving: Chunk serving is more sophisticated. 0 one, li = li + 1, and enters a trial period of T . Peer i sends Individual peers maintain two FIFO queues for each neighbor out requests for chunks in the newly added layer. If peer i (see Fig. 4). One queue is called entitled queue and the other is able to successfully obtain most of requested chunks at is called excess queue. Entitled queue holds chunk requests for the end of the trial period, it passes the test and the new entitled layers, while excess queue holds chunk requests for layer subscription is accepted. Otherwise, peer i falls back excess layers. The chunk requests in excess queues are sorted to original subscription, and enters exponential backoff stage. in ascending order of video layers, with lowest layer chunk k The retry timers is set to be ti = rand(1, 2 T ), where k requests at the head. The entitled queues have strict priority is number of consecutive failures. Meanwhile, peer i runs a over the excess queues. Excess queues would not be served parallel subscription decrease process to ensure that it can unless all entitled queues become empty. If entitled queues receive all subscribed layers. Subscription decrease process become empty, the leftover bandwidth serves the requests in periodically monitors the status of received layers. If the top excess queues in a round robin fashion. The requests that have subscribed layer, li, becomes undecodable, and peer is not in passed their playback deadlines are cleared out of the queues the aforementioned trial period, peer i reduces the number of and won’t be served. subscribed layers to li = max(li − 1,Li). C. Mesh Topology Adaptation B. Chunk Scheduling As discussed in Section II, hierarchical mesh topology is Each peer maintains a downloading window that moves more favorable than random topology in providing differ- forward periodically. Peers periodically exchange chunk avail- ential service while random mesh is better for maximizing ability with their neighbors using buffer-maps. Neighbors help the system-wide utility. In this section, we consider how to each other retrieve missing chunks. Chunk scheduling decides efficiently adapt the mesh topology to achieve different design how to issue chunk requests to neighbor peers, and how to goals. Mesh topology adaptation is achieved through neighbor serve the chunk requests from neighbor peers. The goal is to adaptation. A peer periodically contacts the tracker to retrieve properly utilize peers’ uplink bandwidths so that peers always a list of candidate neighbors. It then applies the adaptation receive the entitled layers and receive the subscribed excess strategy as described below to ensure the overlay topology layers with high probability. In the following, we present the converging to the desired topology. peer chunk requesting and chunk serving algorithms. Every peer has a preset peer out-degree. If the number 1) Chunk requesting: In SVC coded video, lower layer of neighbors falls below the preset out-degree, a peer in- bit-stream is more important than higher layer bit-stream. creases the number of neighbors by adding neighbors ran- Hence in principle, lower layer chunks should be requested domly selected from the candidate list. If the current number before higher layer chunks. In order to increase the data of neighbors is ok, a peer still selects one peer with low chunk diversity and improve the chance that two peers always contribution and replaces it with a new peer from the candidate have chunks to exchange, we further assume that data chunks list. Specifically, a peer uses a replacement index to determine 7

100 100 100 ether ether ether 80 cable 80 cable 80 cable dsl dsl dsl 60 60 60

40 40 40 percentile percentile percentile 20 20 20

0 0 0 0 2 4 6 8 10 0 2 4 6 8 10 0 2 4 6 8 10 layer layer layer (a) Tax rate 0 (b) Tax rate 0.5 (c) Tax rate 0.95 Fig. 5. CDFs of Received Video Layers for Different Types of Peers Under Various Tax Rates which peer to be replaced. Suppose peer i needs to adapt bandwidths are summarized in Table III. In our simulation, l its neighbors. Let cj be the number of retrieved chunks of there is one video server with upload capacity of 10 Mbps. layer l from peer j, and wl be the weight associate with The peer download window is set to 30 seconds. Peers layer l. The replacement index for peer j is defined to be exchange buffer-maps every second to calculate the missing P l l∈i0s entitled layers cjwl. In addition, weight w is set to be chunk downloading schedule. Mesh topology adaptation is 0 as such that wl > wk if l > k. The neighbor with the smallest conducted every ten seconds. The values of T and T in replacement index is selected and swapped out. The length of AIAD layer subscription algorithm are set to be 5 seconds the adaptation period is chosen as ten seconds in our design. and 10 seconds, respectively. The philosophy behind this design is two-fold. TABLE III • Layer Level: a neighbor offering high level layers up to PEERUPLOADBANDWIDTHDISTRIBUTION the entitled layers should stay. There are fewer peers in Peer Type Uplink Bandwidth Percentage the higher virtual overlay. Peers who can offer high layer DSL 400 Kbps 45% chunks are more precious and are more likely of the same Cable 800 Kbps 40% class (with the same entitled layers). Ethernet 1500 Kbps 15% • Chunk Level: among all neighbors offering chunks at the B. Simulation Results same layer, those uploading more chunks should stay. Simulation results in Section IV indicate that the mesh topol- 1) Effectiveness of Taxation Based Incentive Mechanism: ogy will converge to desired structures. At a small tax rate, To reduce the randomness introduced by short-lived peers, which emphasizing differential service, hierarchical topology only peers with life time greater than one minute are counted is achieved. At a large tax rate, which optimizing the system- in this experiment. In taxation based P2P streaming, a peer’s wide utility, more random topology is realized. received video quality, or the number of layers, reflects its bandwidth contribution and the system wide tax rate. In ad- IV. PERFORMANCE EVALUATION dition, the peers with similar bandwidth contributions receive We conduct extensive trace-driven simulations to evaluate similar video quality. Both are true as shown in Fig. 5, which the performance of the proposed taxation-based P2P layered depicts the Cumulative Distribution Functions (CDFs) of the streaming design. Specifically, we investigate the following numbers of received layers for different types of peers at aspects: (1) the effectiveness of taxation-based incentive mech- different tax rates. The peers from the same class consistently anism; (2) peer uplink bandwidth utilization; (3) the mesh receive a similar number of layers, while the numbers of topology adaptation; (4) user/peer perceived video quality; and video layers received by different peer classes are close to (5) the convergence and optimality of AIAD layer subscription the optimum values–(5,9,10) under tax rate 0; (6,8,10) under scheme. tax rate 0.5 and (7,7,8) under tax rate 0.95. 2) Bandwidth Utilization Efficiency: Peers’ uplink band- A. Simulation Setup width utilization is a key performance metric for any P2P A packet-level event-driven simulator is developed in C++. streaming system design. If the system is not well designed, Unless stated otherwise, the simulations are driven by a trace the so-called “content bottleneck” lowers down the uplink collected from the measurement study of PPlive [10], a real- bandwidth utilization, and degrades the average peers’ re- world P2P live streaming system. The trace was collected ceived video quality. from Nov 22nd 17:43, 2006 to Nov 23rd 17:43, 2006. More Table IVlists the uplink bandwidth utilization (UBU) and the than 10,000 video sessions are observed and the number of TABLE IV concurrent peers varies from 100 to more than 9,000. SYSTEM BANDWIDTH UTILIZATION The video is encoded into ten layers, with layer rate of 100 Tax rate UBU WBR Kbps. There are three types of peers: DSL peers (400 Kbps), 0 99.4% 0.4% 0.5 97.9% 0.1% Cable peers (800 Kbps) and Ethernet peers (1500 Kbps). The 0.95 93.1% 0.6% fraction of individual peer types and their respective uplink 8

TABLE V TABLE VI TOPOLOGY STATISTICS FOR TAX RATE 0 TOPOLOGY STATISTICS FOR TAX RATE 0.95 Neighbor Type Ethernet Cable DSL Neighbor Type Ethernet Cable DSL Ethernet 28.4% 19.0% 9.0% Ethernet 21.1% 14.9% 14.5% Cable 47.3% 58.1% 21.1% Cable 38.5% 39.9% 41.5% DSL 24.3% 22.9% 69.9% DSL 40.4% 45.2% 44.0% wasted bandwidth ratio (WBR). Overall, the uplink bandwidth Fig. 6 shows the CDFs of smoothness index under different tax utilization is consistently over 90%, indicating the efficiency rates. As tax rate increases, the smoothness indexes for strong of the protocol without network coding. Interestingly, UBU peers increase, while the smoothness indexes for slow peers is worse at larger tax rates. As tax rate increases, the peers decrease. We suspect this is caused by the peering topology become more altruistic, which requires more bandwidth shar- at different tax rates. ing among different types of peers. Due to the peer churn and As discussed in Section IV-B3, a hierarchical topology is mesh topology constraint, the bandwidth sharing may not be formed at tax rate 0. DSL peers are mainly connected with always possible, thus lower the utilization. other DSL peers and have to actively look for bandwidth In layered video, received chunks become undecodable if resources, which causes more layer changes. In contrast, Ether- the lower layers are not fully decoded. Wasted bandwidth net and Cable users are mainly connected with each other, and ratio (WBR) defines the fraction of bandwidth that is used for have abundant bandwidth within the cluster. Thus fewer layer delivering undecodable chunks. Again, the wasted bandwidth changes. As tax rate increases, the overlay topology becomes ratio is pretty small, pointing to an efficient protocol design. more randomized. Different peers have equal/similar access to bandwidth, leads to similar smoothness index. 3) Mesh Overlay Adaptation: Mesh overlay topology plays a key role in service differentiation. Table V and VI list the 5) Layer Subscription Convergence: In order to examine peer neighborhood statistics with the tax rate of 0 and 0.95, the behavior of layer subscription algorithm without the impact respectively. With tax rate 0, the optimal number of video of peer churn, 500 peers with fixed topology is used in this layers for Ethernet users, Cable users, and DSL users are 10, 9, experiment. The peers’ uplink bandwidth obeys the distribu- and 5, respectively. Around 76% of Ethernet peers’ neighbors tion as stated in Table III. We randomly pick one peer from are either Ethernet or Cable users, and around 77% of Cable each bandwidth category and plot the evolution of its layer peers’ neighbors are either Ethernet or Cable users. In contrast, subscription. We also vary the tax rate to examine its impact. DSL users mainly connect with other DSL users (70%). The Fig. 7 shows the layer subscription process over time strong bias toward connecting with similar peers leads to a with tax rate of 0, 0.5, and 0.95, respectively. With tax rate hierarchical mesh topology, which allows Ethernet and Cable of zero, peers are entirely selfish. The Ethernet peers with users to exchange higher video layers (from layer 6 to layer bandwidth of 1500 Kbps receive all ten layers. The leftover 10) that are not available at DSL users. bandwidth subsidizes other peers. As a result, the optimal With tax rate 0.95, all peers are supposed to receive a layer subscription for Cable and DSL peers are 9 layers and similar number of video layers regardless of their individual 5 layers, respectively. With tax rate of 0.5, the optimal layer bandwidth contributions. Numerical results in Section II-D subscription for DSL, Cable, and Ethernet peers are 6 layers, suggest that random mesh topology is better at achieving high 8 layers, and 10 layers, respectively. Finally, with tax rate social welfare. Our mesh topology adaption scheme is able to of 0.95, peers are altruistic and every peer should receive reflect this requirement. For DSL users, the fraction of DSL 700 Kbps except for Ethernet peers (800 Kbps). Since video neighbors is reduced from 70% (with tax rate 0) to 44%. For is encoded at 100 Kbps per layer, there are more “free” Ethernet users, the fraction of DSL neighbors is increased from bandwidths in this case, introducing minor oscillations in layer 24% to 40%. Compared with the mesh topology constructed subscription. In all cases, AIAD algorithm is able to quickly at tax rate 0, this is a more randomized topology. converge to the target subscription layer and peers stay in their optimal layers for most of the time. 4) Smoothness of Received Video Quality: Video quality is related to the number of received video layers. In addition, V. CONCLUSIONS viewing quality is affected by the variations of the received video layers over time. (QoE) is de- Designing an efficient P2P live streaming system that is fair graded if the number of received video layers changes fre- to all peers and offers strong incentive for them to contribute quently. We define the following smoothness index to quantify is challenging. In this paper, we develop utility maximization the smoothness of playing back received video. models to understand the interplay between efficiency, fairness K and incentive in layered P2P streaming. The models enable 1 X |v(k) − v(k − 1)| SI = , (9) us to numerically investigate the impact of peering strategies K v(k) k=0 and chunk scheduling policies on the fundamental trade-offs where v(k) is the received decodable layers at time period k, between the above three factors. We further integrate taxation- and K is peer’s total number of online time period. The time based incentive mechanism into P2P layered streaming, and period is one second. Large smoothness index indicates bad develop a practical streaming system. Taxation-based P2P viewing quality caused by constant layer increasing/droping. streaming allows us to freely adjust the balance between the 9

100 100 100

80 80 80

60 60 60

40 40 40 percentile ether percentile ether percentile ether 20 cable 20 cable 20 cable dsl dsl dsl 0 0 0 0 0.01 0.02 0.03 0.04 0.05 0 0.01 0.02 0.03 0.04 0.05 0 0.01 0.02 0.03 0.04 0.05 smoothness index smoothness index smoothness index (a) Tax rate 0 (b) Tax rate 0.5 (c) Tax rate 0.95 Fig. 6. CDFs of Smoothness Index for Different Types of Peers Under Various Tax Rates

10 10 10

8 8 8

6 6 6

layers 4 layers 4 layers 4 ether ether ether 2 cable 2 cable 2 cable dsl dsl dsl 0 0 0 0 500 1000 1500 0 500 1000 1500 0 500 1000 1500 time time time (a) Tax rate 0 (b) Tax rate 0.5 (c) Tax rate 0.95 Fig. 7. Layer Subscriptions Over Time for Different Types of Peers Under Various Tax Rates social welfare and individual peer welfare. Extensive trace- [14] Y. hua Chu, J. Chuang, and H. Zhang, “A case for taxation in peer-to- driven simulations demonstrate that the proposed designs can peer streaming broadcast,” in ACM SIGCOMM workshop on Practice and theory of incentives in networked systems, 2004. effectively drive layered P2P streaming systems to operating [15] Y.-W. Sung, M. Bishop, and S. Rao, “Enabling Contribution Awareness points with the desired balance between efficiency, fairness in an Overlay Broadcasting System,” in SIGCOMM, 2006. and incentive. [16] X. Xiao, Y. Shi, Y. Gao, and Q. Zhang, “Layerp2p: A new data scheduling approach for layered streaming in heterogeneous networks,” in Proceedings of IEEE INFOCOM, Rio de Janeiro, Brazil, 2009. REFERENCES [17] A. Habib and J. Chuang, “Service differentiated peer selection: An [1] “PPLive, http://www.pplive.com/.” [Online]. Available: http://www. incentive mechanism for peer-to-peer media streaming,” IEEE Trans. pplive.com/ on Multimedia, vol. 8, pp. 610–621, 2006. [2] “PPStream, http://www.ppstream.com/.” [Online]. Available: http: [18] Z. Liu, Y. Shen, S. S. Panwar, K. W. Ross, and Y. Wang, “Using Layered //www.ppstream.com/ Video to Provide Incentives in P2P Live Streaming,” in Sigcomm 2007 [3] “UUsee, http://www.uusee.com/.” [Online]. Available: http://www. workshop on peer-to-peer streaming and IP-TV, 2007. uusee.com/ [19] N. Magharei, R. Rejaie, and Y. Guo, “Incorporating Contribution- [4] M. Zhang, Q. Zhang, and S. Yang, “Understanding the Power of Pull- Awareness into Mesh-based Peer-to-Peer Streaming Services,” in Tech- based Streaming Protocol: Can We Do Better?” IEEE J. Select. Areas nical report, University of Oregon, 2007. Commun., vol. 25, pp. 1678–1694, Dec. 2007. [20] M. Chen, M. Ponec, S. Sengupta, J. Li, and P. A. Chou, “Utility Maxi- [5] J. Zhao, F. Yang, Q. Zhang, Z. Zhang, and F. Zhang, “LION: Layered mization in Peer-to-peer Systems,” in Proceeding of ACM SIGMETRICS, Overlay Multicast with Network Coding,” IEEE Trans. Multimedia, June 2008. vol. 8, pp. 1021–1032, Oct. 2006. [21] R. Kumar, Y. Liu, and K. Ross, “Stochastic Fluid Theory for P2P [6] P. Decuetos and K. Ross, “Unified framework for optimal video stream- Streaming Systems,” in Proc. IEEE INFOCOM, May 2007. ing,” in Infocom 2004, Hong Kong, February 2004. [22] R. Ahlswede, N. Cai, S.-Y. R. Li, and R. W. Yeung, “Network informa- [7] N. Magharei and R. Rejaie, “PRIME: Peer-to-Peer Receiver-drIven tion flow,” IEEE Trans. on Information Theory, vol. 46, pp. 1204–1216, MEsh-based Streaming,” in Proc. IEEE INFOCOM, May 2007. 2000. [8] Mea Wang and Baochun Li, “R2: Random push with random network [23] D. M. Chiu, R. W.-H. Yeung, J. Huang, and B. Fan, “Can network coding in live peer-to-peer streaming,” IEEE J. Select. Areas Commun., coding help in p2p networks?” in Second Workshop of Network Coding, vol. 25, pp. 1655–1666, Dec. 2007. Boston, USA, April 2006. [9] Z. Liu, Y. Shen, S. S. Panwar, K. W. Ross, and Y. Wang, “Substream [24] F. Kelly, A. Maulloo, and D. Tan, “Rate control in communication Trading: Towards an Open P2P Live Streaming System,” in ICNP, 2008. networks: shadow prices proportional fairness and stability,” Journal of [10] X. Hei, C. Liang, Y. Liu, and K. W. Ross, “Insights into PPLive: A the Operational Research Society, 1998. measurement study of a large-scale P2P IPTV system,” in Workshop on [25] H. Hu, Y. Guo, and Y. Liu, “Peer-to-peer streaming of layered video: Internet Protocol TV (IPTV) services over World Wide Web, Edinburgh, Efficiency, fairness and incentive,” in Technical Report, Polytechnic Scotland, May 2006. Institute of NYU, 2009. [11] S. Xie, G. Y. Keung, and B. Li, “A measurement of a large-scale peer- [26] “Ampl, http://www.ampl.com/.” [Online]. Available: http://www.ampl. to-peer live video streaming system,” in Packet Video, Oct. 2007. com/ [12] S. Ali, A. Mathur, and H. Zhang, “Measurement of Commercial Peer- [27] S. woo Cho and A. Goel, “Pricing for fairness: distributed resource To-Peer Live Video Streaming,” in First Workshop on Recent Advances allocation for multiple objectives,” in Proceedings of the thirty-eighth in Peer-to-Peer Streaming, Aug. 2006. annual ACM symposium on Theory of computing, 2006. [13] H. Schwarz, D. Marpe, and T. Wiegand, “Overview of the Scalable Video Coding Extension of the H.264/AVC Standard,” IEEE Trans. Circuit and System for Video Technology, vol. 17, pp. 1103–1120, Sep. 2007.