Keywords

1 Introduction and Related Works

A major application of Wireless Sensor Networks (WSNs) is area monitoring. Examples of area monitoring are intrusion detection and border surveillance. Unlike full area coverage problem where every point of a region has to be covered, these applications aim to detect an intruder attempting to enter or exit the border of a certain region.

Deploying a set of sensor nodes on a region of interest where sensors form barriers for intruders is often referred to as the barrier coverage [6]. When deploying sensors to monitor boundaries of battlefields or country borders, sensors are usually dispersed from an aircraft following a predetermined path [9]. Therefore sensing gaps are usually unavoidable. In this paper, we aim to address the barrier coverage problem by mending gaps via a distributed manner as well as to minimize the total length of non-mendable gaps.

Many studies on WSNs barrier coverage consider constructing barriers with stationary sensors. [10] studies the scenario where sensors are airdropped along a straight line. They investigate how different sensor deployment strategies impact the barrier coverage of a WSN and provide a tight lower bound on the existence of barrier coverage under the assumption that the offset of each sensor’s actual landing point follows a normal distribution.

However, [10] does not address the issue of mending the barrier gaps formed after the initial deployment. When deploying sensors to monitor boundaries of battlefields or country borders, sensors are usually dispersed from an aircraft following a predetermined path. Therefore sensing gaps may occur.

In [3], the authors proposed a measure of the goodness of sensors called path exposure, which measures the likelihood of detecting a target traversing the region using a given path. They determine the number of sensors that have to be deployed for target detection under the assumption that sensors are randomly deployed in the region of interest. When using stationary sensors, the full barrier coverage is difficult to achieve when sensors are randomly deployed [7].

There are also works investigating the use of mobile sensors to mend barrier gaps, for example [4, 5]. A chain reaction algorithm is proposed by [5] to move sensors automatically and cooperatively such that to form a barrier coverage. [4] considers a hybrid network which consists of both stationary and mobile sensors. Mobile sensors can be moved in order to mend gaps. They provide a scheme to minimize the maximal energy consumed by moving sensors and another scheme to maximize the lifetime of barrier coverage after mending all the gaps.

All of the related works mentioned above are based on the isotropic sensing model of the sensors. However, in many practical applications using infrared sensors, radar sensors, audio sensors, or camera sensors, they often have a directional sensing model [1]. Barrier coverage using directional sensors is an important research topic. One application is providing surveillance of country borders using barrier coverage with sensors equipped with cameras.

[2] proposes two algorithms for weak barrier coverage: the Simple Rotation Algorithm(SRA) and the Chain Reaction-based rotation Algorithm(CRA). These algorithms aim to mend barrier gaps via sensor rotation for a line-based sensor deployment. SRA uses two critical sensors: the right most sensor P in the jth sub-barrier \(B_j\) and the left most sensor Q in the \((j+1)\)th sub-barrier \(B_{j+1}\) in order to mend the gap between \(B_j\) and \(B_{j+1}\).

SRA first rotates P clockwise to cover the gap while maintaining the coverage connection with its left neighbor. If the gap cannot be mended by rotating only P, then SRA rotates Q anti-clockwise to cover the gap while maintaining the coverage connectivity with the right neighbor. If rotating P cannot mend the barrier, SRA rotates P to cover the maximum on the right without creating new gaps, and then rotates Q to cover the gap. SRA fails if rotating both P and Q cannot mend the gap.

CRA first rotates the sensor nodes in \(B_j\) in a chain reaction manner. Node P is first rotated until the gap is mended. If a new gap is created by rotating P, then the node \(P-1\) is rotated in the same manner. The first step of CRA fails when a new barrier gap always exists even after all sensors in \(B_j\) have been rotated. Step 2 of CRA rotates Q anti-clockwise only to see if the gap can be mended, and if not, then step 3 is performed. In step 3 CRA rotates P only to reduce the gap length without creating new gaps, then rotates sensors in \(B_j\) similar to the step 1.

The algorithms proposed in [2] are centralized. Centralized approaches are not suitable since they require a central coordinator and have large delays for a large WSN. In this paper we consider a line-based sensor deployment model with directional sensors, similar to [2]. Our objective is to design a distributed mechanism to mend gaps and to minimize the total length of non-mendable gaps. The performance of our distributed algorithm is compared with SRA and CRA.

2 Network Model and Problem Definition

In this section we start by specifying the network model, notations, and terminologies used in this paper. When sensors are remotely deployed, e.g. sprayed from an aircraft, a larger amount of sensors have to deployed to ensure the barrier coverage. Besides the uniform deployment, the line-based sensor deployment model has been used recently for barrier coverage.

We assume a line-based stationary sensor deployment similar to [2, 11]. A total of n sensor nodes \(\{ s_1,s_2, ..., s_n \}\) are deployed in a rectangular field of length L and width H, see Fig. 1. In the line-based sensor deployment, sensors are evenly deployed on a horizontal-line (e.g. y = 0). Such an example is illustrated in Fig. 1a by the “target” positions, where the coordinate of the \(i^{th}\) node is computed as \((2i-1)L/2N\). This is hard to achieve in practice for remotely deployed sensors, and their “actual” positions have random offsets. We follow the model in [2] where the random offset distances have a Gaussian distribution. We assume that each sensor node knows its location using GPS or other localization mechanisms. A sensor node \(s_i\)’s location is denoted by \((x_i, y_i)\).

Fig. 1.
figure 1

(a) Sensor deployment; (b) Sensor coverage model.

In a WSN designed for barrier coverage, sensors have the ability to exchange messages with each other during initialization, to exchange information, or in response to an intruder detection. We assume an omnidirectional communication model, where the transmission range of each sensor is \(R_t\). In addition, we assume directional sensor nodes which have a finite view angle. Different from isotropic sensors, they cannot sense the whole circular area.

Directional sensing can be modeled as 2D sector-shaped sensing [8]. We describe a sensor \(s_i\) using the five tuple \(<(x_i,y_i), \theta , \varphi _{i}, R_s, R_t>\), see Fig. 1b, where \((x_i,y_i)\) are the Cartesian coordinates of \(s_i\), \(\theta \) is the view angle, \(\varphi _{i}\) is the orientation angle, \(R_s\) is the sensing range, and \(R_t\) is the communication range. We assume that all sensors in the network have the same view angle, sensing range, and communication range.

We assume that intruders move north-south. In the barrier coverage problem, the objective is to construct a barrier such that any north-south path falls into the coverage area of at least one sensor. For the weak barrier coverage, the barrier of sensors has to provide coverage when intruders move along vertical traversing paths.

Due to the random sensor deployment, a full weak barrier coverage may be impossible to attain, and in this case the target region is divided into sub-barriers (where coverage is provided) and gaps. Figure 2 shows an initial sensor deployment scenario with sub-barriers (SB) and gaps (G). Intruders crossing through a SB region are detected, while those crossing though a G region are not detected.

In this paper we seek to design a distributed algorithm where each sensor decides its orientation such that the total number of gaps and the total gap length are minimized.

Problem Definition: Given a connected WSN with n sensors \(\{ s_1,s_2, ..., s_n \}\) deployed using the line-based sensor deployment model, design an efficient distributed algorithm for weak barrier coverage that allows sensors to determine their orientation such that (i) the total number of gaps is minimized, and (ii) the total gap length is minimized.

Fig. 2.
figure 2

An example of initial sensor deployment for weak barrier coverage with sub-barriers (SB) and gaps (G)

3 Distributed Algorithm for Weak Barrier Coverage

In this section, we present our distributed algorithm to mend barrier gaps and minimize the total length of non-mendable gaps. Our algorithm has three phases. In phase 1, sensor nodes perform neighbor discovery and exchange location information with neighboring sensors.

We propose an optimal orientation algorithm in phase 2. Starting from the left boundary node, each node decides its own orientation angle such that the total number of sensing gaps throughout the network is minimized. In phase 3, we minimize the total gap length by maximizing the total sensing coverage.

Fig. 3.
figure 3

Cases for orientation decision when \(\theta > 90^{\circ }\).

3.1 Phase 1: Neighbor Discovery

During the phase 1, each sensor node broadcasts a HELLO message including its ID and location. A sensor node \(s_i\) receiving a \(HELLO( s_j, (x_j, y_j))\) message stores \(s_j\) in its inSensingRangeNeighbor list if \(\sqrt{(x_{i} - x_{j})^2 +(y_{i}-y_{j})^2 } \le R_{s}\).

For the weak barrier coverage problem, we work with sensor projections on the x-axis. In this case \(s_i\) stores \(s_j\) in its inSensingRangeNeighbor list if \(|x_{i} - x_{j}| \le R_{s} \). Each sensor node \(s_i\) computes its closest right neighbor \(N_i^r\) and its closest left neighbor \(N_i^l\) from the nodes in the inSensingRangeNeighbor list. For example, in Fig. 2, sensor \(s_6\) sets \(N_6^r = s_7\) and \(N_6^l = s_5\).

3.2 Phase 2: Optimal Orientation

We assume that sensors have random rotations when they are deployed initially. Phase 2 is started by the left boundary sensor, e.g. \(s_1\) in Fig. 2, which computes \(\varphi _{1} = \pi -\theta -arccos(\frac{x_{1}-x_{l}}{R_{s}})\), where \(x_l\) is the x coordinate of the left boundary of the target region. \(s_1\) then broadcasts the message \(POS( s_1, pos_1 )\), where \(pos_i = <s_i, x_i, y_i, \varphi _{i}>\)

A sensor node \(s_i\) waits to receive a POS message from its closest left neighbor \(N_i^l\), then computes its orientation angle \(\varphi _i\), and broadcasts a message \(POS(s_i\), \(pos_1\), \(pos_2\), ..., \(pos_i)\). The first field is the sender ID, and the other fields are the positioning information for all prior sensors in the same sub-barrier. \(s_i\) appends \(pos_i\) at the end of the list received from \(s_{i-1}\). For example in Fig. 2, node \(s_2\) receives the POS message from \(s_1\), computes \(\varphi _{2}\) accordingly, then broadcasts \(POS( s_2, pos_1, pos_2 )\).

Next we describe the mechanism used by a sensor \(s_{i+1}\) to set up its orientation angle \(\varphi _{i+1}\) after it has received a POS message from its closest left neighbor, denoted \(s_i\). We distinguish two main cases to be addressed individually: \(\theta > 90^{\circ }\) and \(\theta \le 90^{\circ }\).

Since we are concerned with the weak barrier coverage, we work with sensor projections on the x-axis. Let d be the horizontal distance between \(s_i\) and \(s_{i+1}\).

For a view angle \(\theta > 90^{\circ }\), we distinguish three cases, see Fig. 3. Let us assume that \(s_{i+1}\) receives a POS message from its closest left neighbor \(s_i\) and let d be the horizontal distance between \(s_i\) and \(s_{i+1}\).

Fig. 4.
figure 4

Cases for orientation decision when \(\theta \le 90^{\circ }\) and \(\varphi _{i} < 90^{\circ }\).

Fig. 5.
figure 5

Cases for orientation decision when \(\theta \le 90^{\circ }\) and \(\varphi _{i} \ge 90^{\circ }\).

Case 1: \(d\le R_{s}cos\varphi _{i}+R_{s}cos(\pi -\theta )\)

In this case the node \(s_{i+1}\) sets \(\varphi _{i+1}=0\). This provides sensing overlapping with \(s_i\) on the left and maximum coverage on the right. Note that rotating \(s_{i+1}\) anticlockwise (e.g. \(\varphi _{i+1} > 0\)) does not increase the coverage on the left of \(s_{i+1}\), but it decreases the coverage on the right. Such an example is illustrated in Fig. 3a.

Case 2: \(R_{s}cos\varphi _{i}+R_{s}cos(\pi -\theta )<d\le R_{s}+R_{s}cos\varphi _{i}\)

In this case \(s_{i+1}\) calculates its orientation angle \(\varphi _{i+1}\) such that to maintain the sensing coverage connection with \(s_i\) and to maximize the coverage on the right. \(s_{i+1}\) computes \(\varphi _{i+1}=\pi -\theta -arccos(\frac{d-R_{s}cos\varphi _{i}}{R_{s}})\). An example is illustrated in Fig. 3b.

Case 3: \(d>R_{s}+R_{s}cos\varphi _{i}\)

In this case \(s_{i+1}\) is not able to mend the gap between \(s_i\) and \(s_{i+1}\). The node \(s_{i+1}\) sets \(\varphi _{i+1}=0\) to give maximum coverage on the right. An example is illustrated in Fig. 3c.

When \(\theta \le 90^{\circ }\), the orientation angle \(\varphi _{i}\) of the node \(s_i\) is set up either as \(0\le \varphi _{i}< 90^{\circ }\) or \( \varphi _{i} = \pi -\theta \). Note that \(\varphi _{i} \ge 90^{\circ }\) provides no coverage on \(s_i\)’s right side and setting \( \varphi _{i} = \pi -\theta \) maximizes the coverage on \(s_i\)’s left side. We first discuss the case when \(0\le \varphi _{i}< 90^{\circ }\), see Fig. 4.

Case 1: \(0\le d\le R_{s}cos\varphi _{i}\)

The node \(s_{i+1}\) sets \(\varphi _{i+1} = 0\), see Fig. 4a.

Case 2: \(R_{s}cos\varphi _{i}< d\le R_{s}cos\varphi _{i}+R_{s}cos(\frac{\pi }{2}-\theta )\)

The node \(s_{i+1}\) calculates its orientation angle \(\varphi _{i+1} \) such that to maintain sensing connection with \(s_i\) and to maximize the coverage on the right. \(\varphi _{i+1} \) is computed as \(\varphi _{i+1}=\pi -\theta -arccos(\frac{d-R_{s}cos\varphi _{i}}{R_{s}})\), see Fig. 4b.

Case 3: \(R_{s}cos\varphi _{i}+R_{s}cos(\frac{\pi }{2}-\theta )< d\le R_{s}cos\varphi _{i} +R_{s}\)

Node \(s_{i+1}\) sets \( \varphi _{i+1} = \pi -\theta \), see Fig. 4c.

Case 4: \( d > R_{s}cos\varphi _{i} +R_{s}\)

In this case there will be a gap between \(s_i\) and \(s_{i+1}\). The node \(s_{i+1}\) sets \(\varphi _{i+1} = 0 \) to maximize the coverage on the right, see Fig. 4d.

Fig. 6.
figure 6

Nodes positioning after phase 2.

For \(\varphi _{i} \ge 90^{\circ }\) (e.g. \( \varphi _{i} = \pi -\theta \)), if \(0\le d\le R_{s}cos(\frac{\pi }{2}-\theta )\), then \(s_{i+1}\) sets \( \varphi _{i+1} = \pi - \theta - arccos(\frac{d}{R_{s}})\), see Fig. 5a, otherwise \(s_{i+1}\) sets \( \varphi _{i+1} = 0\), see Fig. 5b. Note that there is a gap between \(s_i\) and \(s_{i+1}\) when \(d > R_s\).

Figure 2 shows the initial sensors deployment and Fig. 6 shows nodes orientation at the end of phase 2. A sensor node identifies itself as a left boundary node of a sub-barrier if it is in the case 3 for \(\theta > 90^{\circ }\) (e.g. Figure 3c) or in the case 4 for \(\theta \le 90^{\circ }\) (e.g. Figure 4d). A left-boundary node of a sub-barrier will reset the pos list in the POS message. For example, in Fig. 6, \(s_{3}\) broadcasts \(POS(s_3, pos_1, pos_2, pos_3)\). \(s_4\) is the left-boundary node of \(SB_2\) and it broadcasts \(POS(s_4, pos_4)\). \(s_3\) overhears the POS message from its closest right neighbor and since the pos list was reset, it concludes that it is the right-boundary node of its sub-barrier \(SB_1\).

Note that the right boundary of a sub-barrier will have positioning information of all the nodes in the same sub-barrier. In Fig. 6, \(s_3\) has positioning information of all the nodes in \(SB_1\), \(s_{10}\) has positioning information of all the nodes in \(SB_2\), so on.

3.3 Phase 3: Minimizing the Gap Length

We distinguish 2 types of sub-barriers: to be optimized and optimized. If the right boundary node of a sub-barrier has the orientation angle \(\pi -\theta \), then the sub-barrier is optimized. An example is shown in Fig. 7.

If the orientation angle of the right boundary node of \(SB_j\) is different than \(\pi -\theta \) and is between 0 and \(90^{\circ }\), then \(SB_j\) is a “to be optimized” sub-barrier. Phase 3 has the objective to optimize sensor orientation in \(SB_j\) such that to minimize the gap length. An example of optimizing a sub-barrier \(SB_j\) is illustrated in Fig. 8. By sequentially rotating sensors anti-clockwise, the gap \(G_{j-1}\) is decreased by \(\Delta x_{G_{j-1}}^{-}\), while the gap \(G_j\) is increased by \(\Delta x_{G_{j}}^{+}\).

Fig. 7.
figure 7

Optimized sub-barrier.

Fig. 8.
figure 8

Optimizing a sub-barrier \(SB_j\).

In Fig. 8 the solid sectors indicate the original sensor positioning after phase 2. By rotating sensors anti-clockwise, see the dashed line sectors, the decreased length of the gap \(G_{j-1}\) is larger than the increased length of the gap \(G_j\), thus the total gap length is reduced.

Fig. 9.
figure 9

Nodes positioning after phase 3.

Consider a sub-barrier \(SB_j\) with sensors \(s_{j_1}, s_{j_2}, ..., s_{j_n}\) in order from left to right. The sensor \(s_{j_1}\) is the left most node and \(s_{j_n}\) is the right most node. Let us assume that \(s_{j_n}\)’s orientation angle \(\varphi _{j_n} \ne \pi -\theta \) and \(0 \le \varphi _{j_n} \le 90^{\circ }\), that is \(SB_j\) is a “to be optimized” sub-barrier.

The objective of phase 3 is to minimize \(\sum _{j \ge 1}\) length(\(G_j\)) while maintain the coverage connectivity, e.g. no new gaps are formed. This gap length minimization problem is equivalent to maximizing the coverage of each sub-barrier at the left-most and right-most nodes. \(s_{j_n}\) computes the orientation of all the sensors in \(SB_j\) by formulating a nonlinear optimization problem:

Maximize:

$$\begin{aligned} max\{0,R_s cos(\pi -\theta -\varphi _{j_1}) \} + R_s cos(\varphi _{j_n}) \end{aligned}$$

Subject to:

\(max\{0, R_s cos(\varphi _{j_i})\} + max\{0, R_s cos( \pi - \theta - \varphi _{j_{i+1}} ) \} \ge dist(s_{j_i}, s_{j_{i+1}} ) \) for \(i = 1, 2, 3, ..., n-1\)

\(0 \le \varphi _{j_i} \le \pi -\theta \) for \(i = 1, 2, ..., n\)

The objective function maximizes the coverage of the left most and right most sensors of the sub-barrier \(SB_j\). The first constraint makes sure that no new gap is formed between consecutive sensors in \(SB_j\). The variable constraint specifies the range of the orientation angle for each sensor in \(SB_j\).

The nonlinear optimization of the sub-barrier \(SB_j\) is computed by \(s_{j_n}\). Let us denote \(\varPhi ^{*}= (\varphi _{j_1}^{*}, \varphi _{j_2}^{*} ... \varphi _{j_n}^{*} )\) the orientation angles of all nodes in \(SB_j\) when the global maximum of the objective function is achieved. The node \(s_{j_n}\) then sends the \(\varPhi ^{*}\) values to all other nodes in \(SB_j\) using a message \(SetOrientation(s_{j_n}, \varPhi ^{*})\). When a node receives the \(\varPhi ^{*}\) values from its closest right neighbor, it switches to its optimal orientation accordingly. Then it waits a random delay and re-transmits the SetOrientation message by replacing the first field with its own ID.

Figure 2 shows the initial line-based sensor deployment, Fig. 6 shows sensor orientations after phase 2, and Fig. 9 shows sensor orientation after phase 3. After the phase 2, the number of gaps decreased from 6 to 2. After the phase 3 the total gap length is reduced, since the total coverage provided by \(SB_2\) is maximized.

4 Simulation Results

In this section, we conduct simulations using Matlab to evaluate the performance of our proposed distributed algorithm for mending barrier gaps. The sensor field is a belt region of length L = 500m and width H = 100m. The initial sensor orientation angle follows a uniform distribution in the range \([0,2\pi ]\). The sensing range is \(R_s\) = 15m.

Fig. 10.
figure 10

(a)Average number of unmended gaps when \(\theta =60^{\circ }\); (b)Average total gap length when \(\theta =60^{\circ }\).

As explained in Sect. 2, the actual sensor positions have random offsets following a Gaussian distribution with mean 0 and variance \(\sigma \). If we denote \(\sigma _{i}^{x}\) and \(\sigma _{i}^{y}\) the offset distance of the sensor node \(s_i\) in the horizontal and vertical directions, then we have \(\sigma _{i}^{x}, \sigma _{i}^{y} \sim N(0,\sigma ^{2})\). In our simulations we set \(\sigma _{x}=\sigma _{y}=5\).

We generate 100 different sensor deployments. Each data point in our simulation results is an average of 100 experiments. We compare the performance of our distributed gap mending algorithm with SRA and CRA algorithms proposed in [2]. SRA and CRA [2] are briefly described in Sect. 1.

Fig. 11.
figure 11

(a)Average number of unmended gaps when \(\theta =120^{\circ }\); (b)Average total gap length when \(\theta =120^{\circ }\).

Fig. 12.
figure 12

(a)Average number of unmended gaps when we vary the view angle; (b)Average total gap length when we vary the view angle.

In the first experiment in Fig. 10a, we measure the number of unmended gaps before and after running gap mending algorithms. The total number of sensors deployed in the field varies between 20 and 150 with a step size of 5. Each sensor has a view angle of \(\theta =60^{\circ }\).

Figure 10a shows that deploying a larger number of sensors leads to a smaller number of unmended gaps. The CRA algorithm mends more gaps than the SRA algorithm, while our distributed algorithm mends the most number of gaps among the three algorithms.

Figure 10b compares the total gap length of unmended gaps. Our distributed gap mending algorithm has a smallest total gap length. We can also observe the impact of phase 3 of our algorithm in reducing the total gap length.

In the second experiment, we measure the number of unmended gaps and total gap length when each sensor has a view angle of \(\theta =120^{\circ }\). The results are shown in Fig. 11. Our algorithm mend more gaps then SRA and CRA. We also provide a smaller total gap length.

In the third experiment in Fig. 12, we fix the total number of sensors to 20 and we vary the view angle between \(15^{\circ }\) and \(180^{\circ }\) with a step size of \(15^{\circ }\). The picture shows that a larger view angle leads to a lower number of unmended gaps, since each sensor provider a larger coverage. Our distributed algorithm achieves the least number of unmended gaps for all view angles. In addition, our algorithm with gap length optimization phase provides a smaller total gap length compared to SRA and CRA.

5 Conclusions

In this paper we studied weak barrier coverage for directional sensor networks with a line-based senor deployment. We aim to mend the maximum number of gaps as well as to minimize the total length of unmended gaps. We propose a distributed algorithm for mending gaps. A nonlinear optimization problem is formulated in order to minimize the total gap length. Simulation results show that our algorithm can greatly reduce the number of unmended gaps and the total gap length. In addition, simulation results show that our distributed algorithm outperforms the existing algorithms SRA and CRA.