## 5 Proposed Dynamic Cluster Head Election Algorithm
### Proposed Dynamic Re-Clustering and Self-Organization Method
#### 5.2.2 Dead Nodes and Re-Clustering Organization
#### 6.2.2 Mean Package Delay

Mean delay \(\left(Mean_{dly}\right)\) is the sum of Queuing Delay (\(Que_{dly}\)), Total Transmission Time (\(Total_{transtime}\)), and Routing Delay \(\left(Rout_{dly}\right)\). Mean Package delay can be calculated by Equation (7). \[Mean_{dly}=Que_{dly}+Total_{transtime}+Rout_{dly} \tag{7}\]

The Total expected Queuing Time is as in Equation (8):

\[Queuing\;\;Time\;\;=\;T=\frac{1}{2\mu}\times\frac{\rho}{1-\rho} \tag{8}\]

where: \(\mu=\) service rate, i.e., the time is taken to service each packet. \(\rho\) is the utilization given as follows, \(\rho=\frac{\lambda}{\mu}\)

\(\lambda=\) Arrival time, i.e., the rate at which packets arrive. Total Transmission Time is the sum of transmission time through each link. Transmission time through each link is the same as presented in Equation (9):

\[Transmission\;time\;through\;each\;link=\frac{\;Payload\;\;size\;\;\;\;\left(Bytes \right)\;\times 8}{Uplink\;\;speed\;\;\;\left(bps\right)} \tag{9}\]

Figure 7: Total energy consumption for each node considering a 100 \(\times\) 100 m network size for LEACH, FBCFP, and LEDCHE-WSN protocols. where the payload size is the sum of packet size and the overhead as presented in Equation (10):

\[\textit{Payload size}\quad=\textit{Packet Size}+\textit{Overhead} \tag{10}\]

Routing Delay is approximately 1 micro sec, and can be calculated from the event trace file. It is the difference between \"Physical In\" and \"Physical Out\" time. Figure 8 plots the \(\left(\textit{Mean}_{\textit{dly}}\right)\) considering the round's number. From Figure 8, it can be observed that the proposed protocol improves \(\left(\textit{Mean}_{\textit{dly}}\right)\) by more than 42% compared to the LEACH protocol, and more than 15% compared to the FBCFP protocol; this is a consequence of using the single-hop clustering model at cluster core, resulting in the fast delivery process and making it much more simple and lightweight. The LEACH and FBCFP protocols adopted a multi-hop model and synchronization of multi-hop time in the cluster core, producing a very high load and data transmission among nodes, causing much more packet delay and packet loss, and therefore quick energy depletion. Similarly, using the random method in the LEACH protocol during the CH election process causes much more delay, due to the false election of the failure nodes (black holes) and much more time needed to get out of those holes. Additionally, the extensive calculation in the cluster head election process, such as node density, CH degree count, traffic level, and bandwidth availability in the FBCFP protocol results in more delays and increased complexity, as detailed in Section 6.2. (Results Analysis). On the other hand, the LEDCHE-WSN protocol checks nodes are alive before the election process to overcome the black holes problem. Furthermore, by locating the sink node at the center of the cluster, the distance between nodes and sink nodes is reduced. Consequently, mean package delay is improved, and data aggregation from all sensor nodes is performed effectively. #### 6.2.3 Total Packets Dropped (Loss Ratio)

Considering packet loss in the selection of the best communication path has a significant impact on reducing energy consumption and increasing the network throughput. Moreover, it is used as a measure to determine the efficiency of routing protocols. The loss ratio can be calculated using Equation (11). \[\text{TPD}=\text{Total Packets Sent}-\text{Total Packets Received} \tag{11}\]

where TPD indicates, the total packets dropped during the transmission process. Figure 9 shows the total packets dropped (loss ratio) considering the round's number. As may be observed, the proposed LEDCHE-WSN protocol reduced the loss ratio by more than 46% compared to the LEACH protocol, and more than 25% compared to the FBCFP protocol. This is due to adopting the single-hop clustering model that is easy to implement

Figure 8: Mean package delay considering 100 \(\times\) 100 m network size for LEACH, FBCFP, and LEDCHE-WSN protocols.