## 4 Trust Evaluation Mechanism
### Direct Trust Value of Nodes  
Based on the membership theory of fuzzy mathematics, the fuzzy comprehensive evaluation decision converts the qualitative evaluation of the evaluation object into a quantitative evaluation and performs a comprehensive evaluation with multiple constraints  
Figure 2: The framework of FLTEM. on the evaluation object. In addition, the fuzzy comprehensive evaluation decision model has the characteristics of accurate results and strong systematization, which are suitable for solving uncertain problems, so the DTVs of nodes are calculated based on the fuzzy comprehensive evaluation decision model. The steps to calculate the DTV are given as follows. 1. Construct the factor set \(U=\{u_{1},u_{2},u_{3}\}\), where \(u_{1}\), \(u_{2}\), and \(u_{3}\) represent HPFBTF, DPFBTF, and RERTF, respectively. HPFBTF is calculated according to the number of HELLO packets normally and abnormally forwarded by a node. For understanding, we provide the following definition. **Definition 1**. : _The behavior of abnormally forwarding HELLO packets means that the node does not forward HELLO packets according to the rules._  
In Beta reputation systems designed for sensor networks, [PERSON] et al. fitted the reputation distribution and Beta distribution using the Bayesian formula and concluded that the reputation of sensor nodes obeys the Beta distribution [16; 23]. Therefore, the trust factor of the nodes can be obtained by calculating the expectation of Beta distribution [24]. Assuming that the trust factor distribution of HELLO packet forwarding behavior of node k is denoted by \(h\), then according to the expectation \(E\) of Beta distribution, the \(HPFBTF_{n,k}\) of node k calculated using node n can be expressed as  
\[HPFBTF_{n,k}=E(h)=\frac{N_{n,c}+1}{N_{n,c}+N_{n,c}+2} \tag{2}\]  
where \(N_{n,c}\) and \(N_{n,c}\) represent the number of HELLO packets forwarded normally and abnormally by node k, respectively. As mentioned earlier, a RH_Flag field is set in the neighbor table for each neighboring node to indicate whether the node has received a HELLO packet forwarded by the neighbor node. At the beginning of each HELLO cycle, the node sets the RH_Flag field for each neighbor node to \"0\". Specifically, when node R receives a HELLO packet from node S for the first time within the cycle, it sets the RH_Flag to \"1\". Afterwards, when node R receives one more HELLO packet forwarded by node S within the same cycle, node R determines whether the HELLO packet has been received from node S by determining the RH_Flag in the neighbor information table. If RH_Flag = 1, we think node S forwards the HELLO packet abnormally once. ; in this case, \(N_{a,c}=N_{a,c}+1\); otherwise, \(N_{n,c}=N_{n,c}+1\). DPFBTF is calculated by using the number of DATA packets forwarded normally and abnormally by a node. For understanding, we provide the following definition. **Definition 2**. : _The behavior of abnormally forwarding DATA packets means that an MN is selected as a forwarding node; however, the MN discards the received packets instead of forwarding them, or the MN does not forward the received DATA packets according to the specific routing rules. For example, a packet is forwarded to a node with a higher layer than that of the forwarder._  
As mentioned earlier, the trust factor of a node can be obtained by calculating the expectation of the Beta distribution. Assuming that the trust factor distribution of the DATA packet forwarding behavior of node k is \(d\), then according to the expectation \(E\) of Beta distribution, the \(DPFBTF_{n,k}\) of node k calculated by node n can be expressed as  
\[DPFBTF_{n,k}=E(d)=\frac{N_{n,d}+1}{N_{n,d}+N_{a,d}+2} \tag{3}\]  
where \(N_{n,d}\) and \(N_{a,d}\) represent the number of DATA packets forwarded normally and abnormally by node k, respectively. The detection of abnormal forwarding of data packets mainly includes two aspects.