# An Adaptive Buffering Scheme for P2P Live and Time-Shifted Streaming
## 1 Introduction  
Advances in digital technologies and computer networks have enabled Internet Protocol television (IPTV) systems that provide multimedia services based on IP networks. As the number of IPTV subscribers increases and personalized services such as Video-on-Demand (VOD) and time-shifted TV become more common, the conventional server architectures based on Content Distribution Networks (CDNs) have been limited in scalability because of high installation costs. Therefore, highly scalable peer-to-peer (P2P)-based IPTV systems that can be implemented at low installation cost have emerged as an alternative to conventional systems [1; 2]. In mesh-based structures that have been employed by most commercial P2P streaming systems, peers share data required for video playback [3; 4; 5; 6; 7; 8]. To do so, they exchange buffermaps with their neighbor peers to find which peers have the necessary chunks. Each peer then receives these chunks from multiple neighbor peers simultaneously after requesting each one. To improve the performance of P2P streaming systems, many buffering techniques (e.g., prefetching and caching) have been proposed [9; 10; 11; 12; 13; 14; 15; 16; 17; 18]. Especially in P2P VOD systems, once peersstore video files that they want on their own storage devices, they share these files with each other at any time. Therefore, as long as each peer finds neighbor peers that can transmit the amount of data required to playback a desired video until it completes playback, it is not difficult to perform buffering techniques effectively, because each neighbor peer stores an entire part of the video file. Moreover, even though playback speed changes when supporting video cassette recorder (VCR) operations such as fast forward and rewind, neighbor peers can also transmit a sufficient amount of data because they already have the relevant data stored and access patterns can be easily predicted. In P2P live streaming systems, however, since peers can playback a broadcast video after receiving data generated in real time, they can buffer only a limited amount of data around the live broadcasting time in the main memory. To playback the video seamlessly, it is therefore important to increase data duplication among participating peers by making their buffered data overlap as much as possible. However, due to the nature of P2P live streaming, peers suffers from playback lag between a source server and peers. In other words, even though peers request to move to a live broadcasting position, they may playback data a significant time after the server has transmitted them, depending on when they joined. As a result, even the playback positions of the peers watching a live broadcast are dispersed. Moreover, since playback requests in a live streaming system tend to be concentrated around a live broadcasting time [19], the number of peers decreases rapidly as the playback position moves further from this time by performing time-shifted viewing through rewind, pause, and slow motion functions. Since this widens the distribution of peers' playback positions, data duplication among peers decreases further. If a peer cannot find neighbor peers that can transmit the data required to playback its desired video, peers whose buffering periods do not overlap with that of the given peer should be selected as neighbor peers. This implies that a peer must skip a certain period to synchronize the buffering periods of its neighbors with that of its own, thereby resulting in the degradation of playback quality in P2P live streaming systems. On the other hand, since each peer's buffer behaves like a finite circular queue in conventional P2P live streaming systems (as shown in Figure 1), the buffer area where the chunks that have already been played back are stored can be overwritten at any time by new chunks arriving soon. Thus, such old chunks stored in the buffer area are usually considered as unavailable.