Optimizing Bandwidth Allocation in p2p streaming broadcast INTRODUCTION The new p2p networking paradigms offer new possibilities for content distribution over the network. Most existing research in peer-to-peer has been on file sharing applications. Although many incentives have been proposed in the file sharing context, there is little understanding on how to incorporate incentives into p2p streaming systems. While audio/video disseminations represents an important class of Internet applications, no satisfactory solution exist. The high cost of bandwidth required for server-based solutions or content delivery networks, and the fundamental limitations of IP multicast are the major factors that have limited broadcasting to a small number of rich publishers. Peer to peer architecture provides an interesting alternative in which participants in the broadcast can also contribute forwarding capacity (upstream bandwidth), thereby lowering the cost incurred by the publisher. The ability for the users to obtain content that they would otherwise not have access to, provides a natural incentive to contribute resources to the system. In the p2p streaming environment, bandwidth is the bottleneck resource. A reasonable quality audio/video stream takes at least 350Kbps to encode [Taxation]. However many of the peers are behind DSL and cable modems. These resource poor peers have asymmetrical bandwidth with low forwarding capacity and high receiving capacity, therefore making them inherently unsuitable for schemes like Bit-for-Bit. To accommodate resource poor peers, who would otherwise be unable to participate in the above scheme, I would like to design a market based system which incentivizes the peers to contribute bandwidth naturally to obtain better quality video for themselves. I propose a model that treats peers as independent economic agents buying and selling streaming content as per their own utility. In an ideal case, an agent that needs the content will always obtain it and will always make it available freely to others because of goodwill. But the content may be costly to obtain, since the bandwidth may be constrained at places causing delay costs over particular distribution routes. Furthermore making content accessible to others reduces a peer’s access bandwidth and hence degrades his network access performance [Market Models]. If such costs become significant, the altruistic community spirit may not be sufficient to sustain the successful operation of the system. Deploying a market mechanism within the peer community may solve these problems and reduce unnecessary waste of resources resulting from peers requesting content for which their value is less than the cost imposed to others. PROBLEM STATEMENT In a streaming environment, the requirements of various peers can differ by a great amount. For example in case of video streaming, some peers may require video with very high incoming bandwidth while some others may be satisfied with low bandwidth data. Such a case can arise especially when the video is having many layers of encoding and different peers may have varied requirements of bandwidth as per their own local rules. In general terms we can say that each peer can have a different value associated with the content and this value can be the driving force that can incentivize certain groups of peers to contribute resources to the system. The value of the content for each peer can be loosely modeled as a function of its bandwidth and latency requirements. The mapping form content to value can be represented as: Value = f (latency) + q (bandwidth) + r (bandwidth fwd / total available bandwidth) The above formula represents the dependency of value on the latency, incoming bandwidth and the fraction of outgoing bandwidth to total available bandwidth at a peer. This formulation of Value captures the real-life notion of value of content for various participating peers. The graphs for functions f, q and r for a typical peer would look like: f latency So as the above graphs suggest the value of a streaming content (audio/video) can decrease with the increase in latency. Also the value increases with increase in incoming bandwidth and decreases as the fraction of forwarding bandwidth to total available bandwidth. These relationships can be succinctly stated as: Value α Receiving bandwidth / (latency * fraction of fwd bandwidth to total bandwidth) The above relationship is fairly obvious as the lesser the latency, the streaming content is going to be better. Also the incoming bandwidth curve should be concave or S-shaped to capture the diminishing returns of increased bit rate on perceived video/audio quality. The last function should be convex in shape to capture the effects of link congestion. The above graphs provide a very general picture of these functions while in practice they vary greatly from one peer to another peer. The aim of our project is to enable bandwidth allocation in the streaming environment so that each peer is able to maximize its value for the content. We will also show how it provides natural incentive for some peers to contribute resource to the system. Let us consider the following scenario. A node with some video content decides to allocate some portion (b) of its outgoing bandwidth (B) for streaming purposes. Suppose there are N nodes in the environment. If all the N nodes try to join the root, then each will receive a bandwidth b/N. If N is too large then b/N becomes very small and hence the value will degrade for all the peers. For example root A E B C D Now here each peer will receive a bandwidth of b/5. This may be acceptable for some peers as they have a relaxed bandwidth requirement but it may not be acceptable to certain peers for whom the bandwidth requirements may be stringent and their performance may degrade very sharply. So basically we want to construct an optimum tree such that the value of all the participating peers is maximized and hence the social welfare is also maximized (Social welfare can be the sum of the values of all the participating peers). In the above example, if say node A has a very stringent bandwidth requirement and if by some mechanism we can tweak the tree to result in: root A B D C E Now in the above scenario, node A and D receive bandwidth b/2 and their latency is 0. While the nodes B and C may get some higher bandwidth b’/2 (where b’ is the outgoing bandwidth allocated by A) but their latency increases by 1 (considering that each link has a latency of 1 unit). Also node A’s value will decrease because of the forward link congestion. So there is a trade off for every node in the system and it may adopt the changes if its own value increases by doing so. Since each node will have a different sets of latency and bandwidth functions, the trade offs are different for each node and every participating agent has to make the decision locally whether it wants to adapt to the changes or not. If using some natural mechanisms, we are able to convert to the above tree, and then we can improve the overall performance of the streaming environment and more peers will be able to receive the content according to their choice. APPROACH In order to tackle the above stated problem, I propose a simple economic model that treats peers as independent strategic agents that buy and sell content in the presence of some market mechanisms. In my model, each agent that has the content can post its own price for the content and the incoming agents can then decide to join any particular agent as per their own requirements. So my model is basically a simple market based mechanism which tries to optimize the utility of the content for the participating peers (defined as Value for our purposes). I will describe my approach in detail with the help of an example. Let us assume a group of N peer agents all of whom are interested in certain content. Suppose there exists a root which has the content and it decides to allocate b out of B (where b is the bandwidth allocated by root for streaming and B is its total bandwidth) bandwidth for streaming a video. Now our model requires maintaining a “stock market” where each agent can post its own price for the content. Specifically each agent posts his available bandwidth and latency for the content. For example in the beginning the root will publish something like (b, 0) which can be understood as b bandwidth and 0 latency. Now suppose agent A comes and joins the root. Now the root will publish (b/2 , 0) as from now on which means that from now on whichever agent joins the root, it will get only a bandwidth of b/2 and A’s bandwidth will also get reduced to b/2. Consider the scenario that A has a very high bandwidth requirement (which will be manifested by its bandwidth curve) and doesn’t want its bandwidth to be reduced to b/2. So it will have to post a competitive price for the incoming agents so that they join him instead of the root and his bandwidth is not reduced. So A has a natural incentive to forward content to other peers in order to uphold its own value to the content. Suppose now A publishes a price of (3b/4, 1). Now if a third agent comes and it sees the two quotes in the market: Root - (b/2, 0) A – (3b/4, 1) (For this example all links are assumed to have latency of 1 unit) root Stock Market Root (b/2,0) A (3b/4,0) A Now the incoming node B has a choice of joining either root or A. It will calculate its own utility for the content from these two sources using the utility formula. Suppose for B latency is not at all important and its value function is heavily dominated by the bandwidth component. In that case, it will prefer to join A and hence the value of the entire system will be improved. But suppose B decides to join the root and in that case A’s bandwidth will be reduced to b/2 and its performance will degrade. So it will change its posted value and increase the available bandwidth in order to attract B to join underneath him, so that it can achieve the required bandwidth b from the root. If B finds the new offer from A to be an improvement for its own value, then it will leave the root and join A. In this manner we will construct a tree where each agent has obtained his maximum possible value.