# Image Transmission over Cognitive Radio Networks for Smart Grid Applications
## 3 Proposed MAC Layer for Image Streaming over CRSNs  
In multimedia applications, time-bound constraints are very challenging [66; 72; 73]. In this work, sending an image within the given time should be completed. In the literature, this time is named the maximum allowed time to transfer an image (\(D_{m}\)). To this end, the time overhead should be minimized. The overhead of transmission can be resulted due to several factors such as propagation delay (\(\tau_{P}\)), the MAC layer latency (\(\tau_{MAC-SS}\)) due to the internal competition of secondary nodes, the delay caused by the spectrum sensing (\(\tau_{SpectrumSensing}\)) [74; 75; 76; 77; 78], the delay caused by the retransmission (\(\tau_{Retransmission}\)), and the delay resulting from Negotiation/Agreement process between two cognitive nodes (\(\tau_{N}\)). Therefore, the total delay can be written as follows:  
\[\tau_{OH}=\tau_{P}+\tau_{MAC-SS}+\tau_{MAC-SP} \tag{1}\]  
where \(\tau_{MAC-SP}\) is the delay caused by the competition between the secondary and primary nodes to occupancy of channels with an emphasis on the higher priority for the primary network users (PUs). We write it as below:  
\[\tau_{MAC-SP}=\tau_{SpectrumSensing}+\tau_{Retransmission}+\tau_{N} \tag{2}\]  
Given the fact that the air interface between the cognitive sensor nodes and the cognitive coordinator are assumed as a short-range line of sight, we assume that the delay caused by the propagation is negligible (\(\tau_{P}=0\)). In addition, based on the assumption that M (the number of cognitive senders with is limited in a cluster and can be even lower than the S which is the number of sub-channels (\(M\leq S\)), the delay caused by \(\tau_{MAC-SS}\), also can be ignored. This is one of the assumptions of our proposed model. In our proposed MAC layer, a Common Channel (CC) is considered for dialogue between the cognitive transmitter and receiver nodes. Each time that a spectrum sensing process is executed, the spectrum pool including the S empty channel can be detected and ranked. Then, the decision that has made on the selected optimal channel (\(C_{j}\)) along with the sender and receiver identifiers should be delivered to the receiver node. The receiver, subsequently, should whether acknowledge or disapprove it to the sender (based on the channel situation on the receiver side). Since both the number of channels (S) and the number of transmitter nodes (M) are limited, the data needed to conduct the negotiation between two nodes will be negligible in comparison with the massive amount of the video stream (\(\tau_{N}=0\)). As a result, we consider the total time delay overhead as follows:  
\[\tau_{OH}=\tau_{SpectrumSensing}+\tau_{Retransmission} \tag{3}\]  
When a collision occurs in the network, the sender should retransmit its last packets. This reduces the successful transmission probability of an input image within the maximum allowed time window (\(D_{m}\)). The imposed time overhead due to retransmission depends on the length of the packet has been lost in the last transmission. If the length of the packet is high, the latency will be high (and vice versa), but the important point is that lowering the packet length may reduce the delay due to retransmission,it also means that because of lower packet length it will result in more spectral sensing (SS) iterations. This exactly means that the time span of spectral sensing will increases. Therefore, there should be a tradeoff between the packet length and the number of spectral sensing iterations. In most of the works that have been done, the reduction of the spectrum sensing time window (\(T_{S}\)) is considered as the main and straight idea to reduce the spectrum sensing overhead time [63; 79; 80]. The important problem with these methods is that although any decrease in \(T_{S}\) may lead to a spectrum sensing overhead reduction, in practice, both \(P_{FA}\) and \(P_{CD}\) fall and consequently both probability of successful transmission and throughput will decrease [81].