*5.5. The Average of the Energy of Alive Nodes*

As it was assumed, the network is formed by heterogeneous nodes which have an energy between 0.5 to 1.5 *j*. Figure 12 illustrate the energy consumption of each node in the proposed algorithm and in scenario 1. Figures 12 and 13 compare the amount of energy in each node in HCD for scenarios 1 and 2, at the beginning of the network and during the rounds 250, 500, and 750. The proposed protocol has excellent load balancing. At first, due to the assumption of heterogeneous nodes, an energy difference between the nodes is observed. However, gradually in a period of 250, and particularly 500, during the performance of our proposed protocol, it can be seen that the energy difference between nodes is reduced. This indicates that in the proposed protocol we have high load balancing. The proposed protocol is able to distribute the energy consumption between all nodes and pave the way for increasing the load balancing by selecting the proper CH. In addition, by determining the suitable CH, the presented protocol divided the energy consumption among nodes and it helped reducing energy consumption by multihop transmission. In this type of transmission distance is short, and hence, less energy is required for transmission. Accordingly, the presented protocol prevented the immediate reduction of energy in nodes by selecting appropriate CH and avoiding direct transmission to distant nodes. Consequently, the close and distant nodes consumed energy in a balanced way, the stability was increased and the throughput was improved.

**Figure 13.** Energy consumption of HCD for scenario 2.

One of the important reasons in the proposed protocol which contributed to the increased network lifetime is that it omitted the maximum control messages in the network. Figures 14 and 15 show the energy consumption for control messages in the proposed protocol and other protocols. The proposed protocol decrease energy consumption in terms of control messages to 300% in comparison to EDCD and EADUC-II and 100% in comparison to HUCL.

**Figure 14.** Total energy consumption for control message in scenario 1.

**Figure 15.** Total energy consumption for control message in scenario 2.

Given that in our proposed protocol there were 6 rounds of data transmission per each major slot without the overhead control message, and since the protocol had 42 rounds of data transmission to the BS per each transmission stage, this protocol was able to optimize the energy consumption by reducing the overhead. This led to an increase in average energy of nodes. Figures 16 and 17 show the average energy of alive nodes during the simulation.

**Figure 16.** The average energy of alive nodes for scenario 1.

**Figure 17.** The average of the energy of alive nodes for scenario 2.

According to the results, it can be concluded that in the proposed method by reducing the network overhead, the energy consumption has been reduced.

### *5.6. Throughput*

Figures 18 and 19 demonstrate packet production in relation to the round indicating an increased efficiency of the proposed protocols. This method was able to produce and transmit more packets during the simulation, increase the throughput due to the balanced energy consumption, increased stability and improved number of available nodes. The proposed protocol increases throughout to 40%, 33%, and 37% in the first scenario and 30%, 43%, and 45% in the second scenarios in comparison to ECDC, HUCL, and EADUC-II, respectively.

**Figure 18.** Throughput for scenario 1.

**Figure 19.** Throughput for scenario 2.

#### *5.7. Simulation in Other Scenarios and Parameters*

Based on the reliability of our proposed protocol in this section, we have compared this protocol with simulation scenarios of EADUC-II [25]. Therefore, the simulation parameters reported in [25] were considered. According to their first scenario, 100 nodes were distributed uniformly within an area of 200 × 200 m2 and the location of the BS was set at 250 × 100. The size of the packets and control massage was 500 byte and 25 bytes, respectively. The results, as shown in Figure 20, indicated an improvement in the average number of alive nodes in comparison with the previous protocols.

**Figure 20.** The average of the number of alive nodes for our Simulation.

Our simulation results with the parameters of the article [25], also confirm the simulation of the EADUC-II and the results showed that the proposed protocol had better performance compared to other protocols.

#### **6. Conclusions**

In recent years, the development of technology, IoT has been used over sensor networks in various fields. Wireless nodes have some limitation in case of energy sources since energy consumption is highly related to sending and receiving waves. Optimization of energy consumption in routing protocols is one of the main methods of increase the network lifetime. In this paper, we proposed a new and efficient clustering protocol based on density as a hybrid of static and dynamic as well as multi-hop routing for IoT based on wireless nodes. We considered a distributed clustering method and performed routing between CH and BS on the basis of multi-hop routing. The proposed method significantly reduced the network overhead and energy consumption by deleting unusual control messages. The results showed that HCD can effectively improve network stability and lifetime. Compared to EDCD [24], HUCL [15], and EADUC-II [25], the network stability increased to 179%, 156%, and 78% and to 150%, 320%, and 141% in the first and second scenarios, respectively. In addition, HCD increased throughput to 40%, 33%, and 37% in the first scenario and 30%, 43%, and 45% in the second scenarios in comparison to EDCD, HUCL, and EADUC-II. Furthermore, it is able to balance energy consumption in the network and improve efficiency and throughput.

**Author Contributions:** T.H. and S.M.B. prepared the literature review and performed the experiments and composed the manuscript, A.V.O., A.A.R.H., A.K.S. scrutinized the data, developed Methods and Experiments, T.H. and M.-Y.C., compiled the experimental results, A.K.S. supervised the research activities and devised the systematic plans for this study.

**Acknowledgments:** This work was supported in part by International Scientific and Technological Cooperation Project of Dongguan (2016508102011), in part by Science and Technology Planning Project of Guangdong Province (2016A020210142) and in part by Guangdong provincial key platform and major scientific research projects (2017GXJK174).

**Conflicts of Interest:** The authors declare no conflict of interest.
