Fuzzy-based reliable and secure cooperative spectrum sensing for the smart grid

Cognitive radio is a promising technology to solve the spectrum scarcity problem caused by inefficient utilization of radio spectrum bands. It allows secondary users to opportunistically access the underutilized spectrum bands assigned to licensed primary users. The local individual spectrum detection is inefficient, and cooperative spectrum sensing is employed to enhance spectrum detection accuracy. However, cooperative spectrum sensing opens up opportunities for new types of security attacks related to the cognitive cycle. One of these attacks is the spectrum sensing data falsification attack, where malicious secondary users send falsified sensing reports about spectrum availability to mislead the fusion center. This internal attack cannot be prevented using traditional cryptography mechanisms. To the best of our knowledge, none of the previous work has considered both unreliable communication environments and the spectrum sensing data falsification attack for cognitive radio based smart grid applications. This paper proposes a fuzzy inference system based on four conflicting descriptors. An attack model is formulated to determine the probability of detection for both honest and malicious secondary users. It considers four independent malicious secondary users’ attacking strategies of always yes, always no, random, and opposite attacks. The performance of the proposed fuzzy fusion system is simulated and compared with the conventional fusion rules of AND, OR, Majority, and the reliable fuzzy fusion that does not consider the secondary user’s sensing reputation. The results indicate that incorporating sensing reputation in the fusion center has enhanced the accuracy of spectrum detection and have prevented malicious secondary users from participating in the spectrum detection fusion.


Introduction
*A smart grid is evolving towards a more modernized smarter grid to provide two-way communications of information and electricity to support the diverse applications (Fadel et al., 2015). Bidirectional communications are essential for monitoring and control of power generating stations, transmission lines, distribution centers, and smart homes, where Wireless Sensor Networks are impeded in every part of the smart grid (Yigit et al., 2016). Home Area Networks (HANs) consists of devices and appliances that communicate with their home controller and/or smart meter to exchange data with the utility control center. A group of smart meters in each Neighborhood Area Networks (NANs) is connected to a data collector to aggregate data to the utility for further analysis through the Wide Area Networks (WANs). These communication networks use different communication technologies in various spectrum bands, one of which is the radio frequency band. Smart grid applications require stringent demand for the spectrum to satisfy the Quality of Service (QoS) requirements of diverse applications. However, radiofrequency bands are overloaded and suffer from interference from multiple coexisting technologies. Cognitive Radio (CR) solutions provide a highly attractive communication technology to access the underutilized frequency bands. This enabling technology opens up the licensed spectrum bands to the unlicensed Secondary Users (SUs) (Toma et al., 2020). SUs are allowed to sense, observe, and learn from the environment to opportunistically access underutilized frequency bands of licensed Primary Users (PUs) (Akyildiz and Brandon, 2011).
The Dynamic Spectrum Access (DSA) allows reliable communication, avoids the license costs, and allows sharing of the spectrum among multiple communication networks (Akyildiz et al., 2006). In addition, SUs can also be aware of their wireless environment to reconfigure their transmission parameters to communicate over the most reliable available spectrum. These reliable communications are vital for the successful deployments of the smart grid, where failure to transmit some events to the utility or back to actuators to perform certain prescribed actions results in major operational problems (Fadel et al., 2017). CR technology can be integrated with traditional networks due to their software-based nature (Huang et al., 2020). CR enabled networks can provide substantial benefits to both the utility and service provider to deploy WSNs to perform usual functions in addition to spectrum sensing. Furthermore, the utility can deploy CRbased smart meters that communicate over the advanced metering infrastructure (Khan et al., 2017). Currently, Wireless Regional Area Network (WRAN) is proposed to allow wireless broadband services in wide rural areas to access TV bands opportunistically (Dehalwar et al., 2016).
The most common technique to detect PUs signal or channel occupancy is by using energy detection (Bae et al., 2017). However, local sensing is inefficient due to propagation impairments (Mustapha et al., 2015). Therefore, the Cooperative Spectrum Sensing (CSS) is used to combine the spectrum sensing reports from multiple SUs. Report fusion can be distributed or centralized (Akyildiz and Brandon, 2011). In distributed CSS, local sensing reports are exchanged with neighbors SUs, while in centralized CSS, SUs send their local sensing reports to a centralized Fusion Center (FC) (Hernandes and Abrao, 2020). However, a cluster-based CSS is more suitable for the smart grid where each cluster is controlled by a CR-based Cluster Head (CH) to collect sensing reports and forward these reports to the FC (Nassef et al., 2018). Hard fusion or soft fusion can be used (Fu et al., 2018). However, the accuracy of the decision depends highly on the received spectrum sensing reports, the reliability of the wireless channels, and the trustworthiness of the cooperating SUs. These critical and conflicting parameters result in inaccurate spectrum decision reports and consequently waste the opportunities to access the available spectrum or cause interference to the PUs.
On the other hand, the smart grid inherits most of the security vulnerabilities commonly found on wireless communication networks, sensor networks, and the Internet as a whole (Ansere et al., 2019). A smart grid is vulnerable to security threats that target traditional networks, plus new security threats related to the cognitive features of the software-based air interface. The current spectrum sensing techniques do not provide a security mechanism to defend against these newly introduced attacks (Nassef and Alhebshi, 2016). The current cryptography security solutions cannot deal with this internal type of attack that initiates from malicious SUs within the network (Fragkiadakis et al., 2014). One of the cognitive-related attacks is the Spectrum Sensing Data Falsification (SSDF) attack , where malicious SUs send falsified sensing decisions to mislead the FC and to disrupt the network operation. This attack may waste the opportunity for other SUs to access the spectrum and also cause interference to PU. Furthermore, malicious SUs can work independently or collaborate and can use different attacking strategies (Wan et al., 2019). Security solutions proposed for both Cognitive Radio Ad Hoc Networks (CRAHNs) and Cognitive Radio Networks (CRNs) are not applicable for the resource-constrained CRbased WSNs (Joshi et al., 2013).
Among the possible solutions to prevent the SSDF attack is to evaluate the trustworthiness of cooperative SUs . A reputationbased detection scheme to detect SSDF attacks was considered in Wang et al. (2017). An attack aware cooperative spectrum sensing to defend against SSDF is proposed in Sharifi (2019) to estimate node behavior based on the estimated attack strength. The SUs' reputation values are developed in (Ye et al., 2016) based on their current and historical sensing behaviors. They used a punishment strategy to recompute the reputation to ensure correct global decisions. A multinomial Bayesian trust model is proposed in Bhattacharjee et al. (2015) to defend against SSDF attacks by classifying nodes into honest or malicious. A double adaptive threshold technique is proposed in Khan et al. (2019) to differentiate the honest and malicious nodes by assigning weights to nodes using a Maximal Ratio Combining (MRC) scheme. Dempster-Shafer evidence theory is used at the FC to combine the decision of all the honest nodes. A sequential CSS in the presence of dynamic byzantine attack for mobile networks to defend against dynamic SDFF attacks is designed in Wu et al. (2018), where consistency of individual sensing report is checked. Reputation management combined with subcarrier modulation-based CSS scheme is presented in Zheng et al. (2016) to achieve robustness against unreliable subcarriers due to harsh industrial environments. Both trust and reputation are used in Bennaceur et al. (2018) to secure the network against SSDF. A cooperative multiband detection scheme to optimize the detection performance and maximize the throughput in the existence of malicious users is presented in Saber and Sadough (2016). Moreover, a trust management scheme based on sensing reputation is developed in Kar et al. (2017) to defend against SSDF attacks. They used sensing reputation based on history and consistency factor to isolate malicious nodes from spectrum sensing decision making.
Fuzzy logic was used to develop communication protocols for clustered based networks to select CHs. Both energy efficiency and enhance network lifetime were considered based on three factors of the node's remaining energy, the distribution of neighboring nodes or node degree, and the closest node to the base station. The aim was to decrease energy consumption and increase network lifetime (Rasheed et al., 2018). Finally, a fuzzy-based CSS to improve the probability of spectrum detection in a harsh smart grid environment was developed in Nassef and Alhebshi (2016). However, combining the reliability of communication channels with node behavior was not considered. The objective of this paper is to propose a Fuzzy Inference System (FIS) to improve spectrum detection performance in the presence of malicious SUs. The aim is to evaluate the impact of SSDF attack on fusion decisions, to propose an attack detection to classify SU's behavior, and be able to prevent malicious SU's from cooperating in the fusion process. The proposed FIS allows intermediate values to have a degree of membership function defined in the interval [0, 1]. The FIS inputs apply different functions to determine output using some formulated rules. The FIS takes crisp inputs and produces fuzzy output, which needs defuzzification to extract the crisp output that represents the fuzzy set. It is based on four descriptors of sensing reputation, channel condition, energy, and the probability of detection in the smart grid environment. To the best of our knowledge, there is no previous work that has proposed a secure and reliable cluster-based CSS that is designed especially for a smart grid environment. Therefore, this paper proposes a cluster-based CSS to detect and prevent SSDF malicious activities in a CR-based smart grid. The sensing reputation of SU is computed to classify SUs as honest, malicious, and suspected. A FIS based on sensing reputation of SUs behaviors, channel condition, energy, and the local probability of detection is proposed to enhance the accuracy of spectrum sensing detection.
The rest of the paper is organized as follows. Section II develops the threat model and evaluate performance indicators in both benign network and under SSDF attack with different attacking strategies and attacking probabilities. Section III develops the sensing reputation algorithm to detect SSDF attacks and to classify network nodes as trusted, malicious, and suspicious. Section IV proposes the fuzzy-based trust and reliable fusion to mitigate the impact of SSDF attacks based on four fuzzy descriptors to enhance the accuracy of spectrum decisions. Section V presents the simulation environment, performance metrics, simulation scenarios, and results analysis, where the proposed model is compared with the benign and attacked scenarios. Finally, Section VI provides the conclusion and future work.

Threat model
The network consists of N number of that are uniformly distributed in a square area of sides and number of . Nodes are clustered into clusters, and each cluster is assumed to occupy an area of 2 square meters. Each cluster has one Cluster Head ( ) to communicate with member nodes = , where is the number of SUs in each cluster. The network architecture includes at the higher level a network controller (FC) in which different applications are implemented. The FC selects the frequency bands to be sensed and instructs all network nodes to perform individual sensing. Correspondingly, it receives the sensing reports from all cluster heads. The cluster-based CSS is used to reduce the overhead associated with sensing reports transmission at the WAN level and with limiting effects of malicious SUs within the cluster to enhance attack detection accuracy. ALL continuously scans channels to construct their local occupancy vector and transmits their sensing reports to FC through their corresponding . The honest transmits the same actual vector while malicious transmits a modified report to falsify the occupancy of some channels. Based on the received vectors, submit their reports to FC, which employs fusion rules to make a cluster decision about the spectrum occupancy of all of channels. For the hard fusion, the binary decision of about all channels are constructed as a binary vector and submitted to FC through the corresponding over the error-free channel. For soft fusion, the actual energy and channel conditions are constructed. The occupancy vector is constructed as: where In a benign network, two error performance indicators are defined. The probability of false alarm which are the probability of sensing the presence of a PU when the channel is vacant and the probability of miss detection which is the probability of not sensing a PU when the channel is occupied. Therefore, for honest SUs, = ( = 1 | 0 ) and = ( = 0 | 1 ). These honest SUs do not change their sensing decision results and they advertise to CH such as ( = 1 | = 1) = 1, ( = 0 | = 1) = 0, ( = 0 | = 0) = 1, and ( = 1 | = 0) = 0. Then the probability of detection of individual SUs, , is defined as: The performance indicators for " " fusion in a benign environment is formulated as: where When malicious decide to launch the attack with a probability of , they modify sensing reports sent to the CH to influence the decision about the channel status. Different attacking strategies can be used based on the attack's objectives. The first strategy can be ''Always YES" in which malicious nodes always report that the channel is occupied with increasing the probability of false alarm and with causing channel underutilization. The second strategy can be ''Always NO" in which malicious nodes always report that the channel is vacant to lower the detection probability and increase interference to the PU. The third attack can be ''Always Opposite'' in which the opposite decision is reported to increase false alarm probability and decrease detection probability. The fourth attack can be a ''random attack'' in which a random decision is reported. Always yes and always no strategies are easily identified after several rounds of CSS due to constant sensing reports. However, always opposite and random strategies are the most harmful attacks.
The clustered based CSS consists of a number of SUs that are defined as = + ℎ , where nodes are the number of malicious nodes; ℎ are a number of honest nodes and is the total number of cluster members. In each cluster, there is a percentage of = malicious SUs that defines the attack strength. When decides to attack with a probability , the advertised vector { } of may be different from the actual vector where honest nodes would have the same ( = ), and malicious nodes would have submitted the report that will depend on its attack strategy. The advertises vector will be, Since all the honest SUs ℎ are sensing the same channels, their sensing reports should be similar. The dissimilar reports are received from the malicious SUs. It is assumed that ≪ Where the number of sensing reports from honest is greater than the number of sensing reports from the malicious for the proper operation of the majority fusion, which considers only the maximum number of similar sensing reports to reach a decision. Without loss of generalities, the following is the detection probability of an individual malicious and defined as , For fusion where = + ℎ 2 , the follows a binomial distribution with parameter ℎ and also follows a binomial distribution with parameter . Therefore, the overall detection probability is calculated using the joint distribution of detection probability of independent, honest and independent malicious nodes as follows:

Computation of sensing reputation
To secure the network against the SSDF attack, the sensing reports are collected from all clusters. In each cluster, reports are highly correlated, and malicious reports can be detected based on their similarity (or difference) with reports from honest SUs. The SU's behavior is classified into honest and malicious based on their sensing reputation, which is computed based on direct and indirect trust. Trust is an expectation of a SU's behavior, and for simplicity, trust is formulated for one cluster. In this case, an indirect trust level is not required as all communications are performed between and it's immediate cluster members. Trust is dependent on time, and SUs can gain or lose trust with time. A single observation is not sufficient to estimate the behavior of the nodes. The trust value should be dynamically updated due to its dependence on the percentage of malicious SUs. However, updating the trust value frequently often results in the rapid consumption of energy, and it may not reflect trust value efficiently if the interval for the trusted update is too long. SUs usually observe the spectrum over a time window that may be adjusted depending on the user requirement and computational resource availability. A larger time window of observation allows a more accurate estimation of SU's behavior but consumes more resources. Trust is computed based on previous and current sensing reports. Over the sliding time window , the history of the last spectrum sensing periods is used to classify nodes as Trusted, malicious, and suspicious using trust level. The trust value is modeled as a random variable in the range of [0, 1] (Bai et al., 2017), where the probability of expectation to effectively evaluate the trustworthiness of a SU is computed using the Beta distribution. Beta probability distribution function is computed using two parameters of the number of positive behavior of honest SUs (u_i^h)) and the number of negative behavior of malicious nodes (u_i^m) (Kar et al., 2017). The probabilistic estimation of the future trust and uncertainty about the behavior of a SU is captured from a history table that is created for each channel to record sensing reports from each SU during the sensing periods. The accumulated number of times the sensing reports that were similar to the final decision is computed as positive observations " ℎ ," and the accumulated number of times the number the sensing report was different from the final decision computed as the negative observations " ." These accumulated evidences formulate the trust relationship between CH and SU. The direct trust level is defined as the expectation [ ( ℎ , )] and is computed as The Sensing Reputation [ ] is computed using the sliding time window that moves to remove the recorded history based on three factors. The first factor is the historical trust level with an attenuation factor ( ) to weight the historical experience based on timestamp t, where the newer sensing period is weighted more than, the older one. The second factor is the incentive factor to reward honest SUs for their honest behavior and also punish malicious SUs by decreasing their trust level. The third factor is the consistency factor that maintains an honest trust level. These factors are weighted with different weights to compute the [ ] for each as follows: where weights ∈ [0,1] and ∑ =1 = 1. These weights are adjusted according to the demand of the network. 1 is specified to give more weight to current sensing reports for immediate detection of node behavior, 2 is used to inhibit malicious behavior, and 3 is used to encourage the SUs to be honest for a long time. The trust value is computed over all sensed channels as follows: A predefined threshold is used to classify a node's behavior-based node's sensing reputation. Initially the [ ] of all SUs are assigned a value = 0.5 which is used to initialize the network when no historical trust file is found. With time, the [ ] will be modified, and SUs are classified as honest, malicious, or suspicious based on the following predefined threshold for the three categories as follows:

Proposed fuzzy inference system
Fuzzy fusion to enhance spectrum detection accuracy in unreliable harsh smart grid environments was developed in Nassef and Alhebshi (2016). The proposed FIS considers both reliability and the presence of malicious by incorporating four fuzzy descriptors to detect spectrum: Sensing reputation, channel condition, energy difference, and the local probability of detection. The four input descriptors have three levels of linguistic values to reflect the different degree of membership of the input linguistic variable and specified as follows: Descriptor 1: The sensing reputation has 3 input linguistic variables of malicious, suspicious, and honest. Descriptor 2: The channel condition has 3 input linguistic variables of poor, good, excellent. Descriptor 3: The difference of the energy difference of sensed energy of to the average of all SUs in the cluster. It has 3 input linguistic variables of high, medium, and low. Descriptor 4: The local probability of detection has an input linguistic variable of low, medium, and high.
The output linguistic variable has seven linguistic values of very high, high, med-high, med, med-low, low, very low. All of the seven membership functions are represented by triangular functions, as shown in Fig. 1. The four input parameters with three different levels give a total of 81 fuzzy IF-THEN rules. The two extreme rules are located between these two cases: Case (1): If SR is malicious, SNR is poor, DIFF is high and local is low, then the fuzzy cluster decision is very low. Case (2): If SR is honest, SNR is excellent, DIFF is low, and is high, then the fuzzy cluster decision is very high.

Simulation environment
Simulations are performed to create the same environment found in HAN to investigate the newly introduced SSDF attack and validate the effectiveness of the proposed FIS. The network consists of 100 nodes, and a percentage of these nodes are selected to be malicious. It is also assumed that initially, all nodes are authorized by the FC, which knows the node's location and sensing parameters of all clusters. The performance of the hard fusion rules is simulated and compared with the performance of the proposed FIS. Simulation is carried first in a benign environment, then independent SSDF attack with various strategies are introduced. The traffic and propagation models are based on the requirements of the smart grid environment. The simulation parameters are summarized in Table 1.

Simulation results and analysis
Two scenarios to evaluate the performance of proposed fusion schemes are considered. The first scenario evaluates the probability of detection against the probability of false alarm for the majority fusion under the impact of different independent SSDF attack strategies with 10% malicious nodes. Results indicate that the performance of majority fusion degraded quickly when the percentage of malicious nodes is 10 % as compared with the case of no malicious attacks (0%). The highest degradation is achieved with the opposite attack strategy as compared to always yes and always no attack strategies. The majority of fusion cannot distinguish between honest SUs from malicious SUs, which greatly impacts the fusion process due to inaccurate sensing reports. The figure also presents the impact of random attack strategy and 10% percentage of malicious SUs on the fuzzy reliable fusion where sensing reputation is disabled to consider the impact of reliability with no measure of sensing reputation on detection of SSDF attacks. The improvement is attributed to reliability considerations. As indicated in Fig. 2, the proposed fuzzy scheme shows better results with the introduction of 10 % of malicious SUs and provided the best performance due to its effectiveness in detecting malicious SUs and isolating them from participating in the fusion process, which enhanced detection accuracy.
The second scenario shows the effect of increasing the percentage of malicious nodes on detection performance. When there are no malicious SUs, the difference between proposed fusion and reliable fusion is due to the impact of taking channel condition into consideration. The detection performance of proposed fuzzy fusion has no measures for sensing reputation, and performance dropped quickly when the percentage of malicious SUs increases due to incorrect sensing reports, which impacted the spectrum decision. On the other hand, the proposed fuzzy fusion exhibits more robustness and maintains a relatively good performance as the percentage of malicious nodes increases. As indicated in Fig. 3, the proposed fuzzy fusion has the advantage of integrating the sensing reputation to provide more accurate results, which contributed to the performance improvement. The proposed fuzzy-based secure fusion has prevented malicious SUs from participating in detection probability, which enhanced detection accuracy. Using the proposed FIS, malicious SUs are not allowed to participate in fusion once they are detected.
However, suspected nodes are continuously monitored to evaluate their behavior.

Conclusion and future works
The exponential growth of wireless applications and the spectrum scarcity problem, along with the traditional static spectrum allocation, have caused unreliable communications in the harsh smart grid environment. The unlicensed spectrum band suffers from a spectrum inefficiency problem while the licensed spectrum band is underutilized. Cognitive radio is proposed to allow opportunistic access to these underutilized spectrum bands. The local spectrum detection is inefficient, and a cooperative spectrum sensing is employed to enhance detection accuracy. However, cooperative spectrum sensing is vulnerable to SSDF attacks in which malicious SUs modify their sensing reports to force the fusion center to make the wrong spectrum decision. Sensing reputation is developed to classify SUs as honest, malicious, and suspicious. A fuzzy inference system is proposed to maintain a good detection performance in the presence of malicious SUs. It is based on four conflicting fuzzy descriptors of node's sensing reputation, channel condition, difference of local sensing to the average of cluster cooperative sensing, and the local probability of detection. The proposed FIS has prevented malicious SUs from participating in the fusion process and also allowed to keep track of suspicious SU's behavior. The proposed FIS was evaluated through simulation, and the results demonstrated that the proposed scheme was effective in enhancing detection probability as compared to fuzzy reliable and majority fusion under independent SSDF attacks. However, the effect of launching collaborative malicious SSDF attacks needs to be considered along with other attacks that target the spectrum sensing phase as well as other phases of the cognitive cycle. A deep learning approach is now considered to enhance attack detection and prevention for multiple types of spectrum sensing attacks under a wide range of scenarios, propagation environment, topology, and/or attack strategies that will be based on the dataset obtained from the current simulation work.

Conflict of interest
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.