=Paper=
{{Paper
|id=Vol-2707/mde4iotpaper2
|storemode=property
|title=Analyzing WSN-based IoT Systems using MDE Techniques and Petri-net Models
|pdfUrl=https://ceur-ws.org/Vol-2707/mde4iotpaper2.pdf
|volume=Vol-2707
|authors=Burak Karaduman,Moharram Challenger,Raheleh Eslampanah,Joachim Denil,Hans Vangheluwe
|dblpUrl=https://dblp.org/rec/conf/staf/KaradumanCEDV20
}}
==Analyzing WSN-based IoT Systems using MDE Techniques and Petri-net Models==
Analyzing WSN-based IoT Systems using MDE
Techniques and Petri-net Models?
Burak Karaduman1 , Moharram Challenger2 , Raheleh Eslampanah2 ,
Joachim Denil2 , and Hans Vangheluwe2
1
International Computer Institute, Ege University, Turkey,
{bburakkaraduman}@gmail.com
2
University of Antwerp and Flanders Make, Belgium
{moharram.challenger,raheleh.eslampanah,joachim.denil,
hans.vangheluwe}@uantwerpen.be
Abstract. There are various computation components, operating sys-
tems, and firmware used in the development of the Internet of Things
(IoT). This variety increases the structural complexity and development
cost and effort of the IoT systems. Besides, analyzing and troubleshooting
these systems are time-consuming, costly, and cumbersome. To address
these problems, this study aims to provide a higher level of abstraction for
analyzing and developing IoT systems using Model-driven Engineering
techniques and Petri-net models. To this end, a Domain-specific mod-
eling Language (DSML), called DSML4Contiki, was presented in our
previous study for the development of Wireless Sensor Systems (WSN)
based IoT systems. The current study extends DSML4Contiki by pro-
viding an automated mechanism to analyze the IoT system at the early
design phase, resulting in a reduction of the number of errors in the sys-
tem and iterations in the development process. This is achieved using
model transformation rules to transform the domain models at a high
level to both the target platform artifacts as well as Petri-net models.
By applying k-boundedness property checking on the Petri-net models,
different analyses (such as power consumption, bottlenecks, and first
crashing node) are realized for WSN based IoT systems. To evaluate the
proposed approach, the engineering of a smart fire detection system is
considered as a case study.
Keywords: Internet of Things, Wireless Sensor Networks, Model-driven Engi-
neering, Petri-net, Smart Fire Detection System
1 Introduction
Internet of Things (IoT) is rapidly taking its place in different technologies and
markets [17], such as home appliances, smart buildings, Industry 4.0 applications,
and Digital Twin systems. IoT systems consist of different components such as
sensors, actuators, and log managers for data management. These systems can
benefit from Wireless Sensor Networks (WSN) to make their communication
?
Copyright ©2020 for this paper by its authors. Use permitted under Creative Com-
mons License Attribution 4.0 International (CC BY 4.0).
topology more flexible (using the ad-hoc network provided by WSNs) and in-
crease the coverage of the resulting IoT system in the physical environment,
without a need for a direct Internet connection in all devices.
However, creating WSN based IoT systems require some more components
such as source nodes, sink nodes, and gateways. The resulting system is complex
with different components requiring to be programmed to work collaboratively.
This complexity makes the design and analyses of these systems time-consuming,
costly, and cumbersome. This complexity can be addressed with Model-Driven
Engineering (MDE) techniques [10] to increase the level of abstraction and auto-
matically synthesize the system artifacts. To this end, in [6] and [2], we have in-
troduced a Domain-specific Modeling Language (DSML), called DSML4Contiki,
for the design and development of WSN based IoT systems (using Contiki oper-
ating system). The domain models, i.e. the models designed in DSML4Coktiki,
are used for automatically synthesizing the architectural code/configuration of
WSN based IoT systems. More details on DSML4Contiki can be found in [2].
Using the model-centric development methodology, design models can be
used for the early analyses and validation of the system. This can reduce the
number of errors in the system under development, leading to increase the qual-
ity of the system. This early analyses of the system can also reduce the number
of iterations in the development process of an IoT system, resulting in reduc-
tion of the development cost and effort. As these multi-component systems work
based on some events to fulfill their tasks, their behavior [20] can be represented
by the Petri-net models. Therefore, in this paper, we extend DSML4Contiki to
synthesis the analysis models of the IoT system in Petri-net. In this way, the
modeling language can generate the analysis models of the system from the de-
sign models, using model transformation techniques. By applying k-boundedness
analysis on the automatically generated Petri-net models, various analyses (such
as power consumption, bottleneck, and first crashing node) can be performed
(semi-)automatically on the IoT models. To evaluate the proposed approach, a
case study called fire detection system is used.
The paper is organized as follows: Section 2 discusses the related work. The
proposed approach for analyzing the WSN-based IoT systems with Petri-net
models are discussed in Section 3. Fire detection system is discussed as an eval-
uating case study in Section 4. A computational complexity analysis is provided
as the evaluation for the proposed approach in Section 5. Finally, the paper is
concluded and the future work is stated in Section 6.
2 Related Work
To analyze the design and deployment of WSN and IoT systems, several studies
are proposed in the literature. In the study [18] the power analysis is realized
using a tool called ArchWiSeN. Also, a modeling framework in [5] is proposed
to provide multi-view architectural approach. The authors also offer a code gen-
eration for the simulation of the designed network. However, the simulation can
36
be made for limited devices. These two studies do not benefit from a formal
modeling method, such as Petri-net.
In the study of [12], a discrete event simulation is made for IoT systems
using high-tech and costly multi-core CPUs and GPUs. The study [13] offers
stochastic model checking. However, they are bounded to hardware part that is
operating with Contiki operating system. In our study, we consider an approach
which covers all system components from WSN, IoT to Log Manager as well as
providing a cost efficient development.
Furthermore, there are several studies in the literature which are using man-
ually created Petri-net models for IoT systems to do analysis [16] [22] [21]. How-
ever, these approaches do not benefit from MDE techniques for the automatic
development of Petri-net models and they need lots of effort for creating the
models manually, especially for the industrial cases of IoT systems.
In a complex and multi-component system, such as an IoT system, a low-cost
and effort development is very important. To this end, in our study, the Petri-
net models for WSN based IoT systems are generated automatically (using MDE
techniques) to do a set of early design phase analysis such as power consumption,
bottlenecks, and first crashing node.
3 Analyzing IoT systems with Petri-net models
This section discusses the proposed analysis approach for WSN-based IoT sys-
tems using Petri-net models. These models are automatically generated from
domain models (designed in DSML4Contiki). Figure 1 illustrates the mapping
table, between DSML4Contiki elements to Petri-net model elements, to generate
the Perti-net models both in PIPE and LoLA frameworks. Since LoLA has not
a graphical interface (it runs in terminal), we decided to use PIPE’s graphical
interface for the representation of the system. On the other hand, PIPE has not
k-boundedness feature, so, the k-boundedness analysis is made in LoLA.
For both of the Petri-net analysis tools, the code generation rules are written
in Acceleo model to text transformation language. As it is shown in Figure
1, node elements such as the WSN sensor nodes, ESP8266 Wi-Fi module [11],
RaspberryPI, and Log Manager elements are mapped to places in the Petri-
net model. On the other hand, the messages such as Node messages and ESP
messages are mapped to tokens in the Petri-net model. Finally, the relations in
the domain-specific models are mapped to transitions and arcs, based on their
situation.
Fig. 1. Mapping table between DSML4Contiki elements to Petri-net model elements
37
One of the important criteria to analyze the IoT systems is the data sampling
period of its end-devices [4]. To reduce power consumption and increase battery
life, designers can increase the sampling period. However, this may violate sys-
tem requirements in some cases such as sampling temperature data for a fire
detection system where the fire situation must be reported in a limited amount
of time. However, setting the sampling time very high can bring the risk of bot-
tleneck and also resulting some of the sensors to discharge their batteries fast,
resulting in losing the coverage of part of the system. Therefore, analyzing the
trade-off between these two ends and providing an appropriate sampling period
is very essential. Specifically, realizing these analyses in the early design phase is
important, as it decreases the cost of system development and avoids unforeseen
critical errors in the system after deployment. Another parameter that needs to
be analyzed is the distances between the nodes. In this section, these analyses,
as well as some other analyses (such as cost analyses and propagation delay anal-
ysis), are elaborated using Petri-net models generated from the design models
and the data provided by the user in the design models. These analyses are done
using the k-boundedness feature of Petri-net models.
K-boundedness feature checks a place in a Petri-net model and counts the
number of tokens that are passed in that place, then it compares that number
with the k value, which is determined by system. In this study, the k value
represents the bottleneck of the sensor network. If the number of tokens gets
closer to k value for a node, the node (place) can have bottleneck problem and
also the power consumption will increases in that node and the node may goes
down soon. If the power is depleted in a node, a part of the network may be
disconnected in the WSN. Therefore an optimal k value must be found by the
designer and the topology design must be made considering this value. Moreover,
the number of the tokens pass through a place must be below this k value. One
way to reduce the k value is by adding extra nodes to decrease message traffic
in this specific node, but this approach results in an extra cost to the system.
Another way is tolerating the higher k value by having higher battery capacity
in the node to ease the bottleneck problem, but this also results in additional
cost. We need another trade-off analysis for this situation as well.
To ease understanding and demonstration, the Petri-net based analyses are
divided into two parts. The first part is realized in PIPE framework (with graph-
ical representation) to provide the distance and propagation delay with respect
to the sink node, and to perform a cost analysis and arrange a bill of material
(BOM) for the system. The distance values are provided by the user for each
node. The second part of the analysis is realized using the low-level Petri-net
capability of LoLA (using k-boundedness for the places) for bottleneck analysis,
power consumption analysis, and node crash (first node die) analysis. For the
cost analysis, the BOM is calculated based on a (assumptive) price list.
To perform the analyses, the Petri-net model is generated automatically from
the design models. The model-to-model transformation rules are implemented in
the Acceleo3 language to generate the Petri-net models. These transformation
3
Acceleo: https://www.eclipse.org/acceleo/
38
rules accept the WSN based IoT system design in 4 viewpoints (modeled in
DSML4Contiki framework) as inputs and after applying the transformation rules
they return the Petri-net models in PIPE and LoLA format. An excerpt of LoLA
model generation rules (to create the places) is demonstrated in Listing 1.1. To
generate LoLA model, the elements in the System view and Log Manager view
are used. The rules in Listing 1.1 traverse the design model to collect all ESP
elements (Lines 2-4) and Tags (Lines 5-7) connected to the Log Managers (Line
1) defined in the system and provide the information for the places of the Petri-
net models.
Listing 1.1. Excerpt of LoLA model generation rules in Acceleo for creating Places
1 [for (l:LogMan | IoTSys.logman)]
2 [for (e:ESP | IoTSys.esp)]
3 [e.Name/],
4 [/for]
5 [for (t : Tag | tag)]
6 [t.Name/],
7 [/for]
8 [/for]
However, calculating and transforming some of the semantic properties of the
design models, such as distances of source nodes and sink node, are not straight-
forward and cannot be done using solely a template engine (in Acceleo) and
constraint checking language (in AQL). In fact, we need an imperative language
(such as Java) to do this kind of calculations and later to be transformed to the
target model using a declarative transformation language such as Acceleo.
As an example, in Listing 1.2 the distance property is transformed from the
design model to the Petri-net model. This rule uses the Java wrapper code that
implements the calcDist function. In Listing 1.2, Lines 5-6 are calculating the
BOM and Lines 7-10 are calculating the total distances of each source node to
the sink node.
Listing 1.2. Semantic property calculation Rule for node distance
1 [query public calcDist(arg0:OrderedSet(Tag)):
2 OrderedSet(String) = invoke ...
3 Analyses Report [let abc : OrderedSet(String) = aIoTSystem.logman.tag
4 .calcDist(aIoTSystem.logman.tag)->asOrderedSet()]
5 [for(t:String|calcDist)] TmoteSky x [aIoTSystem.logman.tag->size()/]=
6 [100*aIoTSystem.logman.tag->size()/]$ ...
7 calcDist(Collection tag){for(int i=0; i