# Improving Route Selections in ZigBee Wireless Sensor Networks
## 7 Performance Evaluation
### Symmetric Topologies
#### 7.1.1 Scenario S1: ZigBee-Only, One-Hop Routes  
Consider first the topology of Figure 1 in which sensors at node 3 at (\(0,-80\)), node 4 at (\(-130\),\(0\)), and node 5 at (\(130\),\(0\)) send sensor measurements to the concentrator 0 at (0,\(80\)); and node 1 at (\(-35\),\(0\)and node 2 at (35,0) are available for routing packets. This is the same scenario as considered in the examples of Section 5.1 and it is reproduced in Figure 1 to facilitate the understanding. For this scenario, assume that nodes 3, 4, and 5 generate the same average number of packets/s. Because of the symmetry of the scenario, the actual route costs for routes 3,1,0 and 3,2,0 are the same. To see why \(c_{3,1,0}=c_{3,2,0}\), recall that packet losses occur due to low SINR. Using the ns3 channel model, the distances between nodes are such that the probability of a successful transmission is very close to 1 when no interferers transmit, meaning that packet losses are occurring mainly due to interfering transmissions. Interfering transmissions occur randomly due to the various protocol procedures, such as MAC random backoff or random delays in application packet generation. In this symmetric scenario, the rates of interfering transmissions in nodes 1 and 2 are the same, causing \(p_{3,1}=p_{3,2}\). Likewise, the rates of interfering transmissions in node 0 are the same if either node 1 or node 2 transmits, causing \(p_{1,0}=p_{2,0}\); and \(c_{3,1,0}=c_{3,2,0}\). We first evaluate the performance of the U-RR procedure in the single simulation run of the Example 1 of Section 5.1, in which nodes 3, 4, and 5 generate an average of 20 packets/s; Figure 2e in Section 5.1 illustrates the cumulative costs \(\hat{c}_{3,1}^{(URR)}(t)\) and \(\hat{c}_{3,2}^{(URR)}(t)\) measured at node 3 when using the U-RR procedure. Comparing this figure with Figure 2a, which refers to the same scenario but using the LS-based procedure, it is possible to observe that the U-RR procedure was able to generate estimates with less variation and better recognize that routes 3,1,0 and 3,2,0 have the same cost. To better analyze the performance of the U-RR procedure in reducing the variance of cost estimates, we varied the traffic level generated by nodes 3, 4, and 5, and at each traffic level, we repeated the simulation 30 times, each time with a different random seed. For each simulation run and each estimation procedure, we simulated the network for 400 s and collected the estimated route costs \(\hat{c}_{3,1,0}(t)\) and \(\hat{c}_{3,2,0}(t)\) for \(t\geq 81\) s. Let \(N_{\textit{treq}}^{rx}\) be the number of RREQ messages received at node 3 in the time interval \([81,400]\); and let \(\{t_{n}\}_{n=1}^{N_{\textit{treq}}}\) be the times in which the RREQ were received. From these estimated route costs, we computed the following performance metrics:  
* The average estimated cost measured at node 3 for the routes 3,1,0 and 3,2,0. For example, for the route 3,2,0: \[\overline{c}_{3,2,0} := \frac{1}{N_{\textit{treq}}^{rx}}\sum_{n=1}^{N_{\textit{treq}}^{rx} }\hat{c}_{3,2,0}(t_{n}).\] (12)
* The standard deviation of the estimated costs measured at node 3 for the routes 3,1,0 and 3,2,0. For example, for the route 3,2,0: \[\sigma_{3,2,0} := \sqrt{\frac{1}{N_{\textit{treq}}^{rx}-1}\sum_{n=1}^{N_{\textit{treq }}^{rx}}(\hat{c}_{3,2,0}(t_{n})-\overline{c}_{3,2,0})^{2}}..\] (13) The measures \(\sigma_{3,1,0}\) and \(\sigma_{3,2,0}\) tell us how much the cost of each route varied over the course of the simulation run. Figure 4a,b respectively, show the median of \(\overline{c}_{3,2,0}\) and \(\sigma_{3,2,0}\) for 30 simulation runs at each traffic level for the LS-based, the LQI-based, and the U-RR procedures. Error bars represent the range between the 15 and 85 percentiles among 30 simulation runs. The figures for the median of \(\overline{c}_{3,1,0}\) and \(\sigma_{3,1,0}\) showed similar behavior and were therefore omitted.