# Trust-Aware Routing Mechanism through an Edge Node for IoT-Enabled Sensor Networks
## 4 Proposed Trust-Aware Routing Mechanism
### Trust-Value-Based Route Path Selection
#### 4.2.1 Trust Values Evaluation
## 5 Performance Evaluation

In this section, the performance of the proposed TARM is verified in the MATLAB software (8 GB RAM, i7 core CPU Windows 10 system) and is validated with other similar latest trust-based models that employ edge nodes such as ITCM [18], TBSEER [17], VFDC [10], TEC-SFS [33], and TEM-MEN [16]. Deployment of the sensor nodes in the network is considered according to [PERSON] et al. [34]. The simulation is performed using some parameter settings described in Table 3. We evaluated and plotted (Figure 6) different metrics including the rate of detecting the untrustworthy nodes to the total number of nodes in the network, the accuracy of the model with the increasing percentage of untrustworthy nodes, overall energy utilization in the network, the trust values of nodes with increasing untrustworthy node percentage, average end-to-end delay, and network life evaluation. The experiment includes one IoT network that has clustered WSN scenarios, one MEN, and one base station. The CH in each cluster gathers data from the nodes once the trustworthy nodes are identified. The CH has the ability to relay data to other CHs until it reaches the CH closest to the MEN. The trusted route path established using ABC optimization is updated at the MEN, and the MEN with the data transmission rate of 2 Mbps receives the data from its nearest CH. The data transmission time from MEN to the cloud server is 10 ms. The MEN moves with uniform speed and its motion is restricted to the CH, which is in its proximity. This is performed to save energy and to avoid unnecessary delays. However, the selection of starting point, radius of communication, and speed can be adjusted. Figure 5: The trust evaluation model for proposed TARM. Figure 6: Simulation results. (**a**) Percentage detection rate versus the number of nodes in the network. (**b**) Accuracy in % with respect to the increasing percent of untrustworthy nodes. (**c**) Representation of trusted route and initial route paths for 50 nodes in \(50\times 50\) m\({}^{2}\) network size. (**d**) Evaluation of energy consumption (mJ) of all algorithms for varying percentages of untrustworthy nodes. (**e**) Trust values of nodes for different untrustworthy node percentages. (**f**) Average end-to-end delay in ms versus the percent of untrustworthy nodes. (**g**) Network lifetime evaluation for FND, HND, and LND. (**h**) Rate in % for packet loss in the network. ### Accuracy and Rate of Detection of Untrustworthy Nodes

Figure 5(a) presents the comparison of various approaches in terms of detection rate in percentage while varying the number of nodes. When the network undergoes a high number of detection rounds, the detection rate of the proposed TARM technique to detect the untrustworthy nodes enhances gradually. In Figure 5(a), the approaches considered for comparison are VFDC, TEM-MEN, TEC-SFS, and the proposed method. We can see that the rate at which the proposed TARM detects the untrustworthy nodes increases rapidly compared with the TEM-MEN and TEC-SFS, which show a more or less constant increase in the rate of detection. However, TEC-SFS has a good detection rate but the rate of increase of the detection percent in the case of TEC-SFS from zero number of nodes to 200 is not much and it gradually increases at a constant pace. Both TEM-MEN and TEC-SFS show only a 14.6% and 9.5% increase in the rate of detection when starting from the 0 th node to 200 th node, respectively. At the same time, the TARM offers a 67.6% hike in the enhancement of detection rate from 0 nodes to 200 nodes. TARM has a slightly higher detection rate than the VFDC and TEM-MEN for the maximum number of nodes. Further, it is examined that as the iterations of the moving path enhances, the rate of recognition of trust evaluation correspondingly increases. The accuracy of the trust evaluation mechanism is defined as how accurately the scheme can recognize untrustworthy nodes. It is verified that the TBSEER and proposed method both resist sinkhole attacks under a varying number of malicious nodes.