# QoS Enabled Layered Based Clustering for Reactive Flooding in the Internet of Things
## 4 Proposed CBF for IoT
### The IntraLayer Clustering (IALC)
To obtain the appropriate results simulations are performed 60 times based on the following three scenarios:

* Scenario based on varied intervals of traffic: This condition plays an important role to gauge and ensure the effectiveness of flooding attacks and to regulate the defensive techniques in varying interval of traffic. Ranges for traffic interval is set as 1-10 s, where 1 s is referred to as faster and 10 s is slower. * Scenario based on a varied number of mischievous motes: this condition is favorable in analyzing the impact of flooding attack on the network and to take the appropriate action to counter mischievous motes. Motes 2, 6, 10, 15 are set as mischievous motes, and the interval of traffic is set to 1 s, where 1 s is referred as the fastest traffic in the network. * Condition based on realistic scenario: In this conditional scenario motes are restricted to not transfer the route query information simultaneously; they are only allowed to transfer route query requests at different intervals of time. These intervals are randomly set from 1-10 s.

### Average Consumption of Energy

Figure 9 exhibits the average consumption of energy and number of malicious motes at varying intervals of time. In Figure 9a the proposed QCM technique outperformed compared to DnC, SLA, and Hy-IoT approaches in terms of dropping the average consumption of energy. Since the proposed technique is capable of detecting flooder motes and detach them from the network, in this way it reduces the level of energy consumption that arises during redundant and unwanted flooding attacks, \begin{table}
\begin{tabular}{c c} \hline \hline
**Mote Type** & **Sky Mote** \\ \hline Energy at initial state & 100 J \\ Power at idle state & 31 mW \\ Power at receiving state & 35 mW \\ Power at sending state & 31 mW \\ Power at sleep state & 15 \(\upmu\)W \\ Simulation name & QoS Enabled CBF \\ Radio medium & UDGM with Distance Loss \\ Startup Delay & 1 ms \\ Random Seed & 123,456 (Default) \\ Positioning & Random \\ Topology & Random \\ Number of Motes & 16 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Simulation parameters. whereas the average energy consumption of DnC and SLA is approximately 21 and 18%, respectively, from 1-5 s intervals, and this ratio continuously rises as the interval increases. However, in the case of the proposed mechanism the ratio of consumption of energy falls to 6% as compared to the 13% of the existing Hy-IoT approach. Obviously, for all techniques the average energy consumption is directly proportional to the time interval, as the time interval increases average energy consumption also increases. The flooder mode consumes the highest level of energy as it directly sends redundant queries once detect any communication activity in the network. Figure 9b demonstrates the average consumption of energy along with different numbers of mischievous motes, mischievous motes are resides at 2, 6, 10, and 15. An exact realistic analysis of QCM is conducted to find the level of mischievous motes during flooding expansion in the network. It is evident from the result that in the presence of malicious motes the level of energy consumption increases gradually. At malicious mote 2 the levels of energy consumption are approximately 8 and 5% for DnC and SLA approaches, respectively, and at malicious mote 15 this consumption level reaches to approximately 48% and 40%. Hence, by introducing QCM this level falls to approximately 2%, 4%, and 20% at malicious motes 2, 6, and 15, respectively. The result of proposed QCM is superior then the current Hy-IoT, that is about 3% and 8% at malicious motes 2 and 6, respectively, and subsequently moves upward to 32% at mote 15. The proposed QCM is capable of reducing the level of energy consumption by suspending the flooder mote from redundant transmission to the active state, and treat the flooding attacks effectively and efficiently. Figure 9c demonstrates the average consumption of energy along with malicious motes and realistic conditions.