# Image Transmission over Cognitive Radio Networks for Smart Grid Applications
## 4 Simulations and Results
### Simulation of the Proposed Jopss Model  
This section examines the performance of the proposed cognitive radio MAC layer for transmitting the image of a thermal camera on a wind farm. For this purpose, the parameters of the model described in Section 3 have been initialized as \(T_{S}=0.01\) s, \(D_{m}=1\) s, \(S=1\), and \(I_{b}=6,291,456\) bit. Now, we increase the arrival rate from 2 arrivals per second (APC) to 40 APC (\(\lambda_{i}=[2,5,10,20,40]\)).  
Figure 8 shows the \(NSSI\) in terms of the arrival rate while Figure 9 depicts the length of the packet. In these two figures, a comparison between the simulation and the estimation is shown. As evidenced in these figures, when the arrival rate of PUs is growing, the algorithm intelligently urges to raise the NSSI and decrease the length of the packet. In fact, the algorithm behaves well to reduce the probability of interference at higher rates.  
Figure 8: Number of Spectrum Sensing Iterations (NSSI) vs. Arrival rates (\(\lambda_{i}\)) of primary users (lambda).  
For example, at the low arrive rate \(\lambda_{i}=2\) (arrivals per second (APS)), the algorithm selects a large packet with the length \(\tau_{P}^{i}=\) 64,040 \(\upmu\)s and the \(NSSI=9\). With these values, 87% of the data stored in the transmission buffer are sent in the first attempt. The remaining data only require 105,566 \(\upmu\)s time to be sent in \(9-1=8\) available iterations while the timer overflow occurs 253,879 \(\upmu\)s later. This means that 13% of the input image that is still waiting to send have enough time for successful transmission within the allowed time (\(D_{m}=1\)). In comparison, for \(\lambda_{i}=40\) APS, our algorithm tries to decrease the packet length to \(\tau_{P}^{i}=\) 7731 \(\upmu\)s and increases the \(NSSI\) from 9 APS to 47 APS to avoid overhead due to both SS and retransmission of large packets. In this condition, only 57% of the input image was sent after the first try. In order to fulfill transmission of this image, it is required 625,969 \(\upmu\)s time so about 33% of pixels were missed because of the timeout. In the following, it is intended to evaluate the behavior of the function \(E(\tau_{OH}^{i})\) as a mean time overhead. For this purpose, the value of \(\tau_{P}^{i}\) is increased from approximately 0 to 0.1 s. For this purpose, three different values are considered for the \(NSSI\) which are 1, 4, and 22. Among these values only \(NSSI=22\) was estimated by the proposed algorithm JOPPS, others were selected for making a comparison. In Figure 10, the comparison between the expected value of overhead time \((E(\tau_{OH}^{i}))\) for different NSSIs. As it can be seen, the JOPSS suggests \(NSSI=22\), and \(\tau_{P}^{i}=\) 0.0242 s which accordingly the average time overhead will be about \(E(\tau_{OH}^{i})=\) 0.0337 s. In this figure, the values of \(E(\tau_{OH}^{i})\) for \(NSSI=1\) and 4 and are 0.01 s and 0.028 s, respectively. It sounds the JOPSS has suggested an inappropriate value while If we calculate the percentage of successfully sent packets for these three different values, we discover the truth that for \(NSSI=1\) the overhead time is much less \((E(\tau_{OH}^{i})=\) 0.01 s) but only 1% of the information (an input image) were successfully sent before the first hand-off, and this number is about 8% for \(NSSI=4\). To comparison, it is about 75% of the input image in just first try for \(NSSI=22\) as the optimum value that was selected by our algorithm. This is a testament to the ability of the JOPSS algorithm to select the optimum values for \(NSSI\) and \(\tau_{P}^{i}\) values, jointly.  
Figure 9: Packet length (in \(\upmu\)s) vs. Arrival rate \((\lambda_{i})\) of primary users (lambda).  
In the following, we plan to investigate the performance of the proposed MOTS system for channel ranking and optimal channel selection.