## 5 TAFLRLR Protocol
### Best Forwarding Node Selection and Data Forwarding  
In this subsection, the calculation of _ND_ and _FP_ is presented in detail. In the TAFLRLR protocol, the sending node selects all the nodes whose layer is 1 smaller than its layer in the neighbor information table as candidate forwarding nodes and  
Figure 5: The overall framework of the TAFLRLR protocol. utilizes an FCS to calculate the FPs of candidate nodes according to the ND and CTV of the candidate nodes [17]. The calculation of the CTV is presented in detail in Section 4. The calculation of \(ND\) is given in Equation (13). \[ND=\frac{N_{L-1}}{N-2}\in(0,1) \tag{13}\]  
where \(N_{L-1}\) denotes the number of neighbor nodes whose layer is 1 lower than the layer of the candidate forwarding node, and \(N\) is the number of all nodes in the network. Next, an example is given to explain the calculation of \(ND\), which is shown in Figure 6. In Figure 6, there are 17 nodes in the network. Node a is the sending node, Nodes b and c are candidate forwarding nodes, and the set of candidate nodes is denoted by \(S_{a\_u}=\{b,c\}\). \(S_{b\_all}=\{a,x,y,z\}\) is the set of all the neighbor nodes of the candidate forwarding node b and \(S_{c\_all}=\{a,k,l,m,n,p\}\) is the set of all neighbor nodes of the candidate forwarding node c. \(S_{b\_u}=\{x,y\}\) is the set of upper-layer neighbor nodes of b. \(S_{c\_u}=\{k,l,m,n\}\) is the set of upper-layer neighbor nodes of c.  
1. The linguistic values (i.e., fuzzy sets) are set for ND, CTV, and FP, respectively, as shown in Table 3.
2. By using the triangular membership function and the trapezoidal membership function, membership functions of linguistic values of ND and CTV are fuzzified and expressed as shown in Equations (14)-(16): \[f_{\text{min}}(x)=\left\{ \begin{array}{ll}1,&x\leq a\\ \frac{b-x}{b-a},&a\leq x\leq b\\ 0,&x\geq b\end{array} \right.\] (14) \[f_{\text{med}}\ (x)=\left\{\begin{array}{ll}0,&x\leq e\\ \frac{x-x  
* 4. Establish the rules of fuzzy control. The if-then rule is adopted in the FCS. The total fuzzy rules employed by the control engine are shown in Table 4. For example, if the ND is \"Medium\" and the CTV is \"High\", the FP of the candidate forwarding node is \"High\".
* FP is obtained in this step through defuzzification. The center of gravity method is used to find the center of the area enclosed by the curve of membership degree function and the \(x\)-axis. The value of the horizontal coordinate corresponding to the center is the output value FP. Assume that the domain \(X_{fp}=\{x_{1}\), \(x_{2}\),..., \(x_{n}\}\) is discrete, and \(f(x_{i})\) is the membership degree of \(x_{i}\). Then, FP can be calculated via Equation (17). \[FP=\frac{\sum\limits_{i=1}^{n}(x_{i}f(x_{i}))}{\sum\limits_{i=1}^{n}f(x_{i})}\] (17)  
Figure 8: The relationship between input variables and output variable. Figure 7: Membership functions. (**a**) Membership functions of ND. (**b**) Membership functions of CTV. (**c**) Membership functions of FP. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Input/Output** & \multicolumn{5}{c}{**Linguistic Values**} \\ \hline ND & Low & Medium & High & - & - \\ CTV & Low & Medium & High & - & - \\ FP & Rather Low & Low & Medium & High & Rather High \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Fuzzy sets for ND, CTV, and FP. (6) Select the best forwarding node. The sending node takes the candidate node with the largest FP in step (5) as the best forwarding node and sends the DATA packet to the best forwarding node. Reviewing that the NDs of node b and node c are 0.13 and 0.27, respectively, assuming that the CTVs of node b and node c are 0.85 and 0.75, respectively, based on the above steps, it can be calculated that the FPs of node b and node c are 0.5 and 0.428, which are shown in Figures 7c and 9, respectively. In addition, the rule triggering and defuzzification of node b and node c are simulated through the use of MATLAB R2022a, and illustrated in Figure 10a,b.