Faulty Sensor Node Detection Using Round Trip Time and Discrete Paths in WSNs

Wireless sensor networks (WSNs) with efficient and accurate design to increase the quality of service (QoS) have become a hot area of research. Implementing the efficient and accurate WSNs requires deployment of the large numbers of portable sensor nodes in the field. The quality of service of such networks is affected by lifetime and failure of sensor node. In order to improve the quality of service, the data from faulty sensor nodes has to be ignored or discarded in the decision-making process. Hence, detection of faulty sensor node is of prime importance. In the proposed method, discrete round trip paths (RTPs) are compared on the basis of round trip delay (RTD) time to detect the faulty sensor node. RTD protocol is implemented in NS2 software. WSNs with circular topology are simulated to determine the RTD time of discrete RTPs. Scalability of the proposed method is verified by simulating the WSNs with various sensor nodes.


Introduction
Wireless sensor networks (WSNs) consist of portable sensor nodes distributed in the field according to the requirement of specific application.WSNs with large numbers of sensor nodes found applications in the area of environmental monitoring, military operations, smart homes, surveillance, industries, and hospitals [1,2].In most of the applications, portable sensor nodes are placed randomly.If a sensor node deployed in the field becomes faulty, dead, or malfunction, then the resultant processed value will deviate from the mean and can lead to inaccurate analysis [3,4].Sensor node in the field can become faulty due to various reasons such as battery failure, hardware or software failure, and wireless device problem.Lifetime of WSNs is affected due to failure in portable sensor nodes [5,6].This will degrade the quality of service (QoS) of WSNs.Hence, fault detection becomes a critical issue in WSNs.Designing the efficient fault detection method to reduce the detection time as well as energy consumed by sensor node during fault detection is a need of time.Faulty sensor nodes in WSNs can be neglected or discarded during the decision making to achieve the accuracy in detection [7,8].
Jiang [9] has suggested the fault detection based on neighbor nodes data analysis.In this method, fault detection accuracy will decrease rapidly if the numbers of neighbor nodes to be diagnosed are small and the node's failure ratio is high.Confidence factor measurement based neighbor data analysis proposed by Zhipeng et al. [10] to detect the faulty node has limitations due to the weak and inaccurate algorithm.In [11], link failure detection based on monitoring cycles (MCs) and monitoring paths (MPs) is presented.Three-edge connectivity in the network, separate wavelength for each monitoring cycle (MC), and monitoring locations are the limitations of this method.Time delay based direction of arrival (DOA) estimation to detect and compensate failure of one sensor in an array is suggested in [12].The performance of DOA estimation is limited due to quantization error, wave fronts are not perfectly planar, and source movements.
The different failure detection approaches in WSNs are centralized, distributed, and clustering [1].We have used the discrete clustering approach to detect the faulty sensor node.Detection of fault is based on inspecting the discrete RTPs for their round trip delay (RTD) time.Few RTPs are analyzed during fault detection; therefore involvement of sensor node in investigating the fault is rare.This will improve the lifetime as well as quality of service (QoS) of WSNs.Software tool NS2 is used to implement RTD protocol.Faulty sensor node is detected by simulating circular topology WSNs with RTD protocol.This method is tested for different numbers of sensor nodes in WSNs to verify the scalability.
The paper is organized as follows.In Section 2, the design methodology for RTD time, numbers of RTPs necessary in fault detection, and algorithm to detect faulty node are explained.In Section 3, implementation of the round trip delay (RTD) protocol in NS2 for circular topology WSNs is mentioned.Simulation results and analysis are presented in Section 4. The paper is concluded in Section 5.

Design Methodology
Round trip delay time of the RTP will change due to faulty sensor node.It will be either infinity or higher than the threshold value.Faulty sensor node is detected by comparing the RTD time of RTPs with threshold value.The sensor node common to specific RTPs with infinity RTD time is detected as failed.If this time is higher than the threshold value then this senor node is detected as malfunctioning.Detection time of faulty sensor node depends upon the numbers of RTPs and RTD time.Therefore, RTD time measurement and evaluation of RTPs is must to minimize the detection time.
2.1.Fundamentals of RTD Time.RTD time mainly depends upon the numbers of sensor node present in the round trip path and the distance between them [13].Proposed fault detection technique accuracy can be increased by reducing the RTD time of RTP.It can be decreased only by reducing the sensor nodes in RTP because the distance between sensor nodes in WSNs is determined by particular applications and cannot be decided.Selecting minimum numbers of sensor nodes in the RTP will reduce the RTD time.The round trip path (RTP) in WSNs is formed by grouping minimum three sensor nodes [13].Hence, the minimum round trip delay time ( RTD ) of RTP with three sensor node is given by where  1 ,  2 , and  3 are the delays for sensor node pairs (1,2), (2,3), and (3,1), respectively.Circular topology with ten sensor nodes is shown in Figure 1.Three consecutive sensor nodes in each RTP are almost at equidistance because of circular topology.As a result, sensor node pair delays  1 ,  2 , and  3 will be equal.Let "" be the uniform time delay for all sensor node pairs in RTPs; that is,  =  1 =  2 =  3 .Round trip delay time for RTP with uniform sensor node pair delay is obtained by referring (1) as It is the minimum RTD time of an RTP in WSNs.It is determined by the sensor node pair delay "".This is decided by particular application of WSNs, as it depends upon the distance between the sensor nodes.Hence, the efficiency of the proposed method can be improved only by reducing the RTPs in WSNs.

Evaluation of RTPs.
Faulty sensor node is detected by comparing the specific RTPs to which it belongs.More numbers of sensor nodes in the round path will reduce the RTPs created.But due to this, individual sensor node will be present in more RTPs.While detecting faults, comparisons of all such RTPs become necessary.This will delay the fault detection process.The numbers of RTPs formed with "" sensor nodes are given by  =  ( − ) , where  is the numbers of RTPs.Analysis time of fault detection method is the time required to measure the RTD times of all RTPs in the WSNs.It is the addition of all RTD times.The equation for analysis time with  numbers of RTPs is given by RTD time of RTP will increase for additional numbers of sensor nodes.Referring to (2), optimum value of RTD time of RTP is obtained by considering only three sensor nodes.All the RTPs in WSNs are formed by selecting only three sensor nodes ( = 3).Then, the round trip delay for all RTPs is approximately the same: Equation ( 5) can be written with the equal RTD time as Referring to (2), analysis time can be written in terms of sensor node pair delay as Minimum numbers of sensor nodes used to form RTP will create substantial numbers of RTPs.The maximum possible round trip paths   , created by three sensor nodes per RTP, are obtained by substituting  = 3 in (3) and are given by Analysis time  ANL (), to detect the faulty sensor node using maximum RTPs is obtained by referring ( 8) and ( 9) as follows The fault detection analysis time will increase exponentially with the increase in numbers of sensor nodes  in WSNs.Also the maximum numbers of RTPs produced are not required for comparison to detect the fault.Such selection of RTPs is not an adequate solution to speed up fault detection.Hence, optimization of RTPs in WSNs is essential to speed up the fault detection.

Optimization of RTD Paths.
Fault detection by analyzing RTD times of maximum numbers of RTPs will require substantial time and can affect the performance.Therefore, essential numbers of RTPs have to be selected for comparison purpose.Optimization of RTPs can be done as explained below.

First Level of Optimization.
In order to reduce the RTPs in the fault detection analysis, instead of considering maximum numbers of RTPs, only few paths corresponding to the number of sensor nodes in WSNs are sufficient.We can select the RTPs equal to the numbers of nodes in WSNs to reduce the analysis time.RTPs selected in this way are called as linear RTPs because of the linear relationship between  and .While choosing linear paths for WSNs shown in Figure 1, we found that each sensor node is present in three RTD paths.Hence, comparison of three linear RTPs is sufficient to detect the faulty sensor node.The linear RTPs in WSNs with  sensor node can be written as where   is the number of linear RTPs.Measurement of RTD times of such paths is essential.Referring to ( 8) and ( 11), the analysis time  ANL () for linear RTPs is given by Linear RTPs selected will be higher for large value of sensor nodes .This will not optimize the fault detection time in case of large-size WSNs.Therefore, further reduction in the numbers of RTPs is a must to increase the efficiency of proposed method.

Second Level of Optimization.
In the first level of optimization, the analysis time is curtail up to certain limit.Still the numbers of RTPs are high.For WSNs with large numbers of sensor nodes, the fault detection time is significantly high.So again, there is a need to minimize the RTPs in WSNs.
In the second level of optimization, numbers of RTPs are reduced by selecting only discrete paths in WSNs.Discrete RTPs are selected from sequential linear RTPs only.They are selected by ignoring the two consecutive paths, after each selected linear path.In this way, RTPs are selected in discrete steps of three as each RTP consists of three sensor nodes.The equation to select the discrete RTPs in WSNs is given by and  in the previous equation are expressed as follows: where  is the quotient,  is a remainder,  is numbers of sensor nodes in wireless sensor networks, and  is a correction factor to be added.Correction factor will be 0 if remainder is 0; otherwise, it is 1.Analysis time  ANL () required for detecting fault in discrete RTPs is obtained by referring to ( 8) and ( 13) as follows Analysis of particular selected discrete path will be sufficient to monitor the fault.Selection of discrete RTPs will save the analysis time to a large extent.Discrete RTPs obtained by using (15) in WSNs with different numbers of sensor nodes  are mentioned in Table 1.Four such discrete RTPs selected for wireless sensor network of Figure 1 are illustrated in Figure 2.

Comparison of RTPs. The numbers of RTPs computed
for WSNs with different values of  in maximum, linear and discrete cases used to detect the faulty node are listed in Table 2. Variation of RTPs w.r.t.numbers of sensor nodes in maximum and linear cases is as shown in Figure 3. Similarly the variation of RTPs in linear and discrete cases is shown in Figure 4. RTPs created in maximum case are too high.In linear case, it has been significantly reduced.Still the selection of numbers of linear RTPs for large value of  is much high.The discrete RTPs obtained are very much optimized as compared to linear and maximum cases.RTD time of very few RTPs is measured in case of discrete path selection, which will save the utilization of sensor node in fault detection.
The RTD analysis time required for maximum, linear, and discrete RTPs with different numbers of sensor nodes   is mentioned in Table 3. Analysis time saved by using discrete RTPs as compared to linear RTPs is up to 66%.Thus, the efficiency of fault detection method is improved by considering the discrete RTPs.

Algorithm to Detect the Faulty Node.
Initially all sensor nodes in WSNs are considered as working properly; then program is executed in discrete steps to measure the RTD time of all discrete RTPs.The discrete round trip paths are selected by using step size of three; that is, incrementing sensor node value by three.The subroutine shown in Figure 5 is used to measure the round trip delay time of respective RTP.Highest RTD time measured during this process is selected as threshold time for all discrete RTPs in WSNs.The algorithm designed to detect both cases of faulty sensor node sequentially like failed (dead) and malfunctioning is as shown in Figure 6.Faulty sensor node detection process starts sequentially by comparing the RTD times of discrete RTPs with threshold time.If the RTD time of particular discrete RTP is found to be higher than the threshold time, then this discrete RTP is analyzed in depth with two additional stages.Let discrete path RTP  with source node   has the RTD time higher than threshold time, while other discrete RTPs have RTD time less than the threshold time.Sensor node sequence of this path is   - +1 - +2 .Now the next RTP to be analyzed is formed with  +1 sensor node.Sensor node sequence in RTP ( + 1) is  +1 - +2 - +3 .RTD time of RTP ( + 1) is measured and if found to be less than the threshold time, then the sensor node   is determined as faulty.Verification of   as failed or malfunctioning is done by checking the RTD time of RTP .If the RTD time of RTP  is infinity (∞) then   is failed (dead) otherwise it is malfunctioning.Thus in the first stage, fault at   location is identified.
If the faulty sensor node is not detected in the first stage, then RTD time of RTP ( + 2) is measured and compared with threshold time provided that the RTD time of RTP ( + 1) is higher.The RTD time of RTP ( + 2) is found to be less than the threshold time, then the sensor node  +1 is determined as faulty.If this time is infinity (∞), then  +1 is failed (dead) otherwise it is malfunctioning.Here if the RTD time of RTP ( + 2) is higher than the threshold time, then sensor node  +2 is determined as faulty.The sensor node  +2 will be failed (dead), if the RTD time of RTP ( + 2) is infinity (∞); otherwise, it is malfunctioning.To locate the fault at position  +1 or  +2 , two additional RTPs are required.
In this way, the faults present at position   ,  +1 , and  +2 are monitored and located by the proposed algorithm.After these investigation stages,   is compared with the numbers of sensor nodes  in WSNs (i.e.  ).If it is found to be less, then next discrete RTP is selected for comparison.Consequently, all the discrete RTPs in WSNs are analyzed sequentially to detect the faulty sensor node.
Analysis time of the method suggested here to detect the fault is optimized to a large extent due to the discrete RTPs.Each discrete RTP has a unique source node and is formed by grouping three sensor nodes.Minimum contribution of sensor node in fault detection is effectively managed by discrete RTPs in WSNs.Energy consumed by sensor node is reduced due to less utilization in fault detection, therefore increasing the lifetime.Thus, the overall lifetime of WSNs is improved significantly.Quality of service (QoS) of WSNs is determined by its lifetime.Improvement in lifetime of sensor node eventually enhances the lifetime of WSNs and will provide better quality of service (QoS).

Implementation in Software
Circular topology WSNs having different sensor nodes are implemented by using the open-source software NS2.In the proposed method, round trip paths are formed by combining the adjacent three sensor nodes.RTD protocol is developed and implemented to measure the RTD time of such RTPs.

Implementation of RTD Protocol in NS2.
In this protocol, an RTP is formed between the three sequential sensor nodes in circular topology of WSNs.A packet is routed in between these sensor nodes of RTP.It is routed in the round trip delay path by assigning the addresses of source, forwarding, and destination senor nodes in routing table.The parameters selected for this simulation are listed in Table 4.The circular topology of WSNs having ten sensor nodes ( = 10) is    implemented and simulated in NS2 as shown in Figure 7.
The sensor nodes in circular topology are placed at 1 foot distance.

If
If We have simulated two tcl files named dead.tcland mal.tcl to test the failed (dead) and malfunctioning behavior of sensor nodes, respectively.other RTPs present in WSNs have RTD times less than threshold time.The source node   of 16th RTP is 16 with sensor node sequence as 16-17-18.RTPs with source node 17 and 18 have RTD time less than threshold time.This concludes that 16 sensor node is malfunctioning.Similarly we have observed that RTD time of all RTPs except RTP 16 is less than threshold time (markers shown by square).RTD time of RTP 16 has "−0.2" value.Comparing the RTD time values for RTP 16, 17 and 18 will indicate that 16 sensor node is failed (dead).Analysis time required to detect    Numbers of discrete RTPs required for detecting the fault in WSNs with 30, 50, and 100 sensor nodes are 10, 17, and 34, respectively.These RTPs are sufficient to detect the faulty sensor node.The results for failed as well as malfunctioning behavior of 16 sensor node are shown simultaneously in Figures 13-15.Markers used to indicate the malfunctioning and failed behavior of sensor node 16 are circle and square, respectively.Analysis procedure to detect the fault is similar as explained earlier in Section 2.4.Analysis time to detect faulty sensor node in linear and discrete methods for WSNs with 30, 50, and 100 sensor nodes is as shown in Table 5.It has been optimized to a great extent by using discrete RTPs.Referring to Table 5, we have found that only 34% of analysis time is required in discrete method as compared to linear selection of RTPs.In this way, the efficiency of proposed method is enhanced by considering the discrete RTPs in WSNs.

Detection of Faulty Sensor Node Other than Source Node
Using Discrete RTPs.Faulty sensor node present at position  +1 can be detected with the help of algorithm explained in Section 2.4.If a fault is identified in particular discrete RTP, then additional two RTPs are required to locate this fault.For the demonstration, purpose sensor node 17 is made faulty (i.e. +1 = 17).The 17 sensor node is present in the discrete RTP with 16 as source node.WSNs with 30 sensor nodes are simulated to detect the failed as well as malfunctioning behavior of sensor node 17.Referring (15), the total numbers of RTPs required to detect this fault are 12.These RTPs are formed by source nodes 1, 4, 7, 10, 13, 16, 17, 18, 19, 22, 25, and 28, respectively.Simulation results for failed as well as malfunctioning behavior of 17 are shown in Figure 16.
All the discrete RTPs in Figure 16 except RTP 16 and RTP 17 have RTD time less than the threshold time.The sensor node sequence in these two RTPs is 16-17-18 and 17-18-19, respectively.By comparing both these sequences, we have found that 17 is faulty.If the RTD time of these two RTPs is infinity, marked as "−0.2" value in figure, 17 is failed (dead); otherwise, if it is higher than threshold time, then it is malfunctioning.
Similarly, faulty sensor node present at position  +2 can be detected.For the demonstration purpose, sensor node 18 is made faulty (i.e. +2 = 18).Again, WSNs with 30 sensor nodes are simulated to detect the failed as well as malfunctioning behavior of sensor node 18.Referring to (15), the total numbers of RTPs required to detect this fault are 12.These RTPs are formed by source nodes 1, 4, 7, 10, 13, 16, 17, 18, 19, 22, 25 and 28 respectively.Simulation results for failed as well as malfunctioning behavior of S18 are shown in Figure 17.
The RTPs present in Figure 17 have less RTD time than threshold value except three RTPs with source node 16, 17 and 18.The sensor node sequence in these three RTPs is 16-17-18, 17-18-19, and 18-19-20, respectively.By comparing these path sequences, we have found that 18 is faulty.If the RTD time of these RTPs is infinity, marked as "−0.2" value in Figure 17, 18 is failed (dead); otherwise, it is malfunctioning if it is higher than threshold time.The proposed method requires less time to detect fault with discrete RTPs.While detecting the faulty sensor node in the suggested method, individual sensor node is utilized only for 66 ms (22 ms * 3) duration.Energy consumed during this period will be considerably low.Consequently, lifetime and quality of service of WSNs employing this method will be better.Various results presented in this paper are able to prove the scalability of the investigated method.

Conclusion
In this paper, we have proposed a faulty sensor node detection method in wireless sensor networks.Specific round trip paths are selected and compared with threshold time to identify the failed as well as malfunctioning sensor node.The algorithm is simple to monitor and locate the fault in WSNs effectively.Fault detection efficiency is enhanced by selecting the discrete RTPs.Each sensor node in WSNs is rarely utilized in fault detection due to discrete selection of paths, improving the lifetime due to less energy consumption.Therefore, the suggested method improves lifetime and quality of service of WSNs.Investigated method is scalable to wireless sensor networks with large numbers of sensor nodes.
The proposed method is successfully implemented on circular topology WSNs with variable sensor nodes ().Our future work includes verifying the performance of this method on other topologies in WSNs.Results of this implementation will be communicated separately.

Figure 5 :
Figure 5: Algorithm to measure RTD time of RTPs.
Choose the sensor node "S X " (S 1 ≤ S X ≤ S N ) RTP X RTD time of RTP (X + 1) RTD time of RTP (X + 2)

Figure 6 :
Figure 6: Algorithm to detect faulty sensor node using discrete RTPs.

Figure 10 :
Figure 10: RTD time simulation results of linear RTPs in case of 16 faulty sensor node for WSNs with 30 sensor nodes.

Figure 11 :
Figure 11: RTD time simulation results of linear RTPs in case of 16 faulty sensor node for WSNs with 50 sensor nodes.

Figure 15 :
Figure 15: RTD time simulation results of discrete RTPs in case of 16 faulty sensor node for WSNs with 100 sensor nodes.

Figure 16 :
Figure 16: RTD times of discrete RTPs in case of 17 faulty sensor node for WSNs with 30 sensor nodes.

Table 1 :
Discrete RTPs for WSNs with different numbers of .

Table 2 :
RTPs comparison for maximum, linear, and discrete methods for various WSNs.

Table 3 :
Fault detection analysis time in maximum, linear, and discrete RTPs for various WSNs.

Table 4 :
Threshold RTD time is estimated by considering all sensor nodes in WSNs as working properly.The norm.tclfile with different numbers of sensor nodes as 6, 10, 20, 30, 40, 50, and 100 is simulated separately by using RTD protocol.Simulation results of RTD time for respective linear RTPs are presented in the form of a graph.Results of RTD time of RTPs in WSNs with senor nodes 6, 10, 20, and 30 are shown in Figure 8. Similarly RTD time results of RTPs in WSNs with senor nodes 40, 50, and 100 are shown in Figure 9. Simulation results are too large and hence cannot be shown in one figure.Referring to Figures 8and 9, we have found that the average time span for round trip delay time for WSNs is in the range of 14 to 22 ms and the highest RTD time is 22 ms.Hence, the threshold value of RTD time for RTP is selected as 22 ms (i.e.,  RTD-TR = 22 ms).Parameters used in NS2 simulation.In case of malfunctioning sensor node, delay of 100 ms is added to the RTD time of respective RTPs to which this node belongs.From the simulation results shown in Figures10-12, we have observed that graph for malfunctioning behavior (markers shown by circle) has a peak RTD time at 16 instant.This value is greater than threshold RTD time.Remaining 4.1.Threshold RTD Time Estimation. 4.2.Detection of Faulty Sensor Node Using Linear RTPs.For experimental purpose to check the faulty (failed (dead) or malfunctioning) node in WSNs, sensor node 16 is made faulty.The simulation results for faulty sensor node 16 in Figure 12: RTD time simulation results of linear RTPs in case of 16 faulty sensor node for WSNs with 100 sensor nodes.Detection of Faulty Sensor Node Using Discrete RTPs.Fault detection using linear RTPs requires significant time.Analysis time required for fault detection in WSNs with large numbers of sensor nodes by using linear RTPs will be more.Instead of considering linear RTPs, discrete RTPs in WSNs are used to detect the faulty sensor node.Simulation results for faulty sensor node 16 with discrete RTPs in WSNs withFigure 14: RTD time simulation results of discrete RTPs in case of 16 faulty sensor node for WSNs with 50 sensor nodes.

Table 5 :
Analysis time for linear and discrete RTPs for WSNs with 30, 50, and 100 sensor nodes.