## 5 System Simulation
### Simulation Results
Table 4 details the different values and describes the banning process. In the first activity period, the BS has just received the neighbor report from the nodes, and thus there is still no data to assess the nodes. In the second activity period, the BS has received five nodes from the source node 23 out of which one is detected as a malicious packet with harmful content; so directly the BS flags node 23 as bad without any probation. Then the BS calculates the rest of its traits and values, resulting in banning node 23 for two periods and increasing its banNum to 2; which is clear in the table. Note that banNum acts as a history for bad activity. In the end of the fourth period, the isolation time has ended and the BS includes the node into the network again. However, in the fifth activity period, the BS detects a malicious packet again, and thus the BS decides now to isolate the node for three periods. Note that, since node 23 is a partially malicious node and it is sending a small percentage of bad packets, its dtrust is not very low, and thus its banning period is increasing slowly one time after another. This would have been much more aggressive had the node been totally malicious. This example shows two main features of our model, 1- the network inherently isolates outsider nodes using the strong yet efficient authentication scheme, and 2- the BS directly recognizes the bad, misbehaving node by detecting its sent malicious content even if at a low rate. In this example, the BS isolates node 23 for two periods only as an initial countermeasure since node 23 has not previous bad actions. After the banning period ends, BS tests node 23 again, however this time node 23 has a history and thus when node 23 repeats its malicious activity, it is banned for five periods. This continues by \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Activity Period** & **1 st** & **2 nd** & **3 rd** & **4 th** & **5 th** \\ \hline DL & - & 32 & - & - & 32 \\ Received at sink & - & 5 & - & - & 4 \\ Node received & - & 45 & - & - & 92 \\ Node forwarded & - & 50 & - & - & 96 \\ Bad Received & - & 1 & - & - & \\ Maliciousness & - & 0.2 & - & - & 0.2 \\ Competence & - & 1 & - & - & 1 \\ Cooperation & - & 1 & - & - & 1 \\ Frust & - & 0.3 & - & - & 0.3 \\ Dr trust & - & 0.8 & - & - & 0.8 \\ BanRem & 0 & 2 & 1 & 0 & 3 \\ BanNum & 1 & 2 & 2 & 2 & 3 \\ Probation & 0 & 0 & 0 & 0 & 0 \\ Bad & 0 & 1 & 0 & 0 & 1 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Different Values of node 23 at BS every period. increasing the banning periods before rechecking the node by giving it an additional chance; and anytime the node stops its bad deeds, its banNum starts decreasing until it is considered as a good node again. In the following, we show some misbehavior constituting counter manipulations. Node 17 is claiming to send packets through a non-DL neighbor and thus, the BS directly detects it as a bad node for that. As the drust of node 17 is still equal to 1 and it has no history of bad actions, it is isolated for one period initially, the number which increases as the misbehavior persists. Note that the reason behind this misbehavior may be a malfunctioning node or a bad node trying to delude the BS into considering some good node as bad; however, in any case, this type of misbehavior should be directly stopped as it affects the correct operation of the system. Then, we added two misbehaving nodes, node 3 incrementing its DL counters and node 19 incrementing one of its UL counters. At pass 6, the BS detects the discrepancies and put node 3 on DL-probation and its DL, node 4, on UL-probation; it sets the DL of node 3 as node 12. As for node 19 it has no ULs for this period and it did not do anything wrong so far. In pass 12, node 3 is detected as bad since it took a second DL probation. In this pass, node 19 manipulated its counters for its UL (node 10), and thus node 19 is put on UL probation and node 10 DL probation. In pass 18, node 19 is isolated.