## 4 Experiments
### Load Balancing  
The data gateway is the only node in Layer 0. The nodes, N-hops away from the gateway, are called Layer N. The upper layer is defined as the layer closer to the gateway, and _vice versa_. Layer 1 is the closest layer to the gateway, accumulates all the traffic coming from its lower-layer nodes to the gateway and has the highest load among all the layers. Therefore, upper layers like Layer 1 may become network bottleneck easily. To achieve load-balancing purpose, LEA is developed. In LEA, we used \(\alpha\) to allocate the proportion of estimated load and sample load. In order to find the suitable \(\alpha\), we analyze load balancing of each layer through Flow Variance (FV), which represents each layer's flow distribution. To calculate FV, Equation (1) first determines the standard deviation (SD) of the layer's flow. Subsequently, Equation (2) determines FV value. In Equation (1), \(N\) represents the number of nodes in the layer, \(x_{i}\) represents a specific node's load of the layer, and \(\overline{x}\) represents the average load of the layer. The closer FV is to zero, the more balanced the flow distribution of this layer is:  
\[SD=\sqrt{\frac{1}{N}\sum_{i=1}^{N}\left(x_{i}-\overline{x}\right)^{2}} \tag{1}\]  
\[FV(\%)=\frac{SD}{\overline{x}}\times 100 \tag{2}\]  
In our LBMR design, a good load-balancing mechanism should make FV as close to 0 as possible. More ideally, FV should decrease as the layer number decreases. Figure 5 shows load balancing of each \begin{table}
\begin{tabular}{l l} \hline \hline
**Parameter** & **Value** \\ \hline Simulation time & 600 s \\ Traffic type & Constant Bit Rate \\ Transmission range & 50 m \\ Phy/MAC layer & IEEE 802.15.4 \\ Packet size & 100 Bytes \\ Number of nodes & 85 and 100 \\ Data Sending Interval & 1 s \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Environment parameters in ns2. layer based on FV with four different \(\alpha\) values (\(\alpha\) = 0.125, \(\alpha\) = 0.5, \(\alpha\) = 0.875, \(\alpha\) = 1). From our experiment results, when \(\alpha\) is 0.125, LBMR gives the smallest FV in layer 1, layer 2 and layer 3. As mentioned, smaller FV represents better traffic distribution on each layer. In the condition (\(\alpha\) = 0.125), FV is smaller in the upper layers compared with the lower layers for both grid and random topologies. This proves LBMR is good for WSN because the upper layers tend to gather more traffic from the lower layers to the gateway, and therefore needs more load-balancing assistance. Based on FV, LBMR shows much better performance than AOMDV, especially at Layer 1. In grid topology, FV of LBMR with (\(\alpha\) = 0.125) is close to 0 at layer 1, 2, and 3. On the contrary, FV of AOMDV is from 50% to 75%. In random topology, FV of AOMDV is over 80% and FV of LBMR can be 30% at layer 1. In AODV scenarios, FV is above 120% in both topologies. AODV is a single-path routing protocol, in which network traffic is aggregated at certain paths and the bottleneck issue becomes more serious. This explains why the load balancing performance of AODV is the worst among three protocols. FV of AODV in both topologies is much higher than LBMR and AOMDV. Therefore, LBMR shows much better load-balancing performance than both AOMDV and AODV do. Moreover, we can observe LBMR of grid topology has better FV performance than that of random topology. This is because the number of connections of grid topology is fixed and the traffic is easier to be predicted and optimized. From the above analysis of load balancing based on FV benchmark, the performance of AODV is much worse and therefore AODV is proved to with bad-performance in terms of load balancing. From Figure 5, LBMR seems only slightly better than AOMDV. For a further comparison and a more detailed analysis, we visualize the different load-balancing degrees between LBMR and AOMDV in Figures 6 and 7. Figure 5: Flow variance of each layer. (**a**) Grid topology; (**b**) Random topology.