## 4 The Principle of the Balanced Cross-Layer Fuzzy Logic Routing Algorithm
### The Calculation of the Dispersion  
When the source node wants to send packets, it will collect the cross-layer parameters from its neighbor nodes. After that, the source node will begin the pre-processing for the cross-layer parameters. The reason why the source node needs to do pre-processing to the cross-layer parameters is shown as follows.  
Figure 1: The principle of the BCFL.  
As we know, the cross-layer parameters of different layers are variable, _i.e._, the order-of-magnitudes are different. For instance, as discussed in Section 2, the distance to the base station is 1000 m, the number of link breaks is 5, the interface queue length is 20, the remaining battery power is 50%, the number of hops to the destination node is 10, _etc._ The orders of magnitude of these parameters are different; if we utilize these parameters directly, there will be some problems. Consider the parameters shown in Table 1.  
In Table 1, we can find that the parameter \(\beta_{1}\) is much larger than others. By means of the Balanced Cross-layer Fuzzy Logic routing algorithm, we can get the weights of each parameter that is shown in Table 1; the weights are shown in Table 2.  
Considering Equation (5), for the data in Table 1, the utilities of node 1, node 2, and node 3 are _518.848, 1022.936_, and _1507_, respectively. As a result, node 3 will be chosen as the next hop relay node. However, according the value of the parameters in Table 1, we can conclude that node 3 is not the best candidate as the next hop relay node. For proving this, we utilize the traditional fuzzy logic-based routing algorithm (used in [18,19]) to choose the best next hop relay node, with the result shown in Figure 1(a). Figure 1(a) demonstrates that node 2 rather than node 3 is the best next hop relay node. The reason of this issue is that the parameters in Table 1 are not the same orders of magnitude, so the parameters whose orders of magnitude are much higher will have greater effects on the final result of BCFL. For addressing this problem, in the new algorithm, we transfer all the cross-layer parameters into the same orders of magnitude, which are shown in Table 3. The dispersions of the parameters in Table 2 are the same as that in Table 1 (this is also the reason why we use Equation (3) instead of the variance formula to calculate the parameters' dispersion, because the variances in Table 1 are different with that in Table 2; the result of Equation (3) has nothing to do with the order of magnitude), thus the parameters' weights are the same, too.  
\begin{table}
\begin{tabular}{c c c c} \hline  & **Node 1** & **Node 2** & **Node 3** \\ \hline \(\beta_{1}\) & 1000 & 2000 & 3000 \\ \(\beta_{2}\) & 0.8 & 0.5 & 0.1 \\ \(\beta_{3}\) & 27 & 49 & 15 \\ \hline \end{tabular}
\end{table}
Table 1: The raw data.  
\begin{table}
\begin{tabular}{c c c c} \hline  & **Node 1** & **Node 2** & **Node 3** \\ \hline \(\beta_{1}\) & 0.1 & 0.2 & 0.3 \\ \(\beta_{2}\) & 0.8 & 0.5 & 0.1 \\ \(\beta_{3}\) & 0.27 & 0.49 & 0.15 \\ \hline \end{tabular}
\end{table}
Table 3: The data after pre-processing.  
Figure 2b shows the result of the BCFL that uses the parameters shown in Table 2. Figure 2b illustrates that node 2 will be the best next hop relay node, which is the same with the traditional fuzzy logic based routing algorithm shown in Figure 2a.  
Therefore, we can conclude that the idea that setting all the cross-layer parameters into the same order of magnitude is an appropriate and effective method. In terms of this conclusion, more generally, we can use the numbers between 0 and 1 to represent the cross-layer parameters.  
Once the pre-processing of the cross-layer parameters is finished, we can apply Equation (3) to calculate the parameter dispersion. Furthermore, the dispersions will be used as the fuzzy inference system inputs.