# Cooperative Buffering Schemes for Time-Shifted Live Streaming of Distributed Appliances
## 3 Cooperative Buffering Schemes for Time-Shifted Live Streaming
### Buffering Based on Ratios of Playback Requests to Chunk Copies  
The above \(D\_DP\)-based buffering scheme determines the time ranges to be buffered, based on not only the playback request distribution over time, but also the number of copies of each chunk that are currently buffered, irrespective of the number of actual requests to be processed subsequently. In fact, the number of actual playback requests for each chunk may be different from its estimated number based on its current number. For example, in Figure 4, the total number of chunk copies at \(tr_{(k+5,5)}\) is eight, while that at \(tr_{(k,5)}\) is seven. According to the \(D\_DP\)-based scheme, of the two time ranges, \(tr_{(k,5)}\) will be selected since the \(DD_{tr_{(k,5)}}\) value is larger and \(PD_{tr_{(k,5)}}\) values are also larger. However, we can see that the numbers of actual requests at \(tr_{(k,5)}\) and \(tr_{(k+5,5)}\) are 12 and 22, respectively. That is, the number of actual requests at \(tr_{(k+5,5)}\) is almost twice that at \(tr_{(k,5)}\). This indicates that the chunks at \(tr_{(k+5,5)}\) should be buffered more urgently to prevent playback quality disruption. To determine the priority of each time range for buffering more accurately, we therefore propose the \(R\)atio of Playback \(R\)Requests to Chunk Copies (\(R\_RC\))-based scheme to consider the ratio of the number of actual requests to be processed subsequently to that of chunk copies already buffered.  
In our time-shifted live streaming system based on P2P networks, PVRs exchange data with each other on the mesh-pull structure. They periodically receive the burfermaps of neighbor PVRs and identify which PVRs are storing necessary chunks. After explicitly  
Figure 4: A buffering scheme based on the \(R\)atio of Playback \(R\)Requests to Chunk Copies.  
requesting each necessary chunk to neighbor PVRs, they eventually receive it. By investigating buffermaps of all PVRs, as shown in Figure 4, the tracker server can thus determine how many copies of each chunk among PVRs are actually requested and already buffered.  
To derive how to determine the time range to be buffered, we first calculate both the number of copies of each chunk actually requested at \(p_{i}\), denoted by \(NR_{p_{i}}\), and the number of its copies already buffered at \(p_{i}\), denoted by \(NC_{p_{i}}\), as shown in Figure 4. For example, since five PVRs actually requested the chunk and two already buffered at \(p_{k+5}\), \(NR_{p_{k+5}}\) and \(NC_{p_{k+5}}\) become 5 and 2, respectively. We can also obtain the average numbers of actual playback requests and buffered copies of chunks during \(tr_{(i,b)}\), denoted by \(AR_{tr_{(i,b)}}\) and \(AC_{tr_{(i,b)}}\), respectively, as in Equations (5) and (6).  
\[AR_{tr_{(i,b)}} = \frac{\sum\limits_{k=i}^{i+b-1}NR_{p_{k}}}{b} \tag{5}\] \[AC_{tr_{(i,b)}} = \frac{\sum\limits_{k=i}^{i+b-1}NC_{p_{k}}}{b} \tag{6}\]  
The tracker server finally selects the time range with a maximum value of the ratio of \(AR_{tr_{(i,b)}}\) and \(AC_{tr_{(i,b)}}\), as in Equation (7).  
\[\min_{i=0}^{TP-b-1}\left\{\frac{AR_{tr_{(i,b)}}}{AC_{tr_{(i,b)}}}\right\} \tag{7}\]  
Note that, as the ratio increases, the PVRs playing back at the corresponding time range should process relatively more requests compared to the number of chunk copies already buffered. This indicates that, to further improve the performance, it is required to buffer more chunk copies for the time range with a higher ratio.  
On the other hand, when a PVR moves from the live broadcast time to another playback position by carrying out time-shifted functions, they stop buffering the chunks assigned previously and start to buffer the chunks having been played back for their own time-shifting. It is also noted that, when there is no room to store newly coming chunks in the storage spaces reserved for time-shifting, the earliest buffered chunks are replaced with the new ones.