# Build-Launch-Consolidate Framework and Toolkit for Impact Analysis on Wireless Sensor Networks
## 4 Case Study: Analyzing Flooding Attack
### Results and Analysis
#### 4.3.3 Impact on Power Consumption  
The flooding attack increased the power consumption in binary networks by 55% as presented in Table 4. At the same time, the same metric for the grid layout increased by 120%. The boxplots in Figures 18 and 19 present detailed statistics for the power consumption of each node in both layouts (binary and grid, respectively). Each data point represents one 20-s reading of power consumption by the node. A total of 90 readings were collected for each node throughout each simulation. These boxplots compare the impact of the attack with the normal baseline. The minimum power consumption for both layouts was around 0.09 mW, and this was seen in both normal and attack scenarios. However, the maximum consumption increased from about 5.5 mW in the normal scenario to 12.5 mW under flooding attacks, presented in Figure 18. For the grid layout, the maximum consumption increased from about 7.3 mW in the normal scenario to 11.8 mW under flooding attacks, shown in Figure 19. A drill-down into the performance of individual nodes is summarized in Figure 20 for the binary layout, and Figure 21 for the grid layout.  
Although both binary and grid layouts were impacted to varying degrees, we notice a common pattern in both layouts: the nodes closer to the attacker are more affected by the attack and thus have a shorter lifetime. In the case of the binary layout, the child nodes of the attacker (nodes 20 and 21) had the most increase in terms of power consumption (by 846% and 505%, respectively). Similarly for the grid layout, adjacent nodes to the attacker  
Figure 17: Heatmap of grid layout, highlighting percentage change in average E2E post attack.  
showed the highest increase in power consumption across the network. This can be seen through nodes 23, 18, and 24, which increased by 388%, 320%, and 274%, respectively.  
Additionally, we also notice that some nodes further away from the attacker showed a slight decrease in power consumption. This is applicable to both the binary layout (e.g., nodes 2 and 3), and the grid layout (e.g., nodes 6 and 23). However, one major distinction between the two layouts is that the effect of power consumption was more contained in the binary layout compared to that of the grid layout. In the binary layout, Figure 20 points out that the average power consumption for the nodes in the right-hand branch where the attacker is located increased by 130%, whereas that of the left-hand branch away from the attacker did not show visible changes. The same cannot be said for the grid layout, Figure 21, because some nodes closer to the sink and further from the attacker demonstrated a significant increase in power consumption, such as node 10, which showed an increase by 212%. The lifespan of the sink and its surrounding nodes is critical for the lifetime of the overall network because it serves the only link for further nodes to get their messages transmitted. Accordingly, we believe that a flooding attack would have a devastating impact if the attacker is positioned closer to the sink.  
Figure 19: Boxplot visualizing PC of the grid layout nodes, comparing normal and attack scenarios.  
Figure 18: Boxplot visualizing PC of the binary layout nodes, comparing normal and attack scenarios.