by risky nodes, but it can be worthwhile to further
investigate.
The paper is organised as follows. In Section 2,
we introduce our methodology with an illustrative ex-
ample. In Section 3 we briefly recall the process cal-
culus IOT-LYSA. In Section 4 we define the CFA, and
reason on data trajectories. We conclude in Section 5.
2 AN IRRIGATION SYSTEM
In this section we illustrate our methodology through
a simple yet realistic scenario similar to the one intro-
duced in (Bodei et al., 2018). We consider a smart
agricultural irrigation system, based on a Wireless
Sensor Network, for monitoring and irrigating grapes
crops. The main task of the system is to regulate irri-
gation according to evapo-transpiration (ET), a vari-
able parameter that measures the crop water demand,
which depends on several factors (e.g. weather, soil
moisture, kind of plant and stage of development). Ir-
rigation is needed when ET exceeds the supply of wa-
ter coming from the soil or from precipitations.
In our model, a combination of wired and wire-
less sensors collects soil data like pH, moisture, tem-
perature and so on. The collected data are sent in a
multi-hop manner to a base station node. The base
station node performs a first elaboration of data and
then transmits the results to the remote server. The
aggregated data are further processed and stored. The
server decides the suitable irrigating actions for each
sub-area in the crop: e.g. if, in one of them, the level
of soil moisture goes down a given threshold then
sprinkler actuators are activated. Users can directly
access the server data at any location.
The corresponding model in IOT-LYSA, de-
scribed in Table 1, is a pool of nodes running in
parallel (this is the meaning of the parallel compo-
sition operator |). Some of the terms are enriched
with labels and tags that support the CFA and whose
meaning will be clarified in the next section. Each
node, uniquely identified by a label , consists of
control processes and, possibly of sensors and actu-
ators. Communication is multi-party: each node can
send information to a set of nodes, provided that they
are in the same transmission range. The commu-
nication patterns are not too complicate, so the ex-
ample can serve the aim of illustrating our frame-
work. Outputs and inputs must match in order to
communicate. In more detail, output is modelled as
hhE
1
,··· ,E
k
ii L.P meaning that the tuple E
1
,··· ,E
k
is sent to the nodes with labels in L. Input is in-
stead modelled as (E
1
,··· ,E
j
; x
j+1
,··· ,x
k
).P and
embeds pattern matching. In receiving an output tu-
ple E
0
1
,··· ,E
0
k
of the same size (arity), the commu-
nication succeeds provided that the first j elements
of the output match the corresponding first elements
of the input (i.e. E
1
= E
0
1
,··· ,E
j
= E
0
j
), and then
the variables occurring in the input are bound to the
corresponding terms in the output. Each base sta-
tion node N
bs
i j
is connected to a bunch of sensors
S
1
bs
i j
,··· ,S
k
bs
i j
that sense the environment in the crop
sub-area controlled by the base station control pro-
cess P
bs
i j
and write the sensed values on its store. The
node also includes other components that we omit
because irrelevant here. Similarly, the action τ de-
notes internal actions of the sensor we are not inter-
ested in. The node N
bs
i
collects data z
l
of its sen-
sors, processes them with the help of filter and ag-
gregation functions f
1
,··· , f
m
and transmits their re-
sults to the Cluster Head node N
ch
j
. The commu-
nication is performed as explained above: e.g. the
output hh1, f
1
(z
1
···z
k
),··· , f
m
(z
1
···z
k
)ii {
ch
1
} per-
formed by P
bs
11
matches the input (1; x
1
1
···x
m
1
) per-
formed by P
ch
1
, and therefore the variable x
1
1
is bound
to f
1
(z
1
···z
k
), the variable x
2
1
is bound to f
2
(z
1
···z
k
)
and so on. The construct ∗[...]∗ implements the it-
erative behaviour of processes and of sensors. Each
node N
ch
j
controls a subset of the base station nodes
N
bs
i j
,··· ,N
bs
i j
that send it their data (x
i
stands for
the array (x
1
i
···x
m
i
)). The Cluster Head node re-
ceives these data, aggregates them with the functions
aggr
1
(),··· , aggr
r
(), and then sends the results to the
Server N
as
. The node N
as
processes the data sent by
all the Cluster Head nodes N
ch
1
,··· ,N
ch
n
and makes
its decision on irrigation. If the server detects that
some water is needed in the area controlled by the
node N
ch
j
(i.e. if the water demand w
j1
exceeds a
given threshold th
j1
), it sends a “start irrigation” or-
der, and conversely, when it detects that there is suf-
ficient water (i.e. if the water demand w
j1
is does not
exceed a given threshold th
0
j1
), it transmits a “stop ir-
rigation” order. The relevant Cluster Head node N
ch
j
transmits the received orders to the corresponding ac-
tuators A
j
triggering the irrigation sprinklers. Further-
more, users N
us
t
can access the data processed and
stored by the server N
as
, e.g. for checking whether
there are the conditions for particular manual pro-
cesses, like pruning. For the sake of simplicity, we
omit the specification of the components of the users’
nodes N
us
t
.
Wireless communication depends on the transmis-
sion range. Secure data transfer between the sensors
and the server, through base station nodes, is crucial.
Some nodes can be insecure and therefore may al-
ter or tamper data passing from there, thus potentially
impacting on the whole irrigation system. As a conse-
Tracking Data Trajectories in IoT
573