21
Intl. Trans. in Op. Res. 21 (2014) 559–579 DOI: 10.1111/itor.12086 INTERNATIONAL TRANSACTIONS IN OPERATIONAL RESEARCH Analysis and design of peer-assisted video-on-demand services Pablo Romero, Franco Robledo, Pablo Rodr´ ıguez-Bocca and Claudia Rostagnol Facultad de Ingenieria, Instituto de Computaci´ on, Universidad de la Rep´ ublica, Julio Herrera y Reissig 565, CP 11300, Montevideo Uruguay E-mail: promero@fing.edu.uy [Romero]; frobledo@fing.edu.uy [Robledo]; prbocca@fing.edu.uy [Rodr´ ıguez-Bocca]; crostag@fing.edu.uy [Rostagnol] Received 21 August 2012; received in revised form 8 February 2014; accepted 15 February 2014 Abstract We propose a deterministic fluid model to understand the trade-offs in the design of peer-assisted video-on- demand (VoD) services. There are three entities in this model: peers (or end users), seeders (altruistic users that own one or several complete video items), and cache servers that store and forward videos with a limited capacity. Peers join the network, download one or multiple concurrent video streams (possibly different video items), and abort the system when they wish. Peers are assumed to cooperate in a BitTorrent-based fashion, governed by tit-for-tat and fair availability. The issue is to minimize the expected downloading times, choosing the set of video items that should be stored in each cache server. We first prove that the deterministic model is globally stable, and find closed expressions for the expected waiting times. Then, we introduce a combinatorial optimization problem (COP), whose nature is similar to the multiknapsack problem (where the items are videos, and knapsacks are related with the storage of cache servers). The problem turns out to be NP-complete. Therefore, we heuristically address the problem following a GRASP (greedy randomized adaptive search procedure) methodology. Finally, we simulate the new caching methodology with real-life traces taken from YouTube logs. The results suggest that the peer-to-peer philosophy is both stable and cost-effective for on-demand streaming purposes. Keywords: peer-to-peer; video-on-demand; fluid model; GRASP 1. Motivation The design of the Internet was inspired by the client-server architecture. In this design, the servers offer a simple and predictable service to their users. However, this service can easily collapse by a mismatch between the download requirements and capacity of the upload server. In order to offer a scalable service, a resourceful cluster server must be deployed, and the maintenance and deployment cost is sometimes prohibitive. For instance, YouTube is paying millions of dollars per month in terms of bandwidth usage to Internet service providers and content distribution networks (Huang et al., 2007). Peer-to-peer networks represent an opposite paradigm for the deployment of highly scalable C 2014 The Authors. International Transactions in Operational Research C 2014 International Federation of Operational Research Societies Published by John Wiley & Sons Ltd, 9600 Garsington Road, Oxford OX4 2DQ, UK and 350 Main St, Malden, MA02148, USA.

Analysis and design of peer-assisted video-on-demand services

  • Upload
    claudia

  • View
    229

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Analysis and design of peer-assisted video-on-demand services

Intl. Trans. in Op. Res. 21 (2014) 559–579DOI: 10.1111/itor.12086

INTERNATIONALTRANSACTIONS

IN OPERATIONALRESEARCH

Analysis and design of peer-assisted video-on-demand services

Pablo Romero, Franco Robledo, Pablo Rodrıguez-Bocca and Claudia Rostagnol

Facultad de Ingenieria, Instituto de Computacion, Universidad de la Republica, Julio Herrera y Reissig 565, CP 11300,Montevideo Uruguay

E-mail: [email protected] [Romero]; [email protected] [Robledo]; [email protected] [Rodrıguez-Bocca];[email protected] [Rostagnol]

Received 21 August 2012; received in revised form 8 February 2014; accepted 15 February 2014

Abstract

We propose a deterministic fluid model to understand the trade-offs in the design of peer-assisted video-on-demand (VoD) services. There are three entities in this model: peers (or end users), seeders (altruistic usersthat own one or several complete video items), and cache servers that store and forward videos with a limitedcapacity. Peers join the network, download one or multiple concurrent video streams (possibly differentvideo items), and abort the system when they wish. Peers are assumed to cooperate in a BitTorrent-basedfashion, governed by tit-for-tat and fair availability. The issue is to minimize the expected downloading times,choosing the set of video items that should be stored in each cache server. We first prove that the deterministicmodel is globally stable, and find closed expressions for the expected waiting times. Then, we introduce acombinatorial optimization problem (COP), whose nature is similar to the multiknapsack problem (wherethe items are videos, and knapsacks are related with the storage of cache servers). The problem turns out tobe NP-complete. Therefore, we heuristically address the problem following a GRASP (greedy randomizedadaptive search procedure) methodology. Finally, we simulate the new caching methodology with real-lifetraces taken from YouTube logs. The results suggest that the peer-to-peer philosophy is both stable andcost-effective for on-demand streaming purposes.

Keywords: peer-to-peer; video-on-demand; fluid model; GRASP

1. Motivation

The design of the Internet was inspired by the client-server architecture. In this design, the serversoffer a simple and predictable service to their users. However, this service can easily collapse by amismatch between the download requirements and capacity of the upload server. In order to offer ascalable service, a resourceful cluster server must be deployed, and the maintenance and deploymentcost is sometimes prohibitive. For instance, YouTube is paying millions of dollars per month in termsof bandwidth usage to Internet service providers and content distribution networks (Huang et al.,2007). Peer-to-peer networks represent an opposite paradigm for the deployment of highly scalable

C© 2014 The Authors.International Transactions in Operational Research C© 2014 International Federation of Operational Research SocietiesPublished by John Wiley & Sons Ltd, 9600 Garsington Road, Oxford OX4 2DQ, UK and 350 Main St, Malden, MA02148,USA.

Page 2: Analysis and design of peer-assisted video-on-demand services

560 P. Romero et al. / Intl. Trans. in Op. Res. 21 (2014) 559–579

video-on-demand (VoD) services. They are self-organized communities developed at the applicationlevel, in which users, called “peers,” offer their resources (bandwidth, memory, and CPU-time) toothers, basically because they share common interests. The cooperation among users reduces theoperational costs and promote scalability. Nevertheless, the design of these networks imposes manychallenges. Peers join and leave the network when they wish in an unpredictable manner (knownas node churn). Therefore, the global network resources is a function of time. Moreover, peersare heterogeneous, and the uplink/downlink capacities are not similar, in part due to the highpenetration of asymmetric digital subscriber line (ADSL) services (Bingham, 2000). Selfish peers(called free riders) exploit the resources of the whole system but do not contribute. The topologicalnetwork design and cooperative policies are core mechanisms in order to tackle free-riding effectsand node churn. Smart solutions were proposed during the short life of existence of highly scalableon-demand peer-to-peer (P2P) systems, such as grandchildren gossiping in a tree-like structure (Doet al., 2004), sophisticated multiple video cache policy in PPLive-VoD (Huang et al., 2008), anchor-based solutions to achieve VCR (video-cassette recording) interactivity and caching policies tomaximize global availability (Huang et al., 2007), among others. A neat survey covering the designof resilient peer-to-peer video streaming can be found in Abboud et al. (2011).

Some commercial P2P networks for on-demand streaming are available. The most successfulones are VoD-PPlive (Huang et al., 2008), VoD-PPstream (PPStream home page, 2007), and Spo-tify (Kreitz and Niemela, 2010).

An inspirational system for replication and fast dissemination of files is BitTorrent, created byBram Cohen (Cohen, 2003). BitTorrent was originally designed for off-line downloading. However,nowadays most of the P2P applications over the Internet are BitTorrent based. One such applicationsis the GoalBit video platform, the first free and open source peer-to-peer streaming network (Bertinatet al., 2009). In these systems, peers are either “downloaders” when they actively download content,or “seeders,” once they finished the download process but are still connected, sharing alreadydownloaded items. GoalBit introduces a third node-type to the network named “super-peer.” Thesenodes have higher bandwidth resources than a normal peer, and usually join the network with longerlifetimes (very stable peers). Super-peers are encouraged to store and forward video streaming to endusers (with shorter lifetime). In the current GoalBit protocol specification, super-peers are nodesmanaged by the operator, hosted in the cloud, and implement a specific caching policy (Bertinatet al., 2009). Therefore, super-peers is the GoalBit’s name for the cache servers. In GoalBit, thereis also an entity or software named “tracker,” which knows all the peers who are seeding ordownloading a certain video item.

Our primary objective is to understand the performance of peer-assisted video-on-demand net-works. As a main contribution, we develop an exhaustive fluid model classification for both sequen-tial and concurrent systems (i.e. with simultaneous streams of different video types) and a stabilityanalysis, proving indeed that peer-assisted systems are always globally stable. Furthermore, thebest caching policies for on-demand video streaming are explored in the light of a combinatorialoptimization problem (COP), whose nature is similar to a multiknapsack problem.

This paper is structured as follows. Section 2 contains a summary of related work. Section 3introduces a general fluid model (GFM), in which peers can concurrently download several videos,and are classified according to the number of simultaneous downloads. Two outstanding submodelsare discussed in depth in Section 4 The first one is a concurrent model for BitTorrent-based net-works. The second one is a sequential fluid model (SFM), in which each peer downloads video items

C© 2014 The Authors.International Transactions in Operational Research C© 2014 International Federation of Operational Research Societies

Page 3: Analysis and design of peer-assisted video-on-demand services

P. Romero et al. / Intl. Trans. in Op. Res. 21 (2014) 559–579 561

sequentially. The sequential model is globally stable, and we can find closed expressions for the ex-pected waiting times, regarding P2P and CDN systems separately, and prove that the performance ofa P2P system is never worse than that of a content delivery network (CDN). A COP captures thecaching problem in Section 5, trying to allocate video replicas in super-peers in order to minimize theexpected waiting time. We prove the feasibility of the caching problem is NP-complete, and developa GRASP (greedy randomized adaptive search procedure) technique enriched with a path-relinkingpostoptimization stage. Real-life scenarios based on YouTube traces are analyzed in Section 6.Finally, Section 7 contains the main conclusions and discusses several aspects for future research.

2. Related work

Usually, the development of experiments in real P2P systems is expensive, and a large deviation fromcustomer expectations would be detrimental to their reputation (Tewari and Kleinrock, 2007). Asa consequence, the scientific community works to develop mathematical models in order to predictthe behavior of the system. The consistency of the service capacity of P2P file sharing services ismathematically justified in De Veciana and Yang (2003). They propose a branching process, andstate that a P2P system highly outperforms the traditional CDN. A basic Markovian model is alsointroduced to describe peer evolution. Qiu and Srikant (2004) analyze BitTorrent-like systems understeady state and its variability, showing empirical validation as well. A steady-state analysis is firstpresented with a simple fluid model, in which the peer evolution is captured by exogenous Poissonianarrivals and exponential departures in the system. They consider homogeneous peers, and find aclosed expression for the expected waiting time. A sensitivity analysis of this performance measurewith respect to different design parameters offers one of the first insights of BitTorrent’s correctness.A special treatment is included for the file-sharing efficiency between peers, and states the robustnessof random peer selection. They develop a fluid model whose steady state is partially characterizedas locally stable, and it was conjectured that the model is globally stable in the Lyapunov sense. Theconjecture is true, and proved for the first time in Qiu and Sang (2008). The fluid model proposed byQiu and Srikant is generalized in a first stage by Tian et al. (2006), extending the model for severalconcurrent multitorrents. The authors argue that most BitTorrent users download several files atthe same time. A second generalization is proposed by Rodrıguez-Bocca and Rostagnol (2011),where the authors introduce the presence of super-peers in the network, and study the steady stateof a video-on-demand application. In Robledo et al. (2012), authors introduce a GFM adding thenode-churn phenomenon to the fluid model. Interestingly enough, this general model is still globallystable in the Lyapunov sense. Here, we propose a deeper analysis of Robledo et al. (2012), includingcomplete proofs, and a caching technique to minimize the expected download times in a globallystable peer-assisted service.

We prove both mathematically and empirically that the peer-to-peer architecture outperformstraditional CDNs in a general environment. Then, we explore optimal caching policies in sequentialsystems (in which users can either download zero or one video file at a given time). We proposethe caching problem, and prove its NP-completeness. As a consequence, we solve the cachingproblem heuristically, following a GRASP methodology enriched with a path-relinking postopti-mization technique. We finally illustrate its performance via simulations regarding real traces fromYouTube.

C© 2014 The Authors.International Transactions in Operational Research C© 2014 International Federation of Operational Research Societies

Page 4: Analysis and design of peer-assisted video-on-demand services

562 P. Romero et al. / Intl. Trans. in Op. Res. 21 (2014) 559–579

3. General fluid model (GFM)

3.1. Introduction—fluid models

A fluid model captures the expected evolution of a stochastic system, by means of a deterministicset of ordinary differential equations. In order to understand our GFM, we will first give a pictorial,but conceptually useful, scenario. Suppose a population with N individuals with independent andexponentially distributed lifetimes with rate θ , measured in years. How many individuals will be aliveafter T years, if they do not reproduce? Let Xi represent the lifetime of individual i, and Yi,t = 1Xi>t,where 1x equals 1 whenever x is true, and 0 otherwise. Therefore, the set {Yi,t} is independent forany fixed t, and Yt = ∑n

i=1 Yi,t is binomially distributed, with parameters N and pt = e−λt. As aconsequence, the expected population size at time T equals N(T ) = N pt = Ne−θT . The correctfluid model formulation for this simplified system is as follows:

y′(t) = −θy(t)

y(0) = N.

It is noteworthy that the respective solution is N(t), precisely, the expected number of individualsin time t. Further, if we add a Poissonian arrivals with intensity λ, we should adjust the model toinclude arrival contributions:

y′(t) = λ − θy(t)

y(0) = N.

The special case θ = 0 corresponds to a linearly increasing population y(t) = N + λt, in accordancewith the initial population N and arrival rate λ. This is consistent with the expected arrivals in aPoissonian process.

3.2. General fluid model for peer-assisted systems

Our formulation will involve more variables than the illustrative example, but the concepts areessentially the same. Consider an open network that offers K video items with sizes {s1, . . . , sK}.Peers join the network, download progressively one or possibly many concurrent video items andabort the system when they wish. Peers are then classified in exhaustive and mutually disjoint setsC1, . . . ,CK , where Ci is the set of peers who download i video items simultaneously. Denote xi

j(t)the number of peers from class Ci who are downloading video j in a certain instant t. They join thenetwork following a Poissonian process of respective rates λi

j , and abort the system with exponentiallaw, and respective rates θ i

j . The number of seeders owning exactly i video items, and seeding video jat instant t are denoted by yi

j(t), and depart the system exponentially with rates γ ij . We will assume

identical peers, with respective upload and download capacities denoted by μ and c. Peers alsocontribute with the system uploading video streaming. The exchange efficiency between peers isa coefficient η : 0 ≤ η ≤ 1 that indicates the sharing percentage between downloaders. All seedersfrom class Ci that own video j can decide a portion αi

j of their available uploading capacity, in order

C© 2014 The Authors.International Transactions in Operational Research C© 2014 International Federation of Operational Research Societies

Page 5: Analysis and design of peer-assisted video-on-demand services

P. Romero et al. / Intl. Trans. in Op. Res. 21 (2014) 559–579 563

to feed downloaders of video j (naturally,∑

j αij = 1). Super-peers behave like seeders, but they do

not leave the system. They are denoted by zij , and have upload capacity ρ. All this information can

be summarized in a GFM, specified as follows:

dxij(t)

dt= λ

ji − θ i

jxij(t) − min

{ci

jxij(t), ημi

jxij(t) +

∑k

(μk

j ykj (t) + ρk

j zkj

)}(1)

dyij(t)

dt= min

{ci

jxij(t), ημi

jxij(t) +

∑k

(μk

j ykj (t) + ρk

j zkj

)} − γ ij y

ij(t), (2)

where additionally:

(1) μij = μi

s jis the class Ci upload rate for video j, and

∑k μk = μ.

(2) cij = ci

s jis the class Ci download rate for video j, and

∑k ck = c.

(3) ρ ij = ρi

s jis the class Ci upload rate of video j for super-peers, and

∑k ρk = ρ.

(4) θ ij is the departure rate of peers.

(5) γ ij is the departure rate of seeders.

The minimum function means that the bottleneck is either in downloading or uploading. TheGFM is a nonlinear switched system of ordinary differential equations.

4. Two outstanding submodels

4.1. Concurrent fluid model (CFM)

The number of variables involved in the GFM forces us to assume further hypotheses in order toanalyze the stationary state of the system and have an insight of the super-peers optimal behavior,which are the only nodes that can be managed by the network operator. Inspired in BitTorrent-basedsystems, we will strictly stick to the following assumptions:

(1) “Fair transmission”: the resources are equally distributed in the different concurrent videos:μi = μ

i , ci = ci , and ρi = ρ

i .(2) “Tit-for-tat”: Peers in class Ci who at time t are downloading video j receive from all other

downloaders a streaming rate proportional to the upload bandwidth μij and their population:(

μijx

ij(t)∑

k μkj x

kj (t)

) ∑k

ημkj x

kj (t) = ημi

jxij(t).

(3) “Fair seeders”: Peers from class Ci who at time t are downloading video j receive from all theseeders a streaming rate proportional to the download bandwidth and their population:(

cijx

ij(t)∑

k ckj x

kj (t)

) ∑k

μkj y

kj (t) = αi

j

∑k

μkj y

kj (t).

C© 2014 The Authors.International Transactions in Operational Research C© 2014 International Federation of Operational Research Societies

Page 6: Analysis and design of peer-assisted video-on-demand services

564 P. Romero et al. / Intl. Trans. in Op. Res. 21 (2014) 559–579

(4) “Fair super-peers”: Analogously, peers from class Ci who at time t are downloading video jreceive from all the super-peers a streaming rate proportional to the download bandwidth andtheir population: αi

j∑

k ρkj zk

j .(5) “Peers departures”: The peers and seeders departures follow the “Zipf law,” being linearly

decreasing with respect to the number of concurrent video streaming: γ ij = γ /i, and θ i

j = θ/i.

After including these BitTorrent-based assumptions to the GFM we get the P2P-CFM:

dxij(t)

dt= λi

j − θ

ixi

j(t) − min

{c

is jxi

j(t), ημ

is jxi

j(t) + αij

∑k

s j

ykj (t)

k+ ρ

s j

zkj

k

)}(3)

dyij(t)

dt= min

{c

is jxi

j(t), ημ

is jxi

j(t) + αij

∑k

s j

ykj (t)

k+ ρ

s j

zkj

k

)}− γ i

j yij(t). (4)

The traditional CDN (with a client-server paradigm) can be viewed as a particular case of thisanalytical approach. Specifically, users do not cooperate (μ = 0), seeders do not participate inthe network (yi

j(t) = 0), and the previously named super-peers are now static servers. Replacingthese parameters in expression (3), the CDN-CFM is defined by the following system of ordinarydifferential equations:

dxij(t)

dt= λi

j − θxi

j

i− min

{cs j

xij(t)

i, αi

j(t)∑

k

ρkj zk

j

}. (5)

4.2. Rest point analysis for CFM

If we find a time t such that simultaneously dx ji (t)

dt = dy ji (t)dt = 0 for every pair i, j ∈ [K], the system

will rest indefinitely in the same constant vector state (xij, yi

j ). This is called a stationary state. Now,we will find the stationary state for the P2P-CFM. We denoted for short [n] = {1, . . . , n}.Proposition 1. The rest point for the P2P-CFM is

xijP2P

= max

⎧⎨⎩

iλijs j

θs j + c,

iλij(λ j − ρ j − φ j )

λ j(θ + ημ

s j− μθ

γ s j)

⎫⎬⎭ (6)

yijP2P

= λij − θ i

jxij

γ ij

, (7)

where ρ j = ∑k ρk

j zkj and φ j = μλ j

γ s j.

C© 2014 The Authors.International Transactions in Operational Research C© 2014 International Federation of Operational Research Societies

Page 7: Analysis and design of peer-assisted video-on-demand services

P. Romero et al. / Intl. Trans. in Op. Res. 21 (2014) 559–579 565

Proof. Summing Equations (3) and (4) we immediately prove expression (7). When the downloadcapacity is the system’s bottleneck then the minimum function is equal to c

is jxi

j , so the steady state

for the P2P-CFM can be found by solving following linear system of equations:

xij = is jλ

ij

is jθ + c. (8)

Denote short ρ j = ∑k ρk

j zkj and φ j = ∑

kμk

j λkj

γ kj

= μλ j

γ s j.

On the other hand, when the upload capacity is the system’s bottleneck, and summing (3) for allj ∈ [K], we get

∑i

xij

i=

(θ + ημ

s j− μθ

γ s j

)λ j − φ j − ρ j

. (9)

Additionally, Equation (3) can be rewritten as follows:

λij =

⎛⎝θ + ημ

s j− μθ

γ s j+ ρ j + φ j∑

ixi

j

i

⎞⎠ xi

j

i. (10)

Replacing (9) in (10) and spreading the expression, we obtain the desired result. �The expressions for the steady state in the CDN can be immediately obtained by making μ = 0

in Equation (6):

xijCDN

= xijP2P

(μ = 0) = max

{iλi

js j

θs j + c,

iλij(λ j − ρ j )

θλ j

}. (11)

Now we can compare the capacity of the P2P-CFM and CDN-CFM systems. Let us assumestability for a moment (we prove asymptotic stability of a special but important case in the followingsubsection). Denote T P2P

CF M and TCDNCF M the expected waiting times under regime for the respective

systems P2P-CFM and CDN-CFM. The following proposition is intuitive, and is as follows.

Proposition 2. T P2PCF M ≤ TCDN

CF M .

Proof. Let λ = ∑i∑

j λji by the sum rate, T P2P

CF M and TCDNCF M the mean waiting times in P2P and CDN

architectures for concurrent services, respectively. By Little’s law, the mean waiting time experiencedby an arbitrary user equals the ratio between the number of users and sum rate:

T P2PCF M = 1

λ

∑i

∑j

xijP2P

,

TCDNCF M = 1

λ

∑i

∑j

xijCDN

.

Hence, it suffices to prove that the number of downloaders in the P2P fluid model is never greaterthan the one in the CDN model: xi

jP2P(μ) ≤ xi

jCDN= xi

jP2P(μ = 0). We use expressions (11) and

C© 2014 The Authors.International Transactions in Operational Research C© 2014 International Federation of Operational Research Societies

Page 8: Analysis and design of peer-assisted video-on-demand services

566 P. Romero et al. / Intl. Trans. in Op. Res. 21 (2014) 559–579

(6), and elementary calculus. If the download is the system’s bottleneck, the equality is obvious.Otherwise, the second argument of the maximum function in expression (6) must dominate, andits denominator λ j − ρ j − φ j is positive. We show that xi

jP2P(μ) is monotonically decreasing with

respect to μ, showing that the second argument has negative partial derivative with μ:

iλij(λ j − ρ j − φ j )

λ j(θ + ημ

s j− μθ

γ s j)

= −iλij

λ jγ s j

ηγ (λ j − ρ j ) + ρ jθ

(θ + ημ

s j− μθ

γ s j)2

< 0, (12)

where the latter inequality is obviously true, since λ j ≥ ρ j + φ j > ρ j . �The remainder of the paper focuses on an outstanding case, defined by a single-class system,

where each peer downloads exactly one video item at a time.

4.3. Sequential fluid model (SFM)

In this subsection, we will study the GFM in the particular case in which peers download exactlyone video item at a time (the single-class case—i = 1). We will call it P2P-SFM:

dxj(t)

dt= λ j − θ jx j(t) − min{c jx j(t), ημ jx j(t) + μ jy j(t) + ρ jz j}

dy j(t)

dt= min{c jx j(t), ημ jx j(t) + μ jy j(t) + ρ jz j} − γ jy j(t).

Either by a direct calculation or replacement with i = 1 in expressions (6) and

y jP2PSF M

= λ j − θxjP2PSF M

γ j

x jP2PSF M

= max

{λ js j

θs j + c,λ j(γ s j − μ) − γ ρz j

θ (γ s j − μ) + ηγμ

}.

Recall that an equilibrium point x of a dynamic system is locally stable, if there exists a positiveradius R such that for any arbitrary R < R we can find r < R that the orbit x(t) is inside the ballB(r, x) whenever the starting point is inside it. An equilibrium point x is asymptotically stable, ifit is locally stable and there is a radius R > 0 such that the orbit x(t) converges to x wheneverx(0) ∈ B(x, R). Finally, x is globally stable if the orbit x(t) converges to x for every starting point.The reader can find further definitions and examples in Luenberger (1979).

The P2P-SFM is a linear-switched system, that is, a special class of dynamic system. The globalstability of a special sub-system of the P2P-SFM has been studied in Qiu and Sang (2008). Moreprecisely, it is the P2P-SFM when a single video item is distributed and with no super-peer assistance(i.e. the unidimensional case with no terms ρ jz j). There, the global stability is proved, but the authorsdo not address any performance analysis. We state here that the P2P-SFM is always globally stable.The only assumption is that γ > 0. Otherwise, the number of seeders would increase indefinitely.

C© 2014 The Authors.International Transactions in Operational Research C© 2014 International Federation of Operational Research Societies

Page 9: Analysis and design of peer-assisted video-on-demand services

P. Romero et al. / Intl. Trans. in Op. Res. 21 (2014) 559–579 567

We will sketch an outline of the proof, paying attention to the subtle difference from that work, andleave details for the reader, that can be found in Qiu and Sang (2008).

Lemma 1. The P2P-SFM is locally stable whenever c jy jP2PSF M

�= ημ jx jP2PSF M

+ μ jy jP2PSF M

+ ρ jz j .

Remark 1. In fact, the P2P-SFM is also locally (and globally) stable in general. The proofs are trickybecause the behavior of the system is switched many times when the equality holds.

Proof. The P2P-SFM is a set of K independent ordinary differential equations in the (x, y)

plane. In the product topology, pointwise convergence is equivalent to convergence coordinate-wise.Therefore, the P2P-SFM is locally (globally) stable if and only if each block is locally (globally)stable. Without loss of generality, we will study the following linear switched system:

dxdt

= λ − θx(t) − min{cx(t), ημx(t) + μy(t) + ρz}dydt

= min{cx(t), ημx(t) + μy(t) + ρz} − γ y(t),

where x and y are, respectively:

x = max{

λ

θ + c,

(γ − μ)λ − γ ρz(γ − μ)θ + ημγ

}

y = λ − θxγ

.

The system switches between two linear systems. If c−μ

μx(t) ≤ y(t) + ρz

μ, the dynamic system is

governed by System I.

dx(t)dt

= λ − (θ + c)x(t)

dy(t)dt

= cx(t) − γ y(t).

Otherwise, the dynamic system is governed by System II.dxdt

= λ − (θ + ημ)x(t) − μy(t) − ρz}dydt

= ημx(t) + (μ − γ )y(t) + ρz.

First, we will study the stability of both systems separately. The solution of System I can beimmediately obtained for an arbitrary initial point (x(0), y(0)):

x(t) =(

x(0) − λ

θ + c

)e−(θ+c)t + λ

θ + c;

y(t) = k0e−γ t + k1e−(θ+c)t + λcγ (θ + c)

+ ρzμ

, if γ �= θ + c

y(t) = k2 + k3e−γ t + k4te−γ t, if θ + c = γ ,

C© 2014 The Authors.International Transactions in Operational Research C© 2014 International Federation of Operational Research Societies

Page 10: Analysis and design of peer-assisted video-on-demand services

568 P. Romero et al. / Intl. Trans. in Op. Res. 21 (2014) 559–579

for certain real numbers ki. The eigenvalues are −γ < 0 and −(θ + c) < 0. Hence, System I is alwaysglobally stable. Moreover, if c < μη then cx(t) < ημx(t) + μy(t) for all t ≥ 0 because y(t) ≥ 0, andthe P2P-SFM is governed by System I, hence globally stable in this case.

Recall that a linear system is locally (or globally) stable if and only if the real part of all itseigenvalues are negative. By direct calculations the characteristic polynomial of System II is asfollows:

p(λ) = λ2 + (θ + γ + (1 − η)μ)λ + μηγ + (γ − μ)θ.

The stability of System II depends on the parameters. Note in particular that if γ ≥ μ, the quadraticpolynomial p(λ) has all real positive coefficients, and consequently both eigenvalues are negative.Therefore, System II is globally stable when γ ≥ μ.

Now we return to the P2P-SFM. Let us call m = c−ημ

μand y0 = ρz

μ. On one hand, if the rest point

(x, y) is in Area I: mx < y + y0 and we choose (x(0), y(0)) near the rest point, then the P2P-SFMis governed by System I, which is globally (hence locally) stable. In this case, the P2P-SFM is locallystable. On the other hand, if the rest point is in Area II: mx > y + y0, and we choose a startingcondition near the rest point, the P2P-SFM is governed by System II, which is not always globallystable. Without loss of generality, we assume c > μη (otherwise we will have that the P2P-SFM isglobally stable). Suppose for a moment that γ < μ. Recall that γ y = λ − θx, so the condition ofArea II is equivalent to (mγ + θ )x < λ + γ y0, or equivalently:

0 < x = (γ − μ)λ − γ ρz(γ − μ)θ + ημγ

<μλ + γ ρz

μθ + γ (c − μη).

Note that the numerator of x is negative, so its denominator. By direct algebraic manipulations, wehave the following equivalent inequalities (all of them state that (x, y) is in Area II):

[(γ − μ)λ − γ ρz][μθ + γ (c − μη)] ≥ [μλ + γ ρz][(γ − μ)θ + ημγ ],

γ λ(c − ημ) ≥ μλc + γ ρz(c + θ ),

λc(γ − μ) ≥ γ λμη + γ ρz(c + θ ),

but the latter inequality is impossible, since γ < μ and the right-hand-side is positive. Then neces-sarily γ ≥ μ whenever the rest point is in Area II, in which case System II is stable and hence, theP2P-SFM is again locally stable in this case. �

The analysis of the special case mx = y + y0 is not straightforward, and is tied to global stability.However, a more general result is true (recall that γ j > 0 for all j ∈ [K], otherwise the P2P-SFM istrivially unstable, because the number of seeders will increase indefinitely).

Theorem 1. The P2P-SFM is globally stable.

Proof. The main idea is to prove that the evolution (x(t), y(t)) (for each block of the P2P-SFM)rests indefinitely after a certain t0 either in Area I or Area II, and finally use Lemma 1 to conclude.The reader can write-out a complete proof from Qiu and Sang (2008), where the authors study avery similar system, but with a single file and no super-peer assistance (i.e. without the constantterm ρz in the minimum argument). �

C© 2014 The Authors.International Transactions in Operational Research C© 2014 International Federation of Operational Research Societies

Page 11: Analysis and design of peer-assisted video-on-demand services

P. Romero et al. / Intl. Trans. in Op. Res. 21 (2014) 559–579 569

We omit the proof, which can be reproduced from Qiu and Sang (2008). Lemma 1 can alsobe obtained from that previous work, but the most difficult case (local stability in Area II) hasparticular difficulties, as could be appreciated in the end of the proof. The curious reader can find acareful analysis of linear switched systems and a vast number of references in Liberzon and Morse(1999).

We briefly review the traditional CDN for this important single-class system (CDN-SFM):

dxj(t)

dt= λ j − θ jx j(t) − ρ jz j .

The CDN-SFM is globally stable unless θ = 0 and λ j > ρ jz j . In the latter scenario, peers do notabort the system and arrive massively, in a way that cannot be served reasonably, and the systemcollapses. Otherwise, the peer population converges to the rest point xj :

xjCDNSF M

= λ j − ρ jz j

θ j.

In this case, the complete expected evolution for the peer population can be found:

xj(t) = (xjCDNSF M

− xj(0))(1 − e−θt ) + xj(0).

4.4. Sensibility analysis and consistency

The performance of the peer-to-peer video-on-demand sequential system is never worse than itsequivalent CDN version.

Proposition 3. T P2PSF M ≤ TCDN

SF M .

Proof. By Theorem 1, the system converges to the rest point. Again, the equality holds when thedownload is the system’s bottleneck. Otherwise, it is enough to show that xj

P2PSF M

< xjCDNSF M

, andthe result follows from Little’s law. We exploit the inheritance of the rest points from sequentialsubmodels and Proposition 2:

xjP2PSF M

= x1j

P2P

CF M≤ x1

j

CDN

CF M= xj

CDNSF M

. (13)

In order to understand the consistency of the obtained results, we will analyze the sensibility ofthe expected time TjSF M

for video j, with respect to the network parameters: entry rates, abortionrates, file-sharing efficiency, sizes of the different video items and super-peers capacities. We wouldlike to remark that the number of peers under the rest point does not depend on the seeders abortingrate if it is large enough. In fact, when γ s j >> μ we have

xjSF M≈ γ (λ j s j − ρz j )

γ (θs j + ημ)= λ js j − ρz j

θs j + ημ. (14)

C© 2014 The Authors.International Transactions in Operational Research C© 2014 International Federation of Operational Research Societies

Page 12: Analysis and design of peer-assisted video-on-demand services

570 P. Romero et al. / Intl. Trans. in Op. Res. 21 (2014) 559–579

In real-life networks, the seeders usually abort after complete downloading, and expression (14) isindeed a good approximation. Additionally, the upload is the system’s bottleneck, and γ s j >> μ isa reasonable assumption. In the light of Theorem 1, we conclude that sequential video-on-demandnetworks are globally stable. With Little’s law, we can find a rough approximation for the expecteddownload times for video j ∈ [K] in the SFM:

TjSF M= xj

P2PSF M

λ j= 1

λ j

λ js j − ρz j

θs j + ημ. (15)

By taking partial derivatives of expression (15) with respect to the network parameters, it can beobserved:

1. The waiting times are monotonically increasing with respect to the videos sizes. This is consistentwith our intuitive idea that bigger files will take more time:

∂TjSF M

∂s j= 1

λ j

λ jημ + θρz j

(θs j + ημ)2> 0. (16)

2. If the entry rates increase, peers will wait more. This is a common element of waiting systemswith limited resources:

∂TjSF M

∂λ j= ρz j

λ2j (θs j + ημ)

> 0. (17)

3. When the abortion rates of peers θ increases, the expected waiting times are consequentlyreduced:

∂TjSF M

∂θ= −s j

λ j

λ js j − ρz j

(θs j + ημ)2< 0. (18)

It is evident that peers who depart before downloading will experience lower sojourn times,whereas the number of peers under steady state is hence reduced. The departure rates play therole of a decay in the entry rate.

4. Naturally, when the sharing efficiency η is increased, the throughput of the system increases aswell, and the mean waiting times are consequently reduced.Finally, the throughput of the system increases with the super-peers capacity ρ, and the numberof replicas for video j in the network, z j .

5. Combinatorial optimization problem (COP)

5.1. Description

The main goal of a caching policy is to minimize the mean waiting times in a progressive on-demandservice (in this case, assisted by super-peers). For the sake of simplicity and efficiency, we will focus

C© 2014 The Authors.International Transactions in Operational Research C© 2014 International Federation of Operational Research Societies

Page 13: Analysis and design of peer-assisted video-on-demand services

P. Romero et al. / Intl. Trans. in Op. Res. 21 (2014) 559–579 571

on the P2P sequential fluid model (P2P-SFM), in which closed forms can be obtained for the meanwaiting times.

Let us denote X by the random variable that represents the class of an entry peer in the SFM.Since arrivals are Poisson processes with intensity rates λi, P(X = i) = λi

λ, λ being the sum rate. The

mean waiting time of a user in the P2P-SFM can be found analogously to the GFM (via Little’s lawand conditional expectation):

E (T ) = 1λ

K∑j=1

xjP2PSF M

.

Accordingly, the mean waiting time is proportional to the whole population size, so we will minimizethe latter.

We must decide the number of video replicas among P super-peers. The decision variable isa binary matrix E of size P × K, whose entries are E (p, j) = 1 if and only if we store videoitem j ∈ [K] in super-peer p ∈ [P]. We also impose that every video item must be duplicated, foravailability and redundancy reasons. Let un be the unit column vector of n elements (all its entriesare 1), s = (s1, . . . , sK )t the video sizes and S = (S1, . . . , SP)t the super-peers’ storage capacity.

We define the caching problem in a matrix form as follows:

minE

K∑j=1

max

{λ js j

θs j + c,λ js j − ρz j

θs j + ημ

}(19)

s.t. (20)

E × s ≤ S (21)

Et × uP = z (22)

z ≥ 2uK (23)

E (p, j) ∈ {0, 1}, ∀p ∈ [P], j ∈ [K]. (24)

The objective is to minimize the mean waiting times among all video items. The first constraintstates that super-peer’s storage capacity cannot be exceeded. The second constraint relates thenumber of replicas for video item j, named z j , with the matrix S (summing its columns). Finally,the third constraint imposes that each video item must be available in the network at least twice. Wewill prove that the feasibility problem is NP-complete. As a corollary, we will have that the questionwhether exists or not a solution that achieves a lower bound is also NP-complete. The followingdecision problems will be useful.

Definition 1. PARTITION: Given a set of positive integers A = {a1, . . . , an}. Is there a subset B ⊂ Asuch that

∑B ai = ∑

BC ai?

PARTITION is an NP-complete decision problem (Garey and Johnson, 1979).

Definition 2. CACHING–FEASIBILITY : Given an arbitrary instance of the caching problem.Does it accept a feasible solution?

C© 2014 The Authors.International Transactions in Operational Research C© 2014 International Federation of Operational Research Societies

Page 14: Analysis and design of peer-assisted video-on-demand services

572 P. Romero et al. / Intl. Trans. in Op. Res. 21 (2014) 559–579

Definition 3. CACHING–QUALITY : Given an arbitrary instance of the caching problem and apositive real c. Does it accept a feasible solution whose score is not lower than c?

Theorem 2. CACHING–FEASIBILITY is NP-complete.

Proof. We will prove both that CACHING–FEASIBILITY is in NP and find a reduction fromPARTITION, hence proving its hardness. Given an arbitrary instance of the caching problem anda binary matrix E , we can determine in polynomial time by a nondeterministic Turing Machinewhether the solution is feasible or not. In fact, we find E × s in OK2 operations, so Constraint(21) can be checked in polytime with the input K. The vector z can also be computed by a matrixtimes a vector, in OK2 sums, and compared with 2uK in OK operations. Therefore, CACHING–FEASIBILITY is in NP.

We will find a reduction from PARTITION now. To close the proof, we will show that if we candetermine feasibility of an arbitrary instance of the caching problem in polynomial time, then wewould solve PARTITION in polynomial time as well. Consider an arbitrary set of positive integersA = {a1, . . . , an} and let us call S = ∑n

i=1 ai. We construct the following caching problem instance,with P = 3, S1 = S, S2 = S3 = S/2, and s j = a j for all j ∈ [n]. It is clear that this transformationis polynomial. Given that S1 + S2 + S3 = 2

∑ni=1 si, Constraint (23) forces the three super-peers to

store video items at their full capacity. Therefore, a feasible solution complies that S1 = ∑B ai =∑

BC ai = S2 = S/2, for a certain B ⊂ A. As a consequence, if CACHING–FEASIBILITY can besolved for every instance in polynomial time, then every instance of PARTITION can be solved inpolynomial time as well. This concludes that the decision problem CACHING–FEASIBILITY isNP-complete. �

Corollary 1. CACHING–QUALITY is NP-complete.

Observe that the objective function depends on the variable z j = ∑p E (p, j) if and only if the

maximum function is dominated by its second argument. This is true if and only if

λ js j − ρz j

θs j + ημ>

λ js j

θs j + c. (25)

Inequality (25) can be rewritten to obtain

2 ≤ z j <λ j

ρ

c − ημ

c + θs j, (26)

where we added the constraint z j ≥ 2.The following remarks are corollary of expression (26), and help understanding the limits in the

design of a P2P video-on-demand assisted service:

1. Unless c > ημ, the peers contribution to the system can be neglected without sacrificing per-formance. In practice, the peers download capacity is always higher than its upload, so theinequality holds.

2. If the super-peers’ capacity ρ is extremely high in relation with the peers needs λ j , the cooperationcan be neglected again.

C© 2014 The Authors.International Transactions in Operational Research C© 2014 International Federation of Operational Research Societies

Page 15: Analysis and design of peer-assisted video-on-demand services

P. Romero et al. / Intl. Trans. in Op. Res. 21 (2014) 559–579 573

3. The decision variable z j is also upper-bounded. In fact, the streaming rate is divided into thedownlink once a new video item is included in the super-peers’ storage. Inequality (26) representsa threshold for z j .

We will solve the caching problem under different scenarios in order to show the strength andlimitations of a P2P video-on-demand assisted service.

5.2. Greedy randomized resolution

Grasp is a well-known metaheuristic, which has been applied for solving many hard combinatorialoptimization problems with high performance. It is a multistart iterative process, in which eachiteration consists of two phases: construction and local search. The construction phase buildsa feasible solution, whose neighborhood is explored by local search. The best solution over allGRASP iterations is returned as the result. Details of this metaheuristic can be seen in Resende andRibeiro (1995).

We present MultiSeed, a GRASP resolution for the caching problem, enriched with a postopti-mization path-relinking technique. MultiSeed can be studied in three stages. The first one constructsa seed of our GRASP-heuristic, and it is named GreedySeed. The second stage is a classical localsearch improvement, named LocalSearch. We run n times Stages 1 and 2 to have a pool of initialelite solutions (i.e. solutions with high performance). Finally, Stage 3 combines the previous poolto further introduce a postoptimization process, called path relinking. Path relinking is a valu-able enhancement of the GRASP methodology to tackle several hard combinatorial problems. Itis used as a postoptimization step, combining the best solutions so far, or even as an enhance-ment of a local search or construction phase during a GRASP resolution. The main idea is todefine a path between two given solutions, trying to find a better one inside the path (note thateach step possibly considers a decay in quality, since the terminal solutions of the path can belocally optimal). We recommend the reader to consult Resende and Ribeiro (2005) and Ribeiro andResende (2012) for the concept of path relinking and its implementation issues. MultiSeed is sketchedin Algorithm 1.

Algorithm 1. E = MultiSeed (n, λ, θ, γ .η, s, S, μ, c, ρ)

1: for j = 1 to n do2: E∗

j = GreedySeed (λ, θ, γ .η, s, S, μ, c, ρ)

3: Ej = LocalSearch(E∗j )

4: end for5: for i �= j = 1 to n do6: Ei, j = ReLink(Ei, Ej )

7: end for8: return E = Best(Ei,j )

We will present GreedySeed , LocalSearch, and Relink in order. In GreedySeed , every video isgreedily stored in the two “fattest” super-peers (i.e. the ones with the highest remaining storagecapacity). Note that in this multiknapsack flavored problem, the costs are the item’s sizes s j ,

C© 2014 The Authors.International Transactions in Operational Research C© 2014 International Federation of Operational Research Societies

Page 16: Analysis and design of peer-assisted video-on-demand services

574 P. Romero et al. / Intl. Trans. in Op. Res. 21 (2014) 559–579

whereas the profits are the reduction of the population xj . Then, we introduce the cost-benefitvector W = (w1, . . . , wK ) such that

wj = 1

s jx jP2PSF M

.

Note that a reduction in the cost-to-benefit ratio represents cache or time savings. The populationsize xj

P2PSF M

depends on the number of super-peers z j seeding video j, which a priori is unknown.For that reason, we compute first an approximation W ′ = (w′

1, . . . , w′K ) for the vector W :

w′j = wj|z j=0 = min

{θs j + c

λ js2j

,θs j + ημ

λ js2j

}. (27)

In practice the peer’s upload capacity is always lower than its download, so ημ < c, and

w′j = θs j + ημ

λ js2j

(28)

Without loss of generality, we will assume that w′1 > w′

2 > · · · > w′K (in other words, videos are

numbered in decreasing cost-benefit when z j = 0).GreedySeed is specified in Algorithm 2. The vector W ′ is computed in Line 1, using Equation

(27). The video items are sorted in decreasing cost-benefit ratio, in Line 2. In the iterative block(Lines 3–8) each video item is assigned in turns to the two fattest super-peers, named p1 and p2.Video item j is then stored in both super-peers: the decision variables E (p1, j) and E (p2, j) areturned on in Lines 5 and 6, respectively. Finally, the super-peer resources {Si}i=1,...,P are updatedin Line 7. Under optimistic scenarios (enough memory in cache nodes), Algorithm GreedySeedreturns a feasible solution, contained in the decision matrix E∗.

Algorithm 2. E∗ = GreedySeed (λ, θ, γ .η, s, S, μ, c, ρ)

1: W ′ ← FindW(λ, θ, γ .η, s, μ, c, ρ)

2: SortVideos(W ′)3: for j = 1 to K do4: (p1, p2) ← TwoFattest(S1, . . . , SP)

5: E∗(p1, j) ← 16: E∗(p2, j) ← 17: U pdate(S1, . . . , SP)

8: end for9: return E∗

In order to improve the solution E∗ returned by GreedySeed , a local search improvement isintroduced in a second stage. The idea is very simple: in each step we first try to add, delete or swapvideo items in super-peers. The pseudocode for this local search stage is shown in Algorithm 3.

Remark 1.

1. Functions Add, Delete, and Swap work only if the new solution is feasible and better.2. The effects of Functions Add and Delete never cancel out.

C© 2014 The Authors.International Transactions in Operational Research C© 2014 International Federation of Operational Research Societies

Page 17: Analysis and design of peer-assisted video-on-demand services

P. Romero et al. / Intl. Trans. in Op. Res. 21 (2014) 559–579 575

Algorithm 3. E = LocalSearch(E∗)1: (E∗, improve) ← Add(Rand (SP,Video))

2: IF improve Go to Line 13: (E∗, improve) ← Delete(Rand (SP,Video))

4: IF improve Go to Line 15: (E∗, improve) ← Swap(Rand (SP1,V 1), Rand (SP2,V 2))

6: IF improve Go to Line 17: E ← E∗

8: Return E

In order to further enhance the pool of elite solutions {E∗i }i=1,...,n, an ad hoc path-relinking

postoptimization technique is finally introduced for the caching problem. We will construct apath between two given solutions Ei and Ej , in such a way that all intermediate solutionsare feasible. Note that adding videos to super-peers never breaks feasibility; however, the dele-tion of video items might reach to unfeasible solutions. Therefore, we will exploit our transi-tive neighborhood structure using functions ADD, DELETE, and SWAP carefully, and in thatorder (recall that function SWAP preserves feasibility). We relax those functions: now, ADD(DELETE) simply adds (deletes) one video, no matter whether the new solution is better ornot.

ReLink is detailed in Algorithm 4. The worse solution will be the source s of the path (Line 1),whereas the better one is the terminal t (Line 2). Therefore, we have a forward path relinking. Line 3iteratively adds video items to s covering new feasible solutions. Function AddToInclude appliedADD operation to the starting solution s in a selective order, until t has no more video replicas thans in any video item (the whole video set from solution t is included in the new solution sn1

). It isnoteworthy that the resulting solution sn1

could have more video items than t. Therefore, in Line 4,an opposite operation called DeleteToDraw deletes video items from sn1

until the same cardinalitieshold between sn2

and t (there is a “draw” in the counting of video items between sn2and t). In Line

5, the final swaps are applied in order to reach the terminal solution t. They are simply calls offunction SWAP, where the video items are selected to reach the terminal solution. Finally, the bestsolution from the path is found and returned in Line 6.

Algorithm 4. Ei j = Relink(Ei, Ej )

1: s ← Worse(Ei, Ej )

2: t ← Better(Ei, Ej )

3: (s1, . . . , sn1) ← AddToInclude(s)

4: (sn1+1, . . . , sn2) ← DeleteToDraw(sn1

)

5: (sn2+2, . . . , sn3) ← SwapToGet(sn2

, t)6: Return Ei j = Best(s1, . . . , sn3

)

Observe that all movements are deterministic, and respect the order of the video itemsfrom the will vector. The deterministic nature of the paths could be easily turned to stochas-tic by choosing random operations instead of a fixed video ordering. A new generation com-bining the new pool with path relinking was not included as a sake to bound computationalcosts.

C© 2014 The Authors.International Transactions in Operational Research C© 2014 International Federation of Operational Research Societies

Page 18: Analysis and design of peer-assisted video-on-demand services

576 P. Romero et al. / Intl. Trans. in Op. Res. 21 (2014) 559–579

6. Results in a real-life scenario

Currently, GoalBit supports high-quality Live and on-Demand video streaming to end users. Wewish to improve the performance of the VoD distribution by adding or removing video replicas inthe system. In order to predict the behavior of our new storage-scheduling technique, we picked upreal-life traces taken from YouTube. A crawler script was designed to collect some useful informationas follows:

1. We take a video URL to start.2. From this URL we get useful video data (size, time online, number of views, and others).3. We save these data in a database.4. We collect all the related videos URLs, and go back to Step (1) with a new video URL.

The crawler’s script source code (PHP and MySQL) is available at Rodrıguez-Bocca and Rostagnol(2012).1

The process described above was executed during 3 days, allowing us to have useful informationof more than 50,000 videos. The initial video was chosen from YouTube’s home page, having theidentifier 1DJOTEDBA2c.2

With the collected information we estimated “videos’ popularities” λ j based on the number ofviews and the time online. We stress the system introducing a popularity factor β to the vector(λ1, . . . , λK ). In this way, we can contrast the performance of a CDN versus P2P deploymentin flash-crowded, less-populated, and intermediate scenarios. We use an abortion rate of θ = 0, 1peer per second, file-sharing efficiency of η = 0, 5, download rate of c = 1 Megabytes per second,d = c/4, and a system with P = 4 super-peers (or servers) with a capacity of ρ = 10 Megabytes persecond, storing K = 59, 000 video items. The video and super-peer(s) where to apply the LocalSearchoperations (add a video, delete a video, or swap two videos) are randomly selected. In this case, weuse the MatLab rand () function that generates uniformly distributed pseudorandom numbers. AllMatLab scripts are available at Rodrıguez-Bocca and Rostagnol (2012).

Figure 1 shows the estimated download time for the P2P and CDN models (with solid anddashed lines, respectively) versus i, where the stress factor β takes values 10i, i = 1, . . . , 15. Figure 1underlines two essential features. First, the expected time for a P2P sequential system is never worsethan the one of a traditional CDN system, as can be predicted by Proposition 3. Second, theperformance of both systems is quite similar for less-populated scenarios, whereas the time savingsfor peers are remarkable in highly populated scenarios.

A second experiment was conducted to figure out how the system’s performance can be affectedin terms of scalability. For a fixed popularity factor, we want to find the mean waiting times fordifferent number of super-peers (servers). Figure 2 illustrates the average waiting time for both P2Pand CDN systems (with solid and dashed lines, respectively) versus P, where P is the number ofsuper-peers (servers) in the system. We fixed the popularity factor β = 103, but a similar behavior canbe appreciated for other popularities. From this experiment, we can conclude that P2P system can

1Note that YouTube can change video’s web-pages (HTML and page’s structure) so the crawler could need some adjust-ments in order to be reexecuted.

2Initial YouTube video URL: http://www.youtube.com/watch?v=1DJOTEDBA2c.

C© 2014 The Authors.International Transactions in Operational Research C© 2014 International Federation of Operational Research Societies

Page 19: Analysis and design of peer-assisted video-on-demand services

P. Romero et al. / Intl. Trans. in Op. Res. 21 (2014) 559–579 577

0 0

1 1

2 2

3 3

4 4

5 5

6 6

7 7

8 8

9 9

10 10

0 1 2 3 4 5 6 7 8 9 10

Est

imat

ed d

ownl

oad

time

Est

imat

ed d

ownl

oad

time

Popularity factor (10^i)Popularity factor (10^i)

T_P2PT_P2P

T_CDNT_CDN

Fig. 1. Download time for CDN and P2P when increasing popularity.

0

1

2

3

3 4 5 6 7 8 9 10

Est

imat

ed d

ownl

oad

time

Est

imat

ed d

ownl

oad

time

Number of super-peersNumber of super-peers

T_P2PT_P2P

T_CDNT_CDN

Fig. 2. Download time for CDN and P2P versus the number of cache servers.

work similarly with less resources, while CDN has a very important variability in its performancewhen increasing the number of servers. The results suggest that peers can download the desiredvideo item more than five times faster than users in the traditional CDN, in massive scenarios.This suggests that the average waiting time in the P2P system is consistently low, whereas the CDNperformance is effectively improved distributing the load to more servers. All tests were executedin a home-PC (Intel Core i7, 8 GB RAM), getting more than 300,000 modifications during theLocalSearch phase, with a running-time of 14 hours for each experiment. However, we suspect the

C© 2014 The Authors.International Transactions in Operational Research C© 2014 International Federation of Operational Research Societies

Page 20: Analysis and design of peer-assisted video-on-demand services

578 P. Romero et al. / Intl. Trans. in Op. Res. 21 (2014) 559–579

LocalSearch phase stucked in a locally (possibly globally) optimum, since the resulting solutionsafter this phase were exactly the same, and the postoptimization phase could not take any effect.

7. Conclusions and future work

In this work, we presented a general framework for the analysis and design of concurrent andsequential video-on-demand assisted services. Under this framework of expected evolution, thesequential system is always globally stable, converging to a known rest point. We found closedexpressions for the expected waiting times in both CDN and P2P approaches, and theoreticallyconfirmed that the peer-to-peer philosophy always outperforms the traditional CDNs, showing thefirst hint of effectiveness in the assisted cooperative network.

An experimental validation of the P2P and CDN systems and their performance is presentedconsidering real traces taken from YouTube. The results are encouraging, showing that a P2P-assisted platform preserves its resilience against adverse environments such as flash crowds. Anend user is predicted to wait more than five times longer in a pure CDN when a flash crowd isencountered.

There are several aspects and open problems that deserve further research. We are interested in thepeer-assisted performance in concurrent scenarios. We only proved that the cooperative philosophyoutperforms the traditional client-server architecture, but we could not determine whether bothmechanisms are stable or not. Moreover, we address a static caching problem, where video itemsare stored beforehand. However, a challenging design would dynamically adapt to changes ina controlled system, regarding the video popularity and transient number of peers. Our trendsfor future work include stability and capacity analysis in concurrent video-on-demand assistedscenarios, and the implementation of concurrent services in the GoalBit platform.

References

Abboud, O., Pussep, K., Kovacevic, A., Mohr, K., Kaune, S., Steinmetz, R., 2011. Enabling resilient p2p video streaming:survey and analysis, Multimedia Systems 17, 3, 177–197.

Bertinat, M.E., Vera, D.D., Padula, D., Robledo, F., Rodrıguez-Bocca, P., Romero, P., Rubino, G., 2009. Goalbit: thefirst free and open source peer-to-peer streaming network. Proceedings of the 5th international IFIP/ACM LatinAmerican conference on Networking (LANC’09), ACM, New York, pp. 83–93.

Bingham, J.A., 2000. ADSL, VDSL, and Multicarrier Modulation: Wiley Series in Telecommunications and Signal Pro-cessing. John Wiley & Sons, New York.

Cohen, B., 2003. Incentives build robustness in BitTorrent. Proceedings of the 1st Workshop on Economics of Peer-to-PeerSystems, Berkeley, CA, Vol. 1, pp. 1–5.

De Veciana, G., Yang, X., 2003. Fairness, incentives and performance in peer-to-peer networks. In 41st Annual AllertonConference on Communication, Control and Computing, Monticello, IL.

Do, T.T., Hua, K.A., Tantaoui, M.A., 2004. P2VoD: providing fault tolerant video-on-demand streaming in peer-to-peer environment. Proceedings of the IEEE International Conference on Communications (ICC 2004), Paris,pp. 1467–1472.

Garey, M.R., Johnson, D.S., 1979. Computers and Intractability: A Guide to the Theory of NP-Completeness. W.H.Freeman & Co., New York.

C© 2014 The Authors.International Transactions in Operational Research C© 2014 International Federation of Operational Research Societies

Page 21: Analysis and design of peer-assisted video-on-demand services

P. Romero et al. / Intl. Trans. in Op. Res. 21 (2014) 559–579 579

Huang, C., Li, J., Ross, K.W., 2007. Can Internet video-on-demand be profitable? SIGCOMM Computer CommunicationReview 37, 4, 133–144.

Huang, Y., Fu, T.Z., Chiu, D.-M., Lui, J.C., Huang, C., 2008. Challenges, design and analysis of a large-scale P2P-VoDsystem. SIGCOMM Computer Communication Review 38, 4, 375–388.

Kreitz, G., Niemela, F., 2010. Spotify—large scale, low latency, P2P music-on-demand streaming. Proceedings of the 10thIEEE International Conference on Peer-to-Peer Computing (P2P), Delft, The Netherlands, pp. 1–10.

Liberzon, D., Morse, M., 1999. Basic problems in stability and design of switched systems. IEEE Control System Magazine19, 59–70.

Luenberger, D., 1979. Introduction to Dynamic Systems: Theory, Models, and Applications. Wiley, New York.PPStream home page, 2007. Available at http://www.ppstream.com/ (accessed 12 February 2014).Qiu, D., Sang, W., 2008. Global stability of peer-to-peer file sharing systems. Computer Communications 31, 2, 212–219.Qiu, D., Srikant, R., 2004. Modeling and performance analysis of BitTorrent-like peer-to-peer networks. Proceedings of

SIGCOMM’04, ACM, New York, NY, pp. 367–378.Resende, M.G.C., Ribeiro, C.C., 1995. Greedy randomized adaptive search procedures. Journal of Global Optimization 6,

2, 109–133.Resende, M.G.C., Ribeiro, C.C., 2005. Grasp with path-relinking: recent advances and applications. In Ibaraki, T.,

Nonobe, K., Yagiura, M. (eds) Metaheuristics: Progress as Real Problem Solvers. Springer, New York, pp. 29–63.Ribeiro, C.C., Resende, M.G.C., 2012. Path-relinking intensification methods for stochastic local search algorithms.

Journal of Heuristics 18, 2, 193–214.Robledo, F., Rodriguez-Bocca, P., Romero, P., Rostagnol, C., 2012. Stability and capacity of peer-to-peer assisted video-

on-demand applications. The 4th International Congress on Ultra Modern Telecommunications and Control Systemsand Workshops (ICUMT), St. Petersburg, Russia, pp. 328–335.

Rodrıguez-Bocca, P., Rostagnol, C., 2011. Optimal download time in a cloud-assisted peer-to-peer video-on-demandservice. In Pahl, J., Reiners, T. and Vo, S. (eds) Network Optimization, Vol. 6701 of Lecture Notes in ComputerScience, Springer, Berlin, pp. 283–288.

Rodrıguez-Bocca, P., Rostagnol, C., 2012. GRASP and YouTube’s web-crawler source code and data. Available athttp://www.goalbit-solutions.com/www/publications/itor2013 grasp matlab.zip (accessed 3 February 2014).

Tewari, S., Kleinrock, L., 2007. Analytical model for BitTorrent-based live video streaming. 4th IEEE Consumer Com-munications and Networking Conference (CCNC’07), Las Vegas, NV, pp. 976–980.

Tian, Y., Wu, D., Ng, K.-W., 2006. Analyzing multiple file downloading in BitTorrent. Proceedings of ICPP’06, IEEE,Columbus, OH, pp. 297–306.

C© 2014 The Authors.International Transactions in Operational Research C© 2014 International Federation of Operational Research Societies