# Cooperative Buffering Schemes for Time-Shifted Live Streaming of Distributed Appliances
## 3 Cooperative Buffering Schemes for Time-Shifted Live Streaming
### Buffering Based on Degree of Deficiency and Proximity
\begin{array}{ll}1&\text{if }C_{p_{i}}\geq MIN_{nb}\\ 0&\text{otherwise}\end{array} \right. \tag{1}\]  
We can also obtain the ratio of the qualified periods to all the periods belonging to \(tr_{(i,b)}\) by dividing \(\sum\limits_{k=i}^{i+b-1}Q_{p_{k}}\) by \(b\). \(b\) and \(tr_{(i,b)}\) denote the buffer size of each PVR in periods or chunks and the time range starting at \(p_{i}\) ending at \(p_{i+b-1}\). Note that \(b\) and \(MIN_{nb}\) are set to 5 and 2, respectively, in Figure 3. \(DD_{tr_{(i,b)}}\) represents the deficiency degree of chunks, i.e., the ratio of the unqualified periods to all the periods belonging to \(tr_{(i,b)}\) calculated by subtracting the ratio from 1, as in Equation (2). \[DD_{tr_{(i,b)}}=1-\frac{\sum\limits_{k=i}^{i+b-1}Q_{p_{k}}}{b} \tag{2}\]  
Equation (2) indicates that, as the value of \(DD_{tr_{(i,b)}}\) increases, the number of buffered chunks during \(tr_{(i,b)}\) becomes more deficient. Thus, it is necessary to make more copies of chunks for the time range so that PVRs can play them back without quality degradation during the time range. We also need to consider the fact that, as mentioned above, playback requests are skewed to several minutes after the live broadcast time and the number of requests sharply decreases afterwards. This implies that more copies of chunks should be buffered for the periods closer to the live broadcast time to support more concurrent playback requests. To reflect this trend of the playback request distribution over time periods, we first calculate the relative distance of \(tr_{(i,b)}\) from the live broadcast time based on its middle period, as in \(\frac{\lceil\frac{i+b-1}{T}\rceil}{TP}\), where \(TP\) denotes the total number of periods during the entire time-shifting hours. We can then evaluate \(PD_{tr_{(i,b)}}\) indicating the proximity degree from the live broadcast time to \(tr_{(i,b)}\) by subtracting the distance from 1, as in Equation (3). \[PD_{tr_{(i,b)}}=1-\frac{\lceil\frac{i+b-1}{2}\rceil}{TP} \tag{3}\]  
It can be seen from Equation (3) that, as the value of \(PD_{tr_{(i,b)}}\) becomes larger, playback requests belonging to \(tr_{(i,b)}\) become more popular since the time range becomes closer to the live broadcast time. This also implies that more copies of chunks are needed to accommodate all the concurrent playback requests during the time range. As mentioned above, since the PVRs playing back at the live broadcast time receive TV signals directly through their tuners, they need neither to exchange them with other PVRs nor to buffer them. Thus, the tracker server requests those PVRs to buffer the chunks belonging to some periods before the live broadcast time by utilizing their idle resources needed for buffering. To select the time range that is likely to contribute the most to the system performance, the tracker server considers the criteria of \(DD_{tr_{(i,b)}}\) and \(PD_{tr_{(i,b)}}\) as shown in Equation (4):  
\[\max\limits_{i=0}^{TP_{p}-b-1}\{DD_{tr_{(i,b)}}\times w+PD_{tr_{(i,b)}}\times (1-w)\} \tag{4}\]  
The tracker server evaluates \(DD_{tr_{(i,b)}}\) and \(PD_{tr_{(i,b)}}\) of each time range by sliding the buffer-sized window by one period. The time range with a maximum value among all the candidates is selected so that the PVRs playing at the live broadcast time can buffer more copies of the most needed chunks. In Equation (4), \(w\) is the weight value between \(DD_{tr_{(i,b)}}\) and \(PD_{tr_{(i,b)}}\). Thus, \(w\) can be adjusted depending on the system environment, especially the program popularity distribution over periods. If the playback requests of PVRs are relatively more concentrated around the live broadcast time, we need to decrease \(w\) so that the portion of \(PD_{tr_{(i,j)}}\) can be given more weight.