Optimal Peer Selection for P2P Downloading and Streaming

Similar documents
Optimal Peer Selection in a Free-Market Peer-Resource Economy

Chapter 3 Savings, Present Value and Ricardian Equivalence

Financing Terms in the EOQ Model

Peer-to-Peer File Sharing Game using Correlated Equilibrium

Software Engineering and Development

Channel selection in e-commerce age: A strategic analysis of co-op advertising models

Ilona V. Tregub, ScD., Professor

An Introduction to Omega

AN IMPLEMENTATION OF BINARY AND FLOATING POINT CHROMOSOME REPRESENTATION IN GENETIC ALGORITHM

Effect of Contention Window on the Performance of IEEE WLANs

Converting knowledge Into Practice

Questions & Answers Chapter 10 Software Reliability Prediction, Allocation and Demonstration Testing

Modeling and Verifying a Price Model for Congestion Control in Computer Networks Using PROMELA/SPIN

Cloud Service Reliability: Modeling and Analysis

Problem Set # 9 Solutions

Over-encryption: Management of Access Control Evolution on Outsourced Data

Efficient Redundancy Techniques for Latency Reduction in Cloud Systems

The Supply of Loanable Funds: A Comment on the Misconception and Its Implications

Promised Lead-Time Contracts Under Asymmetric Information

CHAPTER 10 Aggregate Demand I

Questions for Review. By buying bonds This period you save s, next period you get s(1+r)

STUDENT RESPONSE TO ANNUITY FORMULA DERIVATION

Database Management Systems

Scheduling Hadoop Jobs to Meet Deadlines

An Approach to Optimized Resource Allocation for Cloud Simulation Platform

An Efficient Group Key Agreement Protocol for Ad hoc Networks

Nontrivial lower bounds for the least common multiple of some finite sequences of integers

9:6.4 Sample Questions/Requests for Managing Underwriter Candidates

Things to Remember. r Complete all of the sections on the Retirement Benefit Options form that apply to your request.

Comparing Availability of Various Rack Power Redundancy Configurations

Give me all I pay for Execution Guarantees in Electronic Commerce Payment Processes

Data Center Demand Response: Avoiding the Coincident Peak via Workload Shifting and Local Generation

The Binomial Distribution

Semipartial (Part) and Partial Correlation

A framework for the selection of enterprise resource planning (ERP) system based on fuzzy decision making methods

HEALTHCARE INTEGRATION BASED ON CLOUD COMPUTING

est using the formula I = Prt, where I is the interest earned, P is the principal, r is the interest rate, and t is the time in years.

Top K Nearest Keyword Search on Large Graphs

Comparing Availability of Various Rack Power Redundancy Configurations

INITIAL MARGIN CALCULATION ON DERIVATIVE MARKETS OPTION VALUATION FORMULAS

ON THE (Q, R) POLICY IN PRODUCTION-INVENTORY SYSTEMS

How To Find The Optimal Stategy For Buying Life Insuance

An Analysis of Manufacturer Benefits under Vendor Managed Systems

Concept and Experiences on using a Wiki-based System for Software-related Seminar Papers

Automatic Testing of Neighbor Discovery Protocol Based on FSM and TTCN*

Referral service and customer incentive in online retail supply Chain

Define What Type of Trader Are you?

A Capacitated Commodity Trading Model with Market Power

Open Economies. Chapter 32. A Macroeconomic Theory of the Open Economy. Basic Assumptions of a Macroeconomic Model of an Open Economy

Saturated and weakly saturated hypergraphs

The impact of migration on the provision. of UK public services (SRG ) Final Report. December 2011

Chris J. Skinner The probability of identification: applying ideas from forensic statistics to disclosure risk assessment

Approximation Algorithms for Data Management in Networks

Financial Planning and Risk-return profiles

Gravitational Mechanics of the Mars-Phobos System: Comparing Methods of Orbital Dynamics Modeling for Exploratory Mission Planning

Online Competitive Algorithms for Ad Allocation in Cellular Networks (AdCell)

Reduced Pattern Training Based on Task Decomposition Using Pattern Distributor

Research on Risk Assessment of the Transformer Based on Life Cycle Cost

Loyalty Rewards and Gift Card Programs: Basic Actuarial Estimation Techniques

Spirotechnics! September 7, Amanda Zeringue, Michael Spannuth and Amanda Zeringue Dierential Geometry Project

How To Use A Network On A Network With A Powerline (Lan) On A Pcode (Lan On Alan) (Lan For Acedo) (Moe) (Omo) On An Ipo) Or Ipo (

YARN PROPERTIES MEASUREMENT: AN OPTICAL APPROACH

Chapter 2 Valiant Load-Balancing: Building Networks That Can Support All Traffic Matrices

Review Graph based Online Store Review Spammer Detection

Controlling the Money Supply: Bond Purchases in the Open Market

Dual channel closed-loop supply chain coordination with a reward-driven remanufacturing policy

MULTIPLE SOLUTIONS OF THE PRESCRIBED MEAN CURVATURE EQUATION

Firstmark Credit Union Commercial Loan Department

FXA Candidates should be able to : Describe how a mass creates a gravitational field in the space around it.

An Epidemic Model of Mobile Phone Virus

NBER WORKING PAPER SERIES FISCAL ZONING AND SALES TAXES: DO HIGHER SALES TAXES LEAD TO MORE RETAILING AND LESS MANUFACTURING?

Tracking/Fusion and Deghosting with Doppler Frequency from Two Passive Acoustic Sensors

Liquidity and Insurance for the Unemployed

How to recover your Exchange 2003/2007 mailboxes and s if all you have available are your PRIV1.EDB and PRIV1.STM Information Store database

Lab #7: Energy Conservation

Distributed Computing and Big Data: Hadoop and MapReduce

An application of stochastic programming in solving capacity allocation and migration planning problem under uncertainty

883 Brochure A5 GENE ss vernis.indd 1-2

Real Time Tracking of High Speed Movements in the Context of a Table Tennis Application

Risk Sensitive Portfolio Management With Cox-Ingersoll-Ross Interest Rates: the HJB Equation

High Availability Replication Strategy for Deduplication Storage System

PLANNING THE CAPACITY OF A WEB SERVER: AN EXPERIENCE REPORT

2 r2 θ = r2 t. (3.59) The equal area law is the statement that the term in parentheses,

Secure Smartcard-Based Fingerprint Authentication

Saving and Investing for Early Retirement: A Theoretical Analysis

Research and the Approval Process

IBM Research Smarter Transportation Analytics

An Infrastructure Cost Evaluation of Single- and Multi-Access Networks with Heterogeneous Traffic Density

Fixed Income Attribution: Introduction

Uncertain Version Control in Open Collaborative Editing of Tree-Structured Documents

Fast FPT-algorithms for cleaning grids

The transport performance evaluation system building of logistics enterprises

Do Vibrations Make Sound?

NUCLEAR MAGNETIC RESONANCE

Optimizing Content Retrieval Delay for LT-based Distributed Cloud Storage Systems

Liquidity and Insurance for the Unemployed*

Mining Relatedness Graphs for Data Integration

Timing Synchronization in High Mobility OFDM Systems

Coordinate Systems L. M. Kalnins, March 2009

The LCOE is defined as the energy price ($ per unit of energy output) for which the Net Present Value of the investment is zero.

Transcription:

Optimal Pee Selection fo P2P Downloading and Steaming Micah Adle, Rakesh Kuma, Keith Ross, Dan Rubenstein, Tosten Suel and David D. Yao Dept. of Compute Science, Univesity of Massachusetts Amhest, MA; Email: micah@cs.umass.edu Dept. of Electical Engineeing, Polytechnic Univesity, NY; Email: kuma04@utopia.poly.edu Dept. of Compute and Infomation Science, Polytechnic Univesity, NY; Email: oss@poly.edu Dept. Of Electical Engineeing, Columbia Univesity, NY; Email: dan@ee.columbia.edu Dept. of Compute and Infomation Science, Polytechnic Univesity, NY; Email: suel@poly.edu IEOR Dept., Columbia Univesity, NY; Email: yao@columbia.edu Abstact In a P2P system, a client pee may select one o moe seve pees to download a specific file. In a P2P esouce economy, the seve pees chage the client fo the downloading. A seve pee s pice would natually depend on the specific object being downloaded, the duation of the download, and the ate at which the download is to occu. The optimal pee selection poblem is to select, fom the set of pees that have the desied object, the subset of pees and download ates that minimizes cost. In this pape we examine a numbe of natual pee selection poblems fo both P2P downloading and P2P steaming. Fo downloading, we obtain the optimal solution fo minimizing the download delay subject to a budget constaint, as well as the coesponding Nash equilibium. Fo the steaming poblem, we obtain a solution that minimizes cost subject to continuous playback while allowing fo one o moe seve pees to fail duing the steaming pocess. The methodologies developed in this pape ae applicable to a vaiety of P2P esouce economy poblems. Keywods Economics, Mathematical Pogamming/optimization. I. INTRODUCTION Today many computes paticipate in pee-to-pee file shaing applications in which widely distibuted nodes contibute stoage and bandwidth esouces [1], [2], [3], [4]. It is widely documented, howeve, that these P2P systems ae havens fo fee ides : a significant faction of uses do not contibute any significant esouces, and a minute faction of uses contibute the majoity of the esouces [1], [5], [6]. Thus, to impove the pefomance of existing P2P file shaing systems, and to enable new classes of P2P applications, a compelling incentive system needs to be put in place to encouage uses to make thei esouces available. Now suppose the existence of an online maketplace whee entities - such as pees, companies, uses etc. - buy and sell suplus esouces. In this maket place, a pee might puchase stoage and bandwidth fom a dozen othe pees fo the pupose of emotely backing up its files; a content publishe might puchase stoage and bandwidth fom thousands of pees to ceate a peediven content distibution netwok; a biotechnology company might puchase CPU cycles fom thousands of pees fo distibuted computation. If such a flouishing esouce maket existed, individual pees would be incited to contibute thei esouces to the maketplace, theeby unleashing the untapped esouce pool. We envision a fee-maket esouce economy in which pees buy and sell esouces diectly fom each othe [7], [8]. In this maket, selling pees ae fee to set the pices of thei esouces as they please. A client pee, inteested in puchasing a specific esouce, is pemitted to shop the diffeent seve pees and choose the pees that best satisfy its needs at the best pices. The money paid by the client pees and eaned by the seve pees may be eal money, o some pseudo-cuency simila to fequent flye miles. When a selle eans money, it can late spend the money in the esouce maket, obtaining esouces fom othe selle pees. In a P2P esouce economy a client pee can select one o moe seve pees fo downloading a file o steaming a stoed audio/video object. In geneal, multiple seve pees may have the object available, with each offeing a diffeent pice. A seving pee s pice will natually depend on the specific object, the duation of the tansmission, and the ate at which the tansmission is to occu. The client may obtain diffeent potions of the object in paallel fom diffeent seving pees, as is cuently aleady the case with KaZaA and othe file shaing systems. The optimal pee selection poblem is to select, fom the subset of the pees that have the desied object, a set of pees and downloading ates that minimize cost and/o delay. Moe specifically, when a client pee wants to obtain a specific object, the following steps may be taken: (1) Discovey: The client fist uses a look-up sevice to discove seve pees that have a copy of the object. KaZaA is one example of such a lookup sevice, but stuctued DHTs could also be used

fo this. (2) Picing: The client then queies the seve pees fo thei pices. Altenatively, pice infomation might be available via the lookup sevice. (3) Reputation: The client may also use a eputation sevice to detemine the eliability of each of the seve pees. (Reputation sevices ae beyond the scope of this pape; see [9], [10].) (4) Seve and ate selection: Fom the subset of eputable seve pees offeing the object, the client pee selects the seve pees fom which it obtains the object. The client obtains diffeent segments of the object fom each of the selected seve pees. The seves may offe a segment at diffeent upload ates, and advetise an upload pice as a function of the upload ate. The client pee will natually want to choose the seve pees (and ates) to minimize cost and delay. (5) Payment: Money is tansfeed fom the client pee to the seve pees. A potocol fo tansfeing money in a P2P esouce maket is descibed in [7], [8]. In this pape we study the optimal pee selection poblem fo two delivey schemes: (i) steaming, whee the potions of the object must aive in a timely manne such that the client pee can ende the object without glitches; (ii) downloading, whee the client wants to eceive the entie file as quickly and inexpensively as possible, but does not ende the file duing the download. Fo both schemes, thee ae many vaiations of the optimal pee selection poblem. Fo example, fo downloading, one can minimize the download delay subject to a cost constaint, o minimize the cost subject to a download delay constaint. We do not attempt to solve all possible vaiations in an encyclopedic manne. Instead, we have fomulated a few poblems that we feel ae paticulaly epesentative and impotant. The techniques developed in this pape can be extended to othe natual vaiations. Fo the downloading poblem, we fomulate and solve the poblem of minimizing the (paallel) downloading time subject to a budget constaint. We find that the optimal solution is a geedy one in which costly seves ae fully excluded fom downloading. We also detemine the Nash equilibium fo the seves pices. Fo the steaming poblem, we conside the poblem of minimizing cost subject to a continuous-playback constaint. Because seve pees often fail (because of intentional o unintentional disconnects fom the P2P system), we also conside pee failues in ou fomulation. We ae able to find the optimal solution when any subset of f chosen pees may fail. We solve the steaming poblem fo both convex and concave cost functions. Fo both schemes, a content publishe may also be an active component of the system. Fo example, CNN.com may contact with a lage numbe of pees to stoe chunks of video files. When anothe pee, say Alice, asks CNN to see a video, CNN may select the pees on Alice s behalf. The selected pees would then eithe steam o upload the object, depending on the delivey scheme. The methodology developed in this pape is applicable when the client pee is to select the seve pees, o when an intemediate pee (such as CNN) selects the seve pees on the client s behalf. The contibution of ou wok is the development of theoetical methodologies fo these types of pee selection poblems. To facilitate the analysis, we use a model of the netwok whee delivey ates can moe o less be guaanteed. As discussed in the next section, this assumption can be patially justified due to the abundance of bandwidth in the Intenet coe. Implementation of pee selection techniques in moe accuate netwoking models, while not explicitly addessed in this pape, can moe easily be accomplished by using ou esults as a guide o stating point. II. PRICING MODEL In this section we descibe ou picing model. As mentioned in the intoduction, each seve is fee to set its own pices. Conside a seve pee i. As pat of a delivey session, pee i will tansfe a potion of the bytes of some object o to a client pee. Fo such a delivey, the seve pee will fix an appopiate pice that could natually depend on: The object itself: Fo example, ecently-eleased objects (e.g., videos) might be moe expensive than olde objects. Rate of tansfe: The seve may be able to tansfe the object at diffeent ates, and chage diffeent pices fo diffeent ates. In this pape we suppose that pee i has a maximum tansfe ate u i and can tansfe at any ate b in the inteval [0, u i ]. Duation of tansfe: The longe the tansfe (at some constant ate), the moe a seve should chage. We typically expect the seve s pice to be popotional to the duation of the tansfe. Fo a paticula object o, we conside picing functions of the fom pice = c i (b i ) t i whee b i [0, u i ] is the ate (in bytes pe second) of the tansfe fom seve i and t i is the duation of the tansfe fo seve i. Thus, fo a given tansfe ate b i the pice is popotional to the duation of tansfe. It is natual to assume that c i (0) = 0 and c i ( ) is nondeceasing fo all i = 1,..., I. Futhemoe, depending on the boade context, a cost-ate function c i ( ) may be eithe convex o concave. Fo example, if a seve is shaing its upsteam bandwidth esouces between the P2P downloading application and othe applications,

then the maginal cost to the seve of allocating moe bandwidth to the steaming application can be inceasing with b i, in which case c i ( ) is convex. On the othe hand, the seve may pefe to sell in bulk to individual clients (because of client acquisition costs), in which case c i ( ) is natually concave. We theefoe analyze both the convex and concave cases fo both the downloading and steaming poblems. Note that if a seve sends at ate b i bytes/sec fo a duation of t i seconds, then the seve tansfes x i = b i t i bytes. This implies that the pice can also be defined in tems of the ate b i and the object size x i since the pice is equal to c i (b i )t i = [c i (b i )/b i ]x i. Thus, c(b) is the cost pe unit time fo data steamed at ate b, and c(b)/b is the cost pe byte fo data steamed at ate b. Befoe poceeding, let us examine moe caefully what it means fo a seve to be able to tansfe bytes at a specific ate b. A seve i will have access to the Intenet with some upsteam ate u i. At any given time, the seve pee i could be tansfeing files to multiple pees, with each file tansfe taking place at its negotiated ate. In ode to meet its commitment, seve i, of couse, must ensue that the sum of all the committed tansfe ates does not exceed its upsteam access ate u i. In today s Intenet (and in the foeseeable futue), the bottleneck is typically in the access and not in the Intenet coe. Futhemoe, in most boadband esidential connections today (including cable modem and ADSL), the upsteam ate is significantly less than the downsteam ate. Thus, in many cases the bandwidth bottleneck between seve and client is the seve s upload ate. It is theefoe easonable to assume that a seve can povide an offeed ate b as long as the sum of seve s committed ongoing ates is less than u i. Even when this assumption is uneasonable, the fomulations and esults of this pape povide a famewok and stating point fo studying scenaios without the assumption. Thee will be situations, howeve, when the seve will not be able to hono its commitment due to unusual congestion o sevice failues in the coe. In this case, the client pee may want some fom of a efund. Futhemoe, eithe the seve o the client may be dishonest and may not agee on whethe the sevice was actually endeed. Thus, some fom of abitation - pefeably lightweight - may be needed in a ealistic P2P esouce maket; see, e.g., [7]. In Section IV, we will descibe a client stategy that allows one o moe of the contacted pees to fail, eithe because of technical poblems o dishonesty. III. OPTIMAL PEER SELECTION FOR DOWNLOADING As discussed in the Intoduction, in this pape we exploe the optimal pee selection poblem fo two delivey schemes, steaming and downloading. In this section we conside the downloading poblem, in which case the client wants to eceive the entie file as quickly and inexpensively as possible, but does not ende the file while downloading. Natually, a client desiing a specific object o would like to obtain the object as quickly as possible and at lowest possible cost. These two objectives will often be conflicting, as seves that povide high tansfe ates may also demand high pe-byte tansfe costs. Thee ae many ways to fomulate an optimization poblem that takes into account these conflicting goals. In this section, we conside one natual fomulation: the client selects the pees and ates in ode to minimize the total download time subject to a budget constaint fo the download. (Although not consideed hee, the poblem of minimizing the cost subject to a constaint on the download time is also tactable.) We can now define the optimal downloading poblem. Conside a client pee that wants to download a file o. Let F be the size (in bytes) of the file. As descibed in the intoduction, the client pee uses a location sevice to find the set of pees, denoted in the following as {1,, I}, that have a copy of the file. Each seve pee i in this set advetises a pice function c i (b i ), b i [0, u i ]. We assume that the client pee has a budget K fo this paticula download, that is, the client pee is pepaed to spend up to K units on the download. Let t i be the tansfe time fo seve i in this download, i.e., the amount of time that i paticipates in the download. If the client pee does not select seve pee i, then t i = 0. The numbe of bytes tansfeed by seve pee i is b i t i. Because the client wants to obtain the entie file, we have b 1 t 1 + + b I t I = F. Ou optimal pee selection poblem is to detemine b i, i = 1,..., I, and t i, i = 1,..., I, that minimize the total download time subject to the budget constaint. Because the client is downloading fom multiple seve pees in paallel, the total download time is the maximum of the t i. Thus, the optimization poblem is subject to min max{t 1,..., t I } (1) c 1 (b 1 )t 1 + + c I (b I )t I K (2) b 1 t 1 + + b I t I F (3) 0 b i u i i = 1,..., I (4) t i 0 i = 1,..., I (5) Note that since the the cost functions c i (b) ae nondeceasing, any optimal solution must make the constaint in (3) binding. (Fo othewise, we can decease b i and/o t i fo some i, while maintaining feasibility and not inceasing the objective value.) Also note that without the budget constaint (2), the optimal solution is given by b i = u i, t i = F/(u 1 + +

u I ), i = 1,..., I, and the esulting minimal download time is F/(u 1 + + u I ). In othe wods, without the budget constaint, in the optimal solution, the client downloads fom all of the seves at thei maximum ates until all client have eceived all the bytes in the file. Thus F/(u 1 + + u I ) is a lowe bound fo the value of the optimization poblem (1). A. Concave Picing Functions As discussed in Section II, depending on the boade context, a cost function c i ( ) may be eithe convex o concave. We fist conside the scenaio when c i (b), b [0, u i ] is concave, fo all i = 1,..., I. As it will become evident below, this scenaio also povides the solution fo the case when each seve is capable of tansmitting at only the ate u i at cost c i = c i (u i )/u i pe byte. Lemma 1: Suppose fo all i = 1,..., I, c i (b) is concave fo b [0, u i ]. Then, thee exists an optimal solution such that fo each i = 1,..., I: b i = 0 if t i = 0, and b i = u i if t i > 0. Poof: If t i = 0 fo some i, then letting b i = 0 will not affect eithe the constaints o the objective value. To ague the case of t i > 0 implying b i = u i, we fist note that the concavity of c i (b), along with c i (0) = 0, implies that c i (b)/b is non-inceasing in b. Hence, stat with any optimal solution (b i, t i ) I i=0, if t j > 0 and b j < u j fo some j, we can then modify the solution to b j = u j, t j = b j t j /u j t j. This way, b j t j = b j t j, hence, the constaint in (3) emains intact, while the constaint in (2) continues to hold since c j (b j)t j c j (b j )t j, which is equivalent to c j (b j)/b j c j (b j )/b j, i.e., the non-inceasing popety of c j (b)/b mentioned above. Futhemoe, since t j t j, the objective value will not incease. The above lemma implies that the optimal decision on the ates, b i s, follows diectly fom the optimal t i s, and hence can be eliminated fom the poblem fomulation. Specifically, letting c i := c i (u i )/u i, the oiginal poblem can be educed to the following equivalent linea pogam (LP): s.t. min y (6) c i x i K, (7) i i x i F, (8) 0 x i u i y, i. (9) To see the equivalence, suppose (b i, t i ), i = 1,..., I, is an optimal solution to the oiginal poblem. Then, letting y = max{t i }; x i = b i t i, i = 1,..., I i esults in a feasible solution to the LP, taking into account b i = 0 o u i fo all i. Convesely, if (y, x 1,..., x I ) is the optimal LP solution, then a feasible solution to the oiginal poblem is obtained by letting fo each i, b i = t i = 0 if x i = 0, and b i = u i and t i = x i /u i if x i > 0. Theefoe, it suffices to solve the LP poblem. To this end, e-ode the seve pees such that Also, denote 0 < c 1 < < c I. (10) j B j := u i, j β j := u i c i. (11) It is easy to veify that β j /B j is inceasing in j, since β j B j β j+1 B j+1 iff β j B j c j+1, and the last inequality follows fom (10). We note that if β 1 /B 1 > K/F, that is, K < F c 1, then thee is no feasible solution to the LP. Hencefoth, we assume β 1 /B 1 K/F. Theoem 1: Suppose fo all i = 1,..., I, c i (b) is concave fo b [0, u i ]. Then the solution to the LP, and hence the oiginal downloading poblem, takes the following fom: (a) If K/F β I /B I, then x i = u i y fo all i, whee y = F/B I. (b) Othewise, suppose fo some j I we have Then, whee β j B j > K F β j 1 B j 1. x i = u i y, i j 1; x j = F yb j 1 ; x j+1 = = x n = 0; y = F c j K c j B j β j. In both cases, y is the optimal objective value. Poof: If β I /B I K/F, then it is easily seen that x i = u i y fo all i, whee y = F/B I, is a feasible solution to the LP, with a download time equal to the lowe bound F/B I. Thus, this solution is clealy optimal. Next, conside the case of β I /B I < K/F. The dual of the above LP is as follows, with the dual vaiables v and w coesponding, espectively, to the constaints in (7) and (8), and z i coesponding to x i u i y in (9):

min F w Kv (12) s.t. w z i c i v 0, (13) u i z i 1, (14) i v 0, w 0, z i 0, i. Below, we stat deiving a dual feasible solution, which then leads to a pimal feasible solution via complementay slackness. Once these ae veified dual and pimal feasibility and complementay slackness the poblem is completely solved. Letting the constaints in (13) and (14) be binding, we get: z i = w c i v, (15) w = 1 + vβ I B I. (16) Then, the dual objective becomes F w Kv = F ( F βi ) + B I B K v. Conside, fo the time being, B I > K F β B. Then v = v I := 1/(c I B I β I ). Note c I B I > β I follows fom (10); and fo all i, z i = 1 ( βi ) + c i v I 0 B I B I follows fom v I β I 1 c i B I β I, i : c i B I > β I, since c n c i. Also note that z n = 0. The dual feasible solution esults in a dual objective value as follows: F B I + ( F βi B I K ) 1 = F c I K. (17) c I B I β I c I B I β I Fo the coesponding pimal solution, conside the following: x i = u i y, i I; x I = F yb ; (18) whee y is the pimal objective value, obtained via substituting the above solution into (7) and making the latte an equality: ( ) yβ + c I F yb = K, fom which we can obtain F c I K y = = F c I K, (19) c I B β c I B I β I i.e., the pimal objective value is equal to the dual objective value in (17). We still need to veify pimal feasibility and complementay slackness. Fist note that y 0 follows fom (17): both tems on its LHS ae positive. Then x n 0 is equivalent to F B F B I + ( F βi B I ) K v I, which simplifies (with some algeba) to K F β B, the assumed condition in Case (ii). Othe aspects of pimal feasibility hold tivially. Complementay slackness is eadily veified: all pimal vaiables ae positive, and all dual constaints ae binding; all dual vaiables except z I ae positive, and all pimal constaints except x I u I y, the I-th constaint in (9), ae binding. Next suppose K/F falls into the following ange: Then, the dual solution is: v = v := and β B > K F β I 2 B I 2. 1 (c B β ), w = 1 + v β B, z i = w c i v, i I 1; z I = 0. The pimal solution is: x = u i y, i I 2; x = F yb I 2, x I = 0; and y = F c K c B I 2 β I 2 = F c K c B β. Feasibility (pimal and dual) and complementay slackness can be veified as befoe. Roughly speaking, Theoem 1 indicates that the client downloads in paallel fom the least expensive seves at thei maximum ates. The numbe of paallel seves is detemined fom the budget constaint. To meet the budget constaint with equality, one of the selected seves tansmits fo less time than the othe paallel seves. Again, this esult is tue fo two impotant special cases: (i) when the the cost pe byte is linea in b fo all seves; and (ii) when each selected seve can tansmit only at one ate. B. Convex Picing Functions We now conside the downloading poblem fo convex picing functions. Specifically, in this section we suppose that c i (b) is convex with espect to b fo all i = 1,..., I. We ll see that this scenaio gives ise to a completely diffeent fom fo the optimal solution. In paticula, fo many natual picing functions, all I seves will be selected with none of seves tansmitting at its maximal ate. Let t denote the minimal download time fo the downloading poblem.

Theoem 2: Suppose c i (b) is convex in b fo all i = 1,..., I. Then, thee exists an optimal solution fo the downloading poblem with t i = t fo all i. Poof: Fist note that the convexity of c i (b) implies that c i (b)/b is non-deceasing in b. Suppose t i < t fo some i. Then, we can incease t i to t while deceasing b i to b i = b i t i /t. This way, thee is no incease in the objective value; the constaint in (3) emains intact; and the constaint in (2) still holds, since i.e., c i (b i )t i c i (b i)t, c i (b i )/b i c i (b i)/b i, which follows fom the non-deceasing popety of c i (b)/b mentioned above, as b i b i. We emak that Theoem 2 does not necessaily imply that all pees ae selected when the cost functions ae convex. Indeed, fo an optimal solution with t i = t fo all i, we may have b j = 0 fo one o moe seve pees j. The pees with b j = 0 ae not selected. Theoem 2 leads to a ecipe fo identifying the optimal solution. To this end, again let t denote the optimal download time and let b i, i = 1,..., I, be the coesponding optimal ates. By Theoem 2 and (2)-(5) we know that these ates must satisfy c 1 (b 1 )t + + c I (b I )t K (20) b 1 + + b I = F/t (21) 0 b i u i i = 1,..., I (22) Thus, to find the optimal solution we can seach ove all values of t F/(u 1 + + u I ); fo each value of t we solve the optimization poblem: minimize subject to c 1 (b 1 )t + + c I (b I )t (23) b 1 + + b I = F/t (24) 0 b i u i i = 1,..., I (25) The optimal t is found by finding the smallest t such that the objective value fo (23)-(25) is no geate than K. The optimization poblem is a maginal analysis poblem; it can be efficiently solved with the techniques in Section IV. Moeove, since the cost functions ae convex, the value of the optimization poblem (23)-(25) is convex in t (see Section IV). Thus, the optimal t can be found with a binay seach. We emak in passing that anothe inteesting aspect to conside is a estiction on the maximum download ate d to the client. In this case we would have the additional constaint b 1 + + b I d at all times. With asymmetic access (as in ADSL and most cable modem access systems), the downsteam bandwidth is typically lage than the upsteam bandwidth. Howeve, a client pee downloading fom multiple seve pees would eventually satuate the client s downsteam bandwidth d. We note that if each seve pee can tansmit only at one ate u i then the poblem of selecting an optimal set of pees and ates fo downloading a file unde a client bandwidth estiction can be easily shown to be NP- Complete, by a eduction fom the Knapsack poblem [11]. The poblem of selecting a set of seves with aggegate bandwidth as close as possible, but not lage than, the client bandwidth is basically just the Knapsack poblem. Fom the discussions in the last two subsections, in paticula the poofs of Lemma 1 and Theoem 2, it is clea that the equied concavity o convexity of the cost functions c i (b) can be elaxed to the weake condition of c i (b)/b being non-inceasing o non-deceasing, espectively. Note that a function f(x) with x 0 and f(0) = 0 is temed sta-shaped if f(x)/x is nondeceasing. This is a standad popety in eliability theoy, efe to [12]. It is well-known (and easy to veify) that a convex function is sta-shaped, but a sta-shaped function need not be eithe convex o concave. C. Nash Equilibium Suppose a client is inteested in downloading the file o of size F, and it makes its budget K known to the seve pees. Suppose now that each pee seve i is fee to set its picing function c i (b), 0 b u i. We now tun ou attention to the poblem of what picing function a seve should popose to this client. To simplify the analysis, suppose each seve can tansmit at eithe ate 0 o u i. Let c i := c i (u i )/u i. We efe to c = (c 1,..., c I ), consisting of all the poposed pices, as the picing vecto. Fo a given picing vecto c, the pee client will detemine the optimal numbe of bytes to allocate to each seve. Let (x 1 (c),..., x I (c)) denote the optimal allocation fo picing vecto c = (c 1,..., c I ). Fo a given c, seve i eans evenue R i (c) = c i x i (c). Assuming that the seves ae ational, a seve i would modify its cost c i if it could incease its evenue R i (c). A picing (c 1, c 2,..., c I ) is said to be a Nash equilibium if R i (c 1,..., c i + δ,..., c I) R i (c 1,..., c i,..., c I) fo all δ and all i = 1,..., I. In othe wods, (c 1, c 2,..., c I ) is a Nash equilibium if no seve can impove its evenue by unilateally changing its pice. To analyze the Nash equilibium, we emak that when ĉ i = K/F fo all i = 1,..., I, then ˆx i = u i F/(u 1 + + u I ), i = 1,..., I, is optimal fo the downloading poblem. To see this, note that (ˆx 1,..., ˆx I ) is feasible fo the picing vecto ĉ = (ĉ 1,..., ĉ I ) and gives the

minimal cost F/(u 1 + + u I ). We can now state the following coollay of Theoem 1. Coollay 1: ĉ i = K/F fo all i = 1,..., I is a Nash equilibium. Poof: We fist obseve that when ĉ i = K/F fo all i = 1,..., I, then ˆx i = u i F/(u 1 + +u I ), i = 1,..., I is optimal fo (6). To see this, note that (ˆx 1,..., ˆx I ) is feasible fo the picing vecto ĉ = (ĉ 1,..., ĉ I ) and gives the minimal cost F/(u 1 + + u I ). Now let c be a picing vecto that is identical to ĉ fo all components except component j, fo which c j = ĉ j + δ. It suffices to show that fo δ 0, R j ( c) < R j (ĉ). (26) Fist conside the case δ < 0. Fo the picing vecto c, the allocation (ˆx 1,..., ˆx I ) is optimal since it is feasible and it gives the minimal cost F/(u 1 + + u I ). Thus R j ( c) = (ĉ j + δ)ˆx j < ĉ j ˆx j = R j (ĉ), establishing (26). Now suppose δ > 0, so that c j > c i fo all i j. Reode the indices so that j = I. With the picing vecto c, we have β/b > K/F = β /B I. Thus, fom Theoem 1, x I = F yb whee y = (F ĉ I K)/(ĉ I B I β I ). It is staightfowad to show that c I B I β I = δb and F C I K = δf. Thus, y = F/B and x I = 0. Thus R I ( c) = (ĉ I + δ) x I = 0 < R I (ĉ), again establishing (26). The Nash equilibium in Coollay 1 has seveal notable popeties: 1) The pice ĉ i does not depend on u i, the upload ate of seve i. 2) All pees have the same pice in the Nash equilibium. 3) Fo each pee, the Nash pice is exactly equal to the pice pe byte that the client is willing to pay, namely, K/F. IV. OPTIMAL SELECTION FOR STREAMING In this section, we conside steaming of encoded (compessed) audio o video. The delivey constaints ae moe stingent than fo downloading: in ode to pevent glitches in playback, the seves must continuously delive segments of the object on o befoe thei scheduled playout times. An impotant paamete fo the steaming delivey is the object s playback ate, denoted by. Fo an object of size F with playback ate, the viewing time is T = F/ seconds. Suppose the use at the client begins to view the video at time 0. A fundamental constaint in the steaming poblem is that fo all times t with 0 t T, the client must eceive the fist t bytes of the object. We efe to this constaint as the continuousplayback constaint. Thus, when selecting the seve pees and the object potions to be obtained fom each seve pee, the client must ensue that this continuousplayback constaint is satisfied. A natual optimization poblem is, theefoe, to select the pees in ode to minimize the total steaming cost subject to continuous playback. To simplify the analysis and to see the foest though the tees, thoughout we assume that thee is no initial client buffeing befoe endeing, that is, the client begins playback as soon as it begins to eceive bytes fom any seve. Note that fo steaming, it is highly desiable that the playback can continue even if some of the seve pees fail to povide thei sevices. (In contast, fo downloading a seve failue will meely esult in a delay in the total download time.) Thus, it is impotant to explicitly account fo failue in the optimal pee selection poblem. As in the pevious section, denote {1,..., I} fo the set of seve pees that have a copy of the desied object, and denote c i (b) fo the cost pe unit time when pee i tansfes at ate b. To simplify the discussion, we emove the estiction b i u i ; thus, we allow b i to take any value in [0, ] fo all i = 1,..., I. Note that in geneal, the client must not only select a subset of pee seves, but it must also detemine and schedule the specific potions of the file that ae downloaded fom each selected pee, as well as the download ate fom each selected pee. Thee ae two boad appoaches that can be taken to solve this poblem: time segmentation and ate segmentation. In time segmentation, the video is patitioned along the time axis in distinct segments, and each seve is esponsible fo steaming only one of the segments in the patition. Typically in the optimal solution fo time segmentation, the client will begin downloading segments fom vaious seves befoe the scheduled playout times of the fist bytes of those segments. Thus, client buffeing is equied. Futhemoe, in the optimal solution, the client will typically eceive segments fom all the selected seves at the beginning of the video and fom only one of the selected seves at the end of the video. This means that the client must be able to download (at the beginning of the video) at a ate that is equal to the sum of the seve download ates, which will exceed the playback ate. In the ate segmentation appoach, each of the selected seves contibutes bytes fo each of the fames in the video, and at any instant of time the client downloads at the playback ate. In this pape we focus on ate segmentation. To justify focusing on ate segmentation, we now demonstate that fo convex cost functions, time segmentation is at least as expensive as ate segmentation in tems of download cost. Since time segmentation has the additional dawbacks of equiing both client buffeing and highe client download ates, ate segmentation fo such cost functions will usually be the bette stategy. Theoem 3: Suppose c i (b) is convex with espect to b fo all i = 1,..., I. Then fo any solution S that uses time segmentation, thee is a solution S using ate

segmentation that has no lage cost. Poof: Recall that F is the size (in bytes) of the object being steamed, is the ate of playback, and T = F/ is the endeing time of the object. The convexity of the cost functions implies that fo any ate b and any λ 1, c i (λb) λc i (b). In solution S, let x i be the numbe of bytes of the object sent by seve i and let t i be the length of time duing which seve i sends these bytes. Since t i T fo all i, time segmentation cost = = = I c i (b i )t i I c i ( x i T I I T t i )t i T t i c i ( x i T )t i c i ( x i ) T. (27) T In solution S, seve i still sends x i bytes, but these ae sent at a ate of b i = x i F = x i T ove the entie T seconds. Since i x i = F, we see that i b i = and thus the ate constaint is satisfied in solution S. Futhemoe, ate segmentation cost = = I c i (b i )t i I c i ( x i ) T. (28) T Compaing (27) and (28), we see that the cost of S is as least as geat as that of S. A. Poblem Fomulation In the ate-segmentation steaming poblem, to ensue continuous playback the client must eceive (at least) at ate at all times. Thus the objective of the steaming poblem is to choose the seve ates b 1,..., b I which minimize the total cost c 1 (b 1 )T + + c I (b I )T subject to the constaint that the total eceived ate is at least. Because the seves in a P2P system ae inheently uneliable, we must ensue that the client continues to eceive at ate even when one o moe of the selected seves fails. In the ensuing analysis, we allow fo up to one seve failue (in the next subsection we extend the analysis to multiple seve failues). If seve j fails duing some peiod of the steaming, then the client eceives at ate i j b i. Thus, to ensue that the client continues to eceive the video at ate even when thee is one failue, the ates b 1,..., b I must satisfy b i, j = 1,..., I. i j We theefoe aive at the following optimization poblem: min c 1 (b 1 ) + + c I (b I ) (29) s.t. b i, j = 1,..., I. i j 0 b i i = 1,..., I. Without loss of geneality we have included the constaints b i fo all i = 1,..., I. Indeed, if an optimal solution has b j > fo some j, we can always educe b j to without violating feasibility and without having to incease the objective value (since c j ( ) is a nondeceasing function). Befoe poceeding to solve this steaming poblem, we biefly say a few wods about implementation. The optimal solution to (29) typically has b 1 + + b K >, that is, the aggegate steaming ate (befoe failue) exceeds the encoded video ate. In pactice, the video would be easue encoded in a manne that seve i sends x i = b i T bytes and that client can econstuct the video if any I 1 of the I steams ae eceived. Although beyond the scope of this pape, it is indeed possible to devise such easue encoding schemes. The above poblem can be solved by fist solving the following poblem: fo any given y: 0 y, min c 1 (b 1 ) + + c I (b I ) (30) s.t. b i + y, i 0 b i y, i = 1,..., I. Denote C(y) as the coesponding optimal value. Then, solve the poblem min y C(y). To show that the two poblems ae equivalent, let Φ be the set of feasible solutions fo (29) and, Φ(y) be the set of feasible solutions fo (30). It is easily seen that if (b 1,..., b I ) belongs to Φ(y) fo some 0 y, then (b 1,..., b I ) also belongs to Φ. Futhemoe, it is seen that if (b 1,..., b I ) belongs to Φ then it also belongs to Φ(y), whee y = max i {b i }. Thus, Φ = y Φ(y) and hence minimizing c 1 (b 1 ) + + c I (b I ) ove Φ can be solved by minimizing c 1 (b 1 ) + + c I (b I ) ove each Φ(y) and then taking the minimum ove all 0 y. B. Convex Costs Suppose c i (.) is a convex function, fo all i = 1,..., I. Fo a given y, the subpoblem (30) can be solved in a vaiety of diffeent ways. Fo example, if the cost functions ae also diffeentiable, then (30) can be solved by solving c i (b i ) = α fo i = 1,..., I, and then

seaching though α so that b 1 + + b I = + y. We now povide a maginal allocation algoithm, which does not equie diffeentiability: Maginal Allocation: Stat with S := {1,..., I} and b i = 0 fo all i S. In each step identify i = ag min i S {c i(b i + ) c i (b i )}, whee > 0 is a pe-specified small incement (depending on equied pecision), and eset b i b i +. Wheneve b i > y, eset S S {i}. Continue until the constaint j b j + y is satisfied. Note that the complexity of this algoithm is popotional to I( +y)/. To detemine the best y, we can do a line seach on C (y) = 0, fo y [, ]. (If y <, then (30) is infeasible.) If C(y) is convex in y, then min y C(y) is itself geedily solvable: We can stat with y =, incease y by a small incement each time, solve the poblem in (30), and stop when C(y) ceases to decease o y = is eached. In this algoithm, when we go fom one y value to the next, say, y + δ, we do not have to do the maginal allocation that geneates C(y+δ) fom scatch (i.e., stating fom all x j values being zeo and S := {1,..., I}). We can stat fom whee the pevious ound of maginal allocation the one that geneates C(y) fist hits a bounday, i.e., b j = y fo some j, and continue fom thee. O, if no b j has hit the bounday in the pevious ound, then simply stat fom whee the pevious ound ends (i.e., continue with the solution geneated by the pevious ound). [Recall, y [, ]. As y inceases, the numbe of b j values that can hit the bounday in the maginal allocation will decease. Specifically, when y [ k 1, k 2 ], fo k = 3,..., I, the numbe of b j values that can hit the bounday cannot exceed k, since we have ky + y.] The convexity of C(y), in tun, is guaanteed if the c i ( ) ae convex functions. To see this, let (b i (y)) I denote the optimal solution to the poblem in (30), and conside two such poblems, coesponding to y = y 1 and y = y 2, espectively. Fo any α (0, 1), we have = α j αc(y 1 ) + (1 α)c(y 2 ) j c j (b j (y 1 )) + (1 α) j c j (αb j (y 1 ) + (1 α)b j (y 2 )), c j (b j (y 2 )) whee the inequality follows fom the convexity of the c j. Next, conside a thid vesion of (30), with y = αy 1 + (1 α)y 2. It is staightfowad to veify that αb j (y 1 )+(1 α)b j (y 2 ), j = 1,..., I, is a feasible solution to this poblem. Theefoe, we have c j (αb j (y 1 ) + (1 α)b j (y 2 )) C(y), j and hence αc(y 1 ) + (1 α)c(y 2 ) C(y) = C(αy 1 + (1 α)y 2 ). That is, C(y) is a convex function. To summaize, we have: Theoem 4: Suppose fo each i = 1,..., I, c i ( ) is a convex function. Then, the optimal value in (30), C(y), is convex in y. In this case, the steaming poblem in (29) is geedily solvable: In each step incease y by a small incement (stating fom y = ), apply the maginal allocation algoithm to geneate C(y), and stop when C(y) ceases to decease o y = is eached. C. Concave Costs Now, suppose the costs c i ( ), i = 1,..., I, ae concave (instead of convex) functions. The equivalence of (29) and (30) continues to hold. Howeve, thee ae two changes: (i) The maginal allocation will not geneate the optimal solution to (30). (ii) C(y) is no longe a convex function. (Neithe is it a concave function, fo that matte.) The eason fo (ii) is evident fom examining the ealie agument that established the convexity of C(y). The eason fo (i) is that the maginal allocation typically geneates a solution that is at the inteio of the feasible egion of the poblem in (30), which is a polytope. As such the solution can be expessed as a convex combination of the exteme points (vetices) of the feasible egion. (This follows fom the well-known Caathéodoy Theoem.) Due to the concavity, the objective value coesponding to this solution will dominate (i.e., be no smalle than) the convex combination of the objective values coesponding to the exteme points, and hence dominate the smallest of these values. Theefoe, to solve the optimization poblem in (30) in this case, we only need to conside the exteme points of its feasible egion. Fist, obseve that the constaint j b j +y must be binding at optimality; othewise, we could always educe some of the b j values and theeby impove the objective value while maintaining feasibility. Second, we divide the ange y [, ] into segments [ k 1, k 2 ], fo k = 3,..., I. Then, with the constaint j b j + y binding, it is clea that the numbe of b j values at the bounday, b j = y, cannot

exceed k when y [ k 1, k 2 ]. (Hee we assume I 3; the case of I = 2 is tivial: the optimal solution is b 1 = b 2 = y =.) Consequently, when y [ k 1, k 2 ], we only need to conside exteme points that take the following fom: b j = y fo k 1 distinct indices j, b l = (k 2)y fo anothe distinct index l, and b i = 0 fo all the emaining i s. Fo each such exteme point, the b i s sum up to (k 1)y + (k 2)y = + y, making the constaint j b j + y binding. Specifically, with y a given value in the inteval [ ], without loss of geneality, suppose k 1, k 2 c 1 (y) c 2 (y) c I (y), (31) c i1 ( (k 2)y) c ii ( (k 2)y), (32) whee (i 1,..., i I ) is a pemutation of (1,..., I). Denote α i := c i (y), β i := c i ( (k 2)y). Clealy, we only need to conside no moe than k such exteme points, which we shall efe to as nondominant. Each of the othe exteme points is dominant, in the sense that it s objective value C(y) will dominate (i.e., be at least as lage as) one of the non-dominant points. Let α i denote the vecto (α 1, α 2,..., α k ) without the component α i fo some i = 1,..., k. Then, specifically, these (possibly) non-dominant points ae (α 1 ; β 1 ), (α 2 ; β 2 ),..., (α k, β k ) (33) (α k ; β k+1 ), (α 2 ; β k+2 ),..., (α k, β I ). (34) As befoe, let C(y) denote the optimal objective value of (30). Then the C(y) value coesponding to an exteme point is the sum of k 1 values of α i (fo k 1 distinct i s) and one value of β j fo a j that is distinct fom all the i s. Theoem 5: Suppose that fo all i = 1,..., I, c i ( ) is a concave function. Then, the optimal solution to (30), fo y [ k 1, k 2 ], k = 3,..., I, is geneated by taking the minimum of the objective values, C(y), coesponding to the I points in (33) and (34). The solution to the steaming poblem in (29) is then obtained by applying a line seach to min y [/(),] C(y). We may be able to futhe eliminate some of the non-dominant points. Let us illustate this though an example. Conside n = 5. Suppose the pemutation in (31) is (i 1,..., i 5 ) = (2, 4, 1, 3, 5). Conside k = 4. Then, the following fou points coespond to the ones in (33): (1, 3, 4; 2), (1, 2, 3; 4), (2, 3, 4; 1), (1, 2, 4; 3). (35) A close examination tells us, howeve, that the last two of the fou points in (35) ae, in fact, dominant: they dominate, espectively, (1, 3, 4; 2) and (1, 2, 3; 4). Hence, in this case, thee ae only 2 non-dominant points. Specifically, any point that involves a β il such that i l violates the inceasing ode in the pemutation (i 1, i 2,..., i n ) cannot be a dominant point. This is the case fo 1 and 3 in the pemutation (2, 4, 1, 3, 5) in the above example. The full details of this example can be woked out as follows: y [ 4, 3 ), k = 5: the non-dominant points ae: (1, 3, 4, 5; 2), (1, 2, 3, 5; 4), (1, 2, 3, 4; 5). y [ 3, 2 ), k = 4: the non-dominant points ae: (1, 3, 4; 2), (1, 2, 3; 4). y [ 2, ], k = 3: the non-dominant points ae: (1, 3; 2), (1, 2; 4). In each case, the optimal solution (to (30)) is obtained by compaing the C(y) values of the non-dominant points and picking the one coesponding to the smallest C(y) value. Finally, a comment on the line seach mentioned in the above poposition. Suppose we divide the inteval [, ] into equal segments, each of length. Let N := (I 2) () denote the numbe of such segments. When is sufficiently small, we can safely assume that the odeing in (31) does not change ove any given segment. This means that fo any y that belongs to a given segment, the optimal value C(y) is detemined by a single nondominant point (α il ; β il ). That is, C(y) = i k,i i l c i (y) + c il ( (k 2)y). Hence, C(y) is a concave function ove this segment, since the c i and c il ae all concave functions. Consequently, the minimum of C(y) can only be attained at the two end points of the segment. Theefoe, the line seach to minimize C(y) amounts to evaluating N values of C(y) and picking the smallest one. This way, the steaming poblem is solved by an algoithm of O(NI) time. Example: We now completely wok out the optimal bandwidth pofile fo the poblem in (29) in the case of concave cost functions. Let = 5 and c 1 (b) = b c 2 (b) = 0.5b 3 4 c 3 (b) = 0.7b 3 5 c 4 (b) = 0.5b = 5

(a) Concave c i(b) functions (b) Objective function C(y) Fig. 1. (a) shows the vaious concave cost functions fo 0 b 5. (b) is the coesponding plot fo the objective function C(y) fo 5/3 y 5. In Figue 1(a) we plot the fou concave cost functions c i (b) fo 0 b. Let C(y) be defined as in (30). Then the minimal cost (29) is given by C opt = y [ min C(y).,] We use the solution pocedue descibed in Section IV-C to evaluate C(y) fo y [, ]. This esult is plotted in Figue 1(b). As can be seen fom Figue 1(b), C(y) is neithe a concave no a convex function, implying that a line seach has to be done fo finding C opt. It can also be seen that C opt is achieved at y = 2.5. The coesponding optimal bandwidth pofile is given by b 1 = 0, b 2 = 2.5, b 3 = 2.5, b 4 = 2.5. The coesponding cost of downloading is C opt = C(2.5) = 3.4557. D. Multiple Unavailable Seves The above appoach extends eadily to the geneal case when multiple seves can become unavailable. Let f be the maximum numbe of seves that can be unavailable, whee 1 f I 1. In this case, the poblem fomulation in (29) becomes, min c 1 (b 1 ) + + c I (b I ) (36) s.t. b j, i 1,..., i f = 1,..., I. j i 1,...,i f 0 b i, i = 1,..., I. In the above optimization poblem, the notation i 1,..., i f = 1,..., I means one such constaint fo evey subset of f elements fom {1,..., I}. We claim that the equivalent poblem, fo 0 y, becomes min c 1 (b 1 ) + + c I (b I ) (37) s.t. b j + fy, j 0 b i y, i = 1,..., I. The key obsevation hee is that the optimal solution to (36) must satisfy the popety that the lagest f values of b i ae all equal. Specifically, without loss of geneality, suppose b 1 b 2 b f b f+1 b I (38) is an optimal solution to (36). Then, we must have b 1 = b 2 = = b f. Conside any e < f, and hence b e b f. We can educe b e to b f and still do no wose on the objective value (as the c i s ae non-deceasing functions), while maintaining feasibility. To see this, conside the constaint b e + b f+2 + + b I. (39) Reducing b e to b f tuns the above into b f + b f+2 + + b I, (40) which cetainly holds as it is one of the constaints involving b f. Futhemoe, any othe constaint that involves b e has a left hand side that is at least as lage as the left hand side of (39) due to the odeing in (38). Hence, it will also emain feasible when b e is educed to b f, since its left hand side, afte the eduction, will still dominate the left hand side of (40). Theefoe, we can solve the following equivalent poblem: min c 1 (b 1 ) + + c I (b I ) (41) s.t. b j + fy, j 0 b i y, i = 1,..., I.

This equivalence is similaly agued as befoe. Fist, any feasible solution to (36) is a feasible to (41) with y set at the lagest b i value. (Note, as befoe, the optimal solution to (36) must satisfy b i fo all i.) Second, given a feasible solution to (41), we must have j i 1,...,i f b j + fy b i1 b if + fy fy =, i.e., it satisfies the constaint in (36) as well. Hence, we can solve the equivalent poblem in (41) as in the case of f = 1, fo both convex and concave cost functions. It is easy to see that, fo both types of cost functions, we must have y I f ; othewise, the poblem is infeasible. Fo concave costs, we will conside the intevals y [ k f, k f 1 ], fo k = f + 2,..., I (assuming f I 2, the case of f = I 1 being tivial). Fo the k-th inteval, the non-dominant points ae k 1 distinct b i values set at y, and anothe distinct b j set at (k f 1)y, with the total being (k 1)y + (k f 1)y = + fy; and 0 (k f 1)y y (i.e., b j is feasible), o y [ k f, k f 1 ]. V. SUMMARY AND CONCLUSION We envision a fee-maket esouce economy in which pees buy and sell esouces diectly fom each othe. In the context of a P2P esouce maket, we consideed the poblem of optimal pee and ate selection. To ou knowledge, this is the fist wok that consides optimal pee selection in a P2P esouce maket. Thoughout this pape we allowed fo a natual picing function of the fom c i (b i ) t i, whee i indexes the pee seve, b i is the ate at which the seve tansmits bytes to the client, and t i is the duation of the tansfe. We consideed optimal pee selection fo two boad classes of poblems: downloading and fo steaming. Fo both classes of poblems we consideed both convex and concave cost functions. Fo the downloading poblem with concave cost functions, we povided an explicit solution to the poblem, wheeby all selected pees tansmit at thei maximum ate u i. Fo convex cost functions we showed how the poblem can be easily solved with maginal analysis, and that fo many natual convex cost functions, all I seves ae selected, with none of the seves tansmitting at thei maximal ates. We also found that in the Nash equilibium, each seve sets its cost to the pice pe byte that the client is willing to pay. Fo the steaming poblem, we showed that fo poblems of pactical inteest, ate segmentation can always do as well as time segmentation. We then focused on ate segmentation. We fist consideed the scenaio in which at most one seve pee can fail. We then extended the esults to the scenaio in which up to f seve pees can fail, fo any value of f. We again analyzed both convex and concave cases. We found that each case equies a diffeent methodology, although both cases ae quite tactable. The contibution of ou wok is the development of theoetical methodologies fo these types of pee selection poblems. We have fomulated and solved a ich aay of optimal downloading and steaming poblems. The techniques pesented hee should be helpful in solving altenative fomulations of pee selection poblems. Acknowledgments: The wok of Micah Adle was suppoted by NSF Reseach Infastuctue Awad EIA- 0080119, NSF Faculty Ealy Caee Development Awad CCR-0133664. The wok of all the authos was also suppoted by NSF ITR Gant (ITR-0325726). We also want to thank David A. Tune of Califonia State Univesity San Benadino fo his insightful comments. REFERENCES [1] E. Ada and B.A. Hubeman, Fee Riding on Gnutella, Fist Monday, 5(10), Octobe 2000. http://www.fistmonday.dk/issues/issue5 10/ada/ [2] D. Qiu and N.B. Shoff, A Pedictive Flow Contol Scheme fo Efficient Netwok Utilization and QoS, IEEE/ACM Tansactions on Netwoking, Febuay 2004. [3] KaZaA Homepage, http://www.kazaa.com [4] Ovenet, http://www.edonkey2000.com [5] J. Liang, R. Kuma, K.W. Ross, Undestanding KaZaA, submitted, 2004. [6] S. Saoiu, P. K. Gummadi, and S. D. Gibble, A measuement study of pee-to-pee file shaing systems, Poceedings of Multimedia Computing and Netwoking, Jan 2002. [7] D.A. Tune and K.W. Ross, A LightWeight Cuency Paadigm fo the P2P Resouce Maket Seventh Intenational Confeence on Electonic Commece Reseach, Dallas, TX, Jun 2004. [8] D.A. Tune and K.W. Ross, The Lightweight Cuency Potocol, Intenet Daft, Septembe 2003. [9] S. D. Kamva, M. T. Schlosse, H. Gacia-Molina, The Eigen- Tust Algoithm fo Reputation Management in P2P Netwoks, In Poceedings of the Twelfth Intenational Wold Wide Web Confeence, 2003. [10] R. Dingledine, N. Mathewson, P. Syveson, Reputation in P2P Anonymity Systems, Wokshop on Economics of Pee-to-Pee Systems, 2003. [11] M.R. Gaey and D.S. Johnson, Computes and Intactability: A guide to the Theoy of NP-Completeness, W.H. Feeman, 1979. [12] R.E. Balow and F. Poschan, Statistical Theoy of Reliability and Life Testing, Holt, Reinhat and Winston, 1975.