# Verifiable Top-k Query Processing in Tiered Mobile Sensor Networks

Authors: Fangju Liu; Xingpo Ma; Junbin Liang; Mugang Lin
Journal: International Journal of Distributed Sensor Networks
 (2015)

---

## Abstract

Verifiable top-k query processing in tiered sensor networks, which refers to verifying the authenticity and the completeness of top-k query results received by the network owner in tiered sensor networks, has received attention in very recent years. However, the existing solutions of this problem are only fit for static sensor network. In this paper, we try to solve the problem in a tiered mobile sensor network model, where not only static sensor nodes but also mobile sensor nodes existed. Based on the tiered mobile sensor network model, we propose a novel verifiable scheme named VTMSN for fine-grained top-k queries. The main idea of VTMSN is as follows: it maps each of the positions where sensor nodes are in a static state to a virtual node and then establishes relationships among data items of each virtual node with their score orders, which are encrypted along with the scores of the data items and the time epochs using the distinct symmetric keys kept by each sensor node and the network owner. Both theory analysis and simulation results show the efficiency and the security of VTMSN.


---

## Body

## 1. Introduction

More and more attention has been paid to two-tiered sensor networks in recent years [1–3]. A two-tiered sensor network, which is shown in Figure 1, consists of a lot of resource constrained sensor nodes at the lower level and some master nodes with relatively abundant resource at the upper level. The main tasks of the sensor nodes are to monitor the surroundings and generate sensing data, while the main tasks of the master nodes are to collect the sensing data from the sensor nodes and answer queries from the network owner. This two-tiered architecture is known to improve the scalability and capacity of the sensor networks. Besides, it is also able to reduce system complexity and prolong the network lifetime [3].Figure 1
A traditional tiered sensor network model.In this paper, we present a new sensor network model named TMSN (tired mobile sensor network) based on the two-tiered network architecture, which is shown in Figure2. The difference between TMSN and the traditional two-tiered sensor network model is that mobile sensor nodes existed at the lower level of TMSN while all sensor nodes are static in the latter case. There are many advantages when mobile sensor nodes are introduced into the two-tiered network architecture. As an example, moving some of the mobile sensor nodes to heavy traffic regions can help balance the energy consumption of the sensor nodes at the lower level of TMSN. Another example is target coverage [4]. Some of targets in a tiered sensor network may lose coverage because of the early death of some sensor nodes or bad initial deployment of the sensor nodes. If some mobile sensor nodes exist, they can move to the position where dead nodes are located or to some other places by well designing [5].Figure 2
A tired mobile sensor network (TMSN) model.Top-k query is an important kind of queries in sensor networks. To obtain the top k data items from all the data items generated by the sensor nodes in the interested region, the network owner first sends a top-k query to each of the master nodes whose cells are intersected with the interested region. Each of the master nodes processes the top-k query locally and finds out the top-k query result in the intersected region in its own cell. Then the master nodes send their own query results to the network owner. Finally, the network owner finds out the final top-k query result according to the data received from the master nodes.Nowadays, the security of top-k queries in tired sensor networks is under threat. If the master nodes are compromised, they may tamper the query results and return incomplete and/or false top-k query results to the network owner. Moreover, although introducing mobile sensor nodes into tiered sensor network architecture can bring many advantages, it also brings some challenges. One of the challenges is that the data items generated by the same sensor node may be generated at different locations, and the compromised master node may take place the data items generated in the query region with the data items generated by the same sensor node in other places. This is hard to be detected using the existing security verification method in tired sensor networks.To verify the authentication and the completeness of the top-k query results received by the network owner in TMSN, we propose a novel verification scheme, which is called VTMSN. We assume that each sensor node in TMSN has two states: a mobile state and a static state, and they only generate sensing data when they are in a static state. The main technique of VTMSN is that it maps each of the positions where mobile sensor nodes are in a static state to a virtual static node. Thus, a mobile sensor node becomes one or many static sensor node/nodes for a given time interval. Then, with some modifications, schemes used in static tired sensor networks to verify the authentication and the completeness of the top-k query results received by the network owner can be used in TMSN.In summary, the main contributions of this paper are listed as follows:(i)
We present a new sensor network model named TMSN based on the two-tiered network architecture, where mobile sensor nodes are introduced into the lower tier of the architecture.
(ii)
We investigate the problem of verifiable fine-grained top-k queries in TMSN for the first time and propose an effective verification scheme called VTMSN to verify the authentication and the completeness of the top-k query results.
(iii)
Theory analysis and extensive experiment have been conducted to show the efficiency and feasibility of our scheme VTMSN.The rest of this paper is organized as follows. Section2 presents the related work; Section 3 presents the network and attack models; Section 4 presents the notations, some definitions, and the problem statement; in Section 5, we provide the novel verification scheme VTMSN as well as the analysis of its detection probability and energy efficiency; the simulation results and their analysis are given in Section 6; Section 7 makes a conclusion.


## 2. Related Work

Many schemes and protocols are developed to secure query processing in two-tiered sensor networks. Some of them are proposed for range queries [6]. Range queries ask for data within one or multiple attributes falling into specified ranges, and they are different from top-k queries, which aim at finding k data items with peak values among all the data items generated in the query region. Some other papers focus on the problem of securing top-k queries [3, 7–10]. Zhang et al. [3] proposed three schemes, which are the closest work to ours, to solve the problem of verifiable fine-grained top-k queries in two-tiered sensor networks. All of them are only fit for static tiered sensor networks, because it is assumed that the network owner knows the mapping between sensor node IDs and their respective geographic locations. This assumption can not hold in TMSN because of the mobile sensor nodes.There are also some works for mobile sensor networks or for mobile target detection in sensor networks [11]. Good schemes [4, 12, 13] are proposed to solve many kinds of coverage problems in mobile sensor networks; [14–17] are dedicated in localization in mobile sensor networks; routing protocols are studied in mobile sensor networks in [18–20]; an efficient framework for in-network data replication and acquisition in mobile sensor networks are proposed in [21]. In [22], mobility management of mobile sensors was discussed for the purposes of forming a better wireless sensor network. In [23], low cost data gathering using mobile hybrid sensor networks is achieved. In [24], a group-based discovery mechanism was proposed to reduce the discovery delay in low-duty-cycle mobile sensor networks. To the best of our knowledge, no work has been done considering mobile sensor nodes in tiered sensor networks at present.


## 3. Network and Attack Models

### 3.1. TMSN Model

Similar to the traditional tiered sensor networks, TMSN also contains two levels. At the lower level, there are a lot of resource-constrained sensor nodes, which are deployed into many cells. At the upper level, there are some master nodes with relatively abundant resource, each of which is responsible for one cell of sensor nodes at the lower level. We assume that time is divided into epochs, which is the same with [3]. At the end of each epoch, each sensor node sends all of its data generated during the epoch to its corresponding master node. After collecting the data from sensor nodes, master nodes can answer top-k queries from the external network owner. The network owner can communicate with some of the master nodes via an on-demand wireless (e.g., satellite) link, which is relatively low-rate. We assume that each sensor node communicates with its neighboring sensor nodes with short-range radios while master nodes can communicate with their neighboring master nodes through relatively high-rate, long-range radios.The significant difference between TMSN and the traditional tiered sensor networks is that mobile sensor nodes existed in TMSN while all sensor nodes are static in the latter case. The manner of mobility for a sensor node can be divided into two kinds: controllable mobility and uncontrollable mobility. In this paper, we assume the mobility behaviors of sensor nodes are controllable. Specifically, we assume that each sensor node only moves in its own cell. The sensor nodes do not always move because their energy is limited. They will stop moving and monitor the surroundings to meet the demand of applications. When a sensor node stops at some place, the first thing it does is to estimate its position. We assume that some localization techniques in mobile sensor networks such as [14–17] are adopted to help the sensor nodes estimate their current locations. Thus, each sensor node in TMSN has two states: a mobile state and a static state. We assume that all sensor nodes generate sensing data only when they are in a static state, and we consider it a reasonable assumption because data items often need to be bound up with the locations where they are generated. Besides, we assume that all mobile sensor nodes will stop moving at the end of each epoch and assist other sensor nodes to route their data to the corresponding master nodes in the cell.


### 3.2. Adversary Model

Our attack model is similar as [3]. Specifically, we assume that both master nodes and sensor nodes can be compromised, and the sensor nodes that are not compromised are the majority. Adversaries may insert forged data to query results and/or return incomplete query results to the network owner through the compromised master nodes. We do not require the confidentiality of the top-k query results as in [3], but we do require the authenticity and completeness of top-k results. Because each master node in TMSN is in charge of one cell and each sensor node corresponds to one master node, an attacker who wants to break the authenticity and/or completeness of top-k query results in one cell can not get help from the compromised nodes in other cells. Thus we only focus on a cell C consisting of N sensor nodes, which are denoted by {
S
i
}
i
=
1
N, and one compromised master node M in this paper.


## 3.1. TMSN Model

Similar to the traditional tiered sensor networks, TMSN also contains two levels. At the lower level, there are a lot of resource-constrained sensor nodes, which are deployed into many cells. At the upper level, there are some master nodes with relatively abundant resource, each of which is responsible for one cell of sensor nodes at the lower level. We assume that time is divided into epochs, which is the same with [3]. At the end of each epoch, each sensor node sends all of its data generated during the epoch to its corresponding master node. After collecting the data from sensor nodes, master nodes can answer top-k queries from the external network owner. The network owner can communicate with some of the master nodes via an on-demand wireless (e.g., satellite) link, which is relatively low-rate. We assume that each sensor node communicates with its neighboring sensor nodes with short-range radios while master nodes can communicate with their neighboring master nodes through relatively high-rate, long-range radios.The significant difference between TMSN and the traditional tiered sensor networks is that mobile sensor nodes existed in TMSN while all sensor nodes are static in the latter case. The manner of mobility for a sensor node can be divided into two kinds: controllable mobility and uncontrollable mobility. In this paper, we assume the mobility behaviors of sensor nodes are controllable. Specifically, we assume that each sensor node only moves in its own cell. The sensor nodes do not always move because their energy is limited. They will stop moving and monitor the surroundings to meet the demand of applications. When a sensor node stops at some place, the first thing it does is to estimate its position. We assume that some localization techniques in mobile sensor networks such as [14–17] are adopted to help the sensor nodes estimate their current locations. Thus, each sensor node in TMSN has two states: a mobile state and a static state. We assume that all sensor nodes generate sensing data only when they are in a static state, and we consider it a reasonable assumption because data items often need to be bound up with the locations where they are generated. Besides, we assume that all mobile sensor nodes will stop moving at the end of each epoch and assist other sensor nodes to route their data to the corresponding master nodes in the cell.


## 3.2. Adversary Model

Our attack model is similar as [3]. Specifically, we assume that both master nodes and sensor nodes can be compromised, and the sensor nodes that are not compromised are the majority. Adversaries may insert forged data to query results and/or return incomplete query results to the network owner through the compromised master nodes. We do not require the confidentiality of the top-k query results as in [3], but we do require the authenticity and completeness of top-k results. Because each master node in TMSN is in charge of one cell and each sensor node corresponds to one master node, an attacker who wants to break the authenticity and/or completeness of top-k query results in one cell can not get help from the compromised nodes in other cells. Thus we only focus on a cell C consisting of N sensor nodes, which are denoted by {
S
i
}
i
=
1
N, and one compromised master node M in this paper.


## 4. Definitions, Notations, and Problem Statement

In this section, we present some definitions and important notations used throughout the paper as well as the problem investigated in this paper.


### 4.1. Definitions and Notations

We first list some definitions used in this paper as follows.Definition 1 (virtual node).
A virtual node is a position where a real sensor node is in a static state, and it only exists in the epoch/epochs when the sensor node is in a static state at the position.Definition 2 (mother node and child node).
A mother node is a real sensor node, and the child nodes of the mother node are virtual nodes generated by the same mother node.Definition 3 (queried sensor node).
If at least one child node of a sensor node is in the query region of a top-k query during the interested time epoch, the sensor node is called queried sensor node for the query.Definition 4 (qualified and unqualified data item).
If a data item is among the topk data items generated in the query region of a top-k query during the interested time epoch, the data item is qualified for the query. Otherwise it is unqualified for the query.Definition 5 (qualified and unqualified virtual node).
If at least onequalified data item is generated on a virtual node for a top-k query, the virtual node is called a qualified virtual node for the query. Otherwise it is called an unqualified virtual node for the query.Now we present the notations used in this paper. Assume that, during epocht, each node S
i
∈
{
S
i
}
i
=
1
N generates λ
i
t virtual nodes, which are denoted by V
N
D
i
=
{
v
n
d
i
j
}
j
=
1
λ
i
t, and μ
i
j data items denoted by D
i
j
=
{
D
i
,
h
j
}
h
=
1
μ
i
j are generated on each virtual node v
n
d
i
j
∈
V
N
D
i. Each data item D
i
,
h
j
∈
D
i
j can be scored by some public scoring functions, such as the one in [25]. Let f
(
·
) denote a good public scoring function and let d
i
,
h
j denote the score of D
i
,
h
j. Then we have d
i
,
h
j
=
f
(
D
i
,
h
j
). In [3], if a data item is smaller than or equal to another data item, the score of the former data item is also smaller than or equal to the score of the latter data item. In this paper, we release this assumption and just assume that different data items have different data scores. W in this paper denotes the network owner. I
t
=
{
i
}
i
=
1
N is used to denote the ID set of all the sensor nodes in cell C, and V
I
t
i
=
{
(
i
,
j
)
}
j
=
1
λ
i
t denotes the ID set of the child nodes of sensor node S
i (∀
i
∈
I
t).We useQ
t
=
C
,
t
,
k
,
Q
R to denote a primitive top-k query in TMSN, where C denotes a cell ID, t is the epoch number, k is the desired number of data items with peak values, and Q
R is the query region. We use R
Q
t to denote the query result of Q
t. In this paper, we only pay attention to the primitive queries, because more complicated queries can be decomposed into multiple primitive ones easily.


### 4.2. Problem Statement

In this subsection, we present the problem and some metrics that we use to evaluate the performance of the verification scheme proposed in this paper.Given a queryQ
t
=
C
,
t
,
k
,
Q
R, the problem we are interested in this paper is how to verify the authenticity and completeness of R
Q
t in TMSN, where the authenticity of R
Q
t means that all data items in R
Q
t are indeed generated on virtual nodes in Q
R during epoch t, and the completeness of R
Q
t means that R
Q
t indeed contains the top k data items among all the candidates.One of the performance metrics used in this paper isP
d
e
t, which denotes the probability that an incomplete and/or forged top-k query result is detected [3]. Maximizing the lifetime of sensor networks is an important target for many protocols in sensor networks [26, 27]. Generally speaking, communication consumes most of the energy. If the communication cost is decreased, the lifetime of the sensor networks can increase significantly. Thus, the performance metrics used in this paper also include the following.(i)
C
v
-
s
m
: In-Cell Communication Cost. It is the energy consumption in bits incurred by transmitting and receiving the verification information generated by the sensor nodes in cell C per epoch. We also assume that the energy consumption of transmitting and receiving every bit across each hop is the same as [3].(ii)
C
v
-
m
w
: Query Communication Cost. It is the energy consumption in bits incurred by sending and receiving the verification information between M and W to reply to a top-k query. It may need to travel multiple master nodes and the on-demand wireless link for M to connect W. For simplicity, we consider the route connecting M to W a virtual hop. The energy consumption of transmitting one bit across a virtual hop is different from that between neighboring sensor nodes.(iii)
R
v
s
: Ratio of Cost. It is the ratio of the cost of transmitting and receiving verification information to that of transmitting and receiving data items, which are not verification information.


## 4.1. Definitions and Notations

We first list some definitions used in this paper as follows.Definition 1 (virtual node).
A virtual node is a position where a real sensor node is in a static state, and it only exists in the epoch/epochs when the sensor node is in a static state at the position.Definition 2 (mother node and child node).
A mother node is a real sensor node, and the child nodes of the mother node are virtual nodes generated by the same mother node.Definition 3 (queried sensor node).
If at least one child node of a sensor node is in the query region of a top-k query during the interested time epoch, the sensor node is called queried sensor node for the query.Definition 4 (qualified and unqualified data item).
If a data item is among the topk data items generated in the query region of a top-k query during the interested time epoch, the data item is qualified for the query. Otherwise it is unqualified for the query.Definition 5 (qualified and unqualified virtual node).
If at least onequalified data item is generated on a virtual node for a top-k query, the virtual node is called a qualified virtual node for the query. Otherwise it is called an unqualified virtual node for the query.Now we present the notations used in this paper. Assume that, during epocht, each node S
i
∈
{
S
i
}
i
=
1
N generates λ
i
t virtual nodes, which are denoted by V
N
D
i
=
{
v
n
d
i
j
}
j
=
1
λ
i
t, and μ
i
j data items denoted by D
i
j
=
{
D
i
,
h
j
}
h
=
1
μ
i
j are generated on each virtual node v
n
d
i
j
∈
V
N
D
i. Each data item D
i
,
h
j
∈
D
i
j can be scored by some public scoring functions, such as the one in [25]. Let f
(
·
) denote a good public scoring function and let d
i
,
h
j denote the score of D
i
,
h
j. Then we have d
i
,
h
j
=
f
(
D
i
,
h
j
). In [3], if a data item is smaller than or equal to another data item, the score of the former data item is also smaller than or equal to the score of the latter data item. In this paper, we release this assumption and just assume that different data items have different data scores. W in this paper denotes the network owner. I
t
=
{
i
}
i
=
1
N is used to denote the ID set of all the sensor nodes in cell C, and V
I
t
i
=
{
(
i
,
j
)
}
j
=
1
λ
i
t denotes the ID set of the child nodes of sensor node S
i (∀
i
∈
I
t).We useQ
t
=
C
,
t
,
k
,
Q
R to denote a primitive top-k query in TMSN, where C denotes a cell ID, t is the epoch number, k is the desired number of data items with peak values, and Q
R is the query region. We use R
Q
t to denote the query result of Q
t. In this paper, we only pay attention to the primitive queries, because more complicated queries can be decomposed into multiple primitive ones easily.


## 4.2. Problem Statement

In this subsection, we present the problem and some metrics that we use to evaluate the performance of the verification scheme proposed in this paper.Given a queryQ
t
=
C
,
t
,
k
,
Q
R, the problem we are interested in this paper is how to verify the authenticity and completeness of R
Q
t in TMSN, where the authenticity of R
Q
t means that all data items in R
Q
t are indeed generated on virtual nodes in Q
R during epoch t, and the completeness of R
Q
t means that R
Q
t indeed contains the top k data items among all the candidates.One of the performance metrics used in this paper isP
d
e
t, which denotes the probability that an incomplete and/or forged top-k query result is detected [3]. Maximizing the lifetime of sensor networks is an important target for many protocols in sensor networks [26, 27]. Generally speaking, communication consumes most of the energy. If the communication cost is decreased, the lifetime of the sensor networks can increase significantly. Thus, the performance metrics used in this paper also include the following.(i)
C
v
-
s
m
: In-Cell Communication Cost. It is the energy consumption in bits incurred by transmitting and receiving the verification information generated by the sensor nodes in cell C per epoch. We also assume that the energy consumption of transmitting and receiving every bit across each hop is the same as [3].(ii)
C
v
-
m
w
: Query Communication Cost. It is the energy consumption in bits incurred by sending and receiving the verification information between M and W to reply to a top-k query. It may need to travel multiple master nodes and the on-demand wireless link for M to connect W. For simplicity, we consider the route connecting M to W a virtual hop. The energy consumption of transmitting one bit across a virtual hop is different from that between neighboring sensor nodes.(iii)
R
v
s
: Ratio of Cost. It is the ratio of the cost of transmitting and receiving verification information to that of transmitting and receiving data items, which are not verification information.


## 5. Verifiable Top-k Queries in TMSN

In this section, we first propose a novel scheme named VTMSN for verifiable top-k queries in TMSN. For clarity, we ignore compromised sensor nodes temporarily in Section 5.1. Then P
d
e
t, C
v
-
s
m, and C
v
-
m
w are analyzed in Section 5.2. Finally, the impact of compromised sensor nodes is discussed in Section 5.3.


### 5.1. VTMSN: A Novel Verification Scheme in TMSN

VTMSN enables completeness verification by establishing relationships between every two ordered neighboring data items of each virtual node with their orders, which are encrypted along with the time epoch numbers and the virtual node IDs by the symmetric keys shared by sensor nodes and the network ownerW. For each sensor node S
i (∀
i
∈
I
t), we assume that a distinct symmetric key K
i between S
i and W is preloaded on it. To achieve forward-secure authenticity, K
i can be epoch-based as in [7–9]. VTMSN enables authenticity verification by taking the scores of data items encrypted with the distinct keys as the verification information. Recall that different data items have different data scores, each of which is very short in length. Thus, if we create verification information by encrypting the scores, it can not only make the authenticity of top-k query results verifiable but also shrink the amount of verification information. Specifically, VTMSN includes the following four stages.


#### 5.1.1. Data Preparation

At the end of each epoch, each sensor nodeS
i (∀
i
∈
I
t) prepares the data generated during the epoch and some necessary verification information, which will be sent to the master node M. Let I
N
F
O
i
j denote the information that S
i prepares for its child node v
n
d
i
j, let l
o
c
i
j denote the location of virtual node v
n
d
i
j, and let E
K
i
{
∗
} denote the encryption operation with key K
i. Then, according to different values of μ
i
j, the content of I
N
F
O
i
j is also different, and it is shown as follows:(i)
ifμ
i
j
=
0,(1)
I
N
F
O
i
j
=
l
o
c
i
j
,
E
K
i
t
∥
j
;
(ii)
ifμ
i
j
≠
0,(2)
I
N
F
O
i
j
=
l
o
c
i
j
,
E
K
i
μ
i
j
∥
t
∥
j
,
D
i
,
1
j
,
E
K
i
1
∥
t
∥
d
i
,
1
j
∥
j
,
D
i
,
2
j
,
E
K
i
2
∥
t
∥
d
i
,
2
j
∥
j
,
…
,
D
i
,
μ
i
j
-
1
j
,
E
K
i
μ
i
j
-
1
∥
t
∥
d
i
,
μ
i
j
-
1
j
∥
j
,
D
i
,
μ
i
j
j
,
E
K
i
μ
i
j
∥
t
∥
d
i
,
μ
i
j
j
∥
j
,where term E
K
i
{
μ
i
j
∥
t
∥
l
o
c
i
j
} is needed for verification when μ
i
j
<
k and all data items of S
i arequalified data items. It is used to determine whether the data are dropped by the master node M or not in such a case.


#### 5.1.2. Data Submission

After preparing the information for each virtual nodev
n
d
i
j, each sensor node S
i (∀
i
∈
I
t) sends a message, which includes the information prepared for each child node v
n
d
i
j (∀
v
n
d
i
j
∈
V
N
D
i) of node S
i, to master M. Specifically, the message is as follows:(3)
S
i
⟶
M
:
i
,
E
K
i
t
∥
1
∥
l
o
c
i
1
∥
2
∥
l
o
c
i
2
∥
⋯
∥
λ
i
t
∥
l
o
c
i
λ
i
t
,
I
N
F
O
i
1
,
I
N
F
O
i
2
,
…
,
I
N
F
O
i
λ
i
t
.When the message is received byM, the data items and verification information included in the message will be stored on M.


#### 5.1.3. Query Processing

When a top-k query primitive Q
t
=
C
,
t
,
k
,
Q
R
t is received by the master node M in cell C, M first locates the top k data items among all data items generated in Q
R
t during epoch t and then sends them along with some verification information to W. Suppose that there are totally m
queried sensor nodes which are denoted as Q
S
N
t
=
{
S
x
a
}
a
=
1
m for Q
t, and each sensor node S
i
∈
Q
S
N
t has ω
i
t child nodes which are denoted as Q
V
N
i
t
=
{
v
n
d
i
y
b
}
b
=
1
ω
i
t in Q
R
t during epoch t, where the combination (
i
,
y
b
) is the ID of the virtual node v
n
d
i
y
b. Let R
S
T
i
j denote the information included in the query result for child node v
n
d
i
j
∈
Q
V
N
i
t of sensor node S
i
∈
Q
S
N
t and let n
i
j denote the number ofqualified data items generated by S
i on virtual node v
n
d
i
j
∈
Q
V
N
i
t during epoch t. Then, the content of R
S
T
i
j is as follows:(i)
Ifn
i
j
=
μ
i
j
=
0,(4)
R
S
T
i
j
=
E
K
i
t
∥
j
.
(ii)
Ifn
i
j
=
0, μ
i
j
>
0,(5)
R
S
T
i
j
=
E
K
i
1
∥
t
∥
d
i
,
1
j
∥
j
.
(iii)
If0
<
n
i
j
=
μ
i
j
<
k, (6)
R
S
T
i
j
=
E
K
i
μ
i
j
∥
t
∥
j
,
D
i
,
1
j
,
E
K
i
1
∥
t
∥
d
i
,
1
j
∥
j
,
D
i
,
2
j
,
E
K
i
2
∥
t
∥
d
i
,
2
j
∥
j
,
…
,
D
i
,
μ
i
j
-
1
j
,
E
K
i
μ
i
j
-
1
∥
t
∥
d
i
,
μ
i
j
-
1
j
∥
j
,
D
i
,
μ
i
j
j
,
E
K
i
μ
i
j
∥
t
∥
d
i
,
μ
i
j
j
∥
j
.
(iv)
Ifn
i
j
=
k and μ
i
j
≥
k,(7)
R
S
T
i
j
=
D
i
,
1
j
,
E
K
i
1
∥
t
∥
d
i
,
1
j
∥
j
,
D
i
,
2
j
,
E
K
i
2
∥
t
∥
d
i
,
2
j
∥
j
,
…
,
D
i
,
k
-
1
j
,
E
K
i
k
-
1
∥
t
∥
d
i
,
k
-
1
j
∥
j
,
D
i
,
k
j
,
E
K
i
k
∥
t
∥
d
i
,
k
j
∥
j
.
(v)
If0
<
n
i
j
<
k and μ
i
j
>
n
i
j,(8)
R
S
T
i
j
=
D
i
,
1
j
,
E
K
i
1
∥
t
∥
d
i
,
1
j
∥
j
,
D
i
,
2
j
,
E
K
i
2
∥
t
∥
d
i
,
2
j
∥
j
,
…
,
D
i
,
n
i
j
-
1
j
,
E
K
i
n
i
j
-
1
∥
t
∥
d
i
,
n
i
j
-
1
j
∥
j
,
D
i
,
n
i
j
j
,
E
K
i
n
i
j
∥
t
∥
d
i
,
n
i
j
j
∥
j
,
E
K
i
n
i
j
+
1
∥
t
∥
d
i
,
n
i
j
+
1
j
∥
j
.After M prepares R
S
T
i
j for each child node v
n
d
i
j
∈
Q
V
N
i
t of each sensor node S
i
∈
Q
S
N
t, M checks whether it has answered a query whose interested time epoch is the same as that of Q
t. If M has not answered such a query, it returns the following information for each S
i, ∀
i
∈
I
t:(i)
IfS
i
∈
Q
S
N
t, the information is(9)
M
⟶
W
:
i
,
E
K
i
t
∥
1
∥
l
o
c
i
1
∥
2
∥
l
o
c
i
2
∥
⋯
∥
λ
i
t
∥
l
o
c
i
λ
i
t
,
R
S
T
i
y
b
b
=
1
ω
i
t
,
whereR
S
T
i
y
b denotes the information included in the query result for child node v
n
d
i
y
b
∈
Q
V
N
i
t of sensor node S
i
∈
Q
S
N
t.
(ii)
IfS
i
∉
Q
S
N
t, the information is(10)
M
⟶
W
:
i
,
E
K
i
t
∥
1
∥
l
o
c
i
1
∥
2
∥
l
o
c
i
2
∥
⋯
∥
λ
i
t
∥
l
o
c
i
λ
i
t
.IfM has answered a top-k query whose interested time epoch is the same as that of Q
t, it does not need to return the location information for virtual nodes formed during epoch t, because the network owner can find this information from the history query records. Thus, M only needs to return the following information to W for each S
i
∈
Q
S
N
t in this case:(11)
M
⟶
W
:
i
,
R
S
T
i
y
b
b
=
1
ω
i
t
.In fact, the amount of information inR
Q
t can be further shrunk when Q
t is not the first top-k query whose interested time epoch is t. As an example, if v
n
d
i
j is in Q
R
t and it has no qualified data item for query Q
t, R
Q
t should include term E
K
i
{
t
∥
j
}. However, if the same case has appeared for a former query whose interested time epoch is also t, term E
K
i
{
t
∥
j
} does not need to be included in R
Q
t because it has been sent to the network owner before.


#### 5.1.4. Verification

When receiving a top-k query result R
Q
t, the network owner checks the authenticity of R
Q
t in the following way. For each data item D
i
,
h
j in R
Q
t, the network owner decrypts term E
K
i
{
h
∥
t
∥
d
i
,
h
j
∥
j
} following D
i
,
h
j in R
Q
t and checks whether d
i
,
h
j got from term E
K
i
{
h
∥
t
∥
d
i
,
h
j
∥
j
} is equal to f
(
D
i
,
h
j
), where f
(
∗
) is a public scoring function [4]. If they are equal, data items in R
Q
t are authentic; otherwise they are not. The principle is that different data items have different scores [3], and if a compromised master node modifies D
i
,
h
j, it should also modify d
i
,
h
j in term E
K
i
{
h
∥
t
∥
d
i
,
h
j
∥
j
}. However, it can not do this because it does not know the key K
i.Completeness verification ofR
Q
t is a little complicated. The first step to verify the completeness of R
Q
t is to check whether each sensor node S
i in cell C has sent term E
K
i
{
t
∥
1
∥
l
o
c
i
1
∥
2
∥
l
o
c
i
2
∥
⋯
∥
λ
i
t
∥
l
o
c
i
λ
i
t
} to the network owner. If any sensor node has not sent it, R
Q
t is considered incomplete. The second step is to check whether term R
S
T
i
j for each child node v
n
d
i
j
∈
Q
V
N
i
j of each sensor node S
i
∈
Q
S
N
t has been sent to the network owner. If at least one of them has not been sent to the network owner, R
Q
t is considered incomplete. The last step is to verify the completeness of each R
S
T
i
j in R
Q
t. If they are all verified to be complete, R
Q
t is considered complete; otherwise it is not. Details of completeness verification of each R
S
T
i
j are given in Algorithm 1, where d
s
m
a
l
l
e
s
t is the smallest data score in R
Q
t.Algorithm 1:Completeness verification of R
S
T
i
j.
Input: top-k query Q
t
=
C
,
t
,
k
,
Q
R
t, R
S
T
i
j, d
s
m
a
l
l
e
s
t
Output:completeness
(1)completeness=true
(2)if
R
S
T
i
j
includes
γ
i
j(γ
i
j ≠ 0) data items denoted by
D
i
,
h
j
h
=
1
γ
i
j
(3)   Decrypt each termE
K
i
h
∥
t
∥
d
i
,
h
j
∥
j following each data item D
i
,
h
j
∈
D
i
,
h
j
h
=
1
γ
i
j with K
i
(4)if (the orders got from each term
E
K
i
h
∥
t
∥
d
i
,
h
j
∥
j
are not consecutive from 1 to
γ
i
j)
(5)c
o
m
p
l
e
t
e
n
e
s
s
=
f
a
l
s
e
(6)if term E
K
i
μ
i
j
∥
t
∥
j
is in
R
S
T
i
j
(7)   ifμ
i
j ≠ γ
i
j
c
o
m
p
l
e
t
e
n
e
s
s
=
f
a
l
s
e
(8)else
if
term
E
K
i
(
γ
i
j
+
1
)
∥
t
∥
d
i
,
γ
i
j
+
1
j
∥
j
is in R
S
T
i
j
(9)if
d
i
,
γ
i
j
+
1
j
≥
d
s
m
a
l
l
e
s
t
c
o
m
p
l
e
t
e
n
e
s
s
=
f
a
l
s
e
(10)
else
if
γ
i
j
≠
k
c
o
m
p
l
e
t
e
n
e
s
s
=
f
a
l
s
e
(11)
(12)
(13)else if no  data item is in
R
S
T
i
j
(14)if (both term
E
K
i
t
∥
j and E
K
i
1
∥
t
∥
d
i
,
1
j
∥
j
are not in
R
S
T
i
j) or
((E
K
i
1
∥
t
∥
d
i
,
1
j
∥
j  is in
R
S
T
i
j) and (d
i
,
1
j
≥
d
s
m
a
l
l
e
s
t))
(15)
completeness= false
(16)
(17)if(not all the encrypted terms in
R
S
T
i
j
can be decrypted by the same symmetric key) or
(not all the values of j in the encrypted terms in
R
S
T
i
j
are the same)or(at least one time epoch
number in the encrypted terms in
R
S
T
i
j
is not equal to t)
(18)c
o
m
p
l
e
e
n
e
s
s
=
f
a
l
s
e
(19)return
completeness.In Algorithm1, lines (1)–(16) can verify the completeness of R
S
T
i
j under the condition that the data items and their corresponding verification information in R
S
T
i
j are not replaced by those of other virtual nodes. Lines (17)-(18) are added to tear off this constraint condition.


### 5.2. Performance Analysis of VTMSN

Theorem 6.
As long as none of the queried sensor nodes is compromised, a compromised master node can not insert forged data into query results without being detected by VTMSN.Proof.
This theorem is actually proved in the verification stage in Section4.1.Theorem 7.
As long as none of the queried sensor nodes is compromised, a compromised master node can not replace data items generated during the interested time epoch with data items generated in some other time epochs without being detected by VTMSN.Proof.
Each encrypted term in top-k query results contains an epoch number t in VTMSN. Thus, it is easy to detect such behaviors by checking the time epoch numbers in the encrypted terms.Theorem 8.
As long as none of the queried sensor nodes is compromised, a compromised master node can not replace qualified data items with unqualified data items generated during the same epoch without being detected by VTMSN.Proof.
It is clear that the corresponding verification information should also be replaced if some data items are replaced. Then, the following two propositions prove that Theorem8 holds.(1)
The compromised master node can not replacequalified data items withunqualified data items of the same virtual node without being detected by VTMSN. This is because the orders in the encrypted terms following the data items will not be consecutive if such behavior is made.
(2)
The compromised master node can not replacequalified data items withunqualified data items of some other virtual nodes without being detected by VTMSN. The verification information of a virtual node in the query region can not be totally replaced with those of another virtual node because each virtual node in the query region is asked to include its verification information in the query result. Besides, if somequalified data items of a virtual node are replaced withunqualified data items of some other virtual nodes, either the encrypted terms for the same virtual node in the query result can not be decrypted by the same key or the values of j got from each encrypted term following each data item of the same virtual node in the query result are not the same. According to Algorithm 1, both cases can be detected by VTMSN.Theorem 9.
As long as none of the queried sensor nodes is compromised, VTMSN can detect any incomplete top-k query result with probability P
d
e
t
=
1.Proof.
There are totally two methods forM to break the completeness of top-k query results. The first method is to replace thequalified data items with someunqualified data items, and the second method is to drop part or all of thequalified data items without replacing them withunqualified data items. According to Theorems 7 and 8, it can be detected with P
d
e
t
=
1 if M adopts the first method. Then we prove that it can also be detected by VTMSN with probability P
d
e
t
=
1 if M adopts the second method. For each qualified virtual node v
n
d
i
j, if M drops part of thequalified data items of v
n
d
i
j, M must drop all the last σ
i
j (0
<
σ
i
j
<
n
i
j)qualified data items and all theunqualified data items of v
n
d
i
j in order to make the orders of the left data items consecutive. Then term E
K
i
{
μ
i
j
∥
t
∥
j
} or E
K
i
{
χ
∥
t
∥
d
i
,
χ
j
∥
j
} must be left in the query result, where χ
=
n
i
j
-
σ
i
j
+
1; otherwise R
S
T
i
j will be considered incomplete according to Algorithm 1. If term E
K
i
{
μ
i
j
∥
t
∥
j
} is left in the query result, μ
i
j got from E
K
i
{
μ
i
j
∥
t
∥
j
} must not be equal to the number of data items of v
n
d
i
j left in the query result. If term E
K
i
{
χ
∥
t
∥
d
i
,
χ
j
∥
j
} is left in the query result, d
i
,
χ
j got from term E
K
i
{
χ
∥
t
∥
d
i
,
χ
j
∥
j
} must be not smaller than the smallest data score of the data items in the query result. According to Algorithm 1, the query result can be considered incomplete in both cases. If M drops allqualified data items of v
n
d
i
j, the incomplete query result can also be detected because M can not generate a legal term E
K
i
{
t
∥
j
} or E
K
i
{
1
∥
t
∥
d
i
,
1
j
∥
j
} without knowing K
i. Thus, any incomplete query result can be detected as long as none of thequeried sensor nodes is compromised.Next, we will analyze the in-cell communication costC
v
-
s
m of VTMSN. Note that all information in the message sent from each sensor node to M is the verification information except data items. In this paper, we assume that the length of the data after they are encrypted is the same as that before they are encrypted. We use ζ
i
t to denote the number of child nodes, which have data items in epoch t, of each sensor node S
i (∀
i
∈
I
t). Then the number of child nodes, which do not have data items in epoch t, of sensor node S
i is λ
i
t
-
ζ
i
t. The meanings of some other parameters are listed in Table 1.Table 1
Parameters and their meanings.
Para.
Meaning
l
o
r
d
e
r
Length in bits of an order number
l
e
p
o
c
h
Length in bits of an epoch number
l
l
o
c
Length in bits of each  location
l
i
d
Length in bits of an ID number
l
n
u
m
Length in bits of number of data items
l
s
c
o
r
e
Length in bits of a data scoreFor a child node, which does not have data item in time epocht, of sensor node S
i, the length of verification information per epoch in bits is(12)
L
i
λ
-
ζ
=
l
l
o
c
+
l
e
p
o
c
h
+
l
i
d
.LetT
a
v
g denote the average time for a sensor node to be in a static state per epoch and let f
d denote the average data generating frequency of each sensor node. The average number of data items that are generated on a child node in one epoch is(13)
μ
=
f
d
∗
T
a
v
g
.Then, for a child node that has data items in time epocht of sensor node S
i, the length of verification information in bits per epoch is(14)
L
i
ζ
=
l
l
o
c
+
l
e
p
o
c
h
+
l
i
d
+
l
n
u
m
+
μ
∗
l
e
p
o
c
h
+
l
i
d
+
l
o
r
d
e
r
+
l
s
c
o
r
e
.For each sensor nodeS
i (∀
i
∈
I
t), it also has to take some locations and IDs of its child nodes as the verification information. Thus, the length of verification information prepared by each sensor node S
i (∀
i
∈
I
t) in bits per epoch is(15)
L
S
i
=
l
i
d
+
l
e
p
o
c
h
+
λ
i
t
∗
l
l
o
c
+
l
i
d
+
λ
i
t
-
ζ
i
t
∗
L
i
λ
-
ζ
+
ζ
i
t
∗
L
i
ζ
.Leth
i denote the hop counts from S
i to M along the shortest path at the end of epoch t. Then the in-cell communication cost C
v
-
s
m
S
i in bits incurred by sending the verification information generated by S
i to M is(16)
C
v
-
s
m
S
i
=
L
S
i
∗
h
i
.Then we have(17)
C
v
-
s
m
=
∑
i
=
1
N
2
∗
C
v
-
s
m
S
i
.In this paper, we assume that the energy consumption incurred by sending and receiving one bit of data is the same as in [3]. So in formula (17), the total energy consumption is doubled.Suppose that a queryQ
t
=
C
,
t
,
k
,
Q
R
t is received by M. We then derive the query communication cost C
v
-
m
w incurred by VTMSN. First, the query communication cost in bits incurred by sending the verification information from M to W for each virtual node v
n
d
i
j that is located in Q
R
t is(18)
C
v
-
s
m
v
n
d
i
j
=
l
i
d
+
l
e
p
o
c
h
n
i
j
=
μ
i
j
=
0
l
i
d
+
l
o
r
d
e
r
+
l
e
p
o
c
h
+
l
s
c
o
r
e
n
i
j
=
0
,
μ
i
j
>
0
l
i
d
+
l
n
u
m
+
l
e
p
o
c
h
+
μ
i
j
l
e
p
o
c
h
+
l
s
c
o
r
e
+
l
o
r
d
e
r
+
l
i
d
0
<
n
i
j
=
μ
i
j
<
k
k
l
e
p
o
c
h
+
l
o
r
d
e
r
+
l
s
c
o
r
e
+
l
i
d
n
i
j
=
k
n
i
j
+
1
l
e
p
o
c
h
+
l
s
c
o
r
e
+
l
o
r
d
e
r
+
l
i
d
1
≤
n
i
j
<
k
,
μ
i
j
>
n
i
j
,where μ
i
j is the total number of data items generated by sensor node S
i on its child node v
n
d
i
j during time epoch t and n
i
j is the number ofqualified data items among the μ
i
j data items.LetC
v
-
m
w
S
i denote query communication cost in bits incurred by sending the verification information generated by S
i from M to W. Then, if M has not answered a top-k query whose interested time epoch is the same as that of Q
t, the following two cases should be considered.(i)
The first case is thatS
i is not aqueried sensor node; then (19)
C
v
-
m
w
S
i
=
l
i
d
+
l
e
p
o
c
h
+
λ
i
t
∗
l
l
o
c
+
l
i
d
.
(ii)
The second case is thatS
i has ω
i
t (ω
i
t
≠
0) child nodes located in Q
R
t; then we have(20)
C
v
-
m
w
S
i
=
l
i
d
+
l
e
p
o
c
h
+
λ
i
t
∗
l
l
o
c
+
l
i
d
+
∑
a
=
1
ω
i
t
C
v
-
s
m
v
n
d
i
x
a
,where C
v
-
s
m
v
n
d
i
x
a is the query cost for v
n
d
i
x
a
∈
Q
V
N
i
t and ω
i
t is the number of child nodes of sensor node S
i
∈
Q
S
N
t.IfM has answered a top-k query whose interested time epoch is the same as that of Q
t, the location information of each virtual node does not need to be sent to the network owner any more. Moreover, we further shrink the amount of information in top-k query results by excluding the information that has been sent to the network owner. Thus, if S
i is aqueried sensor node for Q
t, the following inequality holds:(21)
C
v
-
m
w
S
i
≤
l
i
d
+
∑
a
=
1
ω
i
t
C
v
-
s
m
v
n
d
i
x
a
.If sensor nodeS
i is not aqueried sensor node for Q
t, then(22)
C
v
-
m
w
S
i
=
0
.Then we have(23)
C
v
-
m
w
≤
∑
i
=
1
N
2
∗
C
v
-
m
w
S
i
.Similarly, we assume that the energy consumption incurred by sending and receiving one bit of data is the same across the on-demand wireless link. Thus,C
v
-
m
w is doubled in (23).


### 5.3. Impact of Compromising Some Sensor Nodes

In above sections, we never consider the case that some sensor nodes are compromised. Thus we now further analyze the impact of compromised sensor nodes. If some sensor nodes are compromised, the following two kinds of attack may be launched.(1) The compromised sensor nodes may collaborate with M to help it escape the detection. The impact of this behavior depends on P
c, which is the probability that at least onequeried sensor node is compromised. In [3], it is known that if sensor nodes are static and uniformly distributed, the probability that at least one compromised node is in the query region is 1
-
∏
i
=
1
c
(
1
-
min
⁡
{
1
,
δ
/
N
-
i
+
1
}
), where c is the number of compromised nodes in a cell and δ is the number of sensor nodes in the query region. Thus, in TMSN, if one sensor node generates b virtual nodes on average in one epoch and all virtual nodes uniformly distributed, we have(24)
P
c
=
1
-
∏
i
=
1
c
∗
b
1
-
min
⁡
1
,
δ
N
∗
b
-
i
+
1
,where δ denotes the number of virtual nodes in the query region in one epoch and c denotes the number of compromised sensor nodes in a cell. If aqueried sensor node is compromised, its forged data can not be detected by W using existing methods including ours.However, some countermeasures can be adopted to solve this problem. One countermeasure is to shrink the query region, so thatP
c can be decreased; another countermeasure is to monitor the frequency for a sensor node to generate data items with peak values. If a sensor node generates data items with extremely high values on some of its child nodes frequently, the sensor node can be suspected as being compromised, and then some tools like software attestation [28] can be used to testify its hypotheses.(2) If M is not compromised, the compromised sensor nodes may generate some verification information encrypted using the incorrect keys to make W take M as being compromised. One countermeasure against this attack is to digitally sign every message transmitted and received. Because of limited space, we do not describe this method in detail, and more details can be found in [3].


## 5.1. VTMSN: A Novel Verification Scheme in TMSN

VTMSN enables completeness verification by establishing relationships between every two ordered neighboring data items of each virtual node with their orders, which are encrypted along with the time epoch numbers and the virtual node IDs by the symmetric keys shared by sensor nodes and the network ownerW. For each sensor node S
i (∀
i
∈
I
t), we assume that a distinct symmetric key K
i between S
i and W is preloaded on it. To achieve forward-secure authenticity, K
i can be epoch-based as in [7–9]. VTMSN enables authenticity verification by taking the scores of data items encrypted with the distinct keys as the verification information. Recall that different data items have different data scores, each of which is very short in length. Thus, if we create verification information by encrypting the scores, it can not only make the authenticity of top-k query results verifiable but also shrink the amount of verification information. Specifically, VTMSN includes the following four stages.


### 5.1.1. Data Preparation

At the end of each epoch, each sensor nodeS
i (∀
i
∈
I
t) prepares the data generated during the epoch and some necessary verification information, which will be sent to the master node M. Let I
N
F
O
i
j denote the information that S
i prepares for its child node v
n
d
i
j, let l
o
c
i
j denote the location of virtual node v
n
d
i
j, and let E
K
i
{
∗
} denote the encryption operation with key K
i. Then, according to different values of μ
i
j, the content of I
N
F
O
i
j is also different, and it is shown as follows:(i)
ifμ
i
j
=
0,(1)
I
N
F
O
i
j
=
l
o
c
i
j
,
E
K
i
t
∥
j
;
(ii)
ifμ
i
j
≠
0,(2)
I
N
F
O
i
j
=
l
o
c
i
j
,
E
K
i
μ
i
j
∥
t
∥
j
,
D
i
,
1
j
,
E
K
i
1
∥
t
∥
d
i
,
1
j
∥
j
,
D
i
,
2
j
,
E
K
i
2
∥
t
∥
d
i
,
2
j
∥
j
,
…
,
D
i
,
μ
i
j
-
1
j
,
E
K
i
μ
i
j
-
1
∥
t
∥
d
i
,
μ
i
j
-
1
j
∥
j
,
D
i
,
μ
i
j
j
,
E
K
i
μ
i
j
∥
t
∥
d
i
,
μ
i
j
j
∥
j
,where term E
K
i
{
μ
i
j
∥
t
∥
l
o
c
i
j
} is needed for verification when μ
i
j
<
k and all data items of S
i arequalified data items. It is used to determine whether the data are dropped by the master node M or not in such a case.


### 5.1.2. Data Submission

After preparing the information for each virtual nodev
n
d
i
j, each sensor node S
i (∀
i
∈
I
t) sends a message, which includes the information prepared for each child node v
n
d
i
j (∀
v
n
d
i
j
∈
V
N
D
i) of node S
i, to master M. Specifically, the message is as follows:(3)
S
i
⟶
M
:
i
,
E
K
i
t
∥
1
∥
l
o
c
i
1
∥
2
∥
l
o
c
i
2
∥
⋯
∥
λ
i
t
∥
l
o
c
i
λ
i
t
,
I
N
F
O
i
1
,
I
N
F
O
i
2
,
…
,
I
N
F
O
i
λ
i
t
.When the message is received byM, the data items and verification information included in the message will be stored on M.


### 5.1.3. Query Processing

When a top-k query primitive Q
t
=
C
,
t
,
k
,
Q
R
t is received by the master node M in cell C, M first locates the top k data items among all data items generated in Q
R
t during epoch t and then sends them along with some verification information to W. Suppose that there are totally m
queried sensor nodes which are denoted as Q
S
N
t
=
{
S
x
a
}
a
=
1
m for Q
t, and each sensor node S
i
∈
Q
S
N
t has ω
i
t child nodes which are denoted as Q
V
N
i
t
=
{
v
n
d
i
y
b
}
b
=
1
ω
i
t in Q
R
t during epoch t, where the combination (
i
,
y
b
) is the ID of the virtual node v
n
d
i
y
b. Let R
S
T
i
j denote the information included in the query result for child node v
n
d
i
j
∈
Q
V
N
i
t of sensor node S
i
∈
Q
S
N
t and let n
i
j denote the number ofqualified data items generated by S
i on virtual node v
n
d
i
j
∈
Q
V
N
i
t during epoch t. Then, the content of R
S
T
i
j is as follows:(i)
Ifn
i
j
=
μ
i
j
=
0,(4)
R
S
T
i
j
=
E
K
i
t
∥
j
.
(ii)
Ifn
i
j
=
0, μ
i
j
>
0,(5)
R
S
T
i
j
=
E
K
i
1
∥
t
∥
d
i
,
1
j
∥
j
.
(iii)
If0
<
n
i
j
=
μ
i
j
<
k, (6)
R
S
T
i
j
=
E
K
i
μ
i
j
∥
t
∥
j
,
D
i
,
1
j
,
E
K
i
1
∥
t
∥
d
i
,
1
j
∥
j
,
D
i
,
2
j
,
E
K
i
2
∥
t
∥
d
i
,
2
j
∥
j
,
…
,
D
i
,
μ
i
j
-
1
j
,
E
K
i
μ
i
j
-
1
∥
t
∥
d
i
,
μ
i
j
-
1
j
∥
j
,
D
i
,
μ
i
j
j
,
E
K
i
μ
i
j
∥
t
∥
d
i
,
μ
i
j
j
∥
j
.
(iv)
Ifn
i
j
=
k and μ
i
j
≥
k,(7)
R
S
T
i
j
=
D
i
,
1
j
,
E
K
i
1
∥
t
∥
d
i
,
1
j
∥
j
,
D
i
,
2
j
,
E
K
i
2
∥
t
∥
d
i
,
2
j
∥
j
,
…
,
D
i
,
k
-
1
j
,
E
K
i
k
-
1
∥
t
∥
d
i
,
k
-
1
j
∥
j
,
D
i
,
k
j
,
E
K
i
k
∥
t
∥
d
i
,
k
j
∥
j
.
(v)
If0
<
n
i
j
<
k and μ
i
j
>
n
i
j,(8)
R
S
T
i
j
=
D
i
,
1
j
,
E
K
i
1
∥
t
∥
d
i
,
1
j
∥
j
,
D
i
,
2
j
,
E
K
i
2
∥
t
∥
d
i
,
2
j
∥
j
,
…
,
D
i
,
n
i
j
-
1
j
,
E
K
i
n
i
j
-
1
∥
t
∥
d
i
,
n
i
j
-
1
j
∥
j
,
D
i
,
n
i
j
j
,
E
K
i
n
i
j
∥
t
∥
d
i
,
n
i
j
j
∥
j
,
E
K
i
n
i
j
+
1
∥
t
∥
d
i
,
n
i
j
+
1
j
∥
j
.After M prepares R
S
T
i
j for each child node v
n
d
i
j
∈
Q
V
N
i
t of each sensor node S
i
∈
Q
S
N
t, M checks whether it has answered a query whose interested time epoch is the same as that of Q
t. If M has not answered such a query, it returns the following information for each S
i, ∀
i
∈
I
t:(i)
IfS
i
∈
Q
S
N
t, the information is(9)
M
⟶
W
:
i
,
E
K
i
t
∥
1
∥
l
o
c
i
1
∥
2
∥
l
o
c
i
2
∥
⋯
∥
λ
i
t
∥
l
o
c
i
λ
i
t
,
R
S
T
i
y
b
b
=
1
ω
i
t
,
whereR
S
T
i
y
b denotes the information included in the query result for child node v
n
d
i
y
b
∈
Q
V
N
i
t of sensor node S
i
∈
Q
S
N
t.
(ii)
IfS
i
∉
Q
S
N
t, the information is(10)
M
⟶
W
:
i
,
E
K
i
t
∥
1
∥
l
o
c
i
1
∥
2
∥
l
o
c
i
2
∥
⋯
∥
λ
i
t
∥
l
o
c
i
λ
i
t
.IfM has answered a top-k query whose interested time epoch is the same as that of Q
t, it does not need to return the location information for virtual nodes formed during epoch t, because the network owner can find this information from the history query records. Thus, M only needs to return the following information to W for each S
i
∈
Q
S
N
t in this case:(11)
M
⟶
W
:
i
,
R
S
T
i
y
b
b
=
1
ω
i
t
.In fact, the amount of information inR
Q
t can be further shrunk when Q
t is not the first top-k query whose interested time epoch is t. As an example, if v
n
d
i
j is in Q
R
t and it has no qualified data item for query Q
t, R
Q
t should include term E
K
i
{
t
∥
j
}. However, if the same case has appeared for a former query whose interested time epoch is also t, term E
K
i
{
t
∥
j
} does not need to be included in R
Q
t because it has been sent to the network owner before.


### 5.1.4. Verification

When receiving a top-k query result R
Q
t, the network owner checks the authenticity of R
Q
t in the following way. For each data item D
i
,
h
j in R
Q
t, the network owner decrypts term E
K
i
{
h
∥
t
∥
d
i
,
h
j
∥
j
} following D
i
,
h
j in R
Q
t and checks whether d
i
,
h
j got from term E
K
i
{
h
∥
t
∥
d
i
,
h
j
∥
j
} is equal to f
(
D
i
,
h
j
), where f
(
∗
) is a public scoring function [4]. If they are equal, data items in R
Q
t are authentic; otherwise they are not. The principle is that different data items have different scores [3], and if a compromised master node modifies D
i
,
h
j, it should also modify d
i
,
h
j in term E
K
i
{
h
∥
t
∥
d
i
,
h
j
∥
j
}. However, it can not do this because it does not know the key K
i.Completeness verification ofR
Q
t is a little complicated. The first step to verify the completeness of R
Q
t is to check whether each sensor node S
i in cell C has sent term E
K
i
{
t
∥
1
∥
l
o
c
i
1
∥
2
∥
l
o
c
i
2
∥
⋯
∥
λ
i
t
∥
l
o
c
i
λ
i
t
} to the network owner. If any sensor node has not sent it, R
Q
t is considered incomplete. The second step is to check whether term R
S
T
i
j for each child node v
n
d
i
j
∈
Q
V
N
i
j of each sensor node S
i
∈
Q
S
N
t has been sent to the network owner. If at least one of them has not been sent to the network owner, R
Q
t is considered incomplete. The last step is to verify the completeness of each R
S
T
i
j in R
Q
t. If they are all verified to be complete, R
Q
t is considered complete; otherwise it is not. Details of completeness verification of each R
S
T
i
j are given in Algorithm 1, where d
s
m
a
l
l
e
s
t is the smallest data score in R
Q
t.Algorithm 1:Completeness verification of R
S
T
i
j.
Input: top-k query Q
t
=
C
,
t
,
k
,
Q
R
t, R
S
T
i
j, d
s
m
a
l
l
e
s
t
Output:completeness
(1)completeness=true
(2)if
R
S
T
i
j
includes
γ
i
j(γ
i
j ≠ 0) data items denoted by
D
i
,
h
j
h
=
1
γ
i
j
(3)   Decrypt each termE
K
i
h
∥
t
∥
d
i
,
h
j
∥
j following each data item D
i
,
h
j
∈
D
i
,
h
j
h
=
1
γ
i
j with K
i
(4)if (the orders got from each term
E
K
i
h
∥
t
∥
d
i
,
h
j
∥
j
are not consecutive from 1 to
γ
i
j)
(5)c
o
m
p
l
e
t
e
n
e
s
s
=
f
a
l
s
e
(6)if term E
K
i
μ
i
j
∥
t
∥
j
is in
R
S
T
i
j
(7)   ifμ
i
j ≠ γ
i
j
c
o
m
p
l
e
t
e
n
e
s
s
=
f
a
l
s
e
(8)else
if
term
E
K
i
(
γ
i
j
+
1
)
∥
t
∥
d
i
,
γ
i
j
+
1
j
∥
j
is in R
S
T
i
j
(9)if
d
i
,
γ
i
j
+
1
j
≥
d
s
m
a
l
l
e
s
t
c
o
m
p
l
e
t
e
n
e
s
s
=
f
a
l
s
e
(10)
else
if
γ
i
j
≠
k
c
o
m
p
l
e
t
e
n
e
s
s
=
f
a
l
s
e
(11)
(12)
(13)else if no  data item is in
R
S
T
i
j
(14)if (both term
E
K
i
t
∥
j and E
K
i
1
∥
t
∥
d
i
,
1
j
∥
j
are not in
R
S
T
i
j) or
((E
K
i
1
∥
t
∥
d
i
,
1
j
∥
j  is in
R
S
T
i
j) and (d
i
,
1
j
≥
d
s
m
a
l
l
e
s
t))
(15)
completeness= false
(16)
(17)if(not all the encrypted terms in
R
S
T
i
j
can be decrypted by the same symmetric key) or
(not all the values of j in the encrypted terms in
R
S
T
i
j
are the same)or(at least one time epoch
number in the encrypted terms in
R
S
T
i
j
is not equal to t)
(18)c
o
m
p
l
e
e
n
e
s
s
=
f
a
l
s
e
(19)return
completeness.In Algorithm1, lines (1)–(16) can verify the completeness of R
S
T
i
j under the condition that the data items and their corresponding verification information in R
S
T
i
j are not replaced by those of other virtual nodes. Lines (17)-(18) are added to tear off this constraint condition.


## 5.1.1. Data Preparation

At the end of each epoch, each sensor nodeS
i (∀
i
∈
I
t) prepares the data generated during the epoch and some necessary verification information, which will be sent to the master node M. Let I
N
F
O
i
j denote the information that S
i prepares for its child node v
n
d
i
j, let l
o
c
i
j denote the location of virtual node v
n
d
i
j, and let E
K
i
{
∗
} denote the encryption operation with key K
i. Then, according to different values of μ
i
j, the content of I
N
F
O
i
j is also different, and it is shown as follows:(i)
ifμ
i
j
=
0,(1)
I
N
F
O
i
j
=
l
o
c
i
j
,
E
K
i
t
∥
j
;
(ii)
ifμ
i
j
≠
0,(2)
I
N
F
O
i
j
=
l
o
c
i
j
,
E
K
i
μ
i
j
∥
t
∥
j
,
D
i
,
1
j
,
E
K
i
1
∥
t
∥
d
i
,
1
j
∥
j
,
D
i
,
2
j
,
E
K
i
2
∥
t
∥
d
i
,
2
j
∥
j
,
…
,
D
i
,
μ
i
j
-
1
j
,
E
K
i
μ
i
j
-
1
∥
t
∥
d
i
,
μ
i
j
-
1
j
∥
j
,
D
i
,
μ
i
j
j
,
E
K
i
μ
i
j
∥
t
∥
d
i
,
μ
i
j
j
∥
j
,where term E
K
i
{
μ
i
j
∥
t
∥
l
o
c
i
j
} is needed for verification when μ
i
j
<
k and all data items of S
i arequalified data items. It is used to determine whether the data are dropped by the master node M or not in such a case.


## 5.1.2. Data Submission

After preparing the information for each virtual nodev
n
d
i
j, each sensor node S
i (∀
i
∈
I
t) sends a message, which includes the information prepared for each child node v
n
d
i
j (∀
v
n
d
i
j
∈
V
N
D
i) of node S
i, to master M. Specifically, the message is as follows:(3)
S
i
⟶
M
:
i
,
E
K
i
t
∥
1
∥
l
o
c
i
1
∥
2
∥
l
o
c
i
2
∥
⋯
∥
λ
i
t
∥
l
o
c
i
λ
i
t
,
I
N
F
O
i
1
,
I
N
F
O
i
2
,
…
,
I
N
F
O
i
λ
i
t
.When the message is received byM, the data items and verification information included in the message will be stored on M.


## 5.1.3. Query Processing

When a top-k query primitive Q
t
=
C
,
t
,
k
,
Q
R
t is received by the master node M in cell C, M first locates the top k data items among all data items generated in Q
R
t during epoch t and then sends them along with some verification information to W. Suppose that there are totally m
queried sensor nodes which are denoted as Q
S
N
t
=
{
S
x
a
}
a
=
1
m for Q
t, and each sensor node S
i
∈
Q
S
N
t has ω
i
t child nodes which are denoted as Q
V
N
i
t
=
{
v
n
d
i
y
b
}
b
=
1
ω
i
t in Q
R
t during epoch t, where the combination (
i
,
y
b
) is the ID of the virtual node v
n
d
i
y
b. Let R
S
T
i
j denote the information included in the query result for child node v
n
d
i
j
∈
Q
V
N
i
t of sensor node S
i
∈
Q
S
N
t and let n
i
j denote the number ofqualified data items generated by S
i on virtual node v
n
d
i
j
∈
Q
V
N
i
t during epoch t. Then, the content of R
S
T
i
j is as follows:(i)
Ifn
i
j
=
μ
i
j
=
0,(4)
R
S
T
i
j
=
E
K
i
t
∥
j
.
(ii)
Ifn
i
j
=
0, μ
i
j
>
0,(5)
R
S
T
i
j
=
E
K
i
1
∥
t
∥
d
i
,
1
j
∥
j
.
(iii)
If0
<
n
i
j
=
μ
i
j
<
k, (6)
R
S
T
i
j
=
E
K
i
μ
i
j
∥
t
∥
j
,
D
i
,
1
j
,
E
K
i
1
∥
t
∥
d
i
,
1
j
∥
j
,
D
i
,
2
j
,
E
K
i
2
∥
t
∥
d
i
,
2
j
∥
j
,
…
,
D
i
,
μ
i
j
-
1
j
,
E
K
i
μ
i
j
-
1
∥
t
∥
d
i
,
μ
i
j
-
1
j
∥
j
,
D
i
,
μ
i
j
j
,
E
K
i
μ
i
j
∥
t
∥
d
i
,
μ
i
j
j
∥
j
.
(iv)
Ifn
i
j
=
k and μ
i
j
≥
k,(7)
R
S
T
i
j
=
D
i
,
1
j
,
E
K
i
1
∥
t
∥
d
i
,
1
j
∥
j
,
D
i
,
2
j
,
E
K
i
2
∥
t
∥
d
i
,
2
j
∥
j
,
…
,
D
i
,
k
-
1
j
,
E
K
i
k
-
1
∥
t
∥
d
i
,
k
-
1
j
∥
j
,
D
i
,
k
j
,
E
K
i
k
∥
t
∥
d
i
,
k
j
∥
j
.
(v)
If0
<
n
i
j
<
k and μ
i
j
>
n
i
j,(8)
R
S
T
i
j
=
D
i
,
1
j
,
E
K
i
1
∥
t
∥
d
i
,
1
j
∥
j
,
D
i
,
2
j
,
E
K
i
2
∥
t
∥
d
i
,
2
j
∥
j
,
…
,
D
i
,
n
i
j
-
1
j
,
E
K
i
n
i
j
-
1
∥
t
∥
d
i
,
n
i
j
-
1
j
∥
j
,
D
i
,
n
i
j
j
,
E
K
i
n
i
j
∥
t
∥
d
i
,
n
i
j
j
∥
j
,
E
K
i
n
i
j
+
1
∥
t
∥
d
i
,
n
i
j
+
1
j
∥
j
.After M prepares R
S
T
i
j for each child node v
n
d
i
j
∈
Q
V
N
i
t of each sensor node S
i
∈
Q
S
N
t, M checks whether it has answered a query whose interested time epoch is the same as that of Q
t. If M has not answered such a query, it returns the following information for each S
i, ∀
i
∈
I
t:(i)
IfS
i
∈
Q
S
N
t, the information is(9)
M
⟶
W
:
i
,
E
K
i
t
∥
1
∥
l
o
c
i
1
∥
2
∥
l
o
c
i
2
∥
⋯
∥
λ
i
t
∥
l
o
c
i
λ
i
t
,
R
S
T
i
y
b
b
=
1
ω
i
t
,
whereR
S
T
i
y
b denotes the information included in the query result for child node v
n
d
i
y
b
∈
Q
V
N
i
t of sensor node S
i
∈
Q
S
N
t.
(ii)
IfS
i
∉
Q
S
N
t, the information is(10)
M
⟶
W
:
i
,
E
K
i
t
∥
1
∥
l
o
c
i
1
∥
2
∥
l
o
c
i
2
∥
⋯
∥
λ
i
t
∥
l
o
c
i
λ
i
t
.IfM has answered a top-k query whose interested time epoch is the same as that of Q
t, it does not need to return the location information for virtual nodes formed during epoch t, because the network owner can find this information from the history query records. Thus, M only needs to return the following information to W for each S
i
∈
Q
S
N
t in this case:(11)
M
⟶
W
:
i
,
R
S
T
i
y
b
b
=
1
ω
i
t
.In fact, the amount of information inR
Q
t can be further shrunk when Q
t is not the first top-k query whose interested time epoch is t. As an example, if v
n
d
i
j is in Q
R
t and it has no qualified data item for query Q
t, R
Q
t should include term E
K
i
{
t
∥
j
}. However, if the same case has appeared for a former query whose interested time epoch is also t, term E
K
i
{
t
∥
j
} does not need to be included in R
Q
t because it has been sent to the network owner before.


## 5.1.4. Verification

When receiving a top-k query result R
Q
t, the network owner checks the authenticity of R
Q
t in the following way. For each data item D
i
,
h
j in R
Q
t, the network owner decrypts term E
K
i
{
h
∥
t
∥
d
i
,
h
j
∥
j
} following D
i
,
h
j in R
Q
t and checks whether d
i
,
h
j got from term E
K
i
{
h
∥
t
∥
d
i
,
h
j
∥
j
} is equal to f
(
D
i
,
h
j
), where f
(
∗
) is a public scoring function [4]. If they are equal, data items in R
Q
t are authentic; otherwise they are not. The principle is that different data items have different scores [3], and if a compromised master node modifies D
i
,
h
j, it should also modify d
i
,
h
j in term E
K
i
{
h
∥
t
∥
d
i
,
h
j
∥
j
}. However, it can not do this because it does not know the key K
i.Completeness verification ofR
Q
t is a little complicated. The first step to verify the completeness of R
Q
t is to check whether each sensor node S
i in cell C has sent term E
K
i
{
t
∥
1
∥
l
o
c
i
1
∥
2
∥
l
o
c
i
2
∥
⋯
∥
λ
i
t
∥
l
o
c
i
λ
i
t
} to the network owner. If any sensor node has not sent it, R
Q
t is considered incomplete. The second step is to check whether term R
S
T
i
j for each child node v
n
d
i
j
∈
Q
V
N
i
j of each sensor node S
i
∈
Q
S
N
t has been sent to the network owner. If at least one of them has not been sent to the network owner, R
Q
t is considered incomplete. The last step is to verify the completeness of each R
S
T
i
j in R
Q
t. If they are all verified to be complete, R
Q
t is considered complete; otherwise it is not. Details of completeness verification of each R
S
T
i
j are given in Algorithm 1, where d
s
m
a
l
l
e
s
t is the smallest data score in R
Q
t.Algorithm 1:Completeness verification of R
S
T
i
j.
Input: top-k query Q
t
=
C
,
t
,
k
,
Q
R
t, R
S
T
i
j, d
s
m
a
l
l
e
s
t
Output:completeness
(1)completeness=true
(2)if
R
S
T
i
j
includes
γ
i
j(γ
i
j ≠ 0) data items denoted by
D
i
,
h
j
h
=
1
γ
i
j
(3)   Decrypt each termE
K
i
h
∥
t
∥
d
i
,
h
j
∥
j following each data item D
i
,
h
j
∈
D
i
,
h
j
h
=
1
γ
i
j with K
i
(4)if (the orders got from each term
E
K
i
h
∥
t
∥
d
i
,
h
j
∥
j
are not consecutive from 1 to
γ
i
j)
(5)c
o
m
p
l
e
t
e
n
e
s
s
=
f
a
l
s
e
(6)if term E
K
i
μ
i
j
∥
t
∥
j
is in
R
S
T
i
j
(7)   ifμ
i
j ≠ γ
i
j
c
o
m
p
l
e
t
e
n
e
s
s
=
f
a
l
s
e
(8)else
if
term
E
K
i
(
γ
i
j
+
1
)
∥
t
∥
d
i
,
γ
i
j
+
1
j
∥
j
is in R
S
T
i
j
(9)if
d
i
,
γ
i
j
+
1
j
≥
d
s
m
a
l
l
e
s
t
c
o
m
p
l
e
t
e
n
e
s
s
=
f
a
l
s
e
(10)
else
if
γ
i
j
≠
k
c
o
m
p
l
e
t
e
n
e
s
s
=
f
a
l
s
e
(11)
(12)
(13)else if no  data item is in
R
S
T
i
j
(14)if (both term
E
K
i
t
∥
j and E
K
i
1
∥
t
∥
d
i
,
1
j
∥
j
are not in
R
S
T
i
j) or
((E
K
i
1
∥
t
∥
d
i
,
1
j
∥
j  is in
R
S
T
i
j) and (d
i
,
1
j
≥
d
s
m
a
l
l
e
s
t))
(15)
completeness= false
(16)
(17)if(not all the encrypted terms in
R
S
T
i
j
can be decrypted by the same symmetric key) or
(not all the values of j in the encrypted terms in
R
S
T
i
j
are the same)or(at least one time epoch
number in the encrypted terms in
R
S
T
i
j
is not equal to t)
(18)c
o
m
p
l
e
e
n
e
s
s
=
f
a
l
s
e
(19)return
completeness.In Algorithm1, lines (1)–(16) can verify the completeness of R
S
T
i
j under the condition that the data items and their corresponding verification information in R
S
T
i
j are not replaced by those of other virtual nodes. Lines (17)-(18) are added to tear off this constraint condition.


## 5.2. Performance Analysis of VTMSN

Theorem 6.
As long as none of the queried sensor nodes is compromised, a compromised master node can not insert forged data into query results without being detected by VTMSN.Proof.
This theorem is actually proved in the verification stage in Section4.1.Theorem 7.
As long as none of the queried sensor nodes is compromised, a compromised master node can not replace data items generated during the interested time epoch with data items generated in some other time epochs without being detected by VTMSN.Proof.
Each encrypted term in top-k query results contains an epoch number t in VTMSN. Thus, it is easy to detect such behaviors by checking the time epoch numbers in the encrypted terms.Theorem 8.
As long as none of the queried sensor nodes is compromised, a compromised master node can not replace qualified data items with unqualified data items generated during the same epoch without being detected by VTMSN.Proof.
It is clear that the corresponding verification information should also be replaced if some data items are replaced. Then, the following two propositions prove that Theorem8 holds.(1)
The compromised master node can not replacequalified data items withunqualified data items of the same virtual node without being detected by VTMSN. This is because the orders in the encrypted terms following the data items will not be consecutive if such behavior is made.
(2)
The compromised master node can not replacequalified data items withunqualified data items of some other virtual nodes without being detected by VTMSN. The verification information of a virtual node in the query region can not be totally replaced with those of another virtual node because each virtual node in the query region is asked to include its verification information in the query result. Besides, if somequalified data items of a virtual node are replaced withunqualified data items of some other virtual nodes, either the encrypted terms for the same virtual node in the query result can not be decrypted by the same key or the values of j got from each encrypted term following each data item of the same virtual node in the query result are not the same. According to Algorithm 1, both cases can be detected by VTMSN.Theorem 9.
As long as none of the queried sensor nodes is compromised, VTMSN can detect any incomplete top-k query result with probability P
d
e
t
=
1.Proof.
There are totally two methods forM to break the completeness of top-k query results. The first method is to replace thequalified data items with someunqualified data items, and the second method is to drop part or all of thequalified data items without replacing them withunqualified data items. According to Theorems 7 and 8, it can be detected with P
d
e
t
=
1 if M adopts the first method. Then we prove that it can also be detected by VTMSN with probability P
d
e
t
=
1 if M adopts the second method. For each qualified virtual node v
n
d
i
j, if M drops part of thequalified data items of v
n
d
i
j, M must drop all the last σ
i
j (0
<
σ
i
j
<
n
i
j)qualified data items and all theunqualified data items of v
n
d
i
j in order to make the orders of the left data items consecutive. Then term E
K
i
{
μ
i
j
∥
t
∥
j
} or E
K
i
{
χ
∥
t
∥
d
i
,
χ
j
∥
j
} must be left in the query result, where χ
=
n
i
j
-
σ
i
j
+
1; otherwise R
S
T
i
j will be considered incomplete according to Algorithm 1. If term E
K
i
{
μ
i
j
∥
t
∥
j
} is left in the query result, μ
i
j got from E
K
i
{
μ
i
j
∥
t
∥
j
} must not be equal to the number of data items of v
n
d
i
j left in the query result. If term E
K
i
{
χ
∥
t
∥
d
i
,
χ
j
∥
j
} is left in the query result, d
i
,
χ
j got from term E
K
i
{
χ
∥
t
∥
d
i
,
χ
j
∥
j
} must be not smaller than the smallest data score of the data items in the query result. According to Algorithm 1, the query result can be considered incomplete in both cases. If M drops allqualified data items of v
n
d
i
j, the incomplete query result can also be detected because M can not generate a legal term E
K
i
{
t
∥
j
} or E
K
i
{
1
∥
t
∥
d
i
,
1
j
∥
j
} without knowing K
i. Thus, any incomplete query result can be detected as long as none of thequeried sensor nodes is compromised.Next, we will analyze the in-cell communication costC
v
-
s
m of VTMSN. Note that all information in the message sent from each sensor node to M is the verification information except data items. In this paper, we assume that the length of the data after they are encrypted is the same as that before they are encrypted. We use ζ
i
t to denote the number of child nodes, which have data items in epoch t, of each sensor node S
i (∀
i
∈
I
t). Then the number of child nodes, which do not have data items in epoch t, of sensor node S
i is λ
i
t
-
ζ
i
t. The meanings of some other parameters are listed in Table 1.Table 1
Parameters and their meanings.
Para.
Meaning
l
o
r
d
e
r
Length in bits of an order number
l
e
p
o
c
h
Length in bits of an epoch number
l
l
o
c
Length in bits of each  location
l
i
d
Length in bits of an ID number
l
n
u
m
Length in bits of number of data items
l
s
c
o
r
e
Length in bits of a data scoreFor a child node, which does not have data item in time epocht, of sensor node S
i, the length of verification information per epoch in bits is(12)
L
i
λ
-
ζ
=
l
l
o
c
+
l
e
p
o
c
h
+
l
i
d
.LetT
a
v
g denote the average time for a sensor node to be in a static state per epoch and let f
d denote the average data generating frequency of each sensor node. The average number of data items that are generated on a child node in one epoch is(13)
μ
=
f
d
∗
T
a
v
g
.Then, for a child node that has data items in time epocht of sensor node S
i, the length of verification information in bits per epoch is(14)
L
i
ζ
=
l
l
o
c
+
l
e
p
o
c
h
+
l
i
d
+
l
n
u
m
+
μ
∗
l
e
p
o
c
h
+
l
i
d
+
l
o
r
d
e
r
+
l
s
c
o
r
e
.For each sensor nodeS
i (∀
i
∈
I
t), it also has to take some locations and IDs of its child nodes as the verification information. Thus, the length of verification information prepared by each sensor node S
i (∀
i
∈
I
t) in bits per epoch is(15)
L
S
i
=
l
i
d
+
l
e
p
o
c
h
+
λ
i
t
∗
l
l
o
c
+
l
i
d
+
λ
i
t
-
ζ
i
t
∗
L
i
λ
-
ζ
+
ζ
i
t
∗
L
i
ζ
.Leth
i denote the hop counts from S
i to M along the shortest path at the end of epoch t. Then the in-cell communication cost C
v
-
s
m
S
i in bits incurred by sending the verification information generated by S
i to M is(16)
C
v
-
s
m
S
i
=
L
S
i
∗
h
i
.Then we have(17)
C
v
-
s
m
=
∑
i
=
1
N
2
∗
C
v
-
s
m
S
i
.In this paper, we assume that the energy consumption incurred by sending and receiving one bit of data is the same as in [3]. So in formula (17), the total energy consumption is doubled.Suppose that a queryQ
t
=
C
,
t
,
k
,
Q
R
t is received by M. We then derive the query communication cost C
v
-
m
w incurred by VTMSN. First, the query communication cost in bits incurred by sending the verification information from M to W for each virtual node v
n
d
i
j that is located in Q
R
t is(18)
C
v
-
s
m
v
n
d
i
j
=
l
i
d
+
l
e
p
o
c
h
n
i
j
=
μ
i
j
=
0
l
i
d
+
l
o
r
d
e
r
+
l
e
p
o
c
h
+
l
s
c
o
r
e
n
i
j
=
0
,
μ
i
j
>
0
l
i
d
+
l
n
u
m
+
l
e
p
o
c
h
+
μ
i
j
l
e
p
o
c
h
+
l
s
c
o
r
e
+
l
o
r
d
e
r
+
l
i
d
0
<
n
i
j
=
μ
i
j
<
k
k
l
e
p
o
c
h
+
l
o
r
d
e
r
+
l
s
c
o
r
e
+
l
i
d
n
i
j
=
k
n
i
j
+
1
l
e
p
o
c
h
+
l
s
c
o
r
e
+
l
o
r
d
e
r
+
l
i
d
1
≤
n
i
j
<
k
,
μ
i
j
>
n
i
j
,where μ
i
j is the total number of data items generated by sensor node S
i on its child node v
n
d
i
j during time epoch t and n
i
j is the number ofqualified data items among the μ
i
j data items.LetC
v
-
m
w
S
i denote query communication cost in bits incurred by sending the verification information generated by S
i from M to W. Then, if M has not answered a top-k query whose interested time epoch is the same as that of Q
t, the following two cases should be considered.(i)
The first case is thatS
i is not aqueried sensor node; then (19)
C
v
-
m
w
S
i
=
l
i
d
+
l
e
p
o
c
h
+
λ
i
t
∗
l
l
o
c
+
l
i
d
.
(ii)
The second case is thatS
i has ω
i
t (ω
i
t
≠
0) child nodes located in Q
R
t; then we have(20)
C
v
-
m
w
S
i
=
l
i
d
+
l
e
p
o
c
h
+
λ
i
t
∗
l
l
o
c
+
l
i
d
+
∑
a
=
1
ω
i
t
C
v
-
s
m
v
n
d
i
x
a
,where C
v
-
s
m
v
n
d
i
x
a is the query cost for v
n
d
i
x
a
∈
Q
V
N
i
t and ω
i
t is the number of child nodes of sensor node S
i
∈
Q
S
N
t.IfM has answered a top-k query whose interested time epoch is the same as that of Q
t, the location information of each virtual node does not need to be sent to the network owner any more. Moreover, we further shrink the amount of information in top-k query results by excluding the information that has been sent to the network owner. Thus, if S
i is aqueried sensor node for Q
t, the following inequality holds:(21)
C
v
-
m
w
S
i
≤
l
i
d
+
∑
a
=
1
ω
i
t
C
v
-
s
m
v
n
d
i
x
a
.If sensor nodeS
i is not aqueried sensor node for Q
t, then(22)
C
v
-
m
w
S
i
=
0
.Then we have(23)
C
v
-
m
w
≤
∑
i
=
1
N
2
∗
C
v
-
m
w
S
i
.Similarly, we assume that the energy consumption incurred by sending and receiving one bit of data is the same across the on-demand wireless link. Thus,C
v
-
m
w is doubled in (23).


## 5.3. Impact of Compromising Some Sensor Nodes

In above sections, we never consider the case that some sensor nodes are compromised. Thus we now further analyze the impact of compromised sensor nodes. If some sensor nodes are compromised, the following two kinds of attack may be launched.(1) The compromised sensor nodes may collaborate with M to help it escape the detection. The impact of this behavior depends on P
c, which is the probability that at least onequeried sensor node is compromised. In [3], it is known that if sensor nodes are static and uniformly distributed, the probability that at least one compromised node is in the query region is 1
-
∏
i
=
1
c
(
1
-
min
⁡
{
1
,
δ
/
N
-
i
+
1
}
), where c is the number of compromised nodes in a cell and δ is the number of sensor nodes in the query region. Thus, in TMSN, if one sensor node generates b virtual nodes on average in one epoch and all virtual nodes uniformly distributed, we have(24)
P
c
=
1
-
∏
i
=
1
c
∗
b
1
-
min
⁡
1
,
δ
N
∗
b
-
i
+
1
,where δ denotes the number of virtual nodes in the query region in one epoch and c denotes the number of compromised sensor nodes in a cell. If aqueried sensor node is compromised, its forged data can not be detected by W using existing methods including ours.However, some countermeasures can be adopted to solve this problem. One countermeasure is to shrink the query region, so thatP
c can be decreased; another countermeasure is to monitor the frequency for a sensor node to generate data items with peak values. If a sensor node generates data items with extremely high values on some of its child nodes frequently, the sensor node can be suspected as being compromised, and then some tools like software attestation [28] can be used to testify its hypotheses.(2) If M is not compromised, the compromised sensor nodes may generate some verification information encrypted using the incorrect keys to make W take M as being compromised. One countermeasure against this attack is to digitally sign every message transmitted and received. Because of limited space, we do not describe this method in detail, and more details can be found in [3].


## 6. Performance Evaluation

In this section, we evaluate the efficiency of VTMSN and illustrate the impact of some factors on the metrics presented in Section4. We use OMNET++ as our simulator. In our simulation model, we assume the size of a cell in TMSN is 400 m × 400 m. In each cell, 500 sensor nodes are deployed randomly. They switch their states between mobile state and static state periodically. Some other default parameters are listed in Table 2, where R is the communication radius of each sensor node, T
s denotes the average time period for a sensor node to keep static, and T
m denotes the average time period for a sensor node to keep mobile. We will make a special declaration if some parameters are changed in the simulation. We also assume collision-free and error-free packet transmissions as in [3]. For ease of presentation, when we say verification information for data items, we refer to the encrypted term following each data item in the query result, and we call the left verification information the verification information for virtual nodes in the following of this paper.Table 2
Default evaluation parameters.
Para.
Val.
l
D
400
f
d
10
l
e
p
o
c
h
10
R
50 m
f
q
100
l
s
c
o
r
e
20
l
i
d
10
T
m
10
l
n
u
m
10
k
10
T
s
10
T
e
50


### 6.1. The Results ofC
v
-
s
m and the Corresponding R
v
s

To evaluate the performance ofC
v
-
s
m and the corresponding R
v
s objectively, we run the simulation for consecutive 100 epochs and take the average values of C
v
-
s
m and R
v
s in one epoch as the final results, which are illustrated as follows.


#### 6.1.1. Impact of ParametersT
m, T
s, and T
e

Figure3 shows that C
v
-
s
m becomes larger and larger as T
e increases. The reason is obvious: the larger T
e is, the more the data items are, and more verification information is needed. However, Figure 4 shows that the corresponding R
v
s does not change too much as T
e increases. This indicates that the ratio of the increasing rate of verification information to that of data items keeps relatively stable as T
e increases.Figure 3
Impact of parametersT
m, T
s, and T
e on C
v
-
s
m.Figure 4
Impact of parametersT
m, T
s, and T
e on R
v
s corresponding to C
v
-
s
m.From Figure3, we can also find that the longer the total time for sensor nodes to be in a static state in one epoch is, the larger C
v
-
s
m is, because sensor nodes generate data items only when they are in a static state. Moreover, when T
m and T
s are equal, the smaller T
m and T
s are, the more the verification information is needed, because more virtual nodes are formed when T
m and T
s are smaller and the amount of data items is almost the same when T
m and T
s are equal. It is also the reason why R
v
s is much larger than that in the other two cases in Figure 4 when T
m and T
s are set to 2 s.Now we explain whyR
v
s with T
m
=
2 s and T
s
=
10 s is almost equal to or sometimes a little larger than R
v
s with T
m
=
10 s and T
s
=
10 s in Figure 4. First, sensor nodes in the former case generate more data items than those in the latter case. If the numbers of virtual nodes are the same for the two cases, the more the data items are generated, the smaller R
v
s is. Of course, R
v
s should be bigger than the ratio of cost of transmitting the verification information for data items to the cost of transmitting data items. Thus, if the number of virtual nodes is the same, R
v
s in the former case should be much smaller than that in the latter case. However, virtual nodes formed in the former case are many more than those formed in the latter case. Thus, much more verification information for virtual nodes is needed in the former case. Taken altogether, R
v
s in the former case is almost equal to or sometimes a little larger than that in the latter case.


#### 6.1.2. Impact of Parameterf
d

From Figure5, we can see that the larger f
d is, the larger C
v
-
s
m is. The reason is clear: more data items need more verification information in VTMSN. Figure 6 shows the simulation results of the corresponding R
v
s. We can see that the larger f
d is, the smaller R
v
s is. The reason is that larger f
d leads to more data items generated in a given time period, and the more the data items are generated, the closer R
v
s is to the ratio of the amount of verification information for data items to the amount of the data items. However, because there is an encrypted term following each data item in VTMSN, R
v
s can not be smaller than the ratio of the length of each verification term following each data item to the length of each data item. That is why R
v
s decreases slower and slower as f
d increases in Figure 6.Figure 5
Impact of parameterf
d on C
v
-
s
m.Figure 6
Impact of parameterf
d on R
v corresponding to C
v
-
s
m.


### 6.2. The Results ofC
v
-
m
w and the Corresponding R
v
s

In this subsection, we evaluate the performance of our verification scheme VTMSN onC
v
-
m
w and its corresponding R
v
s with different parameter configurations. The results are as follows.


#### 6.2.1. Impact of ParametersQ
R and k

Figure7 shows the impact of the query region Q
R and parameter k on C
v
-
m
w in VTMSN. We can see that the larger Q
R and k are, the larger C
v
-
m
w is, because larger Q
R and k bring more virtual nodes and data items which need more verification information.Figure 7
Impact of parametersQ
R and k on C
v
-
m
w.Figure8 shows the impact of Q
R and k on R
v
s corresponding to C
v
-
m
w of VTMSN. We can see that if parameter k does not change, the larger Q
R is, the larger R
v
s is. Recall that R
v
s here is the ratio of C
v
-
m
w to the energy consumption in bits incurred by sending and receiving the top k data items. Thus, if k does not change, the larger C
v
-
m
w is, the larger R
v
s is. On the other hand, we can also see from Figure 8 that, with the same Q
R, the larger k is, the smaller R
v
s is. This can be explained easily according to the definition of R
v
s. In Figure 8, R
v
s decreases slower and slower as k increases. The reason is that there is an encrypted term E
K
i
{
∗
} following each data item as the verification information for data items in VTMSN, and R
v
s can not be smaller than the ratio of the length of the term E
K
i
{
∗
} to the length of a data item.Figure 8
Impact of parametersQ
R and k on R
v
s corresponding to C
v
-
m
w.


#### 6.2.2. Impact of ParametersT
m, T
s, and v

Figures9 and 10 show the impact of moving period T
m, static period T
s, and the moving speed v of a sensor node on C
v
-
m
w and its corresponding R
v
s, respectively. It is clear that both C
v
-
m
w and its corresponding R
v
s are not influenced by the speed of sensor nodes too much.Figure 9
Impact of parametersT
m, T
s, and v on C
v
-
m
w.Figure 10
Impact of parametersT
m, T
s, and v on R
v
s corresponding to C
v
-
m
w.In theory, with the same other parameters, the more the times for sensor nodes to switch their states in one epoch are, the largerC
v
-
m
w is, because more virtual nodes will be generated in the query region and they need more verification information. Figure 9 illustrates this. As an example, when T
m
=
2 s, T
s
=
2 s, and T
e
=
50 s, each sensor node switches its state for 24 times, while there are only 4 times for a sensor node to switch its state when T
m
=
10 s, T
s
=
10 s, and T
e
=
50 s. Figure 9 shows that C
v
-
m
w in the former case is larger than that in the latter case. The corresponding R
v
s in Figure 10 is in conformity with C
v
-
m
w in Figure 9. The reason is that the value of parameter k is the same, which means the amount of data items sent from M to W is the same in this test, and the value of R
v
s depends on the value of C
v
-
m
w totally according to the meaning of R
v
s.


#### 6.2.3. Impact of Parameterf
q

Figures11 and 12 show the impact of query frequency f
q on C
v
-
m
w and its corresponding R
v
s, respectively, where the abscissas denote the number of queries issued by the network owner in one epoch. We can see that both C
v
-
m
w and its corresponding R
v
s decrease as f
q increases. The reason is that the locations of virtual nodes need to be sent to the network owner only when the data generated during the epoch when the virtual nodes existed are queried for the first time. Besides, if a virtual node does not have any qualified data for a query, it needs to send the verification information to the network owner only when it is in the query region for the first time. Thus, as the number of queries increases in one epoch, the probability that a virtual node need not have to have the verification information of itself in the query result increases. Thus, the average value of C
v
-
m
w for each query decreases. Besides, according to the definition of R
v
s, with the same k, R
v
s decreases as C
v
-
m
w decreases.Figure 11
Impact of parameterf
q on C
v
-
m
w.Figure 12
Impact of parameterf
q on R
v
s corresponding to C
v
-
m
w.


## 6.1. The Results ofC
v
-
s
m and the Corresponding R
v
s

To evaluate the performance ofC
v
-
s
m and the corresponding R
v
s objectively, we run the simulation for consecutive 100 epochs and take the average values of C
v
-
s
m and R
v
s in one epoch as the final results, which are illustrated as follows.


### 6.1.1. Impact of ParametersT
m, T
s, and T
e

Figure3 shows that C
v
-
s
m becomes larger and larger as T
e increases. The reason is obvious: the larger T
e is, the more the data items are, and more verification information is needed. However, Figure 4 shows that the corresponding R
v
s does not change too much as T
e increases. This indicates that the ratio of the increasing rate of verification information to that of data items keeps relatively stable as T
e increases.Figure 3
Impact of parametersT
m, T
s, and T
e on C
v
-
s
m.Figure 4
Impact of parametersT
m, T
s, and T
e on R
v
s corresponding to C
v
-
s
m.From Figure3, we can also find that the longer the total time for sensor nodes to be in a static state in one epoch is, the larger C
v
-
s
m is, because sensor nodes generate data items only when they are in a static state. Moreover, when T
m and T
s are equal, the smaller T
m and T
s are, the more the verification information is needed, because more virtual nodes are formed when T
m and T
s are smaller and the amount of data items is almost the same when T
m and T
s are equal. It is also the reason why R
v
s is much larger than that in the other two cases in Figure 4 when T
m and T
s are set to 2 s.Now we explain whyR
v
s with T
m
=
2 s and T
s
=
10 s is almost equal to or sometimes a little larger than R
v
s with T
m
=
10 s and T
s
=
10 s in Figure 4. First, sensor nodes in the former case generate more data items than those in the latter case. If the numbers of virtual nodes are the same for the two cases, the more the data items are generated, the smaller R
v
s is. Of course, R
v
s should be bigger than the ratio of cost of transmitting the verification information for data items to the cost of transmitting data items. Thus, if the number of virtual nodes is the same, R
v
s in the former case should be much smaller than that in the latter case. However, virtual nodes formed in the former case are many more than those formed in the latter case. Thus, much more verification information for virtual nodes is needed in the former case. Taken altogether, R
v
s in the former case is almost equal to or sometimes a little larger than that in the latter case.


### 6.1.2. Impact of Parameterf
d

From Figure5, we can see that the larger f
d is, the larger C
v
-
s
m is. The reason is clear: more data items need more verification information in VTMSN. Figure 6 shows the simulation results of the corresponding R
v
s. We can see that the larger f
d is, the smaller R
v
s is. The reason is that larger f
d leads to more data items generated in a given time period, and the more the data items are generated, the closer R
v
s is to the ratio of the amount of verification information for data items to the amount of the data items. However, because there is an encrypted term following each data item in VTMSN, R
v
s can not be smaller than the ratio of the length of each verification term following each data item to the length of each data item. That is why R
v
s decreases slower and slower as f
d increases in Figure 6.Figure 5
Impact of parameterf
d on C
v
-
s
m.Figure 6
Impact of parameterf
d on R
v corresponding to C
v
-
s
m.


## 6.1.1. Impact of ParametersT
m, T
s, and T
e

Figure3 shows that C
v
-
s
m becomes larger and larger as T
e increases. The reason is obvious: the larger T
e is, the more the data items are, and more verification information is needed. However, Figure 4 shows that the corresponding R
v
s does not change too much as T
e increases. This indicates that the ratio of the increasing rate of verification information to that of data items keeps relatively stable as T
e increases.Figure 3
Impact of parametersT
m, T
s, and T
e on C
v
-
s
m.Figure 4
Impact of parametersT
m, T
s, and T
e on R
v
s corresponding to C
v
-
s
m.From Figure3, we can also find that the longer the total time for sensor nodes to be in a static state in one epoch is, the larger C
v
-
s
m is, because sensor nodes generate data items only when they are in a static state. Moreover, when T
m and T
s are equal, the smaller T
m and T
s are, the more the verification information is needed, because more virtual nodes are formed when T
m and T
s are smaller and the amount of data items is almost the same when T
m and T
s are equal. It is also the reason why R
v
s is much larger than that in the other two cases in Figure 4 when T
m and T
s are set to 2 s.Now we explain whyR
v
s with T
m
=
2 s and T
s
=
10 s is almost equal to or sometimes a little larger than R
v
s with T
m
=
10 s and T
s
=
10 s in Figure 4. First, sensor nodes in the former case generate more data items than those in the latter case. If the numbers of virtual nodes are the same for the two cases, the more the data items are generated, the smaller R
v
s is. Of course, R
v
s should be bigger than the ratio of cost of transmitting the verification information for data items to the cost of transmitting data items. Thus, if the number of virtual nodes is the same, R
v
s in the former case should be much smaller than that in the latter case. However, virtual nodes formed in the former case are many more than those formed in the latter case. Thus, much more verification information for virtual nodes is needed in the former case. Taken altogether, R
v
s in the former case is almost equal to or sometimes a little larger than that in the latter case.


## 6.1.2. Impact of Parameterf
d

From Figure5, we can see that the larger f
d is, the larger C
v
-
s
m is. The reason is clear: more data items need more verification information in VTMSN. Figure 6 shows the simulation results of the corresponding R
v
s. We can see that the larger f
d is, the smaller R
v
s is. The reason is that larger f
d leads to more data items generated in a given time period, and the more the data items are generated, the closer R
v
s is to the ratio of the amount of verification information for data items to the amount of the data items. However, because there is an encrypted term following each data item in VTMSN, R
v
s can not be smaller than the ratio of the length of each verification term following each data item to the length of each data item. That is why R
v
s decreases slower and slower as f
d increases in Figure 6.Figure 5
Impact of parameterf
d on C
v
-
s
m.Figure 6
Impact of parameterf
d on R
v corresponding to C
v
-
s
m.


## 6.2. The Results ofC
v
-
m
w and the Corresponding R
v
s

In this subsection, we evaluate the performance of our verification scheme VTMSN onC
v
-
m
w and its corresponding R
v
s with different parameter configurations. The results are as follows.


### 6.2.1. Impact of ParametersQ
R and k

Figure7 shows the impact of the query region Q
R and parameter k on C
v
-
m
w in VTMSN. We can see that the larger Q
R and k are, the larger C
v
-
m
w is, because larger Q
R and k bring more virtual nodes and data items which need more verification information.Figure 7
Impact of parametersQ
R and k on C
v
-
m
w.Figure8 shows the impact of Q
R and k on R
v
s corresponding to C
v
-
m
w of VTMSN. We can see that if parameter k does not change, the larger Q
R is, the larger R
v
s is. Recall that R
v
s here is the ratio of C
v
-
m
w to the energy consumption in bits incurred by sending and receiving the top k data items. Thus, if k does not change, the larger C
v
-
m
w is, the larger R
v
s is. On the other hand, we can also see from Figure 8 that, with the same Q
R, the larger k is, the smaller R
v
s is. This can be explained easily according to the definition of R
v
s. In Figure 8, R
v
s decreases slower and slower as k increases. The reason is that there is an encrypted term E
K
i
{
∗
} following each data item as the verification information for data items in VTMSN, and R
v
s can not be smaller than the ratio of the length of the term E
K
i
{
∗
} to the length of a data item.Figure 8
Impact of parametersQ
R and k on R
v
s corresponding to C
v
-
m
w.


### 6.2.2. Impact of ParametersT
m, T
s, and v

Figures9 and 10 show the impact of moving period T
m, static period T
s, and the moving speed v of a sensor node on C
v
-
m
w and its corresponding R
v
s, respectively. It is clear that both C
v
-
m
w and its corresponding R
v
s are not influenced by the speed of sensor nodes too much.Figure 9
Impact of parametersT
m, T
s, and v on C
v
-
m
w.Figure 10
Impact of parametersT
m, T
s, and v on R
v
s corresponding to C
v
-
m
w.In theory, with the same other parameters, the more the times for sensor nodes to switch their states in one epoch are, the largerC
v
-
m
w is, because more virtual nodes will be generated in the query region and they need more verification information. Figure 9 illustrates this. As an example, when T
m
=
2 s, T
s
=
2 s, and T
e
=
50 s, each sensor node switches its state for 24 times, while there are only 4 times for a sensor node to switch its state when T
m
=
10 s, T
s
=
10 s, and T
e
=
50 s. Figure 9 shows that C
v
-
m
w in the former case is larger than that in the latter case. The corresponding R
v
s in Figure 10 is in conformity with C
v
-
m
w in Figure 9. The reason is that the value of parameter k is the same, which means the amount of data items sent from M to W is the same in this test, and the value of R
v
s depends on the value of C
v
-
m
w totally according to the meaning of R
v
s.


### 6.2.3. Impact of Parameterf
q

Figures11 and 12 show the impact of query frequency f
q on C
v
-
m
w and its corresponding R
v
s, respectively, where the abscissas denote the number of queries issued by the network owner in one epoch. We can see that both C
v
-
m
w and its corresponding R
v
s decrease as f
q increases. The reason is that the locations of virtual nodes need to be sent to the network owner only when the data generated during the epoch when the virtual nodes existed are queried for the first time. Besides, if a virtual node does not have any qualified data for a query, it needs to send the verification information to the network owner only when it is in the query region for the first time. Thus, as the number of queries increases in one epoch, the probability that a virtual node need not have to have the verification information of itself in the query result increases. Thus, the average value of C
v
-
m
w for each query decreases. Besides, according to the definition of R
v
s, with the same k, R
v
s decreases as C
v
-
m
w decreases.Figure 11
Impact of parameterf
q on C
v
-
m
w.Figure 12
Impact of parameterf
q on R
v
s corresponding to C
v
-
m
w.


## 6.2.1. Impact of ParametersQ
R and k

Figure7 shows the impact of the query region Q
R and parameter k on C
v
-
m
w in VTMSN. We can see that the larger Q
R and k are, the larger C
v
-
m
w is, because larger Q
R and k bring more virtual nodes and data items which need more verification information.Figure 7
Impact of parametersQ
R and k on C
v
-
m
w.Figure8 shows the impact of Q
R and k on R
v
s corresponding to C
v
-
m
w of VTMSN. We can see that if parameter k does not change, the larger Q
R is, the larger R
v
s is. Recall that R
v
s here is the ratio of C
v
-
m
w to the energy consumption in bits incurred by sending and receiving the top k data items. Thus, if k does not change, the larger C
v
-
m
w is, the larger R
v
s is. On the other hand, we can also see from Figure 8 that, with the same Q
R, the larger k is, the smaller R
v
s is. This can be explained easily according to the definition of R
v
s. In Figure 8, R
v
s decreases slower and slower as k increases. The reason is that there is an encrypted term E
K
i
{
∗
} following each data item as the verification information for data items in VTMSN, and R
v
s can not be smaller than the ratio of the length of the term E
K
i
{
∗
} to the length of a data item.Figure 8
Impact of parametersQ
R and k on R
v
s corresponding to C
v
-
m
w.


## 6.2.2. Impact of ParametersT
m, T
s, and v

Figures9 and 10 show the impact of moving period T
m, static period T
s, and the moving speed v of a sensor node on C
v
-
m
w and its corresponding R
v
s, respectively. It is clear that both C
v
-
m
w and its corresponding R
v
s are not influenced by the speed of sensor nodes too much.Figure 9
Impact of parametersT
m, T
s, and v on C
v
-
m
w.Figure 10
Impact of parametersT
m, T
s, and v on R
v
s corresponding to C
v
-
m
w.In theory, with the same other parameters, the more the times for sensor nodes to switch their states in one epoch are, the largerC
v
-
m
w is, because more virtual nodes will be generated in the query region and they need more verification information. Figure 9 illustrates this. As an example, when T
m
=
2 s, T
s
=
2 s, and T
e
=
50 s, each sensor node switches its state for 24 times, while there are only 4 times for a sensor node to switch its state when T
m
=
10 s, T
s
=
10 s, and T
e
=
50 s. Figure 9 shows that C
v
-
m
w in the former case is larger than that in the latter case. The corresponding R
v
s in Figure 10 is in conformity with C
v
-
m
w in Figure 9. The reason is that the value of parameter k is the same, which means the amount of data items sent from M to W is the same in this test, and the value of R
v
s depends on the value of C
v
-
m
w totally according to the meaning of R
v
s.


## 6.2.3. Impact of Parameterf
q

Figures11 and 12 show the impact of query frequency f
q on C
v
-
m
w and its corresponding R
v
s, respectively, where the abscissas denote the number of queries issued by the network owner in one epoch. We can see that both C
v
-
m
w and its corresponding R
v
s decrease as f
q increases. The reason is that the locations of virtual nodes need to be sent to the network owner only when the data generated during the epoch when the virtual nodes existed are queried for the first time. Besides, if a virtual node does not have any qualified data for a query, it needs to send the verification information to the network owner only when it is in the query region for the first time. Thus, as the number of queries increases in one epoch, the probability that a virtual node need not have to have the verification information of itself in the query result increases. Thus, the average value of C
v
-
m
w for each query decreases. Besides, according to the definition of R
v
s, with the same k, R
v
s decreases as C
v
-
m
w decreases.Figure 11
Impact of parameterf
q on C
v
-
m
w.Figure 12
Impact of parameterf
q on R
v
s corresponding to C
v
-
m
w.


## 7. Conclusion

In this paper, we present a tiered mobile sensor network model named TMSN for the first time and propose an effective verification scheme called VTMSN to verify the authentication and the completeness of the top-k query results received by the network owner in TMSN. The proposed scheme achieves the goal of making the network owner verify the authenticity and completeness of top-k query results in TMSN with high probability and good efficiency via the mechanisms of virtual node mapping and data binding. Theory analysis shows that VTMSN can detect any forged and/or incomplete top-k query result with probability that P
d
e
t
=
1 when none of the queried sensor nodes is compromised. We have conducted extensive experiments with different parameter configurations, and the simulation results show that VTMSN is effective and feasible.



---

*Source: 437678-2015-10-18.xml*