## 4 Proposed System
### Selective Forwarding Detection (SFD) Algorithms
#### 4.3.1 MAC Pool of IDs Layer
Given that the network will accept \(k_{l}\) sensor nodes in the network, thus, scalable probability of network can be defined as:\[{S_{p}}^{+}=\sum_{k=0}^{\infty}(k_{\ell})+k_{j}\times\ \iint_{i=0\ \&\ j=0}^{N+}(\Delta p)^{n}\ +\ ( \
abla\mathrm{p}) \tag{7}\]

where \((\Delta p)^{n}\) the number of delivered packets from the sensor nodes that are already part of the network and \(\
abla\mathrm{p}\) the number of packets delivered by nodes joining the network and \({S_{p}}^{+}\) the scalable probability when sensor nodes join the networks. ## 6 Results and Discussion

The approach to detecting selective forwarding attacks is tested using a simulation. In the simulation, 200 sensor nodes are deployed in a network with an area of \(800\times 800\) m\({}^{2}\) using NS2 (Table 2). Therefore, each node had a transmission range of 35 m and a sensing range of 30 m. The energetic cost of a node is 5 J, and there are 180 static and 20 mobile nodes. We calculated the amount of energy consumed. Figure 4a describes the reliable detection rate of our approach and other works. The reliable detection rate is important to extend the network lifetime. We proved the number of packets successfully received at the destination node. It clearly shows that SFD is stable at almost the same level when the time increased from 0 min to 27 min. The reliable detection rate is 98.4%. The reliable detection rate for the LWSS, LWD, SDT, and RSSI-EM approaches are not stable and go down when the time increases. The reliability rates are 88.2%, 90.6%, 89.6%, and 86.3%, respectively. Energy is also an important factor. Figure 4b shows the energy consumption performance of the LWSS, LWD, SDT, and RSSI-EM approaches with 180 static nodes and 20 mobility nodes. In comparing our proposed SFD approach with the other approaches, we assume the 10% of nodes are malicious and 10% of the nodes are mobile. As a result, we saw different percentages of energy consumption for each one of these approaches, which consumed 75.1%, 81.8%, 69.1%, and 68.5%, respectively. Thus, the total of malicious nodes and energy consumption appears. Figure 4c shows the probability detection of selective forwarding attacks and other competing schemes with 50% malicious nodes and static nodes. As a result, SFD has a high probability of almost 96%. In Figure 4d we show the packet delivery ratio with 50% malicious nodes and 25% mobile nodes. Between 5% and 10% malicious nodes, the SFD approach has a ratio of 99.2%, higher than the values of the other approaches which 94.4%, 94.1%, 94.3%, and 94.2%. The accuracy rate of SFD and other competing selective forwarding mechanisms are shown in Figure 4e. The accuracy of our approach is more than 98%. The network consumes less energy when it includes mobile nodes; therefore, it was 60.4% at the highest point, and the energy cost was low. If there are malicious nodes along the routes, the SFD approach is able to reduce the communication overhead. The new approach is more effective while the detection of nodes is increased. \begin{table}
\begin{tabular}{c c} \hline
**Parameters** & **Description** \\ \hline Transmission Range & 35 m \\ Sensing Range of node & 30 m \\ Initial energy of a node & 5 J \\ Bandwidth of node & 60 Kb/Sec \\ Number of legitimate sensors & 120 \\ \hline \end{tabular}
\end{table} 
Table 2: Experiment Parameters. **Figure 4**. _Cont._ \begin{table}
\begin{tabular}{c c} \hline
**Parameters** & **Description** \\ \hline Number of Malicious nodes & 80 \\ Size of network & \(800\times 800\) m\({}^{2}\) \\ Buffering capacity & 45 Packets buffering capacity at each node \\ Data Packet size & 128 bytes \\ Simulation time & 27 min \\ Tx energy & 15.2 mW \\ Rx energy & 11.8 mW \\ Power Intensity & \(-18\) dBm to 13 dBm. \\ \hline \end{tabular}
\end{table} 
Table 2: _Cont._Figure 4: **(a)** Reliable detection rate of selective forwarding attack; (**b**) Energy consumptions; (**c**) Probability detection of selective forwarding attack; (**d**) Packet delivery ratio; (**e**) Accuracy rate.