# Trusted Energy-Aware Hierarchical Routing (TEAHR) for Wireless Sensor Networks
## 3 Proposed Studies
### Proposed Algorithm
### Simulation Environment

Table 3 defines the parameters used in this proposed model; in this table, we define the trustworthiness, packet forward rate, anomaly factor, energy, trust level, threshold for detecting the malicious Node (anomaly), etc. ### Deployment of Sensor Nodes

In this paper, we set up the environment using 1000 \(\times\) 1000 m\({}^{2}\), and 500 sensors are randomly distributed. Figure 7 shows the deployment of the sensor nodes. Trustworthiness (TB(x\({}_{i}\))), Packet Forwarding Rate (PFR), Anomaly Factor (AF), Malicious Threshold (TB(x\({}_{i}\))), Trust Evaluation Interval, and New Node Trust z are used to evaluate the proposed study. The initial energy for each sensor node is 100 J. \begin{table}
\begin{tabular}{p{42.7 pt} p{113.8 pt} p{113.8 pt} p{113.8 pt}} \hline \hline
**S.No.** & **Parameter** & **Description** & **Typical Values or Ranges** \\ \hline
1 & Trustworthiness (TB(x\({}_{i}\))) & Range from 0 (untrustworthy) to 1 (fully trustworthy), with thresholds for roles based on value. & \textgreater{}0.7 for Trust, \textless{}0.7 to \textgreater{}0.3 for partial Trust, \textless{}0.3 for untrust \\
2 & Packet Forwarding Rate (PFR) & Part of Px\({}_{i}\)F() indicates trustworthiness in forwarding packets; closer to 1 is better. & Close to 1 \\
3 & Anomaly Factor (AF) & It reflects a deviation from expected behavior, part of AF(x\({}_{i}\)); being closer to 0 indicates normal behavior. & Close to 0 \\
4 & Residual Energy for CH Selection & Nodes with more than a specified percentage of their initial energy (e.g., \textgreater{}50\%) are eligible for CH selection. & \textgreater{}50\% \\
5 & Trust Level for CH Selection & A minimum trust level (e.g., \textgreater{}0.7) is required for a node to be considered for CH selection. & \textgreater{}0.7 \\
6 & Malicious Threshold (TB(x\({}_{i}\))) & Nodes with a trust level below a certain threshold (e.g., \textless{}0.3) are considered malicious and blocked. & \textless{}0.3 \\
7 & Key Refresh Interval & The frequency of cryptographic key refreshes depends on security requirements (e.g., every 24 h). & Every 24 h or as needed \\
8 & Trust Evaluation Interval & Frequency of trust evaluations, adjusted based on environment stability (e.g., every hour in stable environments). & Every hour to every 10 min \\
9 & New Node Trust Initialization & A neutral initial trust level is assigned to new nodes until enough behavioral data are collected (e.g., 0.5). & 0.5 \\
10 & Cluster Size Range & Adjustable range based on network density and area, typically 5 to 20 nodes per CH. & 5 to 20 nodes per CH \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Parameters for calculating the Trust. Cluster Head (CH) Selection: To select the cluster head (CH), the minimum threshold range is from 0 (untrustworthy) to 1 (fully trustworthy). The minimum trust level required for CH selection = 0.7; nodes with \(>\)50% of initial energy are eligible for CH selection = 0.5. Malicious Trust threshold = 0.3 will be considered a malicious Node, and the trust level required value is 0.7 for CH selection. Figure 8 displays the cluster heads chosen out of 500 sensor nodes on the basis of defined energy. Now, we insert the 20% malicious nodes to find the anomaly in the given sensor network as we insert the 20%, i.e., 100 malicious sensor nodes--the energy of overall sensor nodes after selecting the cluster head and identifying the malicious node. The dashed black circle around a CH represents the area within which sensor nodes communicate with each other via cluster head either directly or indirectly. Initial energy for each node = 1.0, energy consumed for forwarding a packet = 0.01. Threshold below which nodes are blacklisted = 0.3, number of packets each Node attempts to send = 100. Figure 9 displays the total energy consumed by different operations in sensor network mainly three i.e., normal operation, CH selection and anomaly identification.