# A Clustering WSN Routing Protocol Based on k-d Tree Algorithm
## 6 Conclusions and Future Work  
The H-kdtree protocol has main contributions. First, the clustering formation method based on the k-d tree algorithm partitions the sensor node deployment area in a two-hop hierarchical topology. Second, it is a WSN protocol that provides QoS in support of services with stricter resource demands while keeping energy usage at a level similar to the LEACH protocol. The proposed H-kdtree protocol was based on the k-d tree algorithm in evaluating the spatial partitioning to organize nodes in a dimensional space (\(x\) and \(y\)). The average energy results obtained \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Number of Nodes** & **LEACH (r)** & **LEACH-C (r)** & **H-kdtree (r)** \\ \hline \multirow{4}{*}{100} & FND & 26 & 36 & 30 \\  & HND & 121 & 88 & 83 \\  & LND & 147 & 184 & 127 \\  & FND & 24 & 47 & 38 \\
200 & HND & 113 & 99 & 94 \\  & LND & 134 & 164 & 131 \\  & FND & 39 & 71 & 45 \\
300 & HND & 119 & 117 & 89 \\  & LND & 152 & 174 & 149 \\  & FND & 52 & 115 & 37 \\
400 & HND & 137 & 154 & 101 \\  & LND & 164 & 223 & 152 \\ \hline \hline \end{tabular}
\end{table} 
Table 16: Metrics of network lifetime. (r) random. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Number of Nodes** & **LEACH (r)** & **LEACH-C (r)** & **H-kdtree (r)** \\ \hline
100 & 0.0200929664 & 0.2216 & 0.00499735 \\
200 & 0.0205 & 0.04061 & 0.004815 \\
300 & 0.0227276422 & 0.03975 & 0.00462749 \\
400 & 0.0200274796 & 0.2368 & 0.00552575 \\ \hline \hline \end{tabular}
\end{table} 
Table 14: Jitter (seg). (r) random. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Number of Nodes** & **LEACH (r)** & **LEACH-C (r)** & **H-kdtree (r)** \\ \hline
100 & 96,134 & 101,319 & 135,210 \\
200 & 97,940 & 107,854 & 145,900 \\
300 & 102,603 & 110,623 & 163,092 \\
400 & 90,956 & 96,521 & 170,688 \\ \hline \hline \end{tabular}
\end{table} 
Table 15: Throughput (bps). (r) random. with LEACH-C, exceed LEACH and H-kdtree on 42%. The partitions found become clusters, creating a network topology that is able to provide QoS for the longest possible time with energy requirements similar to those of LEACH. H-kdtree is characterized by keeping the number of CH nodes stable for the longest number of rounds, maintaining a constant network topology and, as a consequence, low variability in delay, jitter, and throughput metrics. Although these metrics are a function of time, they depend on the variability of the number of CH nodes. The H-kdtree protocol has three main processes. First, the protocol uses a two-hop network topology that was not altered in each round. Then, during the data transmission phase, the \"Death\" packet allows H-kdtree to implement a reactive mechanism that only returns to the configuration phase when a node requires it by sending the \"Death\" packet. This means that the configuration phase is only repeated on-demand. Finally, the minimum group condition allows network traffic to be more homogeneous, which is reflected in delay, jitter, and throughput and, as a consequence, in improved QoS. The set of experiments performed in random scenarios with 100, 200, 300, and 400 nodes, and a deterministic scenario with 200 nodes, helped us compare LEACH and LEACH-C with the proposed H-kdtree protocol. The conclusion is that the H-kdtree protocol fulfilled the objective by addressing existing problems in cluster generation mechanisms by reducing the variability in CH node formation: with the same resources used in LEACH and LEACH-C, H-kdtree improved delay and jitter by 60% and 95% percent, throughput improved by over 50%, while keeping energy usage at the same levels of LEACH. Additional experiments will be required to measure H-kdtree's performance in additional scenarios, incrementing the number of rounds, varying density in environments with heterogeneous node-energy levels, and proposing optimization mechanisms for CH node selection to maximize energy levels in the network. Additionally, with the QoS results obtained, it will be necessary to perform traffic analysis with multimedia data.