## 3 Data Routing Approaches in WSNs
### Fault-Tolerant Approaches
#### 3.3.1 Fault Prevention  
In Directed Diffusion (DD) protocol [8] receivers and resources use some attributes for recognizing the produced or required information. The goal of this approach is finding an efficient multi-path route between senders and receivers to provide a strong tolerance against node failures. In this scheme, each task is represented as an interest and each interest is a set of attribute-value pairs. For performing a task, the related task will be propagated to the network. In DD, receiver nodes memorize the senders. Thus, a gradient which presents the direction of data flow and the status of request (which can be active, inactive or requiring update) is created. If a node can predicate the next hop from the previous gradients or geographical information, it sends the request only to the nodes which are able to reply to the request; otherwise, it should broadcast the request to all its neighboring nodes. When a node receives a request which is compatible with its data, it activates it sensors for collecting the required information and transmits the packet toward the requester (Figure 8). In DD, data is stored in the intermediate nodes during the forwarding process toward the destination. In fact, this scheme is considered to prevent replication and circle generation. Moreover, the maintained information in the intermediates nodes can be used for in-network information processing. Moreover, when the sink node receives data from multiple paths, according to the quality of each path,it selects the best path and reinforces the source to send its data through this path. Furthermore, when a failure happens in the active path or the rate of data delivery is reduced, the sink selects another best path for data transmission. Energy-efficient and Reliable routing Scheme (EARS) was also proposed in [69] to improve the directed diffusion protocol. This data routing approach selects the next hop neighbor by taking advantage of radio information. In EARS, instead of broadcasting the packets into the network, the most suitable neighbor among other candidates is selected and the data is transmitted only to that node. This strategy resulted in better energy consumption in EARS in comparison with Directed Diffusion. In this approach, each node uses the radio-aware metric of MAC layer to evaluate the quality of links. The lowest value of this metric demonstrates the lowest data rate and Frame Error Rate (FER) of MAC layer. Therefore, the neighbor with the lowest radio-aware metric will be the candidate of the next hop. MAC layer Radio-aware Metric (\(C_{lq}\)) is computed as follows:  
\[C_{lq}=\left[O+\frac{N_{b}}{r}\right]\frac{1}{1-E_{f}}\]  
In this equation, \(O\) is channel access overhead, \(N_{b}\) is number of bits in test frame, r denotes bit rate and \(E_{f}\) is the frame error rate. Therefore, in EAR unlike DD which selects the next hop neighbors based on flooding the interest message, next hop nodes are selected according to their \(C_{lq}\) which is maintained in the routing table. For efficient selection of the next hop neighbors and to perform more reliable data transmission, a Request to Send (RTS) packet is sent to the node with the minimum \(C_{lq}\). If the result of the request becomes positive, the node will be selected as the next hop; otherwise, another node with the least \(C_{lq}\) among the remaining neighbors will be selected as the next hop. Also, it should be notified that, although EARS can be a reliable routing approach but in comparison with DD, it adds more delay to the routing process due to its dependency to the routing table. In [70] the authors proposed a hierarchical structure wherein some relay nodes which have higher capability and power are selected as the cluster heads. Then, such relay nodes are placed in different regions of the sensing environment in a way that each of the sensor nodes is covered by one of these cluster heads. Moreover, for performing a fault tolerant and successful data delivery, the relay nodes are connected to each other in a separate network.