## 3 Data Routing Approaches in WSNs
### Delay-Aware Approaches
#### 3.2.1 Hard Delay-Aware Approaches
When this process is finished, the shortest path with minimum delay from each node to sink is specified. Energy-Efficient and Fast Data Gathering Protocols for Indoor Wireless Sensor Networks [12] focus on some specific applications which require prompt reactions. The proposed protocol considers the indoor environment and it suitable for alert services such as warning of poisonous gases in rooms. This paper, proposes two hierarchical protocols in the names of R-EERP and S-EERP based on LEACH with different clustering structures. In R-EERP nodes are deployed randomly, but in S-EERP their structure is sequential. In both protocols nodes are fixed during the cluster change time and their cluster head selection is done based on LEACH. In this approach, similar to TEEN, two threshold values named critical threshold and base threshold are defined. Base threshold demonstrates the minimum required value which should be sensed; thus, the values below this threshold are not acceptable. On the other hand, critical threshold relates to emergency situations and values above this threshold considers real-time values which cannot tolerate any delay. Therefore, cluster heads attempt to transmit such values with minimum delay. In this approach, the sensed data of the nodes are limited and only the values which are greater than the base threshold are transmitted to the cluster heads. Also, when a cluster head receives a value beyond the critical threshold, it immediately and without waiting for other values transmits the data toward the base station to satisfy the emergency requirement of that data; otherwise, when it receives some data between base and critical thresholds, it performs required filtering and compression before transmitting data toward the sink. In [65] the authors proposed a structure-free Real-time data Aggregation protocol (RAG) which makes use of two methods for temporal and spatial convergence of packets: Judiciously Waiting policy and Real-time Data-aware Anycasting policy. According to their simulation results, they have proved that RAG can be effective in term of end-to-end delay and energy-efficiency. In RAG, Judiciously Waiting policy is used to satisfy the on-time delivery of data packets. In this policy, the end-to-end delay which is the estimated time of data delivery is calculated by measuring estimated one hop delay  
Figure 6: State diagram of the nodes in EAR. including channel contentions and packet transmissions and queuing delay by using a time-stamping method. This scheme can effectively increase temporal convergence for data aggregation while performing delay-sensitive data delivery. The waiting time out (WT) for \(R_{h}\) which is an intermediate node with \(h\) hop distance from the sink is calculated as below:  
\[\text{WT}=\frac{TTL-EED}{1+(\frac{R_{h}-1}{R_{h}})}\times\alpha=\frac{TTL-(R_{h }\times EHD)}{2-(\frac{1}{R_{h}})}\times\alpha\]  
In the equation, the following factors are used for routing decision: TTL (Time-to-Live) which gives the remaining time of the packet to be received at the destination, EED (End-to-End Delay) which is the time required for delivering a packet from a node to sink and EHD (Estimated one-Hop Delay) including channel contentions, packet transmissions, and queuing delay. On the other side, Real-time Data-aware Anycasting policy, by doing some computations, decides which next hop node achieves better aggregation performance while satisfying real-time requirements. In this policy, node \(A\) computes the required velocity based on the progress made toward the sink node and the packet's TTL before forwarding its data to the next hop. The computation is done as follows:  
\[V_{req}\;=\;\frac{d\;(A,Sink)}{TTL}\]  
where \(d\;(A,Sink)\) is the Euclidean distance between node \(A\) and the sink node. Therefore, by satisfying the required velocity of each hop, the end-to-end deadline is addressed.