BRS-Based Robust Secure Localization Algorithm for Wireless Sensor Networks

Localization is the key supporting technology for wireless sensor networks (WSNs). Security and accuracy are the premise of the localization application. Real-world applications of wireless sensor networks are often subject to a variety of adverse circumstances interference, and the localization performance is seriously affected. In this paper, we propose a BRS-based robust secure localization (BRSL) algorithm in order to reduce the impact of the malicious attackers in WSNs. The BRSL method includes two phases. In the first stage, the trust evaluation framework is established on the basis of beta reputation system. In the second phase, we employ the weighted Taylor-series least squares method to estimate the coordinates of sensor nodes. Simulation results demonstrate that the proposed algorithm is robust and effective.


Introduction
Wireless sensor networks (WSNs) are based on the technology of sensor, wireless communication, tiny embedded devices, and distributed computing.They exchange information with the environment through sensors and implement the function of collecting and dealing with data.Wireless sensor networks have been widely used in the fields of environmental monitoring, target tracking, military applications, disaster management, and so forth [1][2][3].
Self-localization technology of nodes is the prerequisite and basis for the application of wireless sensor networks, especially the position information that is needed for the perceived data.Node localization of WSNs is to determine the positions of normal nodes based on the positions of beacon nodes and the constraint relations between normal and beacon nodes.Positions or coordinates of normal nodes are unknown.Beacon nodes usually get their positions or coordinates through global positioning system (GPS) modules or by manual deployments.Being an essential support technology of wireless sensor networks, node localization has got more and more attention in the recent years [4][5][6][7][8][9][10].
Most localization methods depend on measuring the distances or hops between normal and beacon nodes to obtain the coordinates of normal nodes.In many typical localization algorithms [11][12][13], the coordinates of beacon nodes are generally assumed to be completely correct without any disturbs of adverse factors, and the normal nodes can use beacon information in security.However, in the actual hostile situations, some malicious nodes may intrude into sensor networks.They pretend to be true beacon nodes or attack other anchor nodes and make them declare false coordinates [14,15].The false coordinates or distance estimation will cause a major localization error for normal sensor nodes [16].In this case, some methods should be explored to eliminate or reduce the adverse influence caused by malicious beacon nodes and ensure safe localization in wireless sensor networks.
In this paper, we develop a BRS-based robust secure localization (BRSL) algorithm for solving the node selflocalization problem in the case of malicious nodes existence.In BRSL, normal sensor node first observes the anchor nodes in its communication range and evaluates the trust values of these anchor nodes.Specially, the concepts of the beta reputation system are employed to deal with the uncertain factors in trust evaluation.Then, each anchor node obtains a final trust value, and sensor nodes compare the final trust values of anchor nodes in their multihop communication range with the stored threshold.Finally, the normal sensor nodes utilize the trustful anchor nodes to estimate their coordinates.All the above operations can be carried out by each node.The method is a completely distributed localization approach.Through simulations, we demonstrate that the BRSL method can efficiently reduce the influence of malicious attackers in WSNs.
The remainder of the paper is organized as follows: Section 2 introduces related works on secure localization algorithms.Section 3 presents the network model, attack model, and related definitions.Section 4 provides the details of the BRS-based robust secure localization (BRSL) algorithm.Section 5 presents the simulation results.Section 6 concludes the paper.

Related Works
Alfaro et al. [17] consider the localization security of sensor nodes under limited trust anchor nodes.It introduces three algorithms to enable the sensor nodes to determine their positions, but it would fail when the malicious anchor nodes are in colluding conditions.
Liu et al. [18] propose two secure localization algorithms.One is attack-resistant minimum mean square estimation, which excludes malicious anchor nodes by the consistency check.The other is voting-based location estimation.The algorithms are difficult to work for the malicious anchor nodes in colluding conditions.
Zhu et al. [19] propose an attack detection module which can detect compromised beacons and provide a localization service in terms of bounded estimation error by secure localization module, but it mainly concentrates on the onehop localization.
Liu et al. [20] present a secure localization mechanism that detects malicious anchor nodes claiming fake positions.It uses redundant anchor nodes instead of normal nodes in the sensing field to verify malicious anchors.The method relies on a centralized base station for the detection.
Li et al. [21] introduce a secure scheme "Bilateration" which is derived from multilateration.It calculates the weight of anchor nodes and decides which anchor nodes are malicious.After ignoring the coordinates caused by compromised nodes, it uses the average value of the left candidate positions as the estimated location of the sensor node, but it mainly focuses on the one-hop localization.

Preliminaries
3.1.Network Model.We consider a network consisting of two types of nodes, namely, anchor nodes and sensor nodes.The anchor nodes are specially equipped and aware of their coordinates after deployment.The sensor nodes, whose positions are yet to be discovered, estimate their locations by measuring distances to neighboring anchor nodes.All nodes are randomly distributed in a 2D spatial region.Every node has a unique identity (ID).The transmission range or ranging radius of each node is .Every node is capable of measuring the distance to any of its immediate neighbors.
The ranging error  follows a Gaussian distribution (,  2 ), where the mean  is 0 and the standard deviation  is within a threshold.Measurement error  is bounded by |  | ≤  max , and the maximum physical inaccuracy  max can be obtained experimentally.In multihop localization, each anchor node broadcasts a message that carries its declared position to its one-hop neighbors.Then, the message is propagated in the network in a controlled flooding manner.When a sensor node obtains three or more anchor messages, the sensor node can estimate its location by the localization algorithm.

Attack Model.
We assume that the WSN is in a hostile environment, that is, there are malicious attackers in the network.The attackers attack the anchor nodes in order to make them declare dishonest coordinates.When an anchor node is attacked and broadcasts erroneous locations, we call it malicious anchor node.The nodes claiming actual coordinates are called benign anchor nodes.We consider an adversarial environment where the malicious anchor nodes are in noncolluding scenario or colluding scenario.If the malicious anchor nodes are noncolluding, they cannot know whether other anchor nodes are malicious or not.They can only fake their own declared locations to affect the localization process.While the malicious anchor nodes are colluding, they can detect whether other anchor nodes are the same type, and each pair of colluding malicious anchor nodes can revise the measure distance between them by changing their declared locations.
As shown in Figure 1, when a sensor node  gets enough measurement distances   ( = 1, 2, . . ., ), where  ≥ 3, to anchor nodes   , a system of the Euclidean equations can be set up: where   = [  ,   ]  is 's coordinates that need to be estimated and   = [  ,   ]  is anchor node   's declared position.
If the anchor node  1 is attacked, it will become a malicious anchor node   1 with fake coordinates.When  utilizes   1 to compute its position, its estimated position   will deviate far from its physical position, and its location accuracy will be very low.

Related Definitions.
To be convenient, some necessary definitions are given in the following.
(i) Measurement distance: node  is in the communication radius of node .The physical measurement distance from  to  (through RSSI, TDOA, etc.) is called measurement distance.(ii) The Euclidean distance: the distance between the declared coordinates of two anchor nodes  and , that is, where respectively, the declared coordinates of anchors  and .
(iii) Multihop communication range: the range that a node's propagation packet can reach through multihop forwarding.
(iv) Multihop count: the hops count of the shortest path between a pair of nodes.For example, if the shortest path between nodes  and  passes  nodes (including  and ), the multihop count of nodes  and  is HOP  =  − 1.

BRS-Based Robust Secure Localization (BRSL) Algorithm
In BRSL method, every sensor node has the detecting function.The sensor node examines each of the anchor nodes that are available to it and evaluates the reliability of each anchor node according to the geometric relationship among anchor nodes.After the sensor node obtains the final trust values of each anchor node, a weighted Taylor-series least squares method is utilized to compute the sensor nodes' coordinates.
In general, the BRSL method includes two main phases: trust evaluation of anchor nodes and the localization of sensor nodes.

Trust Evaluation of Anchor Nodes.
In this subsection, we employ the concepts of the beta reputation system [22] to construct the trust evaluation framework of anchor nodes.In contrast to most other intuitive reputation systems, the beta reputation system has a firm basis on the theory of statistics, that is, the beta probability density function.The beta distribution (, ) can be expressed by using the gamma function as where 0 <  < 1,  > 0,  > 0, and Γ() is the gamma function.
The gamma function [23] (represented by the capital Greek letter Γ) is an extension of the factorial function, with its argument shifted down by 1, to real and complex numbers.If  is a positive integer, we get the formula Γ() = (−1).If  is a complex number, we get the formula Γ() = ∫ ⋈ 0 ( (−1) /  )d, where the real part of  must be larger than zero (Re() > 0).The gamma function is applicable in the fields of probability and statistics.It is also a component in various probabilitydistribution functions.
The beta reputation system consists of two elements (, ) that can be used separately or in combination to provide a flexible framework for reputation services of WSNs applications.We use the beta reputation system to establish the trust evaluation framework of anchor nodes.In the network, anchor nodes have two types: benign anchor nodes and malicious anchor nodes.And the two elements (, ) of beta reputation system are the most appropriate parameters here to judge the anchor nodes.The probability expectation value of the beta distribution is given by and the variance is In the network, every anchor node has a unique ID, and the sensor node is assumed to have the detecting function.We utilize the beta reputation system to detect the malicious anchor nodes.The detecting process is considered with two possible outcomes (benign anchor node and malicious anchor node).Let ( + 1) be the observed outcome number of benign anchor nodes, and let ( + 1) be the observed outcome number of malicious anchor nodes.Then, we have a beta function expressed as ( | ( + 1), ( + 1)), where  denotes the benign anchor node.The observed number of benign anchor nodes and malicious anchor nodes is used in the beta function to estimate the probability of anchor nodes to be benign ones, which equals to the expectation value of .As we do not know whether the anchor nodes are benign or not at the beginning, we initially assume all anchor nodes to be benign ones.
Let   denotes the reputation of anchor nodes and   ∼ ( + 1,  + 1).Let   denotes the trust value of the anchor node.From the beta reputation system, we know that the expectation value of   is equal to  , that is, ( ) =  .Assume that there are  1 +  2 anchor nodes and  3 sensor nodes randomly deployed in the network.Assume  ( ≤  1 +  2 ) anchor nodes ( 1 ,  2 , . . .,   ) are available to an arbitrary sensor node   .
We deploy the network  times in total.The detail of the detecting process is given as follows. ( For example, Figure 2 and the observed number of anchor node   to be a malicious one is (b) The      ∼ (   + 1,    + 1).The trust value of anchor node   is and the variance of anchor node   is and the final variance of anchor node   is The determination of threshold ∇ depends on the final trust value of each anchor node.The threshold ∇ is defined as follows where  1 +  2 is the total number of anchor nodes,  is the ID of anchor node, and   is the final variance of anchor node .
From the above steps, we will get the trust evaluation of anchor nodes.The situation we investigated in this paper is that the percentage of malicious anchor nodes is less than half of the number of anchor nodes.When the malicious anchor nodes are noncolluding, they will not cooperate with each other.Therefore, it is hard for these malicious anchor nodes to obtain high value of    .As the number of malicious anchor nodes is less than that of benign ones, the colluding malicious anchor nodes will be given more value on    .When malicious anchor nodes are cooperated, some malicious anchor nodes may obtain more value on    than    , but such nodes are very few.Generally,    is smaller than    for malicious anchor nodes, and    is bigger than    for benign anchor nodes.Therefore, most benign anchor nodes' trust values are larger than that of malicious anchor nodes in each network deployment.
Formula (8) shows that the bigger    is, the larger   is.Similarly, the bigger    is, the smaller   is.The variance of anchor node  denotes the deviating degree of anchor node 's trust value from the expectation value.If the final variance of anchor node  is big, it means the distribution of anchor node 's trust values (   1 ,    2 , . . .,     ) is relatively discrete in  times network deployment.While the final variance of anchor node  is small, it means that the distribution of anchor node 's trust values is relatively concentrated.The differences between most benign anchor nodes' trust values and their average trust value are larger than those of malicious anchor nodes, that is,  benign >  malicious .The weight   / ∑ of trust values of anchor nodes in formula (12) demonstrates that the trust values of benign anchor nodes account for a higher proportion than malicious anchor nodes' trust values in the judging threshold, which is helpful in excluding malicious anchor nodes.Therefore, formula (12) indicates the most appropriate threshold here.

The Localization of Sensor Nodes.
When utilizing malicious anchor nodes to localize the sensor nodes, the localization accuracy of sensor nodes is very low.To resolve this problem, we eliminate the malicious anchor nodes before the localization phase.The sensor node  utilizes all its multihop communication anchor nodes to estimate its coordinates.The traditional method like maximum likelihood estimation (MLE) has a high computational complexity and always loses much coordinates information.
We employ the weighted Taylor-series least squares algorithm to estimate the coordinates of sensor nodes and the final trust values   1 ,   2 , . ..,    ( = 1, 2, . . ., ,  ≥ 3) of benign anchor nodes are used as the weight in the localization stage.The weighted Taylor-series least squares method can make better use of the anchor information, and the computing accuracy can be greatly improved.The localization processes are as follows.
Assume   ( = 1, 2, . . ., ) are the measurement distances from the  anchor nodes to the sensor node  and   = (  ,   ) is the declared coordinates of anchor node .The position of sensor node  is denoted as  = ( 0 ,  0 ).Therefore, we have a set of the Euclidean equations: Firstly, calculate the centroid coordinates   = (  ,   ) of  anchor nodes, that is,   = (1/) ∑  =1 X  .Secondly, expand the function () = ‖ −   ‖ 2 in Taylor series at   , and ignore the high-order terms.Equation ( 13) is transformed into the following modus: where   denotes the Euclidean distance between   and   .Therefore, Δ  = (Δ  , Δ  ) can be obtained by Δ  = (    ) −1     , where Thirdly, let  = √Δ 2  + Δ 2  , and judge whether the iteration termination condition  ≤  is satisfied, where  is a prior-defined threshold.If  ≤ , we stop the iteration process.Otherwise, we set   =   + Δ  and go to the second step.
Finally, repeat the second step and the third step until the iteration termination condition is satisfied or the maximum iteration number is reached.The final output   is the estimated coordinates of sensor node .

Performance Evaluation
In this section, the performance of the BRSL algorithm is tested.All simulations are executed in MATLAB.
The WSN is in a hostile environment, and the malicious anchor nodes are in two conditions: noncolluding or colluding.The default network configuration parameters are shown in Table 1.Unless specified, the default parameters are used in the simulations.
Figure 3 shows the random network deployment, and each anchor node has a unique ID in all the simulations, where benign anchor nodes' IDs are from 1 to 20 and malicious anchor nodes' IDs are from 21 to 30.

Trust Evaluation of Anchor
Nodes.Firstly, we analyze the trust evaluation of anchor nodes.Figures 4 and 5 show that the final variances of benign anchor nodes are bigger than those of the malicious anchor nodes, no matter whether the malicious anchor nodes are noncolluding or colluding.Therefore, the weight is proper in this paper.When malicious anchor nodes are in noncolluding condition, from Figure 6, we can see that the final trust values of benign anchor nodes are much larger than those of malicious anchor nodes, and the threshold ∇ is about 0.267032.Therefore, we can remove all the malicious anchor nodes before the localization stage.When malicious anchor nodes are colluding, as Figure 7 shows, some of the malicious anchor nodes' final trust values are bigger than those of benign anchor nodes, and the threshold ∇ is about 0.297201.Although all the malicious anchor nodes can be excluded by the threshold, some benign anchor nodes are also removed.But in Section 5.2, it proves that the localization accuracy is still high although some benign anchor nodes are excluded.

Evaluation of BRSL Algorithm.
In this subsection, we compare the average localization error (ALE) of the BRSL algorithm with other localization techniques: RMLA2 [15], RMLA1 [15], Bilateration [21], and the traditional multihop      localization method without trust evaluation in which Taylorseries least squares solver is used (t-TLS for short).Based on our simulations, we show that BRSL has superior performance in localization accuracy.
The ALE is normalized by the nodes' communication radius : where   is the estimated coordinates of sensor node  and    is the real coordinates of sensor node .Figures 8 and 9 show the impact of malicious anchor number on the localization accuracy of BRSL, RMLA2, RMLA1, Bilateration, and t-TLS.With the increase of number of malicious anchor nodes, the ALE of RMLA2, RMLA1, Bilateration, and t-TLS rises obviously, while that of BRSL remains stable (no more than 22% in noncolluding scenario and 30% in colluding scenario).Therefore, BRSL is robust for multihop localization and can greatly improve the average  ALE almost does not change with the number of simulation rounds whether the malicious anchor nodes are in noncolluding or colluding condition.The variety of network topology does not affect the detecting and localization process.

Cost
Analysis.Finally, we analyze the costs of five algorithms.Assume a sensor node   can hear  anchor nodes in its one-hop range.In BRSL method,   needs to compute (  2 ) times to detect each anchor node.Thus, the cost of reputation computation in the network is ( 3 ⋅  2 ).The computation complexity of the localization stage in our method is ().Then the total cost of BRSL method is ( 3 ⋅  2 ) + ().The costs of RMLA2 equals to that of RMLA1.The communication complexity of RMLA1 or RMLA2 is ( 3 ⋅ The number of rounds  2 ).And the computation complexity of RMLA1 or RMLA2 is ().Thus, the total cost of RMLA1 or RMLA2 is ( 3 ⋅  2 ) + (), which is the same as BRSL algorithm.The costs of Bilateration and t-TLS mainly focus on the computation stage.The computation complexity of Bilateration is ( 2 ), while that of t-TLS is ().Therefore, the cost of our method is moderate and acceptable.

Conclusions
In this paper, we propose a BRS-based robust secure localization algorithm for the case of presence of malicious anchor nodes.Based on the beta reputation system and the trust evaluation, the malicious anchor nodes are detected and excluded.By utilizing the weighted Taylor-series least squares method, the coordinates of sensor nodes are estimated.The simulation results demonstrate that the BRSL algorithm can effectively distinguish malicious anchor nodes and improve localization accuracy, as well as resist topology variety and ranging uncertainties.In the future, our work will focus on the secure localization when there are multiple and different attacks in complex environments.

Figure 4 :
Figure 4: Final variances of anchor nodes when malicious anchors are in noncolluding condition.

Figure 5 :
Figure 5: Final variances of anchor nodes when malicious anchors are in colluding condition.

Figure 6 :
Figure 6: Final trust values of anchor nodes when malicious anchor nodes are in noncolluding scenario.

Figure 7 :
Figure 7: Final trust values of anchor nodes when malicious anchors are in colluding scenario.

Figure 10 :Figure 11 :
Figure 10: ALE versus the standard deviation  when malicious anchor nodes are in noncolluding scenario.
1) Compute   and   through the geometric relationship among anchor nodes.The values of   and   are set to 0 initially.The value of   is the Euclidean distance between   and   , and    denotes the measurement distance between   and   (if   and   are neighbors).
shows the geometric relationship among anchor nodes, in which   ( = 1, 2, . . ., 6) represents the anchor nodes and   ( = 1, 2, . . ., 5 ) represents the sensor nodes.Anchor node  2 is attacked, and   2 is the declared position of  2 .As anchor node  3 is not the neighbor of  2 , we can only obtain the Euclidean distance  23 between them.A set of inequalities can be set up: | 12 −  12 | >  max , | 14 −   14 | ≤  max , | 15 −   15 | ≤  max , | 16 −   16 | ≤  max , and 0 <  23 < 2.Sensor nodes  1 and  3 are in anchor node  1 's communication range.Therefore, we can get  1 (2) Compute the trust value of anchor node   in each network deployment.(a)Assume that  ( ≤  3 ) sensor nodes ( 1 ,  2 , . . .,   ) are available to anchor node   .These  sensor nodes utilize step (1) to detect anchor node   .The observed number of anchor node   to be a benign one is After the anchor node   obtains the final trust value     , it broadcasts     to the network in a multihop flooding manner.The sensor nodes store the final trust values they obtained, based on which they can decide whether   is a benign anchor node.(b) The sensor nodes compare the     that they received from step (3) with threshold ∇.If     ≥ ∇, sensor nodes will consider anchor node   as a benign anchor node and utilize   in the localization phase.If     < ∇, sensor nodes will take anchor node   as a malicious anchor node, and   will be revoked before the localization stage.
) (4) Judge whether anchor node   is a benign anchor node.(a)

Table 1 :
Default network configuration parameters.
65%, and 150% in colluding scenario.The BRSL performs much better than other algorithms.Figures12 and 13illustrate the relationship of ALE with the times of network deployment.The number of simulation rounds equals to the times of network deployment.The