# Research on Secure Localization Model Based on Trust Valuation in Wireless Sensor Networks

Authors: Peng Li; Xiaotian Yu; He Xu; Jiewei Qian; Lu Dong; Huqing Nie
Journal: Security and Communication Networks
 (2017)

---

## Abstract

Secure localization has become very important in wireless sensor networks. However, the conventional secure localization algorithms used in wireless sensor networks cannot deal with internal attacks and cannot identify malicious nodes. In this paper, a localization based on trust valuation, which can overcome a various attack types, such as spoofing attacks and Sybil attacks, is presented. The trust valuation is obtained via selection of the property set, which includes estimated distance, localization performance, position information of beacon nodes, and transmission time, and discussion of the threshold in the property set. In addition, the robustness of the proposed model is verified by analysis of attack intensity, localization error, and trust relationship for three typical scenes. The experimental results have shown that the proposed model is superior to the traditional secure localization models in terms of malicious nodes identification and performance improvement.


---

## Body

## 1. Introduction

WSNs (wireless sensor networks) are composed of a large number of static or mobile sensors. Positioning technologies based on WSN [1] estimate the current location of unknown nodes using the cooperation of position nodes and localization algorithm. In the locating, the nodes whose positions are known are called anchor nodes, while the nodes whose positions are unknown are called unknown nodes. The information on distance of anchor nodes and unknown nodes can be obtained via cooperation. Afterwards, that information and the localization algorithm are used to determine the positions of unknown nodes.Due to random deployment and network topology dynamicity, the locating in the WSN is more vulnerable to various attacks [2, 3]. On this basis, the secure localization algorithms are widely used. Namely, they can be divided into three categories [4]: (1) secure localization algorithms based on robust observation; (2) secure localization algorithms based on isolation of malicious beacon node; and (3) secure localization algorithms based on localization verification. In the first group, the upper-bound limitation of the nodes’ distance disables the attack node to reduce the measure distance. In the second group, the beacon nodes are used as checkpoints for mutual monitoring, in order to prevent the false localization. In the third group, a predetermined deployment location combined with a set of neighbor nodes is used to determine whether the localization process is attacked or not. However, these algorithms have different shortcomings [5]. The first group’s algorithms are unable to resist to the attack, which causes the increase of the measured distance. In addition, the algorithms can only roughly confirm whether the unknown node is in certain area or not. The second group relies too much on the base station node, which might cause the base station overload during the processing of a large amount of node information. Namely, the base station becomes the bottleneck of algorithm performance. The third group’s defense capability is greatly influenced by deployment of the nodes. In order to compensate the inadequacy of the above algorithms and to improve their resistance to various attacks, a secure localization model based on trust valuation is designed.The remainder of the paper is organized as follows. Section2 introduces related work. In Section 3, we detail the secure localization model and give the formal description. Section 4 makes some simulation and analysis on secure localization model based on trust valuation. Section 5 concludes the paper.


## 2. Related Works

According to the usage of distance in the positioning, the positioning technologies can be divided into two main categories: distance-based (range-based) positioning technologies and distance-independent (range-free) positioning technologies. In the distance-based positioning algorithms, the absolute distance, or angle, between anchor node and unknown node is required. On the other hand, in distance-independent localization algorithms, there is no need to obtain the exact distance between anchor and unknown nodes. The distance-based localization algorithms usually consist of two steps: firstly, the distance (or angle) is measured, and, secondly, the measured distance is used to calculate the coordinates of unknown node. The distance measurement methods can be divided into following categories: methods based on time, methods based on signal arrival angle, and methods based on received signal strength.The principle of distance-independent localization is simple and easy to implement, and it has advantages in terms of cost and power consumption. Besides, its performance is not affected by environmental factors. These algorithms can be divided into four categories: APTI algorithm, DV-Hop algorithm [6], Amorphous algorithm [7], and N-hop algorithm.In the WSN, the localization algorithm can be attacked in many ways. The attacks can be divided into two categories: internal attacks and external attacks. Four types of external attacks are concerned: Sybil attack [8], selective forwarding attack, wormhole attack, and node capture attack [9–11].Due to limitation on sensor nodes, it is impossible to have a well-integrated defense system in the traditional WSN. The secure localization algorithms intended for WSN need to balance availability and integrity. According to that, the security localization algorithms can be divided into three categories: secure localization algorithms based on robust observation, secure localization algorithms based on isolation of malicious beacon node, and secure localization algorithms based on localization verification.The gradual application of WSN localization caused the appearance of various attack methods [12]. Nowadays, the main secure localization algorithm in the WSN has no ability to deal with the internal attacks and to identify the malicious nodes. Moreover, in the case of nodes compromising, the secure localization cannot be achieved. Thus, the trust management, which has been widely studied in various network environments, is considered as an effective complement to the traditional localization.In 1994, Marsh proposed a model of trust and cooperation for the first time, which has been regarded for a long time as a scope of sociology and psychology. In addition, Marsh introduced the concept of trust relationship formalization. In 1996, Blaze et al. proposed the concept of trust model in order to solve the complex security problems in the Internet [13].The trust management models can be roughly divided into two categories: objective trust management models and subjective trust management models. The objective trust management models abstract the trust value into Boolean value; thus, there are only two possibilities for trust value. Due to the aforementioned, the commonly used trust management models are subjective trust management models. The most popular subjective trust management models are presented in the following.(1) Pervasive Trust Management. Pervasive Trust Management (PTM) represents a subresearch project of the UBISEC project, which defines a dynamic trust model based on a pervasive environment. The method of average weight is used for trust evaluation, and the evaluation result for two interactive entities can be expressed as(1)RA,B=α,α∈0,1,∃RA,B=α∣Gα+⟶RA,B≥α∧Gα-⟶RA,B<α,where α represents the trust value, α+ indicates that trust increases when feedback is positive, and α- indicates that trust decreases when feedback is negative.The disadvantage of this model is that the arithmetic mean is used to calculate the indirect trust degree. In addition, this method processes data roughly and cannot accurately reflect the characteristics of the fuzzy trust value.(2) Hassan’s Model. Hassan’s model is based on vector mechanism. If there are n entities, namely, Q1,Q2,Q3,…,Qn, then, the relationship between entity Qi and other entities can be represented as a trust vector: Qi⃑=(tQiQ1,tQiQ2,…,tQiQi-1,tQiQi+1,tQiQn).The disadvantage of this model is that it is not resistant to the collusion attacks. Namely, malicious nodes can give each other a high trust value.(3) Sun’s Model. Sun’s model is based on entropy; namely, it uses T to express trust relationship, while P represents the probability that the agent nodes take action to the target nodes. The calculation process of trust value used in Sun’s model is shown as(2)T=1-Hp,0.5≤p≤1,Hp-1,0≤p≤0.5,where Hp=-plog2p-(1-p)log21-p represents the entropy function. Then, the trust value is defined by(3)TABC=RABTBC,where TABC represents the trust degree of node A to node C, TBC denotes direct trust value of node B to node C, and RAB denotes the recommendation trust value of node A to node B.The convergence rate of Sun’s model is limited by the length of trust chain, and it is difficult to get the trust value when the trust chain length increases.


## 3. Secure Localization Model Based on Trust Valuation

### 3.1. Trust Valuation Basis

The concepts in trust valuation and roles of nodes are listed as follows.Definition 1.
Comprehensive trust value is based on the localization error and time consumption of the beacon nodes, and it refers to the adoption level of the information provided by the beacon nodes.Definition 2.
Direct trust value refers to the confidence of unknown node in the anchor node, which is directly involved in the localization process.Definition 3.
Indirect trust value refers to the confidence of unknown node in the anchor node based on recommendation from other nodes.Definition 4.
Recommended trust value refers to the confidence of unknown node in the recommended nodes.Definition 5.
Source node represents an unknown node in the localization process.Definition 6.
Target node represents an anchor node needed for the localization.Definition 7.
Recommended nodes represent all nodes used in the localization except source node and target node.


#### 3.1.1. Trust Valuation Framework

In the WSN localization, the unknown nodeN sends the localization request,Loc_req, and the beacon node B, which is within communication range of node N, sends the response,Loc_ack, to node N after receiving of its request. Then, N calculates direct trust value D for node B using the valuation algorithm. Other beacon nodes, which are within the communication range of node N, form the recommended node set defined as R={B1,B2,…,Bi}. In order to get indirect trust value of node B, node N calculates the recommended trust value of nodes in R. Therefore, the indirect trust value of node B for node N is obtained and labeled as M. According to all mentioned, the comprehensive trust value is defined as(4)C=αD+βM,where α and β represent weight coefficients of direct and recommended trust values, respectively, and C represents the comprehensive trust value. The frame diagram of trust validation is shown in Figure 1.Figure 1
Frame diagram of trust validation.


#### 3.1.2. Direct Trust

According to the multidimensional decision theory [14], the direct trust of source node for target node consists of n attributes that form a set of attributes S={p1,p2,…,pi,…,pn}(0≤pi≤1).Each attribute value has different influence on calculation of direct trust value; thus, the weight vector is defined asV={v1,v2,…,vi,…,vn}  (0≤vi≤1, ∑i=1nvi=1). Moreover, the time decay function, T(k), defined by (5), is used to calculate the direct trust value:(5)Tk=0k=0,1k=1,Tk-1-12k-11≤k≤n.Based on the above function, thekth calculation of direct trust value is obtained. The direct trust value function is defined by(6)Wkp,v=Tk×∑i=1nvi×pi.All previous direct trust values are combined in order to obtain the final result:(7)Dxy=∏k=1nWkp,v,where Dxy indicates the direct trust value of the source node x for target node y. The difference between direct trust values of attack node and normal node is enlarged by this calculation method. In case of attack, the node is close to zero according to the calculated Wk(p,v) value, and the node will be abandoned.


#### 3.1.3. Indirect Trust and Recommended Trust

The trust model is composed of three types of nodes, the source node, the target node, and the recommended node, which form the trust chain as shown in Figure2.Figure 2
Trust chain.In Figure2, S, R, and O represent the source node, the recommended node, and the target node, respectively, while I and D indicate the recommended trust value and the direct trust value, respectively.Received Signal Strength Indicator (RSSI) represents the strength of the received signal [15], with the RSSI signal attenuation model in WSN defined by(8)RSSId=C0-10λlog10d,where RSSId represents the signal strength at distance d from the transmitter, C0 indicates the signal strength reference value from the transmitter, and λ denotes the path loss factor.Due to the influence of environmental noise, there may be errors when measuring RSSI. Thus, (8) can be modified to(9)RSSId=C0-10λlog10d+E,where the measurement error E follows the normal distribution defined by(10)E~N0,σ2,where σ is random variable changes depending on the existing environment [16].Some experiments were carried out in article [17], in order to describe the relationship between the RSSI error and the corresponding distance. It adopts regular pattern as the communication model, and the communication radius of the nodes is 20 m. The distance between two nodes is fixed and RSSI values are observed 100 times. It repeats the observation of RSSI value as the distance between two nodes increases; it comes to the conclusion as shown in Figure 3.Figure 3
Relationship between distance and error.As can be seen from Figure3, the error of RSSI gradually increases with the increasing of distance within communication range. However, the error decreases gradually when distance is beyond the scope of communication. Since the distance is calculated according to the RSSI value, the variation law of distance error is coincident with RSSI error. Thus we get Theorem 8.Theorem 8.
The error, that is, the difference between measured and actual distance values, increases with the increase of distance between nodes [18].According to Theorem8, three anchor nodes that are closest to the target node will be selected as recommended nodes and labeled as Rl, Rm, and Rn. Recommendation trust value is then defined as(11)Ixyk,s,n=12i=1,1+∑i=1nTk×si2+ni>1,where n denotes the total number of nodes that participate in the trust calculation and si represents the Boolean value that indicates whether the node is being trusted in calculation of direct trust. The initial value of the recommended trust value is 1/2. After a certain period, the value fluctuates due to performance of recommended node.Finally, the indirect trust value is obtained by(12)Mxyk,s,n,p,v=Ixuk,s,n×Duyp,v+Ixvk,s,n×Dvyp,v+Ixwk,s,n×Dwyp,v3.


#### 3.1.4. Comprehensive Trust

Based on direct and indirect trust values, the comprehensive trust value of the source node for the target node is obtained, namely,C=αD+βM. Similar to that in the ordinary trust valuation, α and β are generally considered as fixed values; thus, the trust model has no dynamic adaptability. Therefore, an adjustment method based on information entropy theory [19] is proposed.In the calculation of comprehensive trust value, the information entropy of direct trust value is defined by(13)Hsd=∑i=1npiIε=-∑i=1npilog2pi=-Dxyp,v×log2Dxyp,v-1-Dxyp,v×log21-Dxyp,v.Similarly, the information entropy of indirect trust value is defined by(14)Hsm=∑i=1npiIe=-∑i=1npilog2pi=-Mxyk,s,n,p,v×log2Mxyk,s,n,p,v-1-Mxyk,s,n,p,v×log21-Mxyk,s,n,p,v.Through the calculation of direct and indirect trust values of information entropy, the certain information can be acquired. The weight distribution is obtained as(15)α=HsmHsd+Hsm,β=HsdHsd+Hsm.


### 3.2. Key Technologies

#### 3.2.1. Attribute Set Selection

(1) Distance Measurement. The difference between measured and actual distances in the WSN positioning obeys to the normal distribution [20]. Therefore, the error function can be defined by(16)σNd=ae-d-d02/b2,where σNd refers to the Gaussian function of distance d. When d=d0, the measurement error reaches its maximal value. In summary, the p1 attribute of the measured distance value is defined as(17)p1d=dd0d≤d0,d-d0d0d>d0.(2) Localization PerformanceDefinition 9.
The unknown node’s location reference set is defined asR=(x1,y1,d1), x2,y2,d2,…,(xi,yi,di),…,(xn,yn,dn), where (xi,yi) represents the coordinates set of the anchor node i and di is the distance between anchor node i and unknown node.Definition 10.
The residual represents the deviation of observed distance value and real distance value, and the total localization residual is defined as(18)σsum=∑i=1nx-xi2+y-yi2-di,where x and y represent the measured coordinates of unknown node, xi, and yi denote the coordinates of anchor node, and di is measured distance between beacon node i and unknown node.In (18), the coordinates x and y are obtained by the least square method and the least squares regression model [21, 22], while the estimation function is defined by(19)di2=x-xi2+y-yi2+η,x,y=arg⁡min∑i=1nxi-x02+yi-y02-di2,where η is the measurement error and η~U(-ε,ε) [23], while ε is the maximal measurement error defined as(20)max⁡di-xi-x2+yi-y2≤ε.The residuals are used to indicate the degree of each node’s deviation from its true location. The mean residual error is defined as(21)ρ=σsumn≤ξ,where n represents the number of anchor nodes involved in positioning. In order to define a threshold, value of ε is needed. When the mean residual error is smaller than the threshold value, the localization result is considered as consistent. Otherwise, the presence of malicious nodes is indicated. The attribute value of localization performance p2 is defined as(22)p2=ρζ,ρ≤ζ,0,ρ>ζ.(3) Detection of Anchor Node Position. Based on (22), the major attacks can be filtered by comprehensive trust value. Nevertheless, in the case of Sybil attack, the above attribute value is not enough to fight against the attack.Definition 11.
The concept of Sybil attack in the WSN indicates that a single node has a multiple identity.
The RSSI signal attenuation model in WSN environment is defined by (8).
According to the attenuation model, the distance ratio can be deduced as(23)dridrj=10RSSIdri-RSSIdrj/10λ,where dri is the distance between receiver and transmitter. From (23), it can be concluded that the distance ratio is related only to the RSSI difference. Therefore, (23) can be rewritten as(24)dridrj=fRSSIdri-RSSIdrj.Based on the above analyses, we know that if the distance between receiver and transmitter is constant, the RSSI difference is stable. The positioning in the case of Sybil attack is presented in Figure4.Figure 4
Localization in the case of Sybil attack.In Figure4, p is an unknown node, q is an auxiliary judgment node, and r1, r2, r3, and r4 denote the false localization information, while the anchor node r is the attacked node. The RSSI value is affected by environment; thus, the measured distance between node r and node p will change according to the RSSI fluctuation. Therefore, the auxiliary node q is introduced. According to the above analysis, the difference between RSSIdrp and RSSIdrq is stable. Thus, according to (23), the value of drq/drp remains stable.The coordinates ofq are (xq,yq), the coordinates of p are (xp,yp), and the coordinates of r are (xr,yr).(1) When k=±1, (26) can be simplified as (23). According to the form of (27), it can be concluded that the equation represents a straight line.(2) When k≠±1, (26) can be simplified as (28).The discriminant of circle defined asD2+E2-4F is substituted into (29).Whenk≠±1, the result is always greater than zero. In summary, the trajectory of r is a circle or a straight line.According to the above conclusions, the difference of RSSI is stable only when the faked nodes are distributed strictly in standard circle or straight line. Therefore the difference betweenRSSIdrp and RSSIdrq can be used against the witch attack.At time momentt1, node p is an unknown node, nodes q and r are the auxiliary nodes, and nodes s, t are the anchor nodes. In the following moments, t2 and t3, RSSI is detected by these values.Definition 12.
(25)
d
i
f
f
t
1
p
,
q
,
r
=
R
S
S
I
d
r
p
-
R
S
S
I
d
r
q
when the current moment is
t
1
,
d
i
f
f
t
1
p
,
q
,
r
,
s
,
t
=
m
a
x
diff
t
1
p
,
q
,
s
-
d
i
f
f
t
1
p
,
q
,
t
,
d
i
f
f
t
1
p
,
q
,
s
-
diff
t
1
p
,
q
,
t
,
d
i
f
f
t
1
p
,
q
,
s
-
diff
t
1
p
,
q
,
t
,
d
i
f
f
p
,
q
,
r
,
s
,
t
=
max
⁡
d
i
f
f
t
n
p
,
q
,
r
,
s
,
t
1
≤
n
≤
3
.Thus, the definition of attribute valuep3 is defined as (30).(26)xr-xq2+yr-yq2xr-xp2+yr-yp2=k⟹xr-xq2+yr-yq2=k2xr-xp2+yr-yp2⟹k2-1xr2+k2-1yr2-2xrxq-k2xp-2yryq-k2yp=k2xp2+yp2-xq2+yq2,(27)yr=xp-xqyq-ypxr+xq2+yq2-xp2-yp22yq-yp,(28)xr2+yr2-2xq-k2xpk2-1xr+2yq-k2yqk2-1yr+xq2+yq2-k2xp2+yp2k2-1=0,(29)4xq-k2xp2k2-12+4yq-k2yp2k2-12-4xq2+yq2-4k2xp2+yp2k2-1⟹4xq2-8k2xqxp+4k4xp2+4yq2-8k2yqyp+4k4yp2k2-12-4xq2+yq2-4k2xp2+yp2k2-1⟹8xq2-8k2xqxp+8yq2-8k2yqyp-4k2xq2-4k2yq2+4k2xp2+4k2yp2k2-12⟹4k2yp-yq2+4k2xp-xq2+1+k28xq2+8yq2k2-12,(30)p3=diffp,q,r,s,tτdiffp,q,r,s,t≤τ,1diffp,q,r,s,t>τ.(4) Transit Time Detection. As it is well known, there are many attacks in the WSN [24, 25], which mainly consist of replayed attacks, Sybil attacks, and wormhole attacks. In these attacks, the certain time is needed to tamper the information. As a result, the time used for positioning will increase. Figure 5 represents the node communication process.Figure 5
Communication process between nodes.Nodep is the source node, while node q is the target node. The observation time of the target node is T=t3-t2. Before positioning, the n group of experiment were conducted. In the experiments, a set of times T was obtained. The maximum value Tmax was selected from the set.Based on the experimental results, the definition of attribute valuep is obtained by(31)p4=0T>Tmax,TTmaxT≤Tmax.


#### 3.2.2. Discussion on Threshold

In Section3.2.1, the attribute set selection and calculation processes are presented. Equations (20), (21), and. (26) are all crucial for the threshold. According to (20), the threshold ε and the maximal measurement error should be discussed.In the environment without obstacles, according to Definition9, the localization error follows the normal distribution defined by(32)dE~N0,σ2.The second parameter of normal distribution is determined in the literature [26]. The relationship between the parameter σ and the distance d can be fitted into the Gaussian function shown as(33)σd=ae-d-d02/b2.According to the above analysis, when distance between unknown node and anchor node isd0, the standard deviation of the distance error reaches the maximum. Therefore, the maximal deviation value between measured and calculated distances can be used as a threshold. The positioning in the presence of obstacles is presented in Figure 6.Figure 6
Localization in the presence of obstacles.In Figure6, M represents an obstacle between the anchor node p3 and the unknown node q. According to the trilateral localization algorithm principle, when the RSSI is much smaller than the normal value, the localization fails.In the case of localization failure, the RSSI values of the nodes areRSSI(p1q), RSSI(p2q), RSSI(p3q), RSSI(p1p2), RSSI(p2p3), and RSSI(p1p3). Because RSSI(p3q) is much smaller than the normal value, the distance calculated by the distance attenuation model is larger than distance of p3q.Ifp3q>p1p3+p1q and p3q>p2p3+p2q, there is a barrier between node q and node p3. In the environment with obstacles, the distance between two nodes, which are affected by the obstacles, is the maximal distance between the obstacles. The maximal measurement error can be obtained by derivations as(34)cos⁡∠p3p1p2=p1p32+p1p22-p2p322p1p3×p1p2,cos⁡∠qp1p2=p1q2+p1p22-p2q22p1q×p1p2.At the same time, (35) can be obtained:(35)cos⁡∠p3p1q=cos⁡∠p3p1p2cos⁡∠qp1p2+sin⁡∠p3p1p2sin⁡∠qp1p2.According to the values ofcos⁡(∠p3p1q), p1p3 and p1q, p3q can be obtained by(36)p3q=p1q2+p1p32-2p1q×p1p3×cos⁡p3p1q.In an environment with obstacles,ε=dp3q-p3q. dp3q is the distance value obtained by distance attenuation model.In (21), ρ=σsum/n≤ξ, and threshold ξ is a mean residual.Definition 13.
In the WSN positioning, the reference node set isLoc_refer = {l1,l2,l3,l4,ln}, and the information frame format of each reference node is (xi,yi,drssii), wherein (xi,yi) are the reference node coordinates, and drssii is the distance between reference node and unknown node.According to Definition13, the localization error of each reference node in the security localization can be obtained by(37)ei=drssii-xi-x2+yi-y2,where ei is the localization error of each reference node, and (x,y) refers to the actual position of the unknown node.(38)pn=∑i=1nein.In (38), pn represents the average localization error, and ei obeys the normal distribution; thus pn also obeys the normal distribution. In the experimental environment, the mean μ and the variance σ of the pn were obtained by the actual measurement.According to the central limit theorem [27], when n→∞, the distribution function of Yn=∑k=1npk-nμ0/nσ0 obeys the standard normal distribution, where μ0=μ,  σ0=nσ. If qn is equal to n∗pn, then we may get(39)limn→∞⁡pqn-μ0σ0≤x=Φx.Based on the above conclusions, (40) can be obtained:(40)limn→∞⁡Pp≤ξ=limn→∞⁡Pqn≤nξ=limn→∞⁡qn-μ0σ0≤nξ-μ0σ0=Φnξ-μ0σ0.According to (40), the standard normal distribution can be obtained. Therefore, the standard normal distribution table can be used to set the appropriate threshold ξ in different environments.


#### 3.2.3. Localization Process

According to the trust valuation model, the trust value of each anchor node can be obtained in the communication range of the unknown node. Three anchor nodes with the largest value of trust are used for computing.Trilateral-centroid localization [28] is used for unknown node localization. The unknown node is N, and the three beacon nodes are B1, B2, B3. Trilateral-centroid localization is shown in Figure 7.Figure 7
Trilateral-centroid localization.The coordinates of three anchor nodes are (x1,y1), (x2,y2), and (x3,y3). Unknown node coordinate is (x,y). Measurement distance values are d1, d2, and d3. Equation (41) can be listed according to Figure 7:(41)x-x12+y-y12=d1,x-x22+y-y22=d2,x-x32+y-y32=d3.According to (38) and the least square method, unknown node coordinates can be obtained as follows [29]:(42)xy=2x1-x32y1-y32x2-x32y2-y3-1x12-x32+y12-y32+d32-d12x22-x32+y22-y32+d32-d22.In addition, due to the presence of measurement errors, in some cases, the equations may not be solvable (as shown in Figure7). In this case, the center of triangle is formed by the intersection of all circles, taken as the coordinates of the unknown point.There are six intersections among three circles in Figure8. The coordinates of the three intersection points which are close to the unknown nodes are (x1,y1), (x2,y2), and (x3,y3). The coordinates of the estimated position of the unknown node are (x,y). Thus we can calculate (x,y) via(43)x,y=x1+x2+x33,y1+y2+y33.Figure 8
Trilateral-centroid localization.


## 3.1. Trust Valuation Basis

The concepts in trust valuation and roles of nodes are listed as follows.Definition 1.
Comprehensive trust value is based on the localization error and time consumption of the beacon nodes, and it refers to the adoption level of the information provided by the beacon nodes.Definition 2.
Direct trust value refers to the confidence of unknown node in the anchor node, which is directly involved in the localization process.Definition 3.
Indirect trust value refers to the confidence of unknown node in the anchor node based on recommendation from other nodes.Definition 4.
Recommended trust value refers to the confidence of unknown node in the recommended nodes.Definition 5.
Source node represents an unknown node in the localization process.Definition 6.
Target node represents an anchor node needed for the localization.Definition 7.
Recommended nodes represent all nodes used in the localization except source node and target node.


### 3.1.1. Trust Valuation Framework

In the WSN localization, the unknown nodeN sends the localization request,Loc_req, and the beacon node B, which is within communication range of node N, sends the response,Loc_ack, to node N after receiving of its request. Then, N calculates direct trust value D for node B using the valuation algorithm. Other beacon nodes, which are within the communication range of node N, form the recommended node set defined as R={B1,B2,…,Bi}. In order to get indirect trust value of node B, node N calculates the recommended trust value of nodes in R. Therefore, the indirect trust value of node B for node N is obtained and labeled as M. According to all mentioned, the comprehensive trust value is defined as(4)C=αD+βM,where α and β represent weight coefficients of direct and recommended trust values, respectively, and C represents the comprehensive trust value. The frame diagram of trust validation is shown in Figure 1.Figure 1
Frame diagram of trust validation.


### 3.1.2. Direct Trust

According to the multidimensional decision theory [14], the direct trust of source node for target node consists of n attributes that form a set of attributes S={p1,p2,…,pi,…,pn}(0≤pi≤1).Each attribute value has different influence on calculation of direct trust value; thus, the weight vector is defined asV={v1,v2,…,vi,…,vn}  (0≤vi≤1, ∑i=1nvi=1). Moreover, the time decay function, T(k), defined by (5), is used to calculate the direct trust value:(5)Tk=0k=0,1k=1,Tk-1-12k-11≤k≤n.Based on the above function, thekth calculation of direct trust value is obtained. The direct trust value function is defined by(6)Wkp,v=Tk×∑i=1nvi×pi.All previous direct trust values are combined in order to obtain the final result:(7)Dxy=∏k=1nWkp,v,where Dxy indicates the direct trust value of the source node x for target node y. The difference between direct trust values of attack node and normal node is enlarged by this calculation method. In case of attack, the node is close to zero according to the calculated Wk(p,v) value, and the node will be abandoned.


### 3.1.3. Indirect Trust and Recommended Trust

The trust model is composed of three types of nodes, the source node, the target node, and the recommended node, which form the trust chain as shown in Figure2.Figure 2
Trust chain.In Figure2, S, R, and O represent the source node, the recommended node, and the target node, respectively, while I and D indicate the recommended trust value and the direct trust value, respectively.Received Signal Strength Indicator (RSSI) represents the strength of the received signal [15], with the RSSI signal attenuation model in WSN defined by(8)RSSId=C0-10λlog10d,where RSSId represents the signal strength at distance d from the transmitter, C0 indicates the signal strength reference value from the transmitter, and λ denotes the path loss factor.Due to the influence of environmental noise, there may be errors when measuring RSSI. Thus, (8) can be modified to(9)RSSId=C0-10λlog10d+E,where the measurement error E follows the normal distribution defined by(10)E~N0,σ2,where σ is random variable changes depending on the existing environment [16].Some experiments were carried out in article [17], in order to describe the relationship between the RSSI error and the corresponding distance. It adopts regular pattern as the communication model, and the communication radius of the nodes is 20 m. The distance between two nodes is fixed and RSSI values are observed 100 times. It repeats the observation of RSSI value as the distance between two nodes increases; it comes to the conclusion as shown in Figure 3.Figure 3
Relationship between distance and error.As can be seen from Figure3, the error of RSSI gradually increases with the increasing of distance within communication range. However, the error decreases gradually when distance is beyond the scope of communication. Since the distance is calculated according to the RSSI value, the variation law of distance error is coincident with RSSI error. Thus we get Theorem 8.Theorem 8.
The error, that is, the difference between measured and actual distance values, increases with the increase of distance between nodes [18].According to Theorem8, three anchor nodes that are closest to the target node will be selected as recommended nodes and labeled as Rl, Rm, and Rn. Recommendation trust value is then defined as(11)Ixyk,s,n=12i=1,1+∑i=1nTk×si2+ni>1,where n denotes the total number of nodes that participate in the trust calculation and si represents the Boolean value that indicates whether the node is being trusted in calculation of direct trust. The initial value of the recommended trust value is 1/2. After a certain period, the value fluctuates due to performance of recommended node.Finally, the indirect trust value is obtained by(12)Mxyk,s,n,p,v=Ixuk,s,n×Duyp,v+Ixvk,s,n×Dvyp,v+Ixwk,s,n×Dwyp,v3.


### 3.1.4. Comprehensive Trust

Based on direct and indirect trust values, the comprehensive trust value of the source node for the target node is obtained, namely,C=αD+βM. Similar to that in the ordinary trust valuation, α and β are generally considered as fixed values; thus, the trust model has no dynamic adaptability. Therefore, an adjustment method based on information entropy theory [19] is proposed.In the calculation of comprehensive trust value, the information entropy of direct trust value is defined by(13)Hsd=∑i=1npiIε=-∑i=1npilog2pi=-Dxyp,v×log2Dxyp,v-1-Dxyp,v×log21-Dxyp,v.Similarly, the information entropy of indirect trust value is defined by(14)Hsm=∑i=1npiIe=-∑i=1npilog2pi=-Mxyk,s,n,p,v×log2Mxyk,s,n,p,v-1-Mxyk,s,n,p,v×log21-Mxyk,s,n,p,v.Through the calculation of direct and indirect trust values of information entropy, the certain information can be acquired. The weight distribution is obtained as(15)α=HsmHsd+Hsm,β=HsdHsd+Hsm.


## 3.1.1. Trust Valuation Framework

In the WSN localization, the unknown nodeN sends the localization request,Loc_req, and the beacon node B, which is within communication range of node N, sends the response,Loc_ack, to node N after receiving of its request. Then, N calculates direct trust value D for node B using the valuation algorithm. Other beacon nodes, which are within the communication range of node N, form the recommended node set defined as R={B1,B2,…,Bi}. In order to get indirect trust value of node B, node N calculates the recommended trust value of nodes in R. Therefore, the indirect trust value of node B for node N is obtained and labeled as M. According to all mentioned, the comprehensive trust value is defined as(4)C=αD+βM,where α and β represent weight coefficients of direct and recommended trust values, respectively, and C represents the comprehensive trust value. The frame diagram of trust validation is shown in Figure 1.Figure 1
Frame diagram of trust validation.


## 3.1.2. Direct Trust

According to the multidimensional decision theory [14], the direct trust of source node for target node consists of n attributes that form a set of attributes S={p1,p2,…,pi,…,pn}(0≤pi≤1).Each attribute value has different influence on calculation of direct trust value; thus, the weight vector is defined asV={v1,v2,…,vi,…,vn}  (0≤vi≤1, ∑i=1nvi=1). Moreover, the time decay function, T(k), defined by (5), is used to calculate the direct trust value:(5)Tk=0k=0,1k=1,Tk-1-12k-11≤k≤n.Based on the above function, thekth calculation of direct trust value is obtained. The direct trust value function is defined by(6)Wkp,v=Tk×∑i=1nvi×pi.All previous direct trust values are combined in order to obtain the final result:(7)Dxy=∏k=1nWkp,v,where Dxy indicates the direct trust value of the source node x for target node y. The difference between direct trust values of attack node and normal node is enlarged by this calculation method. In case of attack, the node is close to zero according to the calculated Wk(p,v) value, and the node will be abandoned.


## 3.1.3. Indirect Trust and Recommended Trust

The trust model is composed of three types of nodes, the source node, the target node, and the recommended node, which form the trust chain as shown in Figure2.Figure 2
Trust chain.In Figure2, S, R, and O represent the source node, the recommended node, and the target node, respectively, while I and D indicate the recommended trust value and the direct trust value, respectively.Received Signal Strength Indicator (RSSI) represents the strength of the received signal [15], with the RSSI signal attenuation model in WSN defined by(8)RSSId=C0-10λlog10d,where RSSId represents the signal strength at distance d from the transmitter, C0 indicates the signal strength reference value from the transmitter, and λ denotes the path loss factor.Due to the influence of environmental noise, there may be errors when measuring RSSI. Thus, (8) can be modified to(9)RSSId=C0-10λlog10d+E,where the measurement error E follows the normal distribution defined by(10)E~N0,σ2,where σ is random variable changes depending on the existing environment [16].Some experiments were carried out in article [17], in order to describe the relationship between the RSSI error and the corresponding distance. It adopts regular pattern as the communication model, and the communication radius of the nodes is 20 m. The distance between two nodes is fixed and RSSI values are observed 100 times. It repeats the observation of RSSI value as the distance between two nodes increases; it comes to the conclusion as shown in Figure 3.Figure 3
Relationship between distance and error.As can be seen from Figure3, the error of RSSI gradually increases with the increasing of distance within communication range. However, the error decreases gradually when distance is beyond the scope of communication. Since the distance is calculated according to the RSSI value, the variation law of distance error is coincident with RSSI error. Thus we get Theorem 8.Theorem 8.
The error, that is, the difference between measured and actual distance values, increases with the increase of distance between nodes [18].According to Theorem8, three anchor nodes that are closest to the target node will be selected as recommended nodes and labeled as Rl, Rm, and Rn. Recommendation trust value is then defined as(11)Ixyk,s,n=12i=1,1+∑i=1nTk×si2+ni>1,where n denotes the total number of nodes that participate in the trust calculation and si represents the Boolean value that indicates whether the node is being trusted in calculation of direct trust. The initial value of the recommended trust value is 1/2. After a certain period, the value fluctuates due to performance of recommended node.Finally, the indirect trust value is obtained by(12)Mxyk,s,n,p,v=Ixuk,s,n×Duyp,v+Ixvk,s,n×Dvyp,v+Ixwk,s,n×Dwyp,v3.


## 3.1.4. Comprehensive Trust

Based on direct and indirect trust values, the comprehensive trust value of the source node for the target node is obtained, namely,C=αD+βM. Similar to that in the ordinary trust valuation, α and β are generally considered as fixed values; thus, the trust model has no dynamic adaptability. Therefore, an adjustment method based on information entropy theory [19] is proposed.In the calculation of comprehensive trust value, the information entropy of direct trust value is defined by(13)Hsd=∑i=1npiIε=-∑i=1npilog2pi=-Dxyp,v×log2Dxyp,v-1-Dxyp,v×log21-Dxyp,v.Similarly, the information entropy of indirect trust value is defined by(14)Hsm=∑i=1npiIe=-∑i=1npilog2pi=-Mxyk,s,n,p,v×log2Mxyk,s,n,p,v-1-Mxyk,s,n,p,v×log21-Mxyk,s,n,p,v.Through the calculation of direct and indirect trust values of information entropy, the certain information can be acquired. The weight distribution is obtained as(15)α=HsmHsd+Hsm,β=HsdHsd+Hsm.


## 3.2. Key Technologies

### 3.2.1. Attribute Set Selection

(1) Distance Measurement. The difference between measured and actual distances in the WSN positioning obeys to the normal distribution [20]. Therefore, the error function can be defined by(16)σNd=ae-d-d02/b2,where σNd refers to the Gaussian function of distance d. When d=d0, the measurement error reaches its maximal value. In summary, the p1 attribute of the measured distance value is defined as(17)p1d=dd0d≤d0,d-d0d0d>d0.(2) Localization PerformanceDefinition 9.
The unknown node’s location reference set is defined asR=(x1,y1,d1), x2,y2,d2,…,(xi,yi,di),…,(xn,yn,dn), where (xi,yi) represents the coordinates set of the anchor node i and di is the distance between anchor node i and unknown node.Definition 10.
The residual represents the deviation of observed distance value and real distance value, and the total localization residual is defined as(18)σsum=∑i=1nx-xi2+y-yi2-di,where x and y represent the measured coordinates of unknown node, xi, and yi denote the coordinates of anchor node, and di is measured distance between beacon node i and unknown node.In (18), the coordinates x and y are obtained by the least square method and the least squares regression model [21, 22], while the estimation function is defined by(19)di2=x-xi2+y-yi2+η,x,y=arg⁡min∑i=1nxi-x02+yi-y02-di2,where η is the measurement error and η~U(-ε,ε) [23], while ε is the maximal measurement error defined as(20)max⁡di-xi-x2+yi-y2≤ε.The residuals are used to indicate the degree of each node’s deviation from its true location. The mean residual error is defined as(21)ρ=σsumn≤ξ,where n represents the number of anchor nodes involved in positioning. In order to define a threshold, value of ε is needed. When the mean residual error is smaller than the threshold value, the localization result is considered as consistent. Otherwise, the presence of malicious nodes is indicated. The attribute value of localization performance p2 is defined as(22)p2=ρζ,ρ≤ζ,0,ρ>ζ.(3) Detection of Anchor Node Position. Based on (22), the major attacks can be filtered by comprehensive trust value. Nevertheless, in the case of Sybil attack, the above attribute value is not enough to fight against the attack.Definition 11.
The concept of Sybil attack in the WSN indicates that a single node has a multiple identity.
The RSSI signal attenuation model in WSN environment is defined by (8).
According to the attenuation model, the distance ratio can be deduced as(23)dridrj=10RSSIdri-RSSIdrj/10λ,where dri is the distance between receiver and transmitter. From (23), it can be concluded that the distance ratio is related only to the RSSI difference. Therefore, (23) can be rewritten as(24)dridrj=fRSSIdri-RSSIdrj.Based on the above analyses, we know that if the distance between receiver and transmitter is constant, the RSSI difference is stable. The positioning in the case of Sybil attack is presented in Figure4.Figure 4
Localization in the case of Sybil attack.In Figure4, p is an unknown node, q is an auxiliary judgment node, and r1, r2, r3, and r4 denote the false localization information, while the anchor node r is the attacked node. The RSSI value is affected by environment; thus, the measured distance between node r and node p will change according to the RSSI fluctuation. Therefore, the auxiliary node q is introduced. According to the above analysis, the difference between RSSIdrp and RSSIdrq is stable. Thus, according to (23), the value of drq/drp remains stable.The coordinates ofq are (xq,yq), the coordinates of p are (xp,yp), and the coordinates of r are (xr,yr).(1) When k=±1, (26) can be simplified as (23). According to the form of (27), it can be concluded that the equation represents a straight line.(2) When k≠±1, (26) can be simplified as (28).The discriminant of circle defined asD2+E2-4F is substituted into (29).Whenk≠±1, the result is always greater than zero. In summary, the trajectory of r is a circle or a straight line.According to the above conclusions, the difference of RSSI is stable only when the faked nodes are distributed strictly in standard circle or straight line. Therefore the difference betweenRSSIdrp and RSSIdrq can be used against the witch attack.At time momentt1, node p is an unknown node, nodes q and r are the auxiliary nodes, and nodes s, t are the anchor nodes. In the following moments, t2 and t3, RSSI is detected by these values.Definition 12.
(25)
d
i
f
f
t
1
p
,
q
,
r
=
R
S
S
I
d
r
p
-
R
S
S
I
d
r
q
when the current moment is
t
1
,
d
i
f
f
t
1
p
,
q
,
r
,
s
,
t
=
m
a
x
diff
t
1
p
,
q
,
s
-
d
i
f
f
t
1
p
,
q
,
t
,
d
i
f
f
t
1
p
,
q
,
s
-
diff
t
1
p
,
q
,
t
,
d
i
f
f
t
1
p
,
q
,
s
-
diff
t
1
p
,
q
,
t
,
d
i
f
f
p
,
q
,
r
,
s
,
t
=
max
⁡
d
i
f
f
t
n
p
,
q
,
r
,
s
,
t
1
≤
n
≤
3
.Thus, the definition of attribute valuep3 is defined as (30).(26)xr-xq2+yr-yq2xr-xp2+yr-yp2=k⟹xr-xq2+yr-yq2=k2xr-xp2+yr-yp2⟹k2-1xr2+k2-1yr2-2xrxq-k2xp-2yryq-k2yp=k2xp2+yp2-xq2+yq2,(27)yr=xp-xqyq-ypxr+xq2+yq2-xp2-yp22yq-yp,(28)xr2+yr2-2xq-k2xpk2-1xr+2yq-k2yqk2-1yr+xq2+yq2-k2xp2+yp2k2-1=0,(29)4xq-k2xp2k2-12+4yq-k2yp2k2-12-4xq2+yq2-4k2xp2+yp2k2-1⟹4xq2-8k2xqxp+4k4xp2+4yq2-8k2yqyp+4k4yp2k2-12-4xq2+yq2-4k2xp2+yp2k2-1⟹8xq2-8k2xqxp+8yq2-8k2yqyp-4k2xq2-4k2yq2+4k2xp2+4k2yp2k2-12⟹4k2yp-yq2+4k2xp-xq2+1+k28xq2+8yq2k2-12,(30)p3=diffp,q,r,s,tτdiffp,q,r,s,t≤τ,1diffp,q,r,s,t>τ.(4) Transit Time Detection. As it is well known, there are many attacks in the WSN [24, 25], which mainly consist of replayed attacks, Sybil attacks, and wormhole attacks. In these attacks, the certain time is needed to tamper the information. As a result, the time used for positioning will increase. Figure 5 represents the node communication process.Figure 5
Communication process between nodes.Nodep is the source node, while node q is the target node. The observation time of the target node is T=t3-t2. Before positioning, the n group of experiment were conducted. In the experiments, a set of times T was obtained. The maximum value Tmax was selected from the set.Based on the experimental results, the definition of attribute valuep is obtained by(31)p4=0T>Tmax,TTmaxT≤Tmax.


### 3.2.2. Discussion on Threshold

In Section3.2.1, the attribute set selection and calculation processes are presented. Equations (20), (21), and. (26) are all crucial for the threshold. According to (20), the threshold ε and the maximal measurement error should be discussed.In the environment without obstacles, according to Definition9, the localization error follows the normal distribution defined by(32)dE~N0,σ2.The second parameter of normal distribution is determined in the literature [26]. The relationship between the parameter σ and the distance d can be fitted into the Gaussian function shown as(33)σd=ae-d-d02/b2.According to the above analysis, when distance between unknown node and anchor node isd0, the standard deviation of the distance error reaches the maximum. Therefore, the maximal deviation value between measured and calculated distances can be used as a threshold. The positioning in the presence of obstacles is presented in Figure 6.Figure 6
Localization in the presence of obstacles.In Figure6, M represents an obstacle between the anchor node p3 and the unknown node q. According to the trilateral localization algorithm principle, when the RSSI is much smaller than the normal value, the localization fails.In the case of localization failure, the RSSI values of the nodes areRSSI(p1q), RSSI(p2q), RSSI(p3q), RSSI(p1p2), RSSI(p2p3), and RSSI(p1p3). Because RSSI(p3q) is much smaller than the normal value, the distance calculated by the distance attenuation model is larger than distance of p3q.Ifp3q>p1p3+p1q and p3q>p2p3+p2q, there is a barrier between node q and node p3. In the environment with obstacles, the distance between two nodes, which are affected by the obstacles, is the maximal distance between the obstacles. The maximal measurement error can be obtained by derivations as(34)cos⁡∠p3p1p2=p1p32+p1p22-p2p322p1p3×p1p2,cos⁡∠qp1p2=p1q2+p1p22-p2q22p1q×p1p2.At the same time, (35) can be obtained:(35)cos⁡∠p3p1q=cos⁡∠p3p1p2cos⁡∠qp1p2+sin⁡∠p3p1p2sin⁡∠qp1p2.According to the values ofcos⁡(∠p3p1q), p1p3 and p1q, p3q can be obtained by(36)p3q=p1q2+p1p32-2p1q×p1p3×cos⁡p3p1q.In an environment with obstacles,ε=dp3q-p3q. dp3q is the distance value obtained by distance attenuation model.In (21), ρ=σsum/n≤ξ, and threshold ξ is a mean residual.Definition 13.
In the WSN positioning, the reference node set isLoc_refer = {l1,l2,l3,l4,ln}, and the information frame format of each reference node is (xi,yi,drssii), wherein (xi,yi) are the reference node coordinates, and drssii is the distance between reference node and unknown node.According to Definition13, the localization error of each reference node in the security localization can be obtained by(37)ei=drssii-xi-x2+yi-y2,where ei is the localization error of each reference node, and (x,y) refers to the actual position of the unknown node.(38)pn=∑i=1nein.In (38), pn represents the average localization error, and ei obeys the normal distribution; thus pn also obeys the normal distribution. In the experimental environment, the mean μ and the variance σ of the pn were obtained by the actual measurement.According to the central limit theorem [27], when n→∞, the distribution function of Yn=∑k=1npk-nμ0/nσ0 obeys the standard normal distribution, where μ0=μ,  σ0=nσ. If qn is equal to n∗pn, then we may get(39)limn→∞⁡pqn-μ0σ0≤x=Φx.Based on the above conclusions, (40) can be obtained:(40)limn→∞⁡Pp≤ξ=limn→∞⁡Pqn≤nξ=limn→∞⁡qn-μ0σ0≤nξ-μ0σ0=Φnξ-μ0σ0.According to (40), the standard normal distribution can be obtained. Therefore, the standard normal distribution table can be used to set the appropriate threshold ξ in different environments.


### 3.2.3. Localization Process

According to the trust valuation model, the trust value of each anchor node can be obtained in the communication range of the unknown node. Three anchor nodes with the largest value of trust are used for computing.Trilateral-centroid localization [28] is used for unknown node localization. The unknown node is N, and the three beacon nodes are B1, B2, B3. Trilateral-centroid localization is shown in Figure 7.Figure 7
Trilateral-centroid localization.The coordinates of three anchor nodes are (x1,y1), (x2,y2), and (x3,y3). Unknown node coordinate is (x,y). Measurement distance values are d1, d2, and d3. Equation (41) can be listed according to Figure 7:(41)x-x12+y-y12=d1,x-x22+y-y22=d2,x-x32+y-y32=d3.According to (38) and the least square method, unknown node coordinates can be obtained as follows [29]:(42)xy=2x1-x32y1-y32x2-x32y2-y3-1x12-x32+y12-y32+d32-d12x22-x32+y22-y32+d32-d22.In addition, due to the presence of measurement errors, in some cases, the equations may not be solvable (as shown in Figure7). In this case, the center of triangle is formed by the intersection of all circles, taken as the coordinates of the unknown point.There are six intersections among three circles in Figure8. The coordinates of the three intersection points which are close to the unknown nodes are (x1,y1), (x2,y2), and (x3,y3). The coordinates of the estimated position of the unknown node are (x,y). Thus we can calculate (x,y) via(43)x,y=x1+x2+x33,y1+y2+y33.Figure 8
Trilateral-centroid localization.


## 3.2.1. Attribute Set Selection

(1) Distance Measurement. The difference between measured and actual distances in the WSN positioning obeys to the normal distribution [20]. Therefore, the error function can be defined by(16)σNd=ae-d-d02/b2,where σNd refers to the Gaussian function of distance d. When d=d0, the measurement error reaches its maximal value. In summary, the p1 attribute of the measured distance value is defined as(17)p1d=dd0d≤d0,d-d0d0d>d0.(2) Localization PerformanceDefinition 9.
The unknown node’s location reference set is defined asR=(x1,y1,d1), x2,y2,d2,…,(xi,yi,di),…,(xn,yn,dn), where (xi,yi) represents the coordinates set of the anchor node i and di is the distance between anchor node i and unknown node.Definition 10.
The residual represents the deviation of observed distance value and real distance value, and the total localization residual is defined as(18)σsum=∑i=1nx-xi2+y-yi2-di,where x and y represent the measured coordinates of unknown node, xi, and yi denote the coordinates of anchor node, and di is measured distance between beacon node i and unknown node.In (18), the coordinates x and y are obtained by the least square method and the least squares regression model [21, 22], while the estimation function is defined by(19)di2=x-xi2+y-yi2+η,x,y=arg⁡min∑i=1nxi-x02+yi-y02-di2,where η is the measurement error and η~U(-ε,ε) [23], while ε is the maximal measurement error defined as(20)max⁡di-xi-x2+yi-y2≤ε.The residuals are used to indicate the degree of each node’s deviation from its true location. The mean residual error is defined as(21)ρ=σsumn≤ξ,where n represents the number of anchor nodes involved in positioning. In order to define a threshold, value of ε is needed. When the mean residual error is smaller than the threshold value, the localization result is considered as consistent. Otherwise, the presence of malicious nodes is indicated. The attribute value of localization performance p2 is defined as(22)p2=ρζ,ρ≤ζ,0,ρ>ζ.(3) Detection of Anchor Node Position. Based on (22), the major attacks can be filtered by comprehensive trust value. Nevertheless, in the case of Sybil attack, the above attribute value is not enough to fight against the attack.Definition 11.
The concept of Sybil attack in the WSN indicates that a single node has a multiple identity.
The RSSI signal attenuation model in WSN environment is defined by (8).
According to the attenuation model, the distance ratio can be deduced as(23)dridrj=10RSSIdri-RSSIdrj/10λ,where dri is the distance between receiver and transmitter. From (23), it can be concluded that the distance ratio is related only to the RSSI difference. Therefore, (23) can be rewritten as(24)dridrj=fRSSIdri-RSSIdrj.Based on the above analyses, we know that if the distance between receiver and transmitter is constant, the RSSI difference is stable. The positioning in the case of Sybil attack is presented in Figure4.Figure 4
Localization in the case of Sybil attack.In Figure4, p is an unknown node, q is an auxiliary judgment node, and r1, r2, r3, and r4 denote the false localization information, while the anchor node r is the attacked node. The RSSI value is affected by environment; thus, the measured distance between node r and node p will change according to the RSSI fluctuation. Therefore, the auxiliary node q is introduced. According to the above analysis, the difference between RSSIdrp and RSSIdrq is stable. Thus, according to (23), the value of drq/drp remains stable.The coordinates ofq are (xq,yq), the coordinates of p are (xp,yp), and the coordinates of r are (xr,yr).(1) When k=±1, (26) can be simplified as (23). According to the form of (27), it can be concluded that the equation represents a straight line.(2) When k≠±1, (26) can be simplified as (28).The discriminant of circle defined asD2+E2-4F is substituted into (29).Whenk≠±1, the result is always greater than zero. In summary, the trajectory of r is a circle or a straight line.According to the above conclusions, the difference of RSSI is stable only when the faked nodes are distributed strictly in standard circle or straight line. Therefore the difference betweenRSSIdrp and RSSIdrq can be used against the witch attack.At time momentt1, node p is an unknown node, nodes q and r are the auxiliary nodes, and nodes s, t are the anchor nodes. In the following moments, t2 and t3, RSSI is detected by these values.Definition 12.
(25)
d
i
f
f
t
1
p
,
q
,
r
=
R
S
S
I
d
r
p
-
R
S
S
I
d
r
q
when the current moment is
t
1
,
d
i
f
f
t
1
p
,
q
,
r
,
s
,
t
=
m
a
x
diff
t
1
p
,
q
,
s
-
d
i
f
f
t
1
p
,
q
,
t
,
d
i
f
f
t
1
p
,
q
,
s
-
diff
t
1
p
,
q
,
t
,
d
i
f
f
t
1
p
,
q
,
s
-
diff
t
1
p
,
q
,
t
,
d
i
f
f
p
,
q
,
r
,
s
,
t
=
max
⁡
d
i
f
f
t
n
p
,
q
,
r
,
s
,
t
1
≤
n
≤
3
.Thus, the definition of attribute valuep3 is defined as (30).(26)xr-xq2+yr-yq2xr-xp2+yr-yp2=k⟹xr-xq2+yr-yq2=k2xr-xp2+yr-yp2⟹k2-1xr2+k2-1yr2-2xrxq-k2xp-2yryq-k2yp=k2xp2+yp2-xq2+yq2,(27)yr=xp-xqyq-ypxr+xq2+yq2-xp2-yp22yq-yp,(28)xr2+yr2-2xq-k2xpk2-1xr+2yq-k2yqk2-1yr+xq2+yq2-k2xp2+yp2k2-1=0,(29)4xq-k2xp2k2-12+4yq-k2yp2k2-12-4xq2+yq2-4k2xp2+yp2k2-1⟹4xq2-8k2xqxp+4k4xp2+4yq2-8k2yqyp+4k4yp2k2-12-4xq2+yq2-4k2xp2+yp2k2-1⟹8xq2-8k2xqxp+8yq2-8k2yqyp-4k2xq2-4k2yq2+4k2xp2+4k2yp2k2-12⟹4k2yp-yq2+4k2xp-xq2+1+k28xq2+8yq2k2-12,(30)p3=diffp,q,r,s,tτdiffp,q,r,s,t≤τ,1diffp,q,r,s,t>τ.(4) Transit Time Detection. As it is well known, there are many attacks in the WSN [24, 25], which mainly consist of replayed attacks, Sybil attacks, and wormhole attacks. In these attacks, the certain time is needed to tamper the information. As a result, the time used for positioning will increase. Figure 5 represents the node communication process.Figure 5
Communication process between nodes.Nodep is the source node, while node q is the target node. The observation time of the target node is T=t3-t2. Before positioning, the n group of experiment were conducted. In the experiments, a set of times T was obtained. The maximum value Tmax was selected from the set.Based on the experimental results, the definition of attribute valuep is obtained by(31)p4=0T>Tmax,TTmaxT≤Tmax.


## 3.2.2. Discussion on Threshold

In Section3.2.1, the attribute set selection and calculation processes are presented. Equations (20), (21), and. (26) are all crucial for the threshold. According to (20), the threshold ε and the maximal measurement error should be discussed.In the environment without obstacles, according to Definition9, the localization error follows the normal distribution defined by(32)dE~N0,σ2.The second parameter of normal distribution is determined in the literature [26]. The relationship between the parameter σ and the distance d can be fitted into the Gaussian function shown as(33)σd=ae-d-d02/b2.According to the above analysis, when distance between unknown node and anchor node isd0, the standard deviation of the distance error reaches the maximum. Therefore, the maximal deviation value between measured and calculated distances can be used as a threshold. The positioning in the presence of obstacles is presented in Figure 6.Figure 6
Localization in the presence of obstacles.In Figure6, M represents an obstacle between the anchor node p3 and the unknown node q. According to the trilateral localization algorithm principle, when the RSSI is much smaller than the normal value, the localization fails.In the case of localization failure, the RSSI values of the nodes areRSSI(p1q), RSSI(p2q), RSSI(p3q), RSSI(p1p2), RSSI(p2p3), and RSSI(p1p3). Because RSSI(p3q) is much smaller than the normal value, the distance calculated by the distance attenuation model is larger than distance of p3q.Ifp3q>p1p3+p1q and p3q>p2p3+p2q, there is a barrier between node q and node p3. In the environment with obstacles, the distance between two nodes, which are affected by the obstacles, is the maximal distance between the obstacles. The maximal measurement error can be obtained by derivations as(34)cos⁡∠p3p1p2=p1p32+p1p22-p2p322p1p3×p1p2,cos⁡∠qp1p2=p1q2+p1p22-p2q22p1q×p1p2.At the same time, (35) can be obtained:(35)cos⁡∠p3p1q=cos⁡∠p3p1p2cos⁡∠qp1p2+sin⁡∠p3p1p2sin⁡∠qp1p2.According to the values ofcos⁡(∠p3p1q), p1p3 and p1q, p3q can be obtained by(36)p3q=p1q2+p1p32-2p1q×p1p3×cos⁡p3p1q.In an environment with obstacles,ε=dp3q-p3q. dp3q is the distance value obtained by distance attenuation model.In (21), ρ=σsum/n≤ξ, and threshold ξ is a mean residual.Definition 13.
In the WSN positioning, the reference node set isLoc_refer = {l1,l2,l3,l4,ln}, and the information frame format of each reference node is (xi,yi,drssii), wherein (xi,yi) are the reference node coordinates, and drssii is the distance between reference node and unknown node.According to Definition13, the localization error of each reference node in the security localization can be obtained by(37)ei=drssii-xi-x2+yi-y2,where ei is the localization error of each reference node, and (x,y) refers to the actual position of the unknown node.(38)pn=∑i=1nein.In (38), pn represents the average localization error, and ei obeys the normal distribution; thus pn also obeys the normal distribution. In the experimental environment, the mean μ and the variance σ of the pn were obtained by the actual measurement.According to the central limit theorem [27], when n→∞, the distribution function of Yn=∑k=1npk-nμ0/nσ0 obeys the standard normal distribution, where μ0=μ,  σ0=nσ. If qn is equal to n∗pn, then we may get(39)limn→∞⁡pqn-μ0σ0≤x=Φx.Based on the above conclusions, (40) can be obtained:(40)limn→∞⁡Pp≤ξ=limn→∞⁡Pqn≤nξ=limn→∞⁡qn-μ0σ0≤nξ-μ0σ0=Φnξ-μ0σ0.According to (40), the standard normal distribution can be obtained. Therefore, the standard normal distribution table can be used to set the appropriate threshold ξ in different environments.


## 3.2.3. Localization Process

According to the trust valuation model, the trust value of each anchor node can be obtained in the communication range of the unknown node. Three anchor nodes with the largest value of trust are used for computing.Trilateral-centroid localization [28] is used for unknown node localization. The unknown node is N, and the three beacon nodes are B1, B2, B3. Trilateral-centroid localization is shown in Figure 7.Figure 7
Trilateral-centroid localization.The coordinates of three anchor nodes are (x1,y1), (x2,y2), and (x3,y3). Unknown node coordinate is (x,y). Measurement distance values are d1, d2, and d3. Equation (41) can be listed according to Figure 7:(41)x-x12+y-y12=d1,x-x22+y-y22=d2,x-x32+y-y32=d3.According to (38) and the least square method, unknown node coordinates can be obtained as follows [29]:(42)xy=2x1-x32y1-y32x2-x32y2-y3-1x12-x32+y12-y32+d32-d12x22-x32+y22-y32+d32-d22.In addition, due to the presence of measurement errors, in some cases, the equations may not be solvable (as shown in Figure7). In this case, the center of triangle is formed by the intersection of all circles, taken as the coordinates of the unknown point.There are six intersections among three circles in Figure8. The coordinates of the three intersection points which are close to the unknown nodes are (x1,y1), (x2,y2), and (x3,y3). The coordinates of the estimated position of the unknown node are (x,y). Thus we can calculate (x,y) via(43)x,y=x1+x2+x33,y1+y2+y33.Figure 8
Trilateral-centroid localization.


## 4. Simulation and Analysis

### 4.1. Experiment of Environment Selection and Parameter Setting

Matlab7.0 experimental platform is used as the simulation environment. In this simulation environment, 100 nodes are randomly deployed in the range of 100 m∗ 100 m [30]. The number of anchor nodes and unknown nodes is 40 and 60, respectively. The communication radius of the nodes is 20 m, and the communication model is the regular pattern. The path loss factor is η=2.5 and the range standard deviation is σ=0.5.


### 4.2. Simulation Experiment

In the simulation experiment, three types of nodes are listed as follows: attack node, anchor node, or unknown node. First of all, three groups of experiments are carried out under different environments. The experimental conditions are listed as follows: nonexisting attack nodes, attack nodes existing, and attack nodes existing under trust valuation model.According to Figures9, 10, and 11, it can be concluded that the localization error increases with the increasing of attack nodes. When the trust valuation model is added in the localization process, the localization error recovers to normal level.Figure 9
Normal localization.Figure 10
Localization under attack node.Figure 11
Localization under trust valuation model.In addition, the robustness of the model is also investigated. One is attack power and the other is the number of attack nodes.As can be seen from Figure12, when the number of attack nodes is less than 20, the localization error of secure localization model is much smaller than normal localization algorithm. However, when the number of attack nodes exceeds 20, the localization error increases sharply, since the attack node produces much fake information with consistency. The system cannot distinguish between malicious nodes and normal nodes through the consistency of the given information.Figure 12
Localization algorithms comparison.As can be seen from Figure13, the localization error of secure localization model remains in a very low level and the localization error of normal localization algorithm increases with the increasing of attack power. The localization error of secure localization model increases with the increasing of attack power, in case the attack power is under 5, with the performance of malicious nodes being similar to normal nodes. However, the system can distinguish between malicious nodes and normal nodes from the values of each attribute with the increasing of attack power. Thus the localization error remains in a low level.Figure 13
Localization algorithms comparison.In addition, this algorithm is compared with other secure localization algorithm in localization error.As can be seen from Figure14, the overall localization error of this algorithm is smaller than AR-MMSE algorithm. In the AR-MMSE algorithm [31], the localization error becomes large when the number of malicious nodes exceeds 14. After that, with the increasing of the number of malicious nodes, the localization error is also growing. The algorithm proposed in this paper gets much larger localization error when the number of malicious nodes exceeds 20. AR-MMSE algorithm determines malicious nodes just by the consistency of the location information, while the proposed algorithm is capable of identifying malicious nodes via some additional attributes, such as distance measurement, detection of anchor node position, and detection of transition time.Figure 14
Localization algorithms comparison.As can be seen from Figure15, the trust relationship network becomes tighter as the density of anchor nodes increases. Normal node does not build trust relationship with attack node, so the attack node is removed from the secure localization model.Figure 15
Trust relationship.


## 4.1. Experiment of Environment Selection and Parameter Setting

Matlab7.0 experimental platform is used as the simulation environment. In this simulation environment, 100 nodes are randomly deployed in the range of 100 m∗ 100 m [30]. The number of anchor nodes and unknown nodes is 40 and 60, respectively. The communication radius of the nodes is 20 m, and the communication model is the regular pattern. The path loss factor is η=2.5 and the range standard deviation is σ=0.5.


## 4.2. Simulation Experiment

In the simulation experiment, three types of nodes are listed as follows: attack node, anchor node, or unknown node. First of all, three groups of experiments are carried out under different environments. The experimental conditions are listed as follows: nonexisting attack nodes, attack nodes existing, and attack nodes existing under trust valuation model.According to Figures9, 10, and 11, it can be concluded that the localization error increases with the increasing of attack nodes. When the trust valuation model is added in the localization process, the localization error recovers to normal level.Figure 9
Normal localization.Figure 10
Localization under attack node.Figure 11
Localization under trust valuation model.In addition, the robustness of the model is also investigated. One is attack power and the other is the number of attack nodes.As can be seen from Figure12, when the number of attack nodes is less than 20, the localization error of secure localization model is much smaller than normal localization algorithm. However, when the number of attack nodes exceeds 20, the localization error increases sharply, since the attack node produces much fake information with consistency. The system cannot distinguish between malicious nodes and normal nodes through the consistency of the given information.Figure 12
Localization algorithms comparison.As can be seen from Figure13, the localization error of secure localization model remains in a very low level and the localization error of normal localization algorithm increases with the increasing of attack power. The localization error of secure localization model increases with the increasing of attack power, in case the attack power is under 5, with the performance of malicious nodes being similar to normal nodes. However, the system can distinguish between malicious nodes and normal nodes from the values of each attribute with the increasing of attack power. Thus the localization error remains in a low level.Figure 13
Localization algorithms comparison.In addition, this algorithm is compared with other secure localization algorithm in localization error.As can be seen from Figure14, the overall localization error of this algorithm is smaller than AR-MMSE algorithm. In the AR-MMSE algorithm [31], the localization error becomes large when the number of malicious nodes exceeds 14. After that, with the increasing of the number of malicious nodes, the localization error is also growing. The algorithm proposed in this paper gets much larger localization error when the number of malicious nodes exceeds 20. AR-MMSE algorithm determines malicious nodes just by the consistency of the location information, while the proposed algorithm is capable of identifying malicious nodes via some additional attributes, such as distance measurement, detection of anchor node position, and detection of transition time.Figure 14
Localization algorithms comparison.As can be seen from Figure15, the trust relationship network becomes tighter as the density of anchor nodes increases. Normal node does not build trust relationship with attack node, so the attack node is removed from the secure localization model.Figure 15
Trust relationship.


## 5. Conclusion

The problem of secure localization is closely related to the structure characteristics and application background in WSN. Traditional security algorithms in WSN are constrained by the limited resources of sensor nodes. Trust management can improve the security and reliability of the localization system with low system overhead. In this paper, a number of attributes related to the localization are adopted and the threshold of the attribute value is discussed to ensure that the method can deal with the internal attacks and a certain degree of collusion attack. This model is superior to the traditional secure localization algorithm based on WSN in the success rate of identifying malicious nodes and performance overhead.



---

*Source: 6102780-2017-03-08.xml*