# Trusted Energy-Aware Hierarchical Routing (TEAHR) for Wireless Sensor Networks
## 3 Proposed Studies
### Proposed Algorithm
The final CH set is determined by the nodes that receive confirmations from at least one other Node. Each non-CH Node joins the nearest or most suitable CH based on a composite metric M(i,j) considering Eres, D(i,j), and C(i,j). \[M(i,j)=\gamma 1~{}\text{Eres}(j)-\gamma 2D(i,j)-\gamma 3C(i,j) \tag{21}\]

Here, \(\gamma 1~{}\gamma 2~{}\gamma 3\) are weights. The CH should continuously evaluate the trust values of the existing cluster members based on energy backup, packet forwarding, packet consistency, and any other relevant parameters. The network should define dynamic trust thresholds that can be adjusted over time based on network conditions and requirements. The initial trust \(T_{threshold}\) can be set on historical data or network specifications. \[T_{threshold}=f(\text{network conditions, historical data}) \tag{22}\]

This \(T_{threshold}\) is adaptive, based on the network's historical data and current conditions. Trust-based communication and packet forwarding routes within the cluster should be established based on trust values. Higher trust nodes should be preferred for critical roles, such as data aggregation or relay. ### Integrating New Cluster Members

When a new node is added to the cluster, an initial trust assessment is conducted. New nodes start with an initial trust value based on standard network entry criteria, possibly lower than the trust threshold for existing members to account for the lack of historical behavior data. This could involve directly monitoring the Node's behavior in terms of its packet forwarding rate, energy usage, and consistency of data provided. \[T_{new}(\text{i},\text{t})=T_{initial}+\delta(T_{observed~{}actions}(\text{i}, \text{t})) \tag{23}\]

Here, \(\delta(T_{observed~{}actions}(\text{i},\text{t}))\) is the trust changes with time t from when a new node joined based on its types of observation, such as packet forwarding behavior, energy consumption, and proper implementation of network protocols. As a first step, the initial trust threshold of new nodes can be set to slightly less than that for current members so they have time to put their performance where their mouth is. Nevertheless, this maximal Threshold should be enough to hinder obviously nefarious nodes from perturbing mission-critical roles. New nodes may serve a probationary term during which they are observed more carefully. The trust value of those peers is prone to change more often, and their network roles are limited to non-critical tasks until a steady-state level of high Trust has been achieved and security checks are performed to verify if the new Node did not arise from known attacks. This could mean checking the Node's credentials, confirming that its software has not been tampered with, and examining whether it is communicating in an abnormal way. Other nodes in the network watch how new ones on board participate and gradually increase their Trust as it becomes clear they are providing a benefit to the operations of that network. As the trust level of a new node grows and exceeds the dynamic Threshold, it can then be assigned additional tasks (i.e., data aggregation or being a secondary relay) within the cluster. In our proposed algorithm, hierarchical routing is used and focuses on selecting CH from the group of sensor nodes, which is responsible for maintaining the information about the nodes within its cluster, calculating the Trust and making decisions about whether the Node is trustworthy or malicious. Our proposed algorithm, TEAHR, calculates the trustworthiness of nodes based on energy, forwarding behavior and consistency and dynamically adjusts the Threshold to decide whether a node can participate in selecting CH or should be blocked. As mentioned, the proposed algorithm updates the trust threshold dynamically and recalculates it based on various network events, further emphasizing the hierarchical decision-making process at the CH level.