Improvement of DV-Hop Algorithm Based on RSSI Ratio Correction

— This paper aims to improve the positioning accuracy of the traditional DV-hop algorithm in networks of uneven node distribution. For this pur-pose, an improved algorithm was proposed that reduces the errors in terms of the hop count, the mean single-hop distance of anchor nodes and the mean sin-gle-hop distance of unknown nodes. Specifically, the hop count was modified based on the RSSI value of the node and the critical RSSI ratio; the mean sin-gle-hop distance of anchor nodes was corrected based on the ratio of the single-hop RSSI path length between two nodes to the mean single-hop RSSI path length (i.e. the correction factor); the mean single-hop distance of unknown nodes was divided into two sections to achieve better estimation of the distance between anchor nodes and unknown nodes. The simulation results indicate that the improved algorithm boasts better positioning accuracy and stability than the contrastive algorithms, with the addition of a few computing and communication overhead. The research findings shed new light on the accurate positioning of nodes in wireless sensor networks (WSNs).


Introduction
Node location information is essential to various applications of wireless sensor network (WSN), including but not limited to target, detection, target tracking, and automatic configuration of network topology [1]. In light of the ranging requirement, the existing positioning algorithms are either ranging-based or ranging-free [2]. The ranging-based algorithms demand strong hardware capacity and have high positioning accuracy. The typical examples are received signal intensity indication (RSSI), angle of arrival (AOA), time of arrival (TOA), and time difference on arrival (TDOA). In contrast, the ranging-free algorithms, featured by low hardware requirements, and positioning accuracy, mainly include DV-hop algorithm, centroid algorithm and approximate point in triangle (APIT) algorithm. With low cost and no additional hardware, the ranging-free algorithms are more suitable for largescale WSNs [3].
The DV-hop algorithm, as the most popular algorithm of its kind, mainly depends on network connectivity. The minimum length of hop path is approximately the dis-tance between the nodes, and the path is not necessarily linear. Errors may occur in the distance estimation between anchor nodes and unknown nodes, owing to the following factors. (1) The hop count error: the hop count is considered as 1 as long as the internodal distance falls in the communication radius; (2) The slight error in the mean single-hop distance of anchor nodes: the mean distance equals the mean estimated distance of all transmission paths between anchor nodes and unknown nodes; (3) The huge error in the mean single-hop distance of unknown nodes: the mean distance is related to the degree of curvature of the shortest transmission path, which is uncertain if that path covers a long distance. It is the distance estimation error that drags down the positioning accuracy.
Over the years, the distance estimation error has been treated from three aspects. For instance, Reference [4] introduces the deviation factor to correct the hop count error. Reference [5] modifies the mean single-hop distance of anchor nodes and unknown nodes to improve positioning accuracy. Reference [6] rectifies the internodal hop against the RSSI value received by the neighboring nodes of anchor nodes, and optimizes the mean single-hop distance of anchor nodes. Following the method of least squares, Reference [7] derives the total error in the mean single-hop distance of anchor nodes, sets the mean offset of the mean single-hop distance to zero, and obtains the mean single-hop distance that minimizes the total error. Reference [8] relies on the error in mean single-hop distance to correct the mean single-hop distance between anchor nodes and unknown nodes. Reference [9] adjusts the hop count using the RSSI method, and identifies the mean single-hop distance of unknown nodes by weighting the mean single-hop distance of each anchor node. Taking the RSSI value received by anchor nodes at each hop as the reference value, Reference [10] revises the hops from anchor nodes to unknown nodes by the RSSI ratio. By the above methods, the positioning accuracy can be improved by a certain degree, but the results are still undesirable.
To further enhance the positioning accuracy, this paper proposes an algorithm that reduces the errors in such three aspects as the hop count, the single-hop distance of anchor nodes and the mean single-hop distance of unknown nodes.

Positioning process
Proposed by Niculescu et al. [11,12], the DV-hop algorithm estimates the distance between anchor nodes and unknown nodes by multiplying hop count with the mean single-hop distance, and then calculates the coordinates of unknown nodes with threesided measurement. The positioning process is explained below.
Each anchor node broadcasts packets {id i , x i , y i , hop} containing its ID, coordinates, and hop count to neighboring nodes. Then, each neighboring node records the ID, coordinates and hop count in the packet it receives, adds 1 to the hop count, and forwards the packet to its neighboring nodes. In this way, all nodes obtain the minimum hop count to each anchor node.
The mean single-hop distance of each anchor node is calculated by: where (x i , y i ), (x j , y j ) and hops j are the coordinates of anchor node i, the coordinates of anchor node j, and the minimum hop count between the two nodes, respectively. Each unknown node can estimate its distance from the anchor nodes by multiplying the mean single-hop distance of the nearest anchor node with the minimum hop count.
The coordinates of each unknown node can be estimated with its distances to 3 or more anchor nodes.

Error analysis
From the positioning process of the traditional DV-hop, it can be seen that the hop count is considered as 1 as long as the internodal distance falls in the communication radius. As shown in Fig. 1, N is an unknown node, B1 and B2 are anchor nodes, and R is the communication radius. Both the hop count between N and B1 and that between N and B2 are 1. The hop count does not reflect the actual distance. In this case, the mean single-hop distance is reasonable only if the nodes are evenly distributed. Errors are inevitable if the network has an irregular topology. In the second step of node positioning, the anchor nodes calculate their mean single-hop distance according to the minimum hop count to other anchor nodes, while the unknown nodes estimate their distance to the anchor nodes by multiplying the mean single-hop distance of the nearest anchor node with the minimum hop count. In Fig. 1, the estimated distance between N and NB1 equals that between N and NB2. It is clearly inconsistent with the reality, resulting in huge errors in positioning.

RSSI ranging model
The RSSI distance masked dissipation model was adopted to correct the hop count and the mean single-hop distance between nodes. The path loss sub-model takes a near distance d 0 as the reference to predict the mean signal intensity at distance d. The proportional relationship between the two distances can be expressed as: Find the logarithm on the left and right: where PL(d) is the RSSI value at distance d (dBm); n is the path loss coefficient (2~4); PL(d 0 ) is the RSSI value at the reference distance d 0 . As shown in Fig. 2, the RSSI value varies with distances.

Correction of hop count
By the traditional DV-hop algorithm, the hop count is considered as 1 as long as the internodal distance falls in the communication radius, sowing the seed of huge errors (Fig. 1). To prevent the errors, the RSSI technique was introduced to correct the hop count.
It can be seen from Fig. 2 that the internodal distance is negatively correlated with the RSSI value. Since the signal intensity at a node is usually negative, the RSSI ratio was employed to approximate the distance ratio. Suppose two nodes receive the information broadcasted from the same anchor node. Let RSSI 1 and RSSI 2 be the signal intensities at each of the two nodes, and d 1 and d 2 be the distance between the anchor node and each of the two nodes. Then, we have: Let us denote the hop count of the node on the communication radius as 1, and the ideal distance as R. Taking the RSSI value at R is as the critical value RSSI th , the citical value can be expressed as: The principle of the critical RSSI ratio is illustrated in Fig.3. The critical RSSI ratio can be calculated by: If hop i =1, the node falls on the communication radius and has a hop count of 1. The node A in Fig. 3 is such an example. If hop i <1, the node falls within the communication radius and has a hop count less than 1. The nodes B1 and B2 in Fig. 3 are such examples.
In this way, the hop count of the nodes within the communication radius can be expressed as decimals. The new expression is closer to reality, reduces the hop count error, and thus enhances the accuracy of the mean-single hop distance.

Correction of mean single-hop distance of anchor nodes
According to the dissipation model, the path dissipation is negatively correlated with distance (formula (2)). This means the anchor nodes actually differ in mean single-hop distance due to the uneven node distribution. However, the calculation of the distance is often influenced by environmental factors like topography, geomorphology and weather.
To eliminate the influence, the mean single-hop distance was corrected based on the ratio of the single-hop RSSI path length between two nodes to the mean singlehop RSSI path length (i.e. the correction factor).
Considering the RSSI value of each hop recorded by each node and the cumulative RSSI value up to the current hop, the correction factor can be established by the formula below: where RSSI i is the signal intensity at node i; RSSI avg is the mean signal intensity at node i in the case of mean single-hop distance broadcasting from the anchor node. The RSSI avg can be obtained as follows: Then, the correction factor of the mean single-hop distance is multiplied by the mean single-hop distance to yield the corrected mean single-hop distance. If the hop count between unknown nodes and anchor nodes is denoted as n, then the corrected mean single-hop distance is: The above steps make it possible to correct the mean single-hop distance of anchor nodes according to the cumulative signal intensity (RSSI(n)), mean signal intensity (RSSI avg ) and mean single-hop distance (Hopsize). The values of these parameters are saved in the information table.

Correction of mean single-hop distance of unknown nodes
In the traditional DV-hop algorithm, the mean single-hop distance of the nearest anchor node is regarded as the mean single-hop distance of unknown nodes. This expedient measure cannot reflect the overall situation of the network.
To solve the problem, all anchor nodes were used to estimate their distance from the unkown nodes. The previous analysis shows that the hop count from unkown nodes is positively correlated with the error of anchor nodes. Therefore, the mean single-hop distance of unkown nodes was divided into two parts.
In the near range of unkown nodes, the mean single-hop distance is weighted by the mean single-hop distance of anchor nodes around such nodes. Within the range of the unknown nodes, the mean single-hop distance is adjusted to be the weighted sum of the anchor nodes and the mean single-hop distance of the distant anchor nodes.
The estimated distance is corrected as follows. When anchor nodes broadcast over the mean single-hop distance, each unknown node receives the mean single-hop distance of all anchor nodes. The hop count between anchor nodes to the unknown node is ranked in ascending order, and the m smallest hop counts are selected. The corresponding mean single-hop distance are denoted as Hopsize1, Hopsize2, …, Hopsize m . Then, the weight of mean single-hop distance can be calculated by: where hop i is the hop count between an unknown node and anchor node i; Max is the maximum hop count.
In this way, each node is assigned a weight negatively correlated with the distance. The anchor node closer to the unknown node has a greater effect on the calculation of the mean single-hop distance. Thus, the anchor nodes are grouped rationally based on their contributions to the calculation. The mean single-hop distance of unknown nodes was also divided into two parts.
If the unknown node is within the range.
If the distance to anchor nodes is within m hops, then the mean single-hop distance of the unknown node can be calculated by: The distance from the unknown node to M anchor nodes can be obtained by: If the distance to anchor nodes is greater than m hops, then the mean single-hop distance of the unknown node can be calculated by: where q is the number of anchor nodes with a distance greater than m hops. The distance from the unknown node to these nodes can be obtained by: iJOE -Vol. 14, No. 5, 2018

Workflow of the Improved DV-hop Algorithm
The workflow of the improved DV-hop algorithm is detailed below.
(1) Each anchor node sends packets {ID, (x, y), hop, RSSI i , RSSI(sum)} to the network, where ID is the node number, (x, y) are the coordinates, hop is the corrected hop count (initial value=0), RSSI i is the signal intensity at each neighboring node (initial value=0), and RSSI(sum) is the cumulative signal intensity of all nodes up to the current hop (initial value=0).
(2) When the direct neighboring node receives a packet, it reads the signal intensity ( ) from the register of the wireless node chip. The RSSI is set as the signal intensity when the node receives the packet, = . Then, the hop count is updated in the packet as hop=hop+RSSI 1 /RSSI R . Among all the packets of the same ID, the node only saves the one with the smallest hop count, and forwards the rest of the packets.
(3) The direct neighboring node continues to send packets to its neighboring nodes. Upon receiving a packet, the node changes the packet information to {ID, (x, y), hop, RSSI 2 , RSSI 1 +RSSI 2 }, and updates the hop count hop=hop+RSSI 2 /RSSI R . Again, among all the packets of the same ID, the node only saves the one with the smallest hop count, and forwards the rest of the packets.
(4) Repeat Step (3) until the hop count no longer changes. The final information in each packet is {ID, (x, y), hop, RSSI n , RSSI 1 +RSSI 2 +……+ RSSI n }. The mean singlehop distance, calculated by formula (1), and the mean signal intensity, calculated by formula (8) will be broadcasted in flooding mode.
(5) The correction factor of each hop is computed by formula (7), and the mean single-hop distance is corrected by formula (9) according to the correction factor. Then, the corrected mean single-hop distance will be broadcasted to the network.
(6) The unknown nodes receive the mean single-hop distance of all the anchor nodes. Then, the hop counts between the anchor nodes and the unknown nodes are ranked in ascending order, and the m smallest hop counts are selected. The weight of each node is calculated by formula (10). Formulas (12) and (14) are used to calculate the distance between the nearer and farther nodes.
(7) The coordinates of unknown nodes are obtained by maximum likelihood estimation.

Algorithm Simulation and Result Analysis
To verify its performance, the improved DV-hop algorithm was simulated in MATLAB 7.0, and contrasted with the traditional DV-hop algorithm and the algorithm mentioned in Reference [10]. The positioning accuracy of these algorithms were examined at different proportions of anchor nodes, communication radiuses and number of nodes.

Simulation environment and parameter setting
The anchor nodes and unknown nodes are randomly distributed in a network with an area of [0100] * [0100]. The anchor nodes were randomly selected, and assigned with the same communication radius R. To eliminate the errors resulted from random node distribution, 100 simulation experiments were performed in the same network environment to obtain the mean values.
Normalized positioning error is an indicator of the positioning accuracy of the algorithm [13]. Let (x t , y t ) and (x e , y e ) respectively be the actual location and estimated location of a node. Then, the mean positioning error of all unknown nodes is: The normalized positioning error is defined as: Hence, the positioning accuracy is (1-error')*100%. During the simulation experiments, the number of network nodes was set to 100, the proportion of anchor nodes to 30%, and the communication radius to 30m. Fig. 4 shows the variation in the positioning accuracy with the value of M.

Effect of the proportion of anchor nodes on positioning accuracy
In the network area, 100 nodes were randomly distributed. During the experiments, the total number of nodes was kept unchanged and the number of anchor nodes was increased gradually from 10% to 50% by a step of 10%. The communication radius R was set to 30m. Fig. 5 presents the normalized location errors of the three algorithms.
According to Fig. 5, the positioning errors of the three algorithms all gradually declined with the increase in the proportion of anchor nodes. When the proportion of anchor nodes fell between 10% and 20%, the positioning errors plunged rapidly. In this case, the positioning accuracy hinges on the anchor node density or network connectivity. After the proportion of anchor nodes surpassed 20%, the positioning errors were gradually stabilized. Overall, the improved DV-hop algorithm had a 17.56% higher positioning accuracy than the traditional DV-hop algorithm and a 12.87% higher positioning accuracy than the algorithm in Reference [10]. The performance edge is attributable to the modification of the minimum internodal hop count and the correction of the mean single-hop distances of anchor nodes and unknown nodes in the improved algorithm. In this way, fewer errors are caused by the minimum hop count and mean single-hop distances. Thus, the distance between unknown nodes and anchor nodes are closer to the actual distance. As shown in Fig. 5, the curve of the improved algorithm is smoother and more stable than the curves of the contrastive algorithms.

5.3
The effect of the number of nodes on positioning accuracy The number of randomly distributed network nodes was set to 100, 120, 140, 160, 180 and 200, respectively, the communication radius to R=35m, and the proportion of anchor nodes to 30%. During the simulation experiments, the proportion of anchor node remained constant. Fig. 6 compares the positioning accuracy of the improved algorithm, the traditional DV-hop algorithm and the algorithm in Reference [10]. http://www.i-joe.org It is observed that the positioning errors of the three algorithms decreased with the increase in the number of nodes. The curves of these algorithms were relatively smooth. This means the number of nodes has little to do with the positioning accuracy when the proportion of anchor nodes remains constant. However, the improved algorithm obviously outperformed the other two algorithms in positioning accuracy. The lead was 15.5% over the traditional DV-hop algorithm and 8.3% over the algorithm in Reference [10].

5.4
The effect of communication radius on positioning accuracy The number of network nodes was fixed at 100, and the proportion of anchor nodes was kept at 30%. Then, the communication radius was adjusted to compare the positioning accuracy of the improved algorithm, the traditional DV-hop algorithm and the algorithm in Reference [10]. Fig. 7 illustrates the results of the simulation experiments. It can be seen from Fig. 7 that the positioning error of the improved algorithm was much lower than that of the traditional algorithm and the algorithm in Reference [10].
Since all nodes in the network were randomly distributed, the positioning errors decreased as the communication radius widened. Compared to the other two algorithms, the improved algorithm had limited vibration such that the positioning error decreased steadily despite the changes in communication radius. The positioning accuracy of the improved algorithm was 14.4% higher than that of the traditional algorithm and 8.6% higher than that of the algorithm in Reference [10]. The results demonstrate that our algorithm boasts better stability and performance, and is more adaptive to the environment.

Conclusion
To overcome its huge positioning error in networks of random node distribution, the traditional DV-hop algorithm was improved in three phases. Specifically, the hop count was adjusted by the RSSI value, the mean single-hop distance of anchor nodes was modified by the correction factor, and the mean single-hop distance of unknown nodes was calculated in two parts. The simulation results show that, the improved algorithm boasts better positioning accuracy than the traditional algorithm and the algorithm in Reference [10], with the addition of a few computing and communication overhead. The future research will attempt to reduce the computing load without sacrificing the positioning accuracy, so that the improved algorithm has a better application potential.