# A Clustering WSN Routing Protocol Based on k-d Tree Algorithm
## 5 Simulation and Results Analysis
### Results Summary
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Protocol** & **LEACH (r)** & **LEACH-C (r)** & **b** & **LEACH (d)** & **LEACH-C (d)** & **H-kdtree (d)** \\ \hline Min & 17 & 15 & 23 & 21 & 12 & 20 \\ Q1 & 24 & 28 & 23 & 27 & 24 & 20 \\ Average & 28.01 & 34.15 & 24.03 & 30.22 & 31.69 & 21.78 \\ Q3 & 32 & 40 & 30 & 34 & 39 & 23 \\ Max & 36 & 68 & 30 & 40 & 74 & 25 \\ Normalized average & 1 & 1.2192 & 0.8579 & 1.0789 & 1.1313 & 0.7775 \\ Variance & 37.2625 & 34.8312 & 2.9384 & 33.7894 & 39.7114 & 5.3248 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Number of cluster head with 200 nodes. (r) random—(d) deterministic. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Protocol** & **LEACH (r)** & **LEACH-C (r)** & **H-kdtree (r)** & **LEACH (d)** & **LEACH-C (d)** & **H-kdtree (d)** \\ \hline Min & 0 & 0 & 0 & 0 & 0 & 0 \\ Q1 & 1.941 & 0 & 0 & 0 & 0 & 0 \\ Average & 27.06 & 13.96 & 9.7799 & 13.52 & 6.91 & 10.38 \\ Q3 & 48.29 & 25 & 10.012 & 22.5 & 12.5 & 16 \\ Max & 76 & 68 & 78 & 44 & 33 & 27 \\ Normalized average & 1 & 0.5158 & 0.3614 & 0.4996 & 0.2553 & 0.3835 \\ Variance & 677.3701 & 401.614 & 368.7591 & 232.9591 & 106.38 & 120.3591 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Number of death nodes with 200 nodes. (r) random—(d) deterministic. With the level of delay variability shown in Figure 18a and Table 6, H-kdtree is able to provide QoS in networks with hierarchical topologies. In both the random and deterministic scenarios, H-kdtree showed a reduction in delay of 87.72% in the random scenario and of 95.39% in the deterministic scenario, compared to LEACH. With respect to LEACH-C, H-kdtree presented a reduction of 82.095% for the random scenario and 93.1% for the deterministic scenario. Jitter response shown in Figure 18b and Table 7, interpreted as temporal variability in packet transmission, is also due to using TDMA for medium access. The level of jitter reduction found in the random scenario was of 76.52%, and 74.4% for the deterministic scenario. The values for delay, jitter, and variance were so low during the observed rounds that we can estimate that H-kdtree can guarantee the requirements for multimedia applications. The reason for this is that H-kdtree's on-demand CH node selection mechanism is able to manage WSN resources efficiently. The results obtained show that H-kdtree is able to provide QoS in applications with high restrictions in bandwidth and delay, at the expense of energy consumption. On the other hand, \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Protocol** & **LEACH (r)** & **LEACH-C (r)** & **H-kdtree (r)** & **LEACH (d)** & **LEACH-C (d)** & **H-kdtree (d)** \\ \hline Min & 0.1568 & 0.077 & 0.02986 & 0.13 & 0.039 & 0.01 \\ Q1 & 0.4328 & 0.573 & 0.09687 & 0.4273 & 0.5565 & 0.02026 \\ Average & 0.928 & 0.8758 & 0.114 & 0.8495 & 0.9068 & 0.04285 \\ Q3 & 1.324 & 1.1715 & 0.1392 & 1.236 & 1.3115 & 0.04935 \\ Max & 1.588 & 1.56 & 0.1411 & 1.546 & 1.669 & 0.1094 \\ Normalized & \(1\) & 0.94375 & 0.1228 & 0.9154 & 0.9771 & 0.0461 \\ average & 0.251437 & 0.16277 & 0.000960 & 0.218075 & 0.21478 & 0.000851 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Delay with 200 nodes. (r) random—(d) deterministic. Figure 18: General QoS metrics. LEACH and LEACH-C are able to adapt to energy fluctuations in the network but is not capable of supporting multimedia applications or time restrictions, on account of its high variability. Regarding bandwidth and the amount of data that it can transport per round, H-kdtree showed an increase of 48.96% in the random scenario and of 39.37% in the deterministic scenario, which compensates and justifies the energy requirements for transmitting data packets to the Sink/BS node as shown in Figure 18c and Table 8.  
Among the metrics for hierarchical protocols, we took into account the metrics related to node death, included in Table 9.