MODELING REAL-TIME APPLICATIONS FOR WIRELESS
SENSOR NETWORKS USING STANDARDIZED TECHNIQUES
Andreas Blunk, Mihal Brumbulli, Ingmar Eveslage and Joachim Fischer
Department of Computer Science, Humboldt-Universit
¨
at zu Berlin, Unter den Linden 6, 10099 Berlin, Germany
Keywords:
Wireless sensor networks, Standardized languages, UML, SDL-RT, Code generation, Simulation, Performance
evaluation.
Abstract:
The development of applications for Wireless Sensor Networks is a challenging task. Any approach for devel-
oping such applications needs to provide means for describing their functionality, obtain an executable, and
be able to evaluate their potential real-time behavior. This paper shows how standardized techniques can be
used to address these challenges by giving a real application example. We evaluate our approach based on
experiment results and provide some considerations on the used standardized languages.
1 INTRODUCTION
Wireless Sensor Networks (WSNs) have become pop-
ular for monitoring physical phenomena. Still, the
development of applications for such complex sys-
tems remains a challenging task. For this the devel-
oper needs to describe the application’s functionality,
obtain an executable from it, and be able to evaluate
its potential real-time behavior. These are general re-
quirements that any approach for developing applica-
tions for WSNs needs to consider.
We focus on using standardized techniques as
a possible solution, because they offer description
means on a much higher level than general purpose
languages and can be understood by large groups of
people from different domains.
In our days the most recent and well-known stan-
dardized language is the Unified Modeling Language
(UML) by the OMG (OMG, 2010). Although UML
has proven successful for some applications, its se-
mantics are sometimes unclear or incomplete (by so-
called semantic variation points). They leave room
for interpretation, making model execution a difficult
task.
But standardization efforts did not start with
UML. The Specification and Description Language
(SDL) (ITU, 2007a) has a long history in model-
ing the functionality of telecommunication protocols.
The strong side of SDL is a combination of the wide-
used concept of communicating state automatons.
These are represented by a graphical notation with a
mathematical foundation of the static and dynamic se-
mantics of the language. Because of these strengths,
the standardized version SDL-2000 had an important
influence on the UML 2.0 standard. Also efforts were
made in defining SDL as a precised subset of UML
(ITU, 2007b). A more pragmatic approach is SDL-
RT (SDLRT, 2011), which is an extension of standard
SDL by UML.
Our goal is to evaluate the standardized techniques
using SDL-RT for developing applications for WSNs.
We focus on (1) modeling their functional aspects, (2)
generating executable code, and (3) evaluating perfor-
mance based on their real-time behavior. For this we
provide a real example of an earthquake early warning
application.
In Section 2 we present some related work. Next,
we start by introducing SDL-RT (Section 3) as stan-
dardized technique for describing communicating
systems. In Section 4 we outline the functional as-
pects of our application example and our approach
for code generation and performance evaluation. In
Section 5 we provide our evaluation based on exper-
iment results and some considerations regarding the
used standardized languages. We present the conclu-
sions of our work in Section 6.
2 RELATED WORK
Network simulators are considered a good tool for
evaluating the potential real-time behavior of applica-
161
Blunk A., Brumbulli M., Eveslage I. and Fischer J..
MODELING REAL-TIME APPLICATIONS FOR WIRELESS SENSOR NETWORKS USING STANDARDIZED TECHNIQUES.
DOI: 10.5220/0003599601610167
In Proceedings of 1st International Conference on Simulation and Modeling Methodologies, Technologies and Applications (SIMULTECH-2011), pages
161-167
ISBN: 978-989-8425-78-2
Copyright
c
2011 SCITEPRESS (Science and Technology Publications, Lda.)
tions running on a distributed and networked environ-
ment. Simulators like ns-2 (NS2, 2011), ns-3 (NS3,
2011), OMNET++ (OMNET, 2011), and JistSwans
(JIST, 2011) provide such an environment for both
wired and wireless networks. Nevertheless, the de-
scription of the functional behavior of the applica-
tion remains a challenging and tedious task. In many
cases this is done by using a general purpose language
(e.g. C++ in ns-3 or Java in JistSwans). It is quite
difficult to use these non-standardized techniques for
performance evaluation because of their framework-
dependency, which produces different models for the
same application. Also, there is no way of using these
models for generating code for a target platform (e.g.
the operating system of a WSN-node).
In this context, some integrated tool environments,
that combine standardized techniques with different
kinds of simulators and code generators for different
platforms, have been proposed.
The SPACE (Kraemer et al., 2009) method can
be used for the rapid engineering of reactive systems.
The method is based on reusable building blocks that
express their behavior in terms of UML activities and
collaborations.
The WISENES (Kuorilehto et al., 2008) frame-
work can be used for the design, simulation, and eval-
uation of WSNs. The WSN protocols and applica-
tions are modeled in SDL. These models are compiled
to executables used for both simulation and final im-
plementation.
ns+SDL (Kuhn et al., 2005) enables developers to
use SDL specifications as a common base for the gen-
eration of simulation and target code. The approach
uses the ns-2 simulation framework for performance
evaluation of SDL models.
We use the GAF4WSN framework (Ahrens et al.,
2009) for the design, simulation, evaluation, and de-
ployment of applications for WSNs. The same SDL-
RT model is used for generating code for several sim-
ulators and the target platform.
3 MODELING WITH SDL-RT
SDL-RT is a pragmatic combination of the standard-
ized languages SDL, UML, and C++ for modeling
different aspects of real-time systems. These aspects
include the modeling of a system’s structure, its be-
havior, its initial configuration, an object-oriented de-
scription of data structures, and a description of ac-
tions in C++. The notation of SDL-RT is graphical on
the SDL/UML-part and textual on the C++-part.
The following paragraphs provide a short descrip-
tion of the languages involved in SDL-RT with re-
spect to the supported subsets of concepts.
3.1 SDL Subset
SDL-RT includes a subset of SDL-2000 with some
additions and modifications, but these do not fun-
damentally change SDLs semantics. It adds a
semaphore concept that can be used to protect access
to global variables and changes the names of certain
SDL constructs (e.g. a signal in SDL is renamed to a
message in SDL-RT).
3.1.1 Basic Constructs
In SDL a system is modeled by a composition of
agents and communication constructs. While agents
model the structure and the behavior of the system,
the communication constructs are used for modeling
possible information exchange between them. The
agents come in two flavors: block agents and process
agents. A special block agent is the system agent,
which is the outermost agent of the model. A brief
overview of these concepts is depicted in Figure 1.
Figure 1: Excerpt of a sample system model using basic
SDL concepts.
Block agents are composed of other agents and
communication constructs. They are solely used for
structuring the model in a hierarchical way and do not
specify a behavior on their own.
Process agents model active elements of a system
and are executed concurrently. Their behavior is spec-
ified by a communicating state machine, which may
also include local variables and procedures. Process
agents can react to a message reception or to an ex-
piration of a timer. They act by invoking procedures,
sending messages, starting timers, dynamically cre-
ating process agents or directly executing C++ code
SIMULTECH 2011 - 1st International Conference on Simulation and Modeling Methodologies, Technologies and
Applications
162
(e.g. changing variable values). The messages are
consumed according to their priority first and then in
FIFO order.
Communication constructs specify how informa-
tion can be exchanged between agents. These con-
structs specify that communication takes place either
by (1) exchanging messages through communication
channels or (2) accessing global variables. If channel-
based communication is used, channels have to be
specified between agents including the types of mes-
sages to be exchanged in them. If on the other hand
variable-based communication is used, agents have
to protect concurrent access to global variables by
semaphores.
3.1.2 Instance-oriented and Type-oriented
Modeling
At the language level presented so far, each agent
models a set of agent instances (1 instance by default).
This style of modeling could be named instance-
oriented modeling because agent definitions may only
be used in the context where they are defined.
Reusing agent definitions is only possible by us-
ing type-oriented modeling. Here the modeler spec-
ifies agents as agent types and places them in pack-
ages from where they may be used in different agent
contexts. The usage of an agent type represents an
instantiation of the type in the context. Communica-
tion can be described in a context-independent way
by using gates. They serve as communication end
points where channels can be connected to at instan-
tiation time. Agent instances may be given a name
and an initial number of instances to be created. Ad-
ditional instances may be created dynamically by pro-
cess agents.
3.1.3 Object-oriented Modeling
Object-oriented modeling is only supported for pro-
cess agents with single inheritance relations between
them. Variables, procedures, and state machines can
be inherited from a base process agent through spe-
cialization. In specialized agents, transitions may be
added or they may overload existing ones. Also base
agents may specify abstract transitions that have to be
made concrete in specializations.
3.2 UML and C++
SDL-RT contains a subset of UML that is used for
object-oriented modeling of data structures and sys-
tem deployment. A subset of UML class diagrams
can be used for modeling data structures. The subset
includes classes (with attributes and operations), asso-
ciations (as aggregation or composition and with uni
or bidirectional relation), and class generalizations.
C++ is used for declaring data types and for spec-
ifying transition actions in state machines. Data types
have to be declared for variables, procedure param-
eters, and message parameters. Here any valid C++
type declaration may be used. Actions are also speci-
fied with C++. This allows an efficient execution and
opens the possibility to easily interface with existing
C or C++ libraries.
4 APPLICATION EXAMPLE
Earthquakes produce different types of seismic
waves: (1) P-waves and S-waves (called body waves);
(2) Rayleigh waves and Love waves (called surface
waves). P-waves (primary waves) travel faster than S-
waves (secondary waves)
1
. They are less destructive
than the S-waves and surface waves that follow them.
Earthquake early warning is based on the detection
of the harmless P-waves that precede the slower and
destructive S-waves and surface waves.
Our application example consists in the devel-
opment of an earthquake early warning application
(Alarming Protocol) (Fischer et al., 2009). The
Alarming Protocol (AP) runs on top of SOSEWIN
2
(Fleming et al., 2009), which is a decentralized WSN-
based earthquake early warning system. The AP is
a hierarchical alarming system, where the network is
composed of node clusters. The organization of the
network into clusters and the designation of corre-
sponding cluster heads is done at installation time, but
can change dynamically following the changes in the
topology.
The functional aspects of the Alarming Protocol
are described in SDL-RT (Figure 2).
4.1 The Alarming Protocol
As Figure 2 shows, the Alarming Protocol (AP) is
modeled as a set of asynchronous communicating
protocol entities:
Signal Analyzing Entity (SAE).
The SAE analyzes the incoming streams of data
and informs the SE in case of a detected event.
Sensing Entity (SE).
The SE reacts on the results received from the
SAE by informing its associated Leading Entity
1
P-waves travel at 5-8 km/s, and S-waves at 3-7 km/s.
2
Self-Organizing Seismic Early Warning Information
Network.
MODELING REAL-TIME APPLICATIONS FOR WIRELESS SENSOR NETWORKS USING STANDARDIZED
TECHNIQUES
163
Figure 2: SDL-RT description of the Alarming Protocol.
(LE). The LE is either located on the same node
as the SE if the node is a cluster head or on another
node if it is not.
Leading Entity (LE).
The LE monitors all associated SEs. It is able to
issue group alerts and system alerts. This entity is
active when the node is a cluster head.
Gateway Entity (GE).
The GE is responsible for forwarding system
alerts to end-users outside the network.
Transport Entity (TE).
The TE provides a bridge between AP entities and
the underlying communication layer. In Figure 2
this is represented by a SDL-RT block, which is
composed of two processes (not shown in the fig-
ure) for sending and receiving messages over the
network.
Managing Entity (ME).
The ME is responsible for interpreting and pro-
cessing network management messages (i.e. es-
tablishment of cluster structures).
The AP’s functionality is defined in two layers, an
intra and a inter-cluster protocol. The former handles
(1) the communication between the SAE and SE and
(2) the communication between LEs and their asso-
ciated SEs. The inter-cluster protocol handles com-
munication between all LEs. When a critical number
of P-wave triggers have reached the LE, it informs its
neighboring LEs. In the case that a LE has received
enough cluster alarms, a system alarm will be sent
as fast as possible to the GEs and other LEs, which
will distributed it to all their cluster members (SEs).
According to this hierarchical principle, three alarm
levels are recognized by the nodes:
Pre-alarm recognized by the LE, when a P-wave
is detected by at least one SE in its cluster;
Group Alarm recognized by the LE, when a cer-
tain number of SEs in its cluster have detected a
P-wave;
System Alarm recognized by the LE, when a cer-
tain number of LEs have triggered a group alarm.
4.2 Target Platforms
The SDL-RT model of the AP is used for generat-
ing code for different target platforms. These include
several simulator frameworks, which are used for per-
formance evaluation of the application, and also the
operating system installed on the WSN-nodes.
The code generation is based on an extension of
PragmaDev’s RTDS
3
(PRAGMADEV, 2006) with a
new transcompiler (Ahrens et al., 2009; Brumbulli
and Fischer, 2010), which is able to generate C++
code artifacts from SDL-RT models. After compila-
tion the artifacts are linked to different libraries (Fig-
ure 3), producing the corresponding binaries: RTDS
built-in simulator, ODEMx (ODEMX, 2011), ns-3,
and OpenWrt (OPENWRT, 2011).
The RTDS built-in simulator can just be used for
evaluating the functional behavior of SDL-RT specifi-
3
A SDL-RT tool including an editor, code generator, and
debugger.
SIMULTECH 2011 - 1st International Conference on Simulation and Modeling Methodologies, Technologies and
Applications
164
Compiler/
Linker
Transcompiler
SDL-RT
SDL
UML
C++
C code
RTDS Transcompiler
RTDS
Simulator
Compiler/
Linker
Boost
C++ code
ODEMx
C++ code
ns-3
C++ code
Boost
Library
Binary
OpenWrt
Compiler/
Linker
ODEMx
Library
Simulation
Script
Binary
ODEMx
Compiler/
Linker
Binary
ns-3
ns-3 Library
Simulation
Script
RTDS
Patterns
Boost
Patterns
ODEMx
Patterns
ns-3
Patterns
Figure 3: The transcompiler’s architecture.
cations. It cannot be used for performance evaluation.
For performance evaluation of large network topolo-
gies we use two simulation frameworks: ODEMx and
ns-3.
We use ODEMx for simulations without a pre-
cise model of the underlying communication layers.
ODEMx is a general purpose simulation library writ-
ten in C++. It supports process- and event-oriented
modeling of discrete and continuous event systems
and also a combination of both.
We use ns-3 for simulations with a detailed model
of the underlying communication layers. It is a
discrete-event network simulator for internet systems
written entirely written in C++; simulations are also
C++ executables.
Our target platform for the nodes is OpenWrt.
It is a Linux distribution for embedded devices that
provides a fully writable file system with package
management. This allows us to customize the device
through the use of packages to suit any application.
5 EVALUATION
We evaluate the standardized techniques using UML
and SDL-RT for developing applications for WSNs
based on three criteria:
1. modeling of their functional aspects,
2. generating executable code, and
3. evaluating performance based on their real-time
behavior.
First we present some experiment results for the
Alarming Protocol to show that our pragmatic ap-
proach of using SDL-RT in combination with code
generation and performance evaluation provides a so-
lution for the defined criteria.
Another approach could be to include some new
concepts in the modeling language itself. We think
that this could also provide a solution for the defined
criteria. These proposed concepts are listed in the sec-
ond part of this evaluation.
5.1 Experiment Results
We define two types of experiments: real-world and
simulation based.
Real-world experiments consist in running the
Alarming Protocol with synthesized earthquake data
on the Humboldt Wireless Lab (HWL, 2011) testbed.
As a result of these experiments, we provide the times
available for early warning in Figure 4. These times
are given as difference between S-wave detection and
System Alarm for different earthquake distances. The
figure shows that it is possible to use our AP for early
warning.
0
5000
10000
15000
20000
25000
30000
20 40 60 80 100 120 140 160 180 200
Time for early warning (ms)
Distance of the network from earthquake’s epicentre (km)
Figure 4: Time available for early warning in real-world
experiments.
Simulation based experiments use the ns-3 li-
brary for evaluating potential real-time behavior of
the Alarming Protocol. For a comparison to be possi-
ble, we use the same configuration (network model +
earthquake data) as in our real-world experiments. A
comparison between real-world and simulation based
experiments is shown in Figure 5. Because of the
small differences (less than 150 ms), we can assume
that simulation experiments with larger topologies
can be used to predict the behavior of the AP.
5.2 Modeling Methodology
SDL-RT was created for developing real-time and
embedded systems. We showed in our example that
its pragmatic nature (the combination of UML, SDL,
and C++) can be used successfully for the develop-
ment of applications for WSNs. Nevertheless, we
MODELING REAL-TIME APPLICATIONS FOR WIRELESS SENSOR NETWORKS USING STANDARDIZED
TECHNIQUES
165
0
50
100
150
200
20 40 60 80 100 120 140 160 180 200
Time difference (ms)
Distance of the network from earthquake’s epicentre (km)
group alarm
system alarm
Figure 5: Difference in alarm times between real-world and
ns-3 simulation.
identified a number of concepts that we believe can
provide better means for describing functional aspects
and evaluating potential real-time behavior of these
applications.
5.2.1 Time Consumption
Modeling the time consumption of actions is an im-
portant aspect when a system’s timed behavior needs
to be evaluated. In SDL-RT, timers can be used for
modeling time-dependent action execution. But when
using SDL-RT timers, functional and timing aspects
are not separated in the model. From such a speci-
fication, code for either target platform execution or
simulation cannot be generated automatically.
5.2.2 Inter-node Communication
SDL-RT supports communication between agents in
a local one-to-one fashion: one sender to one receiver
in a local context (i.e. sender and receiver are running
on the same node). Although this type of commu-
nication is suitable for embedded systems, the same
cannot be stated for distributed ones (e.g. WSNs).
In these systems inter-communication between nodes
plays an important role, but there are no language con-
structs in SDL-RT that allow an agent to address or
send a message to a remote one (agent running on an-
other node).
5.2.3 Broadcast Communication
When modeling protocols for wireless networks, it is
a common case that information should be send re-
motely to multiple identifiable receivers or even be
broad-casted to every receiver in range. But SDL-RT
only supports the sending of information to exactly
one identifiable receiver, that must also be reachable
by a complete communication path. We believe that
modeling wireless network protocols could be done
in a more concise way if multi-send or broadcast-send
would be supported by the description language.
5.2.4 Addressing Gates in Message Receives
When entities are able to receive the same type of
message via multiple gates, then it may be necessary
to identify the gate if different gate-dependent actions
are to be taken. This can be done by addressing the
gate where a message is received. Such a feature is
currently not available in SDL-RT.
5.2.5 Dynamic Block Instantiation
Evaluating timed behavior of an application in a dis-
tributed environment may require the creation of sev-
eral application instances depending on the size of the
network. Although this can be achieved in SDL-RT
by static block instantiation, it becomes almost im-
possible for large networks. In this context, we be-
lieve that creating block instances and channels dy-
namically can be helpful.
In SDL-2000 we already have the concept of dy-
namic block instantiation. Nevertheless, this can only
be done in an existing agent context and there are no
means of dynamically creating channels.
6 CONCLUSIONS
The development of applications for WSNs is a chal-
lenging task. This task is handled in different ways,
varying from general purpose languages to domain
specific ones. Although these techniques do provide
a solution, they can only be used within their specific
frameworks. This makes it almost impossible to eval-
uate the potential behavior of applications because
different framework-dependent models are used.
In this paper we showed that standardized tech-
niques can be used to describe the functional aspects
of applications for WSNs. Also it was possible to de-
rive from the same model executables for different
platforms so that potential real-time behavior could
be evaluated.
Based on a real application example and our ex-
perience, we identified a number of concepts that can
provide better means for describing such applications.
We propose to extend the existing modeling language
in order to include these concepts. If such a solution
is really feasible, has to be checked in future work.
SIMULTECH 2011 - 1st International Conference on Simulation and Modeling Methodologies, Technologies and
Applications
166
REFERENCES
Ahrens, K., Eveslage, I., Fischer, J., K
¨
uhnlenz, F., and We-
ber, D. (2009). The Challenges of Using SDL for
the Development of Wireless Sensor Networks. In
Reed, R., Bilgic, A., and Gotzhein, R., editors, SDL
2009: Design for Motes and Mobiles, volume 5719 of
Lecture Notes in Computer Science, pages 200–221.
Springer Berlin / Heidelberg.
Brumbulli, M. and Fischer, J. (2010). SDL Code Genera-
tion for Network Simulators. In System Analysis and
Modeling - SAM 2010.
Fischer, J., K
¨
uhnlenz, F., Ahrens, K., and Eveslage, I.
(2009). Model-based Development of Self-organizing
Earthquake Early Warning Systems. In Proceedings
MATHMOD 09 Vienna.
Fleming, K., Picozzi, M., Milkereit, C., Kuhnlenz, F., Licht-
blau, B., Fischer, J., Zulfikar, C., Ozel, O., et al.
(2009). The Self-organizing Seismic Early Warning
Information Network (SOSEWIN). Seismological Re-
search Letters, 80(5):755.
HWL (2011). http://hwl.hu-berlin.de/.
ITU (2007a). ITU-T Recommendation Z.100: Specification
and Description Language (SDL).
ITU (2007b). ITU-T Recommendation Z.109: SDL-2000
combined with UML.
JIST (2011). http://jist.ece.cornell.edu/.
Kraemer, F., Sl
˚
atten, V., and Herrmann, P. (2009).
Model-Driven Construction of Embedded Applica-
tions Based on Reusable Building Blocks - An Exam-
ple. In Reed, R., Bilgic, A., and Gotzhein, R., editors,
SDL 2009: Design for Motes and Mobiles, volume
5719 of Lecture Notes in Computer Science, pages 1–
18. Springer Berlin / Heidelberg.
Kuhn, T., Geraldy, A., Gotzhein, R., and Rothl
¨
ander, F.
(2005). ns+SDL - The Network Simulator for SDL
Systems. In Prinz, A., Reed, R., and Reed, J., editors,
SDL 2005: Model Driven Systems Design, volume
3530 of Lecture Notes in Computer Science, pages
103–116. Springer Berlin / Heidelberg.
Kuorilehto, M., H
¨
annik
¨
ainen, M., and H
¨
am
¨
al
¨
ainen, T. D.
(2008). Rapid Design and Evaluation Framework for
Wireless Sensor Networks. Ad Hoc Netw., 6:909–935.
NS2 (2011). http://www.isi.edu/nsnam/ns/.
NS3 (2011). http://www.nsnam.org/.
ODEMX (2011). http://odemx.sourceforge.net/.
OMG (2010). OMG Unified Modeling Language, Infras-
tructure.
OMNET (2011). http://www.omnetpp.org/.
OPENWRT (2011). http://www.openwrt.org/.
PRAGMADEV (2006). http://www.pragmadev.com.
SDLRT (2011). http://www.sdl-rt.org/.
MODELING REAL-TIME APPLICATIONS FOR WIRELESS SENSOR NETWORKS USING STANDARDIZED
TECHNIQUES
167