# SACRB-MAC: A High-Capacity MAC Protocol for Cognitive Radio Sensor Networks in Smart Grid
## 2 SACRB-MAC Framework
### Protocol Description
#### 2.3.2 Channel Selection Algorithm for Spectrum Aggregation  
In channel selection for spectrum aggregation, the highest capacity that each receiver can provide is the key. Before responding to the sender, each receiver must stay for a duration \(\Delta t_{y}\), where \(y\) denotes the index of receiver. \(\Delta t_{y}\) is dependent on the highest capacity that receiver \(y\) can provide. Therefore, the receiver with better capacity potential can respond earlier so as to determine the channels to be aggregated.  
Based on the Shannon's Theorem, the capacity of the link between nodes \(x\) and \(y\) on the \(i^{th}\) channel in \(j^{th}\) band is as follows.  
\[C_{x,y}^{j,i}=B_{x,y}^{j,i}\log_{2}\left(1+SNR_{y}^{j,i}\right)\leq R_{D} \tag{7}\]  
where \(SNR_{y}^{j,i}\) and \(B_{x,y}^{j,i}\) denote the received SNR at node \(y\) and the bandwidth of the \(i^{th}\) channel in the \(j^{th}\), respectively; \(R_{D}\) is the minimum requested rate demand.  
The received SNR of the \(i^{th}\) channel in \(j^{th}\) band at the node \(y\) can be given by  
\[SNR_{y}^{j,i}=\frac{P^{j,i}\big{|}H_{x,y}\big{|}^{2}}{\delta^{2}} \tag{8}\]  
where \(\delta^{2}\) denotes the power of noise, \(\mathcal{P}^{j,i}\) denotes the transmission power of \(x\) over the \(i^{th}\) channel in the \(j^{th}\) band, and \(H_{x,y}\) denotes the channel coefficient, which can be given by  
\[H_{x,y}=F_{x,y}^{j,i}\sqrt{1\big{/}L_{x,y}} \tag{9}\]where \(F_{x,y}^{j,i}\) and \(L_{x,y}^{j,i}\) denote the fading coefficient and pathloss of \(i^{th}\) channel in the \(j^{th}\), respectively. Therefore, the minimum transmission power for \(x\) over \(i^{th}\) channel in the \(j^{th}\) band can be given by:  
\[\mathcal{P}_{min\_x}^{j,i}=\frac{\left(2^{\frac{R_{D}}{\beta_{m,y}^{j,i}}}-1 \right)\delta^{2}}{\left|H_{x,y}^{2}\right|} \tag{10}\]  
As per [25], the maximal capacity of the link can be achieved by solving the optimization problem.  
\[P: \max\ \ \ \sum_{j=1}^{N}\sum_{i=1}^{M}C_{x,y}^{j,i}s_{j,i} \tag{11}\] \[s.t. (a)\ \ \ \mathcal{P}_{x}^{j,i}\leq\mathcal{P}_{m}^{j,i},\ \ \ \forall\ j\in N,\forall\ i\in M\] \[(b)\ \ \ \ \sum_{j=1}^{N}\sum_{i=1}^{M}\mathcal{P}_{x}^{j,i}s_{j,i} \leq\mathcal{P}_{max}\] \[(c)\ \ \ \ \sum_{j=1}^{N}\sum_{i=1}^{M}s_{j,i}\leq\epsilon\] \[(d)\ \ \ \ \sum_{j=1}^{N}\sum_{i=1}^{M}C_{x,y}^{j,i}s_{j,i}\ \geq R_{D}\] \[(e)\ \ \ \ s_{i,j}\in\mathbf{S},\ \ \ \forall\ j\in N,\forall\ i\in M\]  
where \(\mathcal{P}_{m}^{j,i}\) denotes the maximum transmission power on the \(i^{th}\) channel of the \(j^{th}\) band, \(\epsilon\) denotes the maximum number of channels aggregated due to the hardware constraints, and \(\mathcal{P}_{max}\) denotes the maximum of total transmission power for a node.  
By solving the optimization problem, the highest capacity that the receiver can provide is obtained. Therefore, the timer \(\Delta t_{y}\) for the receiver \(y\) before responding the preamble of the sender node \(x\) is given by:  
\[\Delta t_{y}=\omega\left(C_{max\_x,y}\right)^{-1}+t_{0} \tag{12}\]  
where \(C_{max\_x,y}\) denotes the maximal capacity of the link between node \(x\) and \(y\) using spectrum aggregation, and \(\omega\) and \(t_{0}\) are two constants.