# Buffer with N Policy and Active Management
## 4 Analysis
We obtain the following:  
\[ \begin{split} H(1,k,t)=\sum_{j=1}^{N-1}\int_{0}^{t}H(j,k,t-u)Q_ {2}(1,j,u)\mathrm{d}F(u)+\delta(1,k)Q_{2}(1,k{-}1,t)[1{-}F(t)],\\ k=1,\ldots,N.\end{split}  \tag{30}\]  
Denoting  
\[h(n,k,s)=\int_{0}^{\infty}e^{-st}H(n,k,t)\mathrm{d}t, \tag{31}\]  
Finally, we have the following:  
\[\overline{R}=\sum_{k=0}^{N}B(k)=\sum_{k=1}^{N}\bigl{[}\mathbf{Z}(0)^{-1}\mathbf{v }(k,0)\bigr{]}_{K}. \tag{43}\]  
**Summary of Parts 1-3. ** We are now in a position to gather together all the partial results into the final theorem. It suffices to combine (17) with (25), (27), (42), and (43). Consequently, the following theorem is proven. Theorem 1: _The stationary distribution of the queue length in a buffer with the \(N\) policy and active management has the following form:_  
\[\pi(k)=\left\{ \begin{array}{ll}\frac{1}{\lambda(1-d_{1}(0))(\overline{P}+ \overline{R})},&\text{if}\quad k{=}0,\\ \\ \frac{1}{\lambda(1-d_{1}(k))(\overline{P}+\overline{R})}+\frac{\bigl{[} \mathbf{Z}(0)^{-1}\mathbf{v}(k,0)\bigr{]}_{K}}{\overline{P}+\overline{R}},& \text{if}\quad k{=}1,\ldots,K{-}1,\\ \\ \frac{\bigl{[}\mathbf{Z}(0)^{-1}\mathbf{v}(k,0)\bigr{]}_{K}}{\overline{P}+ \overline{R}},&\text{if}\quad k{=}K,\ldots,N,\end{array} \right. \tag{44}\]  
_where \(\mathbf{Z}(0)\), \(\mathbf{v}(k,0)\), \(\overline{P}\) and \(\overline{R}\) are given in (38)-(40), (27), and (43)._  
Now, we can easily derive the energy efficiency of the system, as defined in Section 3. The system operates in a cyclic manner, alternating between energy-saving and transmission phases, and each cycle lasts, on average, \(\bar{P}+\bar{R}\). Moreover, in each cycle, the radio is off for an average of \(\bar{P}\) seconds. Hence, the energy efficiency \(E\) is given by \(E=\frac{\overline{P}}{\overline{P}+\overline{R}}\). Combining this with formulae (27) and (43), yields the following result. Theorem 2: _The energy efficiency of a buffer with \(N\) policy and active management equals the following:_  
\[E=\frac{\sum_{k=0}^{K-1}\frac{1}{\lambda(1-d_{1}(k))}}{\sum_{k=0}^{K-1}\frac{ 1}{\lambda(1-d_{1}(k))}+\sum_{k=1}^{N}\bigl{[}\mathbf{Z}(0)^{-1}\mathbf{v}(k, 0)\bigr{]}_{K}}, \tag{45}\]  
_where \(\mathbf{Z}(0)\) and \(\mathbf{v}(k,0)\) are given in (38)-(40)._  
As for the throughput, we see that, on average, \(\overline{R}/\overline{F}\) packets are transmitted in one cycle. As the expected length of the cycle is \(\overline{P}+\overline{R}\), the expected number of packets transmitted in a time unit must be \(\overline{R}/\overline{F}/(\overline{P}+\overline{R})\). Hence, using (27) and (43) again, we have shown the following. Theorem 3: _The throughput of a buffer with \(N\) policy and active management equals the following:_  
\[\gamma=\frac{\sum_{k=1}^{N}\bigl{[}\mathbf{Z}(0)^{-1}\mathbf{v}(k,0)\bigr{]} _{K}}{\overline{F}(\sum_{k=0}^{K-1}\frac{1}{\lambda(1-d_{1}(k))}+\sum_{k=1}^{N }\bigl{[}\mathbf{Z}(0)^{-1}\mathbf{v}(k,0)\bigr{]}_{K})}, \tag{46}\]  
_where \(\mathbf{Z}(0)\) and \(\mathbf{v}(k,0)\) are given in (38)-(40)._  
Finally, the only missing component needed to apply Theorems 1-3 in numerical calculations is the function \(Q_{2}(n,k,t)\). It can be obtained using Theorem 1 from [28]. Specifically, from this theorem we have the following:  
\[q_{2}(n,k,s)=\frac{\prod_{i=0}^{k-1}\lambda(1-d_{2}(n+i))}{\prod_{i=0}^{k} \bigl{[}s+\lambda(1-d_{2}(n+i))\bigr{]}}, \tag{47}\]where  
\[q_{2}(n,k,s)=\int_{0}^{\infty}e^{-st}Q_{2}(n,k,t)\mathrm{d}t. \tag{48}\]