# Image Transmission over Cognitive Radio Networks for Smart Grid Applications
## 3 Proposed MAC Layer for Image Streaming over CRSNs
### The Average Time Overhead Due to Retransmission
In the following, we find the mathematical equation for \(E(X^{i})\):  
\[E(X^{i}) =\Sigma_{x=0}^{X}xp\{X^{i}=x\}\] \[=\Sigma_{x=0}^{X-1}x(L_{i}^{x}-L_{i}^{x+1})+XL_{i}^{X}\] \[=XL_{i}^{X}+\Sigma_{x=0}^{X-1}xL_{i}^{x}(1-L_{i})\] \[=XL_{i}^{X}+(1-L_{i})\Sigma_{x=0}^{X-1}xL_{i}^{x}\] \[\Sigma_{x=0}^{X-1}xL_{i}^{x} =L_{i}\frac{1-XL_{i}^{X-1}+(X-1)L_{i}^{X}}{(1-L_{i})^{2}}\] \[\Sigma_{x=0}^{X}xp\{X^{i}=x\} =XL_{i}^{X}+(1-L_{i})(L_{i}\frac{1-XL_{i}^{X-1}+(X-1)L_{i}^{X}}{( 1-L_{i})^{2}})\] \[=\frac{1}{(1-L_{i})}(XL_{i}^{X}((1-L_{i}))+L_{i}-XL_{i}^{X}+XL_{i }^{X+1}-L_{i}^{X+1})\] \[\tau_{OH}^{i}=(X^{i}T_{s}+\tau_{P}^{i})P_{Ar}^{PU,X}(X^{i})+(X^{i}T_{s})(1-P_{Ar }^{PU,X}(X^{i})) \tag{7}\]0 \[\tau_{OH}^{i}=(X^{i}T_{s}+\tau_{P}^{i})P_{Ar}^{PU,X}(X^{i})+(X^{i}T_{s})(1-P_{Ar }^{PU,X}(X^{i})) \tag{7}\]1 \[\tau_{OH}^{i}=(X^{i}T_{s}+\tau_{P}^{i})P_{Ar}^{PU,X}(X^{i})+(X^{i}T_{s})(1-P_{Ar }^{PU,X}(X^{i})) \tag{7}\]2  
So we can write Equation (9):  
\[\tau_{OH}^{i}=(X^{i}T_{s}+\tau_{P}^{i})P_{Ar}^{PU,X}(X^{i})+(X^{i}T_{s})(1-P_{Ar }^{PU,X}(X^{i})) \tag{7}\]3  
Then, we continue to fine the \(E(g(t_{P}^{i},X^{i},\lambda_{i},P_{fa},T_{S}))\):  
\[\tau_{OH}^{i}=(X^{i}T_{s}+\tau_{P}^{i})P_{Ar}^{PU,X}(X^{i})+(X^{i}T_{s})(1-P_{Ar }^{PU,X}(X^{i})) \tag{7}\]4 \[\tau_{OH}^{i}=(X^{i}T_{s}+\tau_{P}^{i})P_{Ar}^{PU,X}(X^{i})+(X^{i}T_{s})(1-P_{Ar }^{PU,X}(X^{i})) \tag{7}\]5 \[\tau_{OH}^{i}=(X^{i}T_{s}+\tau_{P}^{i})P_{Ar}^{PU,X}(X^{i})+(X^{i}T_{s})(1-P_{Ar }^{PU,X}(X^{i})) \tag{7}\]6 \[\tau_{OH}^{i}=(X^{i}T_{s}+\tau_{P}^{i})P_{Ar}^{PU,X}(X^{i})+(X^{i}T_{s})(1-P_{Ar }^{PU,X}(X^{i})) \tag{7}\]7 \[\tau_{OH}^{i}=(X^{i}T_{s}+\tau_{P}^{i})P_{Ar}^{PU,X}(X^{i})+(X^{i}T_{s})(1-P_{Ar }^{PU,X}(X^{i})) \tag{7}\]8 \[\tau_{OH}^{i}=(X^{i}T_{s}+\tau_{P}^{i})P_{Ar}^{PU,X}(X^{i})+(X^{i}T_{s})(1-P_{Ar }^{PU,X}(X^{i})) \tag{7}\]9Now, we can write Equation (10):  
\[E(\tau_{OH}^{i})=E(X^{i})T_{s}+\tau_{P}^{i}E(g(t_{P}^{i},X^{i};\lambda_{i},P_{ fa},T_{S})) \tag{8}\]0  
Ultimately, based on all proofed formulas from Equations (8)-(10), we demonstrate our extracted Equation (11):  
\[ \begin{split} E(\tau_{OH}^{i})=L_{i}\frac{(1-L_{i}^{X})}{(1-L_{i} )}T_{S}+\tau_{p}^{i}\frac{1-L_{i}^{2X}}{1+L_{i}},\\ L_{i}=L_{i}^{1}=(1-P_{f})e^{-\lambda_{i}t_{p}^{i}}\end{split}  \tag{11}\]  
As a result, we have achieved the important formula that describes weights of both SS and Retransmission on the time overhead. These weights are \(L_{i}\frac{(1-L_{i}^{X})}{(1-L_{i})}\), and \(\frac{1-L_{i}^{2X}}{1+L_{i}}\) for them, respectively. In Figure 2, assuming the fixed number of the spectral sensing iterations (\(NSSI=X=3\)), the curve of the mean time overhead ETOH = \(E(\tau_{OH}^{i})\) due to the retransmission and the spectral sensing, is plotted in terms of the packet length (\(\tau_{p}^{i}\)). As this figure, the average amount of overhead is low for small values of packet time (\(\tau_{p}^{i}\)). The reason is that the smaller \(\tau_{p}^{i}\) is equivalent to the more frequent spectrum sensing. Therefore, the time overhead will be more due to the spectrum sensing. Now, if its value goes up from the minimum point at \(\tau_{p}^{i}\) = 0.023 s, the time interval between spectral sensing runs will increase but in the case of interference, it means that a longer-length packet should be retransmitted. Thus, increasing the packet size can magnify weigh of retransmission side effects on the total time overhead in comparison to the SS. In the following, Figure 3 shows the effect of variations X on the value of \(E(\tau_{OH}^{i})\). In this figure, with the assumption that the packet length is constant (\(\tau_{p}^{i}\) = 0.001 s), increasing X will lead to an increase in the average time overhead. Figure 2: The average amount of time overhead for the constant value of X (ETOH=\(E(\tau_{OH}^{i})\)). In the following, we plan to examine the effect of variations in the SS time on the mean time overhead. As shown in Figures 4 and 5, when \(T_{\mathrm{S}}\) is increased the average overhead time will be increased as well.