## 6 Results and Analysis
### Network Lifetime  
Network lifetime is measured through a set of parameters, which include:  
Number of Alive Nodes: The number of nodes alive in the network is an indicator for the network lifetime because, as long as there are functioning nodes, the network will keep running. Figure 13 illustrates a comparison among the three designs in terms of the number of alive nodes. It can be seen that, in Watchdog design, the nodes start to die after a long period of time when compared to the rest of the designs. Thus, this design will increase the network lifetime. This is due to the same reasons explained in Figure 11. The least efficient design is the Broadcasting, and this is due to the message transmission process done at the end of each round and mainly because of the SCH notification process, where each CH broadcasts a message to the entire associated nodes, to inform them with the identity of the SCH. Routing messages are very expensive in WSNs and their cost can be observed by this design. Number of Rounds: The more rounds in the network, the longer the network will live and the more services will be provided and hence the higher probability of user satisfaction. Table 8 illustrates a comparison between the three designs. Table 8 stresses the inefficiency of Broadcast design as it performs the least number of rounds among Scheduling and Watchdog designs which reported a close number of rounds. Figure 13: Number of nodes alive measurements. \begin{table}
\begin{tabular}{c c} \hline \hline
**Design** & **Number of Rounds** \\ \hline Scheduling & 29 \\ Broadcast & 20 \\ Watchdog & 27 \\ \hline \hline \end{tabular}
\end{table} 
Table 8: Number of rounds. Time of First Node to Die: The earlier the node dies, the more energy it has been consumed and the less time for the network to last. Table 9 illustrates a comparison between the three designs in regard to this metric. It can be noticed that the earliest first node to die was in the Broadcast design. This indicates the shortening in the network lifetime, which means that the network did not live for long here. Consequently, Broadcast design is the worst design among them all. On the other hand, the Watchdog design had the latest first node to die, which outperformed the other two designs. Table 10 summarizes the results of the overall tests which were carried out. To conclude, the Watchdog design was the best design among the three suggested designs. The Scheduling design comes afterwards and then the Broadcast design. This is due to the excessive number of message transmissions, especially in the Broadcast design, causing the nodes to lose their energy over message passing. As can be also observed from the above results, this research highlighted the importance of following proper SDLC process while developing IDS to ensure efficient, secure services running over WSNs. Since all packets can be tracked and logged within an IDS, it is very important to utilize those logs. Those logs are used for the purpose of information gathering, monitoring, and analysis. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Performance Measurements** & **Scheduling Design** & **Broadcast Design** & **Watchdog Design** \\ \hline Energy Consumption (j) & 339.05 & 394.3 & 319.6 \\ Network Lifetime (s) [last node to die] & 453.5 & 311.4 & 540.6 \\ Nodes Alive at End of Simulation (No.) & 4 & 4 & 4 \\ Time of First Node to Die (s) & 330.6 & 228.825 & 381.85 \\ \hline \hline \end{tabular}
\end{table} 
Table 10: Results summary. Figure 14: Results summary. \begin{table}
\begin{tabular}{c c} \hline \hline
**Design** & **Time of First Node to Die** \\ \hline Scheduling & 330.6 \\ Broadcast & 228.825 \\ Watchdog & 381.85 \\ \hline \hline \end{tabular}
\end{table} 
Table 9: First node to die. Figure 15 illustrates the \"Monitoring Report\" that collects all sorts of data attributes and Figure 16 shows the \"Detection Report\" that has all the detected Black hole attacks.