# Trust-Aware Routing Mechanism through an Edge Node for IoT-Enabled Sensor Networks
## 4 Proposed Trust-Aware Routing Mechanism  
This paper deals with trust issues arising during data transmission in IoT-enabled WSNs. The proposed model uses an edge node to fetch the data from only trusted nodes. However, detecting the trusted nodes is a challenging task. In this context, we proposed a Trust-Aware Routing Mechanism (TARM) through an edge node for IoT-enabled WSNs, which is summarized using a flow graph in Figure 2. The proposed algorithm uses modified GWO and ABC optimizations to achieve the goal in this context. Modified GWO is employed for the clustering of nodes to ensure energy efficiency in the network. Then, all nodes of each cluster are checked for their trustworthiness using a trust evaluation algorithm based on the calculation of direct and indirect trust values. Once the untrustworthy nodes are identified, the mobile edge node collects the data from all CHs in each cluster. The notations used in the paper are given along with their meanings in Table 2.  
\begin{table}
\begin{tabular}{l l} \hline \hline
**Symbols** & **Meaning** \\ \hline \(pop\) & population of gray wolf \\ \(p\) & current iteration \\ \(pmax\) & maximum iterations \\ \(W\) & swarm size \\ \(R\) & maximum communication range \\ \(itr_{c}\) & current iteration \\ \(t\) & number of cycles or iterations \\ \(f_{i}\) & objective function value \\ \(onl\) & onlooker bees \\ \(Emp\) & employer bees \\ \(F_{ij}\) & \(i\)th dimensional data of \(j\)th food site \\ \(S\) & sink node \\ \(F_{j}^{max}\) & upper limit for \(F_{ij}\) \\ \(F_{j}^{min}\) & lower limit for \(F_{ij}\) \\ \(F_{j}^{\prime}\) & \(j\)th site for food. \\ \(RG_{CH}\) & relay group for packet forwarding, it yields minimum value \\ \(F_{kj}\in[1,k]\) & food source searched randomly \\ \(k\) & number of food sites. \\ \(\varphi\) & random number which lies in \([-1,1]\) \\ \(DD_{j}\) & rate of data delivered from \(j\)th energy to ’s’ queue length \\ \((w_{j})\) & weight of routing \\ \(cl_{j}\) & cluster head for \(j\)th cluster \\ \(ch_{i}\) & cluster head for \(i\)th cluster \\ \(DD(CH_{m})\) & likelihood of delivery for transmission of data \\ \(DD(CH_{m})^{\prime}\) & indicates upgraded node model for delivery. \\ \hline \hline \end{tabular}
\end{table}
Table 2: Frequently used notations.  
An optimized routing mechanism based on ABC optimization is utilized to efficiently route the data from nodes to CH and from CH to Mobile Edge Node (MEN). The ABC aims to find an optimized relay path from the nodes that reach CH and ultimately the MEN. There are three sets of bees--onlookers, scouts, and employee bees. The suggested ABC approach for routing guarantees the drop in energy depletion during the routing of information in inter- and intra-cluster. The low hop count indicates that this is a low energy consumption when data are sent from nodes to CH and all CHs to the mobile edge node. The process is repeated, and scout bees search and forage the food site again. Figure 3 depicts the routing paths for the nodes, which are evaluated as trustworthy and untrustworthy nodes, the latter of which do not participate in data transmission.  
Figure 3: Evaluation of trustworthy nodes establishing optimized trust path for data routing.  
Figure 2: Optimized clustering and trust evaluation process with ABC-based routing.