<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Analyzing WSN-based IoT Systems using MDE Techniques and Petri-net Models?</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Burak Karaduman</string-name>
          <email>fbburakkaradumang@gmail.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Moharram Challenger</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Raheleh Eslampanah</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Joachim Denil</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Hans Vangheluwe</string-name>
          <email>hans.vangheluweg@uantwerpen.be</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>International Computer Institute, Ege University</institution>
          ,
          <country country="TR">Turkey</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>University of Antwerp and Flanders Make</institution>
          ,
          <country country="BE">Belgium</country>
        </aff>
      </contrib-group>
      <fpage>35</fpage>
      <lpage>46</lpage>
      <abstract>
        <p>There are various computation components, operating systems, and rmware used in the development of the Internet of Things (IoT). This variety increases the structural complexity and development cost and e ort 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-speci c modeling 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 providing an automated mechanism to analyze the IoT system at the early design phase, resulting in a reduction of the number of errors in the system 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, di erent analyses (such as power consumption, bottlenecks, and rst crashing node) are realized for WSN based IoT systems. To evaluate the proposed approach, the engineering of a smart re detection system is considered as a case study.</p>
      </abstract>
      <kwd-group>
        <kwd>Internet of Things</kwd>
        <kwd>Wireless Sensor Networks</kwd>
        <kwd>Model-driven Engineering</kwd>
        <kwd>Petri-net</kwd>
        <kwd>Smart Fire Detection System</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Internet of Things (IoT) is rapidly taking its place in di erent technologies and
markets [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ], such as home appliances, smart buildings, Industry 4.0 applications,
and Digital Twin systems. IoT systems consist of di erent components such as
sensors, actuators, and log managers for data management. These systems can
bene t from Wireless Sensor Networks (WSN) to make their communication
? Copyright ©2020 for this paper by its authors. Use permitted under Creative
Commons License Attribution 4.0 International (CC BY 4.0).
topology more exible (using the ad-hoc network provided by WSNs) and
increase the coverage of the resulting IoT system in the physical environment,
without a need for a direct Internet connection in all devices.
      </p>
      <p>
        However, creating WSN based IoT systems require some more components
such as source nodes, sink nodes, and gateways. The resulting system is complex
with di erent 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 [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] to increase the level of abstraction and
automatically synthesize the system artifacts. To this end, in [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] and [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], we have
introduced a Domain-speci c Modeling Language (DSML), called DSML4Contiki,
for the design and development of WSN based IoT systems (using Contiki
operating system). The domain models, i.e. the models designed in DSML4Coktiki,
are used for automatically synthesizing the architectural code/con guration of
WSN based IoT systems. More details on DSML4Contiki can be found in [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>
        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
quality 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
reduction of the development cost and e ort. As these multi-component systems work
based on some events to ful ll their tasks, their behavior [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ] 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
design 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 rst crashing node) can be performed
(semi-)automatically on the IoT models. To evaluate the proposed approach, a
case study called re detection system is used.
      </p>
      <p>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
evaluating 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</p>
    </sec>
    <sec id="sec-2">
      <title>Related Work</title>
      <p>
        To analyze the design and deployment of WSN and IoT systems, several studies
are proposed in the literature. In the study [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ] the power analysis is realized
using a tool called ArchWiSeN. Also, a modeling framework in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] is proposed
to provide multi-view architectural approach. The authors also o er a code
generation for the simulation of the designed network. However, the simulation can
be made for limited devices. These two studies do not bene t from a formal
modeling method, such as Petri-net.
      </p>
      <p>
        In the study of [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], a discrete event simulation is made for IoT systems
using high-tech and costly multi-core CPUs and GPUs. The study [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] o ers
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 e cient development.
      </p>
      <p>
        Furthermore, there are several studies in the literature which are using
manually created Petri-net models for IoT systems to do analysis [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ] [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ] [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ].
However, these approaches do not bene t from MDE techniques for the automatic
development of Petri-net models and they need lots of e ort for creating the
models manually, especially for the industrial cases of IoT systems.
      </p>
      <p>In a complex and multi-component system, such as an IoT system, a low-cost
and e ort development is very important. To this end, in our study, the
Petrinet 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 rst crashing node.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Analyzing IoT systems with Petri-net models</title>
      <p>This section discusses the proposed analysis approach for WSN-based IoT
systems 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.</p>
      <p>
        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 [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ],
RaspberryPI, and Log Manager elements are mapped to places in the
Petrinet 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-speci c models are mapped to transitions and arcs, based on their
situation.
      </p>
      <p>
        One of the important criteria to analyze the IoT systems is the data sampling
period of its end-devices [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. To reduce power consumption and increase battery
life, designers can increase the sampling period. However, this may violate
system requirements in some cases such as sampling temperature data for a re
detection system where the re situation must be reported in a limited amount
of time. However, setting the sampling time very high can bring the risk of
bottleneck 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-o between these two ends and providing an appropriate sampling period
is very essential. Speci cally, 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
analysis), 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.
      </p>
      <p>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 tra c
in this speci c 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-o analysis for this situation as well.</p>
      <p>To ease understanding and demonstration, the Petri-net based analyses are
divided into two parts. The rst part is realized in PIPE framework (with
graphical 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 ( rst node die) analysis. For the
cost analysis, the BOM is calculated based on a (assumptive) price list.</p>
      <p>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/
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) de ned in the system and provide the information for the places of the
Petrinet models.</p>
      <p>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]</p>
      <p>However, calculating and transforming some of the semantic properties of the
design models, such as distances of source nodes and sink node, are not
straightforward 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.</p>
      <p>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.</p>
      <p>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)-&gt;asOrderedSet()]
5 [for(t:String|calcDist)] TmoteSky x [aIoTSystem.logman.tag-&gt;size()/]=
6 [100*aIoTSystem.logman.tag-&gt;size()/]$ ...
7 calcDist(Collection tag){for(int i=0; i&lt;aTag.size(); i++)
8 for(int j=0; j&lt;aTag.get(i).getSelftag().size(); j++)
9 aTag.get(i).getSelftag().get(j).setDistance(aTag.get(i).
10 getSelftag().get(j).getDistance()+aTag.get(i).getDistance());
11 ...</p>
      <p>Finally, using k-boundedness feature, the highest risky nodes (the rst to
die nodes) can be detected. These nodes have the highest connectivity in the
network. Considering the k value applied in the Petri-net model of the network,
the nodes with their connectivity value equals or nearest to the k value, are
candidate risky nodes and the user need to be aware of the risk of connection
due to the failure of these nodes.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Case Study: Smart Fire Detection System</title>
      <p>
        In this section, the proposed approach is evaluated using a case study called
smart re detection system [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. The system modeling (design), generation of
Petri-net models and analyzing the case study using DSML4Contiki and the
proposed approach are discussed in this section.
4.1
      </p>
      <sec id="sec-4-1">
        <title>System Modeling</title>
        <p>
          The requirements of the re detection system are elicited from the needs of a
municipality library system in Izmir, Turkey [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]. It is designed and modeled in
DSML4Contiki using a WSN multi-hop topology [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]. Figure 2 shows the topology
(Long Manager) viewpoint of the system in DSML4Contiki including the tags
for the sensors and a log manager called " redection".
        </p>
        <p>The system aims to use a WSN based IoT system to detect the re and notify
the users to evacuate the building as soon as possible. This system has several
WSN source nodes to sense the temperature at certain spots in the library and
send the values to the gateway which delivers them to a log manager. Also,
there are ESP8266s modules that sense the room temperature and directly send
the temperature data to the log manager. Based on these temperature values,
the system can decide about the states of a possible re, Blue (Safe), Yellow
(Warning), and Red (Alarm).
Using the transformation approach discussed in the previous section, a
Petrinet model is generated from the domain model (mainly topology viewpoint in
Figure 2) of the re detection system. The generated Petri-net model is shown in
PIPE framework, see Figure 3. This gure shows the places, transitions, and arcs
related to a multi-hop WSN for the re detection system. The initialization of
tokens is made according to the sensing activity of sink nodes. If a node (place)
has a sensor data and has to transmit this data, then that node (place) must
have a token.</p>
        <p>Moreover, the distance between the sensor nodes and the sink node, and
propagation delay results are calculated via the transformations and shown
topright side of Figure 3. They are calculated based on the information provided
via the designer in the design models.</p>
        <p>Finally, the generated BOM is generated and shown in the bottom-right side
of Figure 3 with the number of materials which are used in the design.</p>
      </sec>
      <sec id="sec-4-2">
        <title>Analyzing the Fire Detection System with Petri-net</title>
        <p>
          Bottleneck problem and its relation with power consumption for IoT systems
is discussed in the study of [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]. In our proposed IoT analysis approach, the
bottlenecks can be detected using k-boundedness, if the designed system model
can be transformed to a model in Petri-net. In this way, the power analysis
can be done using the Petri-net model to nd out the impact of bottleneck in
the system. Generally, if there is a bottleneck problem in a node, the network
lifetime, which has already planned, may not be valid anymore.
        </p>
        <p>In our case study, the k-boundedness feature of the Petri-net models is used
so that the nodes are analyzed for the power consumption as they may go out of
battery and cause a part of the network to go down. Therefore, the user can go
back to the design and can devise alternatives, such as adding new connections,
new nodes, or increasing battery capacity. To keep the planned/designed lifetime
of the network, the bottleneck problem must be analyzed for the IoT system
before developing and deploying the system in the physical environment.</p>
        <p>If k increases, the bottleneck problem may occur and as a result power
consumption can be increased. A k value must be found to provide the desired
lifetime with planned battery capacity in the system. Some of these analyses are
discussed below for the re detection system.</p>
        <p>Load bottleneck (First Crashing Node Analysis):</p>
        <p>The load in a node is the number of messages to be received and/or
transmitted to the next node(s). Naturally, the message load of a node increases when
the node has more sub-nodes (neighbor nodes). This can create a bottleneck
and results in more power consumption, which can result in a node crash earlier
than the planned lifetime. Moreover, a node can have message over ow due to
the limited bu er (as they have limited memory). To analyze these two
problems, the number of operations in each node (place) should be calculated using
the number of its neighbors (k).</p>
        <p>To nd the number of operations for a place/node, the number of messages
which are received and transmitted in a node should be considered, and it can
be calculated using the equation 1. The value of k (neighbors) is multiplied by
two since a node that receives a message should transmit it to the next node(s);
a send and receive actions are considered two di erent operations. The node also
sends its own sampling data to the sink node, which adds 1 operation. It worth
to note that in re detection system, each sensor node periodically samples the
temperature and send it to the sink node via intermediate neighbor nodes.</p>
        <p>N umberOf Operations = (2 k) + 1
(1)</p>
        <p>Using these calculations throughout the Petri-net model with a speci c initial
con guration, the user can monitor the behavior of the system in terms of the
node's load (and probable bottlenecks) in the network. The nodes with highest
number of operations (or highest k value) are the candidate nodes to crash the
rst (high risk nodes). The user can modify the design to resolve the problems
(by adding new nodes or battery capacity) and continue to the development.
Alternatively, the designer may resolve the problem by reducing the number of
neighbors for the node. This needs a trade-o analysis.</p>
        <p>Power consumption:</p>
        <p>Power consumption depends on the number of operations for each node.
Therefore, to bound the network with a value of k, the user rst should decide
on the nodes' lifetime, the battery capacity and the message sending
period/sampling rate.</p>
        <p>The lifetime of a node can be calculated using equation 2. If the user
increases battery capacity, then the lifetime of nodes increase. The power
consumption of a send and receive operation (using internal antenna) is averaged
with (RxT xAvgmA). The average of receiving and transmitting operations is
averaged to ease the calculation. T represents the number of using antenna in an
hour (as the unit of battery capacity is also in mAh). The value of T is bounded
to the sampling period of the nodes and can be calculated using equation 3.
Since our Petri-net analyses are based on tokens instead of time, if the system's
lifetime is determined then k value can be found to analyze the Petri-net model
in LoLa.</p>
        <p>Lif eT imehour =</p>
        <sec id="sec-4-2-1">
          <title>BatteryCapacitymAh (N umberOf Operations) (RxT xAvgmA) T</title>
          <p>T =
3600</p>
        </sec>
        <sec id="sec-4-2-2">
          <title>SamplingP eriodseconds</title>
          <p>(2)
(3)</p>
          <p>In this study, TmoteSky motes are used to create a multi-hop WSN. To do
the above-mentioned calculations, the power consumption of transmission and
reception values are found from the data-sheet of TmoteSky. In the case study,
the nodes send temperature values periodically, in each 120-seconds. According
to equation 3, nodes use their antenna 30 times in an hour. In experiment,
a 5-volt (10000mAh) power-bank was used. It can provide 33000mAh battery
capacity since TmoteSky runs at a voltage level of 3.3v. To ease the calculations
the average of transmitted and received current consumption is calculated (based
on the data-sheet), which is approximately 20mA. In equation 2, if k is 5, a node
with 5 sub-nodes (see equation 1) can run for 5 hours. We should consider that
k = 5 is a very highly connected network with very high reliability.</p>
          <p>These manual calculations show how to perform the trade-o analyses
between k and lifetime of the network (via power consumption). In the system
design phase, network size can be huge where it is not easy to track the paths
and do the analyses manually, so to test the k value and to bound the network,
the proposed automatic analyses in LoLA can be used. For example, the sensor
topology shown in Figure 2, is transformed to LoLA code and the network is
tested for a node named sensor1 using a k value and the output result is shown
in Listing 1.3. If a node cannot be bounded with given k value, then alternatives
must be devised by the user.</p>
          <p>Listing 1.3. Application of k-boundedness to calculate power consumption using LoLA
1 lola --formula=AG sensor1 &lt; 5 IoTSystem.lola : lola:result:no
Response time for alarm:</p>
          <p>The rst minutes of indoor re events are critical considering the evacuation
possibility of the building. Therefore, the response time of a re detection system
must be as low as possible. If the re starts exactly after sampling of temperature
(the worst case), then the re spreads until the time for the next sampling time.
To keep the sampling interval more often, either the battery capacity must be
increased or several sink nodes must be added.</p>
          <p>In calculation of the response time (from sensing to triggering alarm), the
message transmission times should be also considered. Therefore, if the distance
to the sink node is too far for a node in a multi-hop network, the system's total
propagation delay for a message can be a problem. If the distance increases, the
propagation delay increases. Although there is a processing delay in the nodes,
it is trivial amount of time comparing to the message transmission time and
it can be ignored in the calculations. Consequently, the time to trigger the re
alarm in the worst case needs to be calculated with respect to the node which
has the furthest distance to the sink node. These kinds of trade-o analyses can
be done by the user using the automatically calculated propagation delays (see
Figure 3) to reach a proper response time.
5</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Evaluation</title>
      <p>In this section, the computational complexity of the proposed approach is
evaluated. The main process for system design using the proposed approach is model
transformations. So, the complexity of these transformations are focused for the
evaluation.</p>
      <p>First, we present the assumptions of evaluating transformations.
1. M represents the set of Log Managers in the system
2. Nm represents the set of the Tags for Log Manager m
3. 8m 2 M; N = [Nm
4. 8ni; nj 2 Nm ! ni 6= nj
5. 8ni 2 Np ^ nj 2 Nq ! ni 6= nj</p>
      <p>Items 1-3 gives the de nitions for log managers, their tags, and total number
of tags in the system. Assumption number 4 means that the Tags of each Log
manager are unique and assumption 5 means that the Log Managers have no
common Tags. This is because the log managers store the data for the devices
and the system should not have redundancy in storing the data.</p>
      <p>The transformation from design models to Petri-net models is given in
Listing 1.2. This transformation routine contains two nested loops, the outer one
traverses all log managers of the system and the inner one transverses all of the
tags for the log manager indicated by the outer loop. Although, the total
complexity seems to be O(jM j jNmj), however, this estimation is too high as the
sets of Tags for log managers are disjoint (assumption 5). So, the total number
of iterations for these two nested loops is the number of log managers M (for
the outer loop) plus the total number of Tags N in the system (for the inner
loop), resulting to O(jM j + jN j).</p>
      <p>If the total number of Log managers are much less than total number of Tags
(i.e. M &lt;&lt; N ), then the complexity of the algorithm becomes O(jN j). Therefore,
the computational complexity depends on the number of the nodes (Tags). If
M=N, only one Tag is used in each Log manager to connected a device, which
is a poor design. In other words there are lots of Log managers and each Log
manager just have one node (single Tag). Then the complexity is O(jM j + jN j)
= O(jN j + jN j) = O(2jN j). This complexity is equal to O(jN j). As a result, in
any case the computational complexity of the transformation is dependent on
the total number of Tags in the system (or the devices which are connected to
the IoT system). This complexity is linear and has a reasonable computational
cost.</p>
    </sec>
    <sec id="sec-6">
      <title>Conclusion and Future Work</title>
      <p>The current study extends DSML4Contiki by automatic generation of the
Petrinet models from the design models and applying di erent analyses on these
models using k-boundedness property of Petri-net models. Using this
development approach, the developers can apply analyses such as network lifetime ( rst
crashing nodes), bottleneck, and power consumption analyses in the early design
phase. This prevents the extra iterations of re-design and re-deployment for the
system. The proposed approach not only can generate a high ratio of the codes
from the system but also can apply analyses based on the same domain-speci c
models. The study is evaluated using a smart re detection system, and various
analyses are applied in this case study and the results are discussed.</p>
      <p>
        In the future, it is planned to raise the level of abstraction on the
PlatformIndependent modeling level. It will extend this study to support the modeling
of IoT systems, independent of their target platforms, such as RIOT [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] and
TinyOS [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ]. This will be achieved using the model to model transformations.
Moreover, we aim to use Multi-agent Systems [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ] [
        <xref ref-type="bibr" rid="ref19">19</xref>
        ] in the modeling, analysis,
and implementation of IoT systems.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>S.</given-names>
            <surname>Arslan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Challenger</surname>
          </string-name>
          , and
          <string-name>
            <given-names>O.</given-names>
            <surname>Dagdeviren</surname>
          </string-name>
          .
          <article-title>Wireless sensor network based re detection system for libraries</article-title>
          .
          <source>In 2017 International Conference on Computer Science and Engineering (UBMK)</source>
          , pages
          <fpage>271</fpage>
          {
          <fpage>276</fpage>
          . IEEE,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>T. Z.</given-names>
            <surname>Asici</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Karaduman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Eslampanah</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Challenger</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Denil</surname>
          </string-name>
          , and
          <string-name>
            <given-names>H.</given-names>
            <surname>Vangheluwe</surname>
          </string-name>
          .
          <article-title>Applying model driven engineering techniques to the development of contiki-based iot systems</article-title>
          .
          <source>In 2019 IEEE/ACM 1st International Workshop on Software Engineering Research &amp; Practices for the Internet of Things (SERP4IoT)</source>
          , pages
          <fpage>25</fpage>
          {
          <fpage>32</fpage>
          . IEEE,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>S.</given-names>
            <surname>Bosmans</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Mercelis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Denil</surname>
          </string-name>
          , and
          <string-name>
            <given-names>P.</given-names>
            <surname>Hellinckx</surname>
          </string-name>
          .
          <article-title>Challenges of modeling and simulating internet of things systems</article-title>
          .
          <source>In International Conference on P2P, Parallel, Grid, Cloud and Internet Computing</source>
          , pages
          <volume>457</volume>
          {
          <fpage>466</fpage>
          . Springer,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4. J. Cheng, H.
          <string-name>
            <surname>Jiang</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          <string-name>
            <surname>Ma</surname>
            ,
            <given-names>L.</given-names>
            Liu, L.
          </string-name>
          <string-name>
            <surname>Qian</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <string-name>
            <surname>Tian</surname>
            , and
            <given-names>W.</given-names>
          </string-name>
          <string-name>
            <surname>Liu</surname>
          </string-name>
          .
          <article-title>E cient data collection with sampling in wsns: making use of matrix completion techniques</article-title>
          .
          <source>In 2010 IEEE Global Telecommunications Conference GLOBECOM</source>
          <year>2010</year>
          ,
          <article-title>pages 1{5</article-title>
          . IEEE,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>K.</given-names>
            <surname>Doddapaneni</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Ever</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Gemikonakli</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Malavolta</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Mostarda</surname>
          </string-name>
          , and
          <string-name>
            <given-names>H.</given-names>
            <surname>Muccini</surname>
          </string-name>
          .
          <article-title>A model-driven engineering framework for architecting and analysing wireless sensor networks</article-title>
          .
          <source>In Proceedings of the Third International Workshop on Software Engineering for Sensor Network Applications</source>
          , pages
          <fpage>1</fpage>
          <lpage>{</lpage>
          7,
          <string-name>
            <surname>Piscataway</surname>
          </string-name>
          , USA,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>C.</given-names>
            <surname>Durmaz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Challenger</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Dagdeviren</surname>
          </string-name>
          , and
          <string-name>
            <given-names>G.</given-names>
            <surname>Kardas. Modelling ContikiBased IoT</surname>
          </string-name>
          <article-title>Systems</article-title>
          .
          <source>In 6th Symposium on Languages, Applications and Technologies (SLATE</source>
          <year>2017</year>
          ), volume
          <volume>56</volume>
          of OpenAccess Series in Informatics (OASIcs), pages
          <fpage>5</fpage>
          <issue>:1</issue>
          {5:
          <fpage>13</fpage>
          ,
          <string-name>
            <surname>Dagstuhl</surname>
          </string-name>
          , Germany,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>B.</given-names>
            <surname>Karaduman</surname>
          </string-name>
          , T. As c , M. Challenger, and
          <string-name>
            <given-names>R.</given-names>
            <surname>Eslampanah</surname>
          </string-name>
          .
          <article-title>A cloud and Contiki based re detection system using multi-hop wireless sensor networks</article-title>
          .
          <source>In Proceedings of the Fourth Intl. Conf. on Engineering &amp; MIS</source>
          <year>2018</year>
          ,
          <article-title>page 66</article-title>
          . ACM,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>B.</given-names>
            <surname>Karaduman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Challenger</surname>
          </string-name>
          , and
          <string-name>
            <given-names>R.</given-names>
            <surname>Eslampanah</surname>
          </string-name>
          .
          <article-title>ContikiOS based library re detection system</article-title>
          .
          <source>In 2018 5th Intl. Conf. on Electrical and Electronic Engineering (ICEEE)</source>
          , pages
          <fpage>247</fpage>
          {
          <fpage>251</fpage>
          . IEEE,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>B.</given-names>
            <surname>Karaduman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Challenger</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Eslampanah</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Denil</surname>
          </string-name>
          , and
          <string-name>
            <given-names>H.</given-names>
            <surname>Vangheluwe</surname>
          </string-name>
          .
          <article-title>Platform-speci c Modeling for RIOT based IoT Systems</article-title>
          . In 2nd International Workshop on Software Engineering Research &amp;
          <article-title>Practices for the Internet of Things (SERP4IoT</article-title>
          <year>2020</year>
          ), pages
          <fpage>1</fpage>
          <issue>{ 8</issue>
          (
          <issue>Accepted</issue>
          ),
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <given-names>G.</given-names>
            <surname>Kardas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Demirezen</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Challenger</surname>
          </string-name>
          .
          <article-title>Towards a dsml for semantic web enabled multi-agent systems</article-title>
          .
          <source>In Proceedings of the International Workshop on Formalization of Modeling Languages, page 5. ACM</source>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <given-names>N.</given-names>
            <surname>Karimpour</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Karaduman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Ural</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Challengerl</surname>
          </string-name>
          , and
          <string-name>
            <given-names>O.</given-names>
            <surname>Dagdeviren</surname>
          </string-name>
          .
          <article-title>Iot based hand hygiene compliance monitoring</article-title>
          .
          <source>In 2019 International Symposium on Networks, Computers and Communications (ISNCC)</source>
          , pages
          <fpage>1</fpage>
          <article-title>{6</article-title>
          . IEEE,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <given-names>S.</given-names>
            <surname>Kim</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Cho</surname>
          </string-name>
          , and
          <string-name>
            <given-names>D.</given-names>
            <surname>Park</surname>
          </string-name>
          .
          <article-title>Accelerated devs simulation using collaborative computation on multi-cores and gpus for re-spreading iot sensing applications</article-title>
          .
          <source>Applied Sciences</source>
          ,
          <volume>8</volume>
          (
          <issue>9</issue>
          ):
          <fpage>1466</fpage>
          ,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <given-names>A.</given-names>
            <surname>Lekidis</surname>
          </string-name>
          , E. Stachtiari,
          <string-name>
            <given-names>P.</given-names>
            <surname>Katsaros</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Bozga</surname>
          </string-name>
          , and
          <string-name>
            <given-names>C. K.</given-names>
            <surname>Georgiadis</surname>
          </string-name>
          .
          <article-title>Modelbased design of iot systems with the bip component framework</article-title>
          .
          <source>Software: Practice and Experience</source>
          ,
          <volume>48</volume>
          (
          <issue>6</issue>
          ):
          <volume>1167</volume>
          {
          <fpage>1194</fpage>
          ,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>H. M. Marah</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          <string-name>
            <surname>Eslampanah</surname>
            , and
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Challenger</surname>
          </string-name>
          . Dsml4tinyos:
          <article-title>Code generation for wireless devices</article-title>
          . In 2nd International Workshop on Model-
          <article-title>Driven Engineering for the Internet-of-Things (MDE4IoT</article-title>
          ),
          <source>21st International Conference on Model Driven Engineering Languages and Systems (MODELS2018)</source>
          , Copenhagen, Denmark,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <given-names>V.</given-names>
            <surname>Mascardi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Weyns</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Ricci</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C. B.</given-names>
            <surname>Earle</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Casals</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Challenger</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Chopra</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Ciortea</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L. A.</given-names>
            <surname>Dennis</surname>
          </string-name>
          ,
          <string-name>
            <surname>A. F. D az</surname>
          </string-name>
          , et al.
          <article-title>Engineering multi-agent systems: State of a airs and the road ahead</article-title>
          .
          <source>ACM SIGSOFT Software Engineering Notes</source>
          ,
          <volume>44</volume>
          (
          <issue>1</issue>
          ):
          <volume>18</volume>
          {
          <fpage>28</fpage>
          ,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <given-names>K.</given-names>
            <surname>Nakahori</surname>
          </string-name>
          and
          <string-name>
            <given-names>S.</given-names>
            <surname>Yamaguchi</surname>
          </string-name>
          .
          <article-title>A support tool to design iot services with nusmv</article-title>
          .
          <source>In 2017 IEEE International Conference on Consumer Electronics (ICCE)</source>
          , pages
          <fpage>80</fpage>
          {
          <fpage>83</fpage>
          ,
          <string-name>
            <surname>Jan</surname>
          </string-name>
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17. L. Ozgur, V. K. Akram,
          <string-name>
            <given-names>M.</given-names>
            <surname>Challenger</surname>
          </string-name>
          , and
          <string-name>
            <given-names>O.</given-names>
            <surname>Dagdeviren</surname>
          </string-name>
          .
          <article-title>An iot based smart thermostat</article-title>
          .
          <source>In 2018 5th International Conference on Electrical and Electronic Engineering (ICEEE)</source>
          , pages
          <fpage>252</fpage>
          {
          <fpage>256</fpage>
          . IEEE,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18. T. Rodrigues,
          <string-name>
            <given-names>T.</given-names>
            <surname>Batista</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F. C.</given-names>
            <surname>Delicato</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P. F.</given-names>
            <surname>Pires</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A. Y.</given-names>
            <surname>Zomaya</surname>
          </string-name>
          .
          <article-title>Modeldriven approach for building e cient wireless sensor and actuator network applications</article-title>
          .
          <source>In 2013 4th International Workshop on Software Engineering for Sensor Network Applications (SESENA)</source>
          , pages
          <fpage>43</fpage>
          {
          <fpage>48</fpage>
          . IEEE,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <string-name>
            <given-names>B. T.</given-names>
            <surname>Tezel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Challenger</surname>
          </string-name>
          , and
          <string-name>
            <given-names>G.</given-names>
            <surname>Kardas</surname>
          </string-name>
          .
          <article-title>A metamodel for jason bdi agents</article-title>
          .
          <source>In 5th Symposium on Languages, Applications and Technologies (SLATE'16)</source>
          .
          <source>Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik</source>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          20.
          <string-name>
            <surname>H. M. Wanniarachchi</surname>
            ,
            <given-names>K. S.</given-names>
          </string-name>
          <string-name>
            <surname>Perera</surname>
            , and
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Goonatillake</surname>
          </string-name>
          .
          <article-title>Behavioral modeling of wireless sensor nodes using meta-data</article-title>
          .
          <source>In 2015 IEEE Tenth International Conference on Intelligent Sensors, Sensor Networks and Information Processing (ISSNIP)</source>
          , pages
          <fpage>1</fpage>
          <article-title>{5</article-title>
          . IEEE,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          21.
          <string-name>
            <given-names>R.</given-names>
            <surname>Yang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Li</surname>
          </string-name>
          , and C. Cheng.
          <article-title>A petri net-based approach to service composition and monitoring in the iot</article-title>
          .
          <source>In 2014 Asia-Paci c Services Computing Conference</source>
          , pages
          <volume>16</volume>
          {
          <fpage>22</fpage>
          . IEEE,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          22.
          <string-name>
            <given-names>Y.</given-names>
            <surname>Zhang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Wu</surname>
          </string-name>
          , and
          <string-name>
            <given-names>C.</given-names>
            <surname>Qian</surname>
          </string-name>
          .
          <article-title>Iot-enabled real-time production performance analysis and exception diagnosis model</article-title>
          .
          <source>IEEE Transactions on Automation Science and Engineering</source>
          ,
          <volume>13</volume>
          (
          <issue>3</issue>
          ):
          <volume>1318</volume>
          {
          <fpage>1332</fpage>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>