# 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
As shown in Figure 5(b), the accuracy plot is drawn against the percentage of untrustworthy nodes. The lowest accuracy is shown by the VFDC method, which is 71.1%. The highest accuracy is shown by the proposed method, which is 91.96%. The TBSEER performs very well in this case and records an accuracy of 88.76% for the highest percentage of untrustworthy nodes. Figure 5(c) shows the initial route path in the absence of a trust evaluation scheme and the trusted route when the trust evaluation algorithm is executed. Figure 5(c) shows that the trusted route path takes mostly trustworthy nodes and covers a very short distance to transmit the data to the destination, whereas the same task if performed by the initial route path takes more nodes and hops, which enhances the distance as well as the energy and latency in the network. The calculation for energy consumption for the trusted route has been performed and is represented in Figure 5(d). ### Impact of the Percentage of Untrustworthy Nodes on QoS Parameters

Figure 5(d) shows energy consumption in the whole network for the increasing number of untrustworthy nodes. The proposed method, as observed in Figure 5(d), outperforms the other three similar methods. The TBSEER method shows 13.09% more energy consumption compared with the proposed method. Similarly, for VFDC, the percentage enhancement in energy usage is 54.92% higher than the energy usage in the proposed method. The proposed method shows 73.37% higher energy efficiency compared with the ITCM approach. Figure 5(e) depicts the node trust values for increasing percentage of untrustworthy nodes. As the proportion of the untrustworthy nodes enhances to 50%, the trust values of the nodes decline rapidly. This factor reflects the trustworthiness of the proposed trust evaluation scheme. All the algorithms show the same declination but the proposed method shows superiority over others. The proposed model shows 58% higher trustworthiness compared with the TBSEER method and this percentage goes beyond 100 for other approaches. In Figure 5(f), the value of average end-to-end delay rises as the percentage of untrustworthy nodes increases. In the case of TBSEER, the frequent packet losses are responsible for the delay in establishing the link between the nodes for packet re-transmission. Moreover, it leads to the degradation of the routing stability. The proposed approach shows 85.16% less delay than the TBSEER protocol. The TEM-MEN approach is tested on the cloud as well as edge computing and it is verified that edge computing is more reliable for real-time applications as it offers low latency, as shown in Figure 5(f). The ITCM offers 81.77% high delay and the proposed method is 35.5% more delay-efficient than the TEM-MEN approach. The network lifetime analysis is depicted in Figure 6g. As can be observed from the graph, the network lifetime represented by the number of rounds is calculated when the first node dies, when the half node dies, and when the last node dies. The proposed model offers the highest network life for all three conditions ensuring the effectiveness and reliability of the system over a longer period. The ITCM performs poorly; TBSEER performs moderately in all three cases and outperforms the other two algorithms, which are ITCM and VFDC. The proposed method is 83.8%, 45.1%, and 28% more efficient compared with TBSEER for FND, HND, and LND, respectively. In general, it is verified that for the same network size, the scenario with a high number of IoT devices offers short network life compared with the small scenario. In the proposed method, the network size of \(50\times 50\) m\({}^{2}\) is kept constant and the number of nodes is increased. It is recorded that there is not much difference between the scenario with 50 nodes and the scenario with 200 nodes. However, in the case of ITCM, the network life is short because of the same reason. Figure 6h depicts the packet loss rate for TBSEER, VFDC, TEM-MEN, and the proposed method.