# Minimizing the In-Cloud Bandwidth for On-Demand Reactive and Proactive Streaming Applications
## 3 Optimizing Cloud-Based Streaming Internal Bandwidth: Case of an Unpopular Video
### SASST Performance Evaluation: Case of a Deterministic High Load  
As portrayed in Figure 2(b), we consider in this subsection the deterministic high load scenario where we have at least one SN request per time slot.  
Let \(l\) be the number of missed video slots by a late SN request, \(a_{s}\) be the number of slots streamed through and FTS and \(b_{t}\) be the number of slots tapped into (shared through) the FTS opened to the previous late SN request, as represented in boxes with orange color in Figure 2(b).  
We have  
\[l=a_{s}+b_{t} \tag{1}\]  
Figure 3: Example of FTS handling with SST and SASST at a high workload. (a) SST FTS; (b) SASST FTS.  
Let us recursively instantiate Equation (1) to each SN arrival of Figure 3b,  
\[1 =1_{s}+0_{t},\] \[1_{s} :\text{slot 1}\text{ which is streamed through the 2 nd SN FTS} \tag{2}\] \[2 =2_{s}+0_{t},\] \[2_{s} :\text{slot 1}\text{ and slot 2 are streamed through the 3 nd SN FTS}\] \[3 =2_{s}+1_{t},\] \[2_{s} :\text{slot 1}\text{ and slot 3 are streamed through the 4 nd SN FTS}\] (4) \[1_{t} :\text{slot 2 is tapped through the 3 nd SN FTS}\] \[\ldots\] \[n =(\frac{n}{2}+1)_{s}+(\frac{n}{2}-1)_{t}\text{ if $n$ is even}\] (5) \[or\] \[n =(\frac{n+1}{2})_{s}+(\frac{n-1}{2})_{t}\text{ if $n$ is odd} \tag{6}\]  
At a given value of \(l=n\), the storage node should decide to open a CS instead of an FTS to a new SN request to minimize the consumed bandwidth and then start a new cycle. The average bandwidth value denoted \(B\) is the same in each cycle and is stated as follows:  
\[B(n)=\frac{S_{CS}(n)+S_{FTS}(n)}{n} \tag{7}\]  
where \(S_{CS}(n)\) denotes the number of video slots streamed through CSs and \(S_{FTS}(n)\) denotes the number video slots streamed through FTSs during a cycle duration of \(n\) time slots.  
At the stationary regime, the storage node opens a CS for each \(n\) slot. Thus,  
\[S_{CS}(n)=\frac{D}{n}n=D \tag{8}\]  
where \(D\) is the CS duration.  
To determine \(S_{FTS}\), let us first consider the case of \(n\) being even. By summing the first terms \(a_{s}\) of Equations (2)-(5), we obtain  
\[S_{FTS}(n)=1+2\sum_{i=2}^{\frac{n}{2}}i+(\frac{n}{2}+1)=\frac{n^{2}}{4}+\frac{ n}{2}+1. \tag{9}\]  
When \(n\) is odd, we obtain by summing the terms \(a_{s}\) of Equations (2)-(6) (except Equation (5)),  
\[S_{FTS}(n)=1+2\sum_{i=2}^{\frac{n+1}{2}}i=\frac{n^{2}}{4}+n-\frac{1}{4}. \tag{10}\]  
Replacing \(S_{CS}(n)\) and \(S_{FTS}(n)\) in Equation (7) by their expressions determined in Equations (8)-(10), respectively, gives  
\[B(n)=\begin{cases}\frac{D+1}{n}+\frac{n}{4}+\frac{1}{2},&\text{if $n$ is even}\\ \frac{D-1}{n}+\frac{n}{4}+1,&\text{if $n$ is odd}.\end{cases} \tag{11}\]  
Plotting \(B\) for three different values of video duration \(D=50\), \(D=100\) and \(D=150\) shows that we can optimize \(B\) with regard to \(n\), as portrayed in Figure 4.  
The optimal value of \(n\) denoted as \(n^{*}\) could be determined by resolving \(\frac{dB}{dn}=0\), which gives  
\[n^{*}=\begin{cases}2\sqrt{D+1},&\text{if $n$ is even}\\ 2\sqrt{D-\frac{1}{4}},&\text{if $n$ is odd}.\end{cases} \tag{12}\]  
Thus, we can determine the optimal average bandwidth value denoted as \(B^{*}\) by replacing \(n^{*}\) in Equation (11),  
\[B^{*}(n)=\begin{cases}\sqrt{D+1}+\frac{1}{2},&\text{if $n^{*}$ is even}\\ \sqrt{D-\frac{1}{4}+1},&\text{if $n^{*}$ is odd}.\end{cases} \tag{13}\]