Componennt and Service For IoT Platform
Componennt and Service For IoT Platform
Keramidas · Nikolaos Voros
Michael Hübner Editors
Components
and Services for
IoT Platforms
Paving the Way for IoT Standards
Components and Services for IoT Platforms
Georgios Keramidas • Nikolaos Voros
Michael Hübner
Editors
123
Editors
Georgios Keramidas Nikolaos Voros
Technological Educational Institute Technological Educational Institute
of Western Greece of Western Greece
Embedded System Design and Application Embedded System Design and Application
Laboratory (ESDA) Laboratory (ESDA)
Antirio, Greece Antirio, Greece
Michael Hübner
Chair for Embedded Systems
for Information Technology (ESIT)
Ruhr Universität Bochum
Bochum, Germany
The Internet of Things (IoT) is upon us and touches almost every industry! Current
forecasts predict that there will be more than 50 billion devices connected to
the Internet by 2020 and it looks like this is just the beginning. What is highly
interesting with this technology trend is that it is more defined by what it enables
rather than the technology itself. This is because IoT enables all kinds of smart
objects (e.g., smart sensors and actuators) to communicate and interact with each
other across different networks and domains. As such, a plethora of new services
and applications are possible and must be created revealing the potential to create
substantial new markets and to stimulate existing ones.
However, it is also clear that on the way to a fully connected cyber-physical
world, numerous challenges have to be addressed. Do we have the technology
and experience to make IoT reality? What kind of technology is actually missing?
Do we need new hardware technology, new tools and programming languages,
new network protocols, new services, and new data management techniques? To
sum up, do we really need new technology or is IoT just a matter of ensuring
interoperability among existing technologies or do we maybe need a paradigm
change in technology and design methods? As with every new technology wave,
we are witnessing a debate regarding industry standards striving to find a position
in the IoT marketplace.
The intention of this book is to shed some light on all those questions. Certainly,
one book cannot cover all topics related to the trends in IoT. Since IoT is in fact in its
infancy, we see this book as an ongoing effort to offer the current trends and open
issues in the area and also to sketch the future of IoT; we are strongly convinced
that the IoT industry will not stop until your tablet, smartphone, or smartwatch is
downscaled enough so they fit on your eyes or your wrist.
The book is organized in five main sessions covering the whole spectrum of the
IoT technologies. The first four parts of the book are:
• Platforms and Design Methodologies for IoT Hardware
• Simulation, Modeling, and Programming Frameworks for IoT
• Opportunities, Challenges, and Limits in WSN Deployment for IoT
• Efficient Data Management and Decision Making for IoT
v
vi Preface
The last part of the book is devoted to the description of four IoT use cases and
includes also an additional chapter offering our view on various IoT projects funded
by the European Commission under the Horizon 2020 work program.
The editors would like to thank all the authors of the individual chapters of the
book and also the program committee of the International Conference on Field-
Programmable Logic and Applications (FPL), 2015. The conception of writing this
book was born in the course of the First International Workshop on Components
and Services for IoT Platforms (WCS-IoT 2015), held in conjunction with FPL
2015 (http://esda-lab.cied.teiwest.gr/wcs-iot/).
We would especially like to thank the members of the organizing committee of
the WCS-IoT workshop: their contribution and participation in this effort as well
as their experience have led to a very successful program for the workshop. In this
book, we included all papers presented in the workshop.
Finally, we would like to state that we strongly believe that this effort should
be followed up by additional workshops and conferences in the future focusing
on the existing and evolving IoT standards: every industry can benefit from IoT
deployments but must adhere to a myriad of existing technology and regulatory
constraints plus a new set of policy considerations. The latter will be especially true
in the new IoT vertical markets.
vii
viii Contents
Index . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 377
Part I
Platforms and Design Methodologies
for IoT Hardware
Chapter 1
Power-Shaping Configurable Microprocessors
for IoT Devices
Fabio Campi
1.1 Introduction
Despite being a technology little less than 50 years old, our capability to design
and manufacture integrated circuits (ICs) has deeply affected our society and the
way we live. The concept of computer has somehow pre-dated the advent of IC
manufacturing technology, but as a consumer product the “computer” only makes
sense as a product of the CMOS industry. If we define a “microprocessor” as a
computer device that is miniaturized to be part of an integrated circuit, we can
safely claim that the concept of integrated circuit and that of microprocessor have
advanced hand in hand in the last 50 years, influencing each other’s development,
as they both constantly expanded to new markets and applications. In the last 50
years, integrated circuits have entered our houses first as desktop computers, then as
mobile phones, and then again as portable WWW, communication, and infotainment
terminals: we can consider the advent and diffusion of the “Internet-of-Things”
as the latest pivotal change enabled on our society by the interaction between IC
technology and computer design.
It may be interesting to evaluate in this book, on top of all the aspects already
introduced in previous chapters, what is the innovation that the “Internet of Things”
may trigger on microprocessors. And, to evaluate what impact the advent of the
“Internet of things” may have on the way we design microprocessors (plural)
today on CMOS IC technology. We can identify three phases in the history of
commercial ICs: the first phase took place in the 1970 with the advent of very
large scale integration (VLSI), when a mass market for ICs started to appear.
The second phase lasted through the 1980s and the 1990s: the diffusion of the
personal computer, symbolized by the iconic role of companies such as Apple, Intel,
F. Campi ()
Simon Fraser University, Metro Vancouver, Burnaby, BC, Canada
e-mail: [email protected]
IBM, and Microsoft. This was the time when microprocessors entered households,
and became a commodity we started to take for granted. The third phase of the
evolution of digital technologies is the system-on-chip (SoC) era, triggered in the
early 1990s by the diffusion of cellular phones and the advent of the World Wide
Web. From the circuit design perspective, low power design, that was before a
specialized niche of research emerged in this period as a mainstream requirement.
Also, severe real time requirements in digital communications, embedded system
control, multimedia processing, triggered a wave of innovation in digital design:
traditional microprocessor architectures were not able to sustain computational
demands and power constraints introduced by emerging application fields. The
new market dictated new attention to alternative computer architectures, and more
effective solutions for high-performance, low power computing. This led to the
advent of Systems-on-Chip (SoC), defined as ICs embedding in a single silicon
die all functionalities required by a given application environment: a processor is
not considered an electronic “product” in its own terms any more, but a building
block (although a very crucial one) in the design of a larger system. Microprocessors
have found their way out of the desktop, and creeped into our cars, our phones, our
communication infrastructures, and our industrial machinery.
Today, we stand at the dawn of a fourth era of IC design, that of pervasive
computing and the Internet of Things (IoT) [1]. Observers agree that the largest
market for integrated circuits will be in the near future the production of IoT
devices: small, massively distributed ICs including sensor circuitry and related
signal processing logic embedded in the physical space surrounding us. As they
occupy the lowest hierarchical level in the “connected” communication chain,
we will define such nodes as IoT “LEAVES.” Of course, the IoT connectivity
chain also requires advanced and performant synchronization and processing nodes
(“HUBS”) that will collect, synchronize, and combine information collected by the
ubiquitous sensing leaves (Fig. 1.1). From an economic perspective, it is evident
how the ratio between ubiquitous small processors/sensors (leaves) and centralized
communication/synchronization nodes (hubs) is extremely low. In fact, the de-
centralization of information processing is one of the most significant aspects of
the IoT itself.
Pervasive computing will change our design style and constraints: we will need
tiny, flexible devices where electrical and micro-mechanical sensors/actuators and
digital signal processing share small silicon areas and limited power resources. Key
to the design success will be the synergy between analog sensing circuitry and
digital logic. And since such pervasive, embedded devices tend to be both prone to
malfunctioning AND difficult to substitute in their embedded locations, reliability
of circuits in an increasingly mixed signal context will become of paramount
importance.
microprocessor cores will play a significant role. This chapter will focus on the
devices introduced in (2), describing the “leaves” of the hardware infrastructure:
what is the hardware that will be needed by the distributed, ubiquitous devices that
represent the “IoT leaves,” and what features and potentialities would be desirable
in such hardware?
While the spectrum of functionalities that can compose the last level of the IoT
is by definition very wide, we can determine few guidelines that can be applicable
to all:
1. IoT leaves need to be small devices that can be embedded in physical systems
without affecting the system features, design, and functionality.
2. IoT leaves need to support connectivity to other leaves and the hub nodes in
the network. Depending on the host system features, this connectivity could be
wired (e.g., in the case of a car or household appliances) such as I2C, CAN,
USB, or wireless (e.g., in the case of temperature or pressure sensors distributed
in a room) such as Zigbee, Bluetooth, radio frequency identification, and wireless
sensor network.
3. IoT leaves are first of all a vehicle for collecting/transferring information from/to
the “cloud” to/from a physical system. As a consequence, they are likely to share
the same IC, or be in very close proximity with an analog sensing system (or an
actuating system if the flow of information is from the cloud to the device).
4. IoT leaves may be embedded in conditions where it is not possible to provide
reliable power supply connection. This is not the case for home appliances or
automotive devices, but may be the case for sensors implanted in a person’s body
or massively distributed in a room or in a public space. In such cases, IC must
consume as little energy as possible, being connected either to a small battery or
to an energy harvesting system.
5. In all cases, the number of distributed leaves and their pervasiveness will grow
exponentially with the diffusion of the IoT. Given their large number and
sometimes difficult location, it would be unpractical and costly to reach the
leaf IC to fix it or repair it in case of malfunctioning or upgrades. For this
reason, possibly the most desirable feature of a leaf IC for the IoT would be
programmability coupled with long term reliability.
Another feature that is recurrent in IoT leaves is that of carrying one or more
embedded microprocessor core(s). This is not a requirement per-se, but an indirect
effect of the guidelines outlined above: the primary scope of an IoT leaf is that
of sensing, gathering, storing, processing, and transmitting information to/from
a physical system. This action must be enabled in a small chip, with limited
IO connection, possibly limited bandwidth and utilizing a very limited power
budget. As a consequence, IoT LEAVES MUST PERFORM A FIRST STAGE OF
1 Power-Shaping Configurable Microprocessors for IoT Devices 7
with small energy requirements. As summarized in Fig. 1.2, they will be composed
by analog sensing/actuating logic (or a direct interface to the same), a digital
signal processing unit centered around one or more microprocessors and the related
bus/memory architecture, one or more connectivity protocols (wired or wireless).
Some of such devices may be coupled to a small battery, possibly supported by an
energy harvesting system. We summarize in the following the constraints to be met
in their hardware design in a strictly hierarchical order of priority:
1. Real time processing capabilities, in order to accurately monitor and report the
status of the physical system
2. High Reliability, in order to avoid costly and unpractical on-the-field intervention
and substitutions
3. High Programmability, at two levels:
a. In terms of run-time reconfiguration: it must be possible to perform different
data processing task of different computational cost in different moments in
time.
b. In terms of friendliness to upgrade: it must be possible to refine/upgrade the
service provided by the leaf by means of remote software upgrades
4. Low cost, as leaf IC may be produced and pervasively distributed in massive
numbers
5. In some cases, Limited Energy consumption related to the lack of a reliable power
supply connection due to the nature of the physical system where the leaf is
embedded
6. In some cases, low area and low Pad count due to the nature of the physical
system where the leaf is embedded.
The constraints outlined above represent an interesting shift with respect to the con-
straints that have been driving the processor market. Traditionally, microprocessor
used to be highly performant, general purpose machines. They were plugged to
power supply, and needed to perform at the highest possible speed very generic
application benchmarks. With the diffusion of embedded systems, new computation
paradigms have been proposed to mitigate the cost of microprocessor computation:
the emergence of the ARM processor architecture targeted at low power computa-
tion, the introduction of hardware acceleration and HW/SW co-design in SoC, and
the diffusion of multicore systems are examples of such trends. Processor-based
systems have evolved, in order to negotiate the constraints of application-specific,
real time embedded systems. But in itself, a microprocessor still is an intrinsically
power inefficient, highly redundant general purpose computation machine.
Given the set of constraints outlined at the end of Sect. 1.2, hardware designers
targeting leaf devices for the IoT find themselves balancing a difficult trade-off:
1 Power-Shaping Configurable Microprocessors for IoT Devices 9
minimize greenhouse gas emissions [1, 4], but in turn will be in itself cause for
severe increase in energy consumption and consequent GHS emissions. IoT leaves
are numerically largely dominant with respect to other ICs that contribute to the IoT
infrastructure. Hence, a careful attention to low power design is essential. On the
other hand, this cannot be obtained compromising performance, due to real time
constraints.
The large majority of the temporal unreliability effects outlined above are strictly
related to the power consumption in the IC (NBTI, TR, EM, and IRD), and more in
particular to the time-varying peaks in the current distribution across the IC power
grid (SSN, DVD, and EMI). As a consequence, especially for low cost, embedded
devices that need to deliver significant computational power, energy consumption
is not only a constraint in itself: with the latest nodes in technology scaling,
energy consumption has become a severe reliability issue: high power dissipation,
and worse still high supply current gradients may create malfunctioning and even
permanent ruptures. Designers challenging the next generation of IoT devices
simply cannot confront architecture design without carefully considering supply
currents, and their impact on reliability [7]. Moreover, IoT processors are almost
invariably coupled to critical analog sensing circuitry: strong current gradients
on the digital supply lines may create different kind of disturbances (coupling,
substrate currents, and radiated and conducted electro-magnetic interferences) that
can jeopardize the correct functioning of the analog and A2D circuitry, leading to
further unreliability.
For the reasons mentioned above power consumption, and in particular the shape
of the supply currents over time need to become a fundamental design parameter,
negotiated at every level of the design: at circuit level, at architectural level, but
even, as it will become apparent in the next sections, at the level of the operating
system and the application software.
In VLSI literature, many approaches to low power have been proposed. The most
dramatic reductions can be obtained by means of specific low power circuits
(e.g., high-Vt transistors, near-threshold computation) and/or micro-architecture
design (e.g., synthesis strategies for low speed). Most of such approaches are
not applicable to IoT leaves, because they require modification of libraries and
design flows, and/or affect peak performance. As described at length in Sect. 1.2,
for IoT leaf ICs described in this chapter, low power is a constraint that is very
stringent, but cannot jeopardize real time performance or design cost. IoT processors
typically cannot sustain the costs dictated by the application of specific low power
circuits: in order for the IoT paradigm to be economically sustainable, small cost is
indispensable. Standard VLSI design flows must be applicable, and it is unlikely that
project budgets could afford design of customized cell libraries enabling aggressive
power optimizations. Moreover, most strategies for low power design trade peak
performance to decrease consumption: again, this is not acceptable for IoT devices.
Other well-known strategies for low power design are power gating and clock
gating. Power gating is the practice of shutting off the supply network of a digital
block when unused for a relatively long time. Turning off and on the supply
voltage of a digital block implies very strong current transitories to “charge-up”
the significant parasitic capacitance of the Vdd supply network. As described in
12 F. Campi
Sect. 1.3.3, on-chip current gradients are dangerous, especially for mixed signal
devices such as IoT processors. In high-end SoC design, specific current limiting
regulators are embedded in the power supply to avoid current peaks, but this
increases design costs, and implies very long “charge-up” times that may be
unacceptable for IoT processors. On the contrary, clock gating can be applied
with good results for IoT processors, although for most applications, power saving
enabled by clock gating is useful but not sufficient. Clock gating is fully embedded
in modern HDL-based design flows and as such can be added on top of other
strategies discussed in the following. Clock gating will applied in the test cases
that will be introduced, and every gain that will be discussed should be considered
on top of the clock gating effect.
Among existing approaches to low power design, supply voltage scaling is the most
effective technique to reduce energy consumption with a limited impact on the
design flow. In particular, dynamic voltage and frequency scaling (DVFS) is based
on the principle of adapting dynamically clock and voltage supply of a system to
the chosen computation workload, so that at every moment in time a given part
of the circuit will be delivered only the exact amount of power necessary to meet
its timing constraints. The same processing core may be run at high voltage (e.g.,
1.2 V) when it needs to perform at a high clock speed to handle severe computational
requirements, and then be switched to a significantly lower voltage (e.g., 600 mV)
when lower performance is acceptable, leading to energy consumption that can be
up to 20 %/30 % of the consumption for the same computation at higher speeds.
From the VLSI design flow perspective, the overheads related to an extensive
application of DVFS are
1. Architecture Design: The definition of independent clock/voltage entities
requires explicit synchronization in order to support the crossing of clock
domain boundaries. Strategies for fully asynchronous communication are
well established in VLSI and FPGA design communities, and commonly
implemented in most communication IPs available for reuse [8, 9, 28]. A
widely utilized example of architecture strategy for asynchronous domain
synchronization is described in [9].
2. Physical Design: defining separate power supply grids induce small overheads
on the IC design. After synthesis, during the floorplan phase, different supply
regions (a.k.a. “Voltage Islands”) need to be defined. Also, Level Shifter cells
must be inserted in between domains to ensure a smooth electrical transition
between different voltage levels. It should be underlined that such methodology
is usual in any industrial design flow, its only drawback being a slight area
overhead.
1 Power-Shaping Configurable Microprocessors for IoT Devices 13
PAD Voltages
1.22
Voltage (V)
1.18
1.14
1.10
1.06
1.02
PAD Currents
70.0M
Current (A)
67.0M
65.0M
63.0M
61.0M
59.0M
4.5
3.5
2.5
1.5
0.5
-0.5
0.0N 2.0N 4.0N 6.0N 8.0N 10.0N 12.0N 14.0N 16.0N 18.0N 20.0N
Time (s)
Fig. 1.3 Power supply current waveforms in a 45 nm GALS design divided in 14 independent
DFVS islands. Red waveforms are currents due to a synchronous clock; Blue waveforms are
currents due to fully asynchronous clocks
ideal opportunity for utilizing this design concept in an innovative context. In fact,
IoT processors are an appealing test case to apply DVFS at a finer granularity than
what normally applied in large state-of-the-art SoCs. Moreover, recent evolutions in
the CMOS technology manufacturing process offer new and exciting opportunities
for applying DFVS to small and low cost products, offering further substantial
performance peaks AND low power potential at a relatively small design cost. The
following sections will focus on these innovations, and the opportunity they offer
for IoT processor design.
sub-portion of the chip architecture depending on the local workload. The triple-
well option is a very straightforward modification of the standard CMOS, and does
not imply significant additional design or manufacturing costs.
Biasing the substrate regions (i.e., wells) requires an additional power grid
network. But such network is only used for biasing, and not for power supply,
and carries negligible currents. As such, it is not particularly critical to design, and
does not induce specific design congestion problems or reliability concerns. When
applying body biasing, the P and N wells are biased symmetrically with respect to
the reference power supply levels (VDD for N-type substrate and GND for P-type
substrate). The power/ground supply lines for well biasing are usually named VDDS
(pMOS devices, N-type substrate) and GNDS (nMOS devices, P-type substrate). In
particular:
• Forward body biasing (FBB) of the substrate (VDDS < VDD, GNDS > GND)
induces lower MOS threshold voltage, enabling faster timing behavior of stan-
dard cells, while introducing higher leakage consumption.
• Reverse body biasing (RBB) of the substrate (VDDS > VDD, GNDS < GND)
induces higher MOS threshold voltage, enabling smaller leakage consumption,
while imposing higher delays in standard cell activity.
Body biasing can be used as a powerful tool to fine tune speed/leakage ratio
depending on the application workload being deployed at every moment in time
in the device lifetime. Differently from DVFS, that significantly affects dynamic
power, body biasing in itself mostly impacts leakage, while dynamic power
remains essentially unchanged. As a consequence, BB is only convenient in design
environments where the leakage component is dominant.
As a rule, IoT nodes are likely to have very leakage-intensive computation
patterns. On the one hand, it is not reasonable to assume that most IoT IC would
adopt in the short term very advanced technology nodes: the majority of IoT leaves
are likely to converge on established, lower cost technologies where leakage is not
dominant as compared to dynamic power. On the other hand, it is in the nature of
IoT processors to be powered-on for their whole life cycle. Most of the time, such
devices would be “monitoring” a physical system: it reasonable to expect that IoT
leaf nodes will be mostly of the time “dormant,” collecting information at low rates,
only to be “awaken” in case of sudden attention from the “cloud” or in case of
specific events (e.g., an alarm in a surveillance system, a driver action in a car, and a
sudden change of condition in a temperature/pressure sensor). In devices serving
long stand-by or low-performance times and shorter high-processing transitory
periods, the impact of leakage power (and the potential power saving enabled by
body biasing) would be significant (Fig. 1.5).
We will define in the following the standard CMOS process technology as “bulk”
CMOS. Unfortunately, widespread application of body biasing is limited in bulk
1 Power-Shaping Configurable Microprocessors for IoT Devices 17
Fig. 1.5 Schematic description of parasitic BJTs causing latch-up in a triple-well MOS process
CMOS by physical issues. The first reason for concern is the presence of P-
Well/N-Well diodes, which must not be forward biased. Especially in technology
nodes below 100 nm, a second significant reliability concern is caused by latch-
up phenomena [18], [29]: latch-up is a disruptive failure mechanism induced by
the presence of a parasitic stack of BJT transistors that is “built-in” in the CMOS
structure. Latch-up is triggered when BJTs are turned on due to voltage mismatches
between substrate and the diffusion regions of the MOS. Once BJTs are turned on,
they create a parasitic conductive channel between the VDD and GND in the chip,
and they may cause domino effect on the neighboring CMOS stages, leading to very
high currents and ultimately the chip destruction (Fig. 1.6).
While in standard MOS functioning P- and N-substrate are connected, respec-
tively, to VDD and GND, the presence of independent VDDS and GNDS voltage
severely increases the risk of latch-up. In order to avoid such occurrence, in bulk
CMOS processes the range of biasing voltages must be limited to ˙400 mV, limiting
the potential for leakage mitigation.
Fig. 1.6 Example of the routing of VDDS line in a design supporting FBB/RBB biasing (from
[17])
Fig. 1.7 Propagation delay and leakage power variation across different VDD/VDDS operation
points (from [17])
degradation at the lower leakage points, where propagation delays can be almost
doubled with respect to the reference: but, DVFS-RBB is a dynamic strategy, and in
case the IoT node would be in need of a temporary performance boost, a different
operation point could be chosen for a transitory time.
In particular, FBB could be applied to run the design even faster than in the
zero-biasing reference condition, enabling localized “overclocking” of the design.
This should be applied with care: Fig. 1.7 shows strong asymmetry between
timing and leakage behavior. Leakage dissipation has a larger variation range with
respect to propagation delay: FBB induces a greater and non-constant increase in
leakage, and the ratio between timing and leakage is strongly unbalanced. For this
reason, application of FBB must be very limited in time (i.e., to satisfy sudden
but temporary computation demands). Continued application of FBB may create
significant dissipation that may in turn create reliability issues, in particular thermal
runaway [19]. Thermal phenomena on-chip depend on many external factors, that
for IoT leaves are difficult to control at design time (e.g., thermal conductance of the
physical system embedding the IC and ambient temperature). In case widespread
use of FBB is planned, the IC should be equipped with an evenly distributed set
of on-chip temperature sensors, and appropriate thermal management software,
preferably embedded in the operating system to guarantee timely and immediate
intervention in case of unplanned dissipation peaks.
If we look back at the specifications for IoT leaves that were outlined in Sect. 1.3,
the need for sudden, significant performance for short transitories was underlined as
the main constraint. Power mitigation is an important feature, but in the IoT context
it is only significant if it does not compromise management of real time events. As a
consequence, the choice of supporting RBB for enabling very low leakage appears
unsuitable, as it would implicitly require to renounce to the temporary performance
boost enabled by FBB. While RBB may still be accessible for low speed IPs, the
majority of the IoT leaf IC blocks, and in particular the processing core(s) would
have to be designed in order to exploit FBB.
Interestingly, the choice of using strong FBB to support high-performance
transitory peaks does not necessarily imply high consumption during normal com-
putation: in fact, the potential speed up made available by consistent exploitation
of FBB is such that, applying FBB, it is possible to run a processor (or any other
digital IP such as a DMA, an hardware accelerator, a bus or NoC architecture)
at the frequency imposed by real time constraints while featuring a lower supply
voltage than what would be required without FBB. In turn, running the application
at a lower voltage has a very beneficial effect not only on leakage consumption, but
also on dynamic power.
In conclusion, SOI technologies offer a new, innovative strategy for power
mitigation that is particularly interesting for IoT devices. This strategy is different
and much more effective than the standard RBB strategy outlined in Sect. 1.5.2:
on top of applying reverse biasing up to 300 mV for quasi-stand-by conditions,
FDSOI flipped-well designs may be forward biased up to 3 V. FBB enables to supply
the circuit at much higher speed, with a dual advantage:
1. In case of high peaks of computational requirements, running FBB with high
voltage supply would offer speed-ups in the range of 30 % with respect to the
non-biased conditions
22 F. Campi
2. In all other cases, using FBB with lower voltages would allow to reach the same
speeds as the non-biased conditions with a significantly lower Vdd, thus enabling
lower leakage as well as lower dynamic power consumption.
Fig. 1.9 Power vs frequency behavior of RISC core and FPU unit
network. But this design option can provide two levels of advantage: if applied at
fixed VDD voltage, FBB can provide a 20 % boost in performance at the price
of higher leakage (as also reported in [20]): in the IoT context, this could be very
useful to manage temporary computation peaks due to asynchronous events in the
environment. If applied at a fixed frequency, FBB allows to run the design at a
smaller VDD, offering an average reduction of 10 % in power consumption when
operated the range of the “native” range of frequencies where timing closure was
obtained without FBB. Again, in the IoT context this can be very useful to limit
power dissipation and related reliability issues, and mitigate energy consumption.
Finally, at the lowest frequencies RBB could be applied up to 300 mV to at the
price of performance, obtaining leakage reduction in the same range as the case
of “bulk” CMOS already reported in Sect. 1.4.3.2, featuring a 3–5 reduction in
leakage at 0.6 V at 10 MHz. Once again, this option is particularly significant as
leakage is the largely dominant when the IoT processor is in a dormient or quasi-
static state, monitoring the environment in non-critical conditions.
On top of the gains enabled by DVFS-BB thanks to FD-SOI flipped well
technology, the application of a fine-grained GALS allows the RISC core to run
80 % faster than it would with a single clock, thus enabling much more effective
run-time servicing when the FPU is not heavily exploited. Moreover, having
independent tuning of FPU and Core allows to adapt the working point of each
to the external events.
Finally, it should be noted that although degrees of DVFS can be applied with
relevant advantages also to embedded memory cuts, memories do not follow the
same scaling pattern of stdcell logic. In particular, in the technology node of this
example, memory cuts should not be scaled below Vdd D 800 mV to preserve the
memory state. Measurements reported above only considered digital logic and did
not include memory cuts, for whom detailed characterization libraries were not
available. In the design, memory cuts had independent voltage, but shared same
clock as the RISC core.
24 F. Campi
1.6 Conclusions
References
5. G. Gielen, P. De Wit, E. Maricau et al., Emerging yield and reliability challenges in nanometer
CMOS technologies. Proceedings of the IEEE symposium on design and test in Europe (2008)
6. E. Maricau, G. Gielen, Analog IC Reliability in Nanometer CMOS (Springer, New York, 2013)
7. D. Draper et al., Signal and power integrity for SoCs. 2010 IEEE international
solid-state circuits conference digest of technical papers (ISSCC), pp. 520–520.
doi:10.1109/ISSCC.2010.5433856
8. Synopsys Design Ware FIFO, www.synopsys.com/products/designware/docs/doc/dwf/
datasheets/dw_fifo_s2_sf.pdf
9. C. Cummings, Simulation and synthesis techniques for asynchronous FIFO design. Synopsys
users group conference (SNUG), San Jose, CA, 2002
10. A. Wang, A.P. Chandrakasan, S.V. Kosonocky, Optimal supply and threshold scaling for
subthreshold CMOS circuits. Proc. ISVLSI, Apr 2002, pp. 5–9
11. M. Krstic, E. Grass, F.K. Gurkaynak, P. Vivet, Globally asynchronous, locally syn-
chronous circuits: overview and outlook. IEEE Des. Test Comput. 24(5), 430–441 (2007).
doi:10.1109/MDT.2007.164
12. D. Rossi, F. Campi, S. Spolzino, S. Pucillo, R. Guerrieri, A heterogeneous digital signal
processor for dynamically reconfigurable computing. IEEE J. Solid State Circuits 45(8), 1615–
1626 (2010). doi:10.1109/JSSC.2010.2048149
13. J.W. Tschanz, S.G. Narendra, Y. Ye, B.A. Bloechel, S. Borkar, V. De, Dynamic sleep transistor
and body bias for active leakage power control of microprocessors. IEEE J. Solid State Circuits
38, 1838–1845 (2003)
14. D.N. Truong, W.H. Cheng, T. Mohsenin, Z. Yu, A.T. Jacobson, G. Landge, M.J. Meeuwsen, C.
Watnik, A.T. Tran, Z. Xiao, E.W. Work, J.W. Webb, P.V. Mejia, B.M. Baas, A 167-processor
computational platform in 65 nm CMOS. IEEE J. Solid State Circuits 44(4), 1130–1144
(2009). doi:10.1109/JSSC.2009.2013772
15. R. Airoldi, F. Garzia, J. Nurmi, Improving reconfigurable hardware energy efficiency and
robustness via DVFS-scaled homogeneous MP-SoC. 2011 IEEE international symposium on
parallel and distributed processing workshops and PhD forum (IPDPSW), 2011, pp. 286–289.
doi:10.1109/IPDPS.2011.160
16. S.M. Martin, K. Flautner, T. Mudge, D. Blaauw, Combined dynamic voltage scaling and
adaptive body biasing for lower power microprocessors under dynamic workloads. Proc.
ICCAD, Nov 2002, pp. 721–725
17. A. Manuzzato, F. Campi, D. Rossi, V. Liberali, D. Pandiniin, Exploiting body biasing for
leakage reduction: a case study. Proc. ISVLSI, Aug 2013
18. N.S. Kim, T. Austin, D. Baauw, T. Mudge, K. Flautner, J.S. Hu, M.J. Irwin, M. Kandemir, V.
Narayanan, Leakage current: Moore’s law meets static power. IEEE Trans. Comput. 36(12),
68–75 (2003). doi:10.1109/MC.2003.1250885
19. A. Vassighi, M. Sachdev, Thermal and Power Management of Integrated Circuits (Springer,
Berlin, 2006). ISBN 978-0-387-25762-4
20. D. Jacquet et al., A 3 GHz Dual Core Processor ARM CortexTM-A9 in 28 nm UTBB FD-SOI
CMOS with ultra-wide voltage range and energy efficiency optimization. IEEE J. Solid State
Circuits 49(4), 812–826 (2014)
21. F. Arnaud, N. Planes, O. Weber, V. Barral, S. Haendler, P. Flatresse, F. Nyer, Switching energy
efficiency optimization for advanced CPU thanks to UTBB technology. IEEE int. electron
devices meeting (IEDM), Dig., 2012
22. R.C. Johnson, FinFETs C FD-SOI Proposition: May Save Power, http://www.eetimes.com/
document.asp?doc_id=1327035. Accessed Feb 2016
23. T. Matsukawa et al., Lowest variability SOI FinFETs having multiple Vt by back-biasing.
2014 Symposium on VLSI technology (VLSI-technology): digest of technical papers.
doi:10.1109/VLSIT.2014.6894393
24. FD-SOI technology innovations extend Moore’s law. A GlobalFoundries white paper,
September 2015, http://globalfoundries.com/docs/default-source/brochures-and-white-
papers/globalfoundries_fd-soi_wp_sep2015.pdf. Accessed Feb 2016
26 F. Campi
Michael Dossis
2.1 Introduction
M. Dossis ()
TEI of Western Macedonia, Kastoria Campus, Fourka Area, Kastoria, 52100 Greece
e-mail: [email protected]
All of the issues reported in the introduction and elsewhere have motivated industry
and academia to invest in automated, integrated, and formal design automation
methodologies and tools for the design and development of embedded ICs and
systems. These methods are based on the idea of transforming a textual software-
program-code-like description into a netlist of logic gates. Nowadays, a higher
level of code abstraction of hardware description formats, such as VHDL and
Verilog, C, SystemC, and ADA, is pursued as input to automated high-level E-CAD
tools. Methodologies such as high-level synthesis (HLS) and electronic system level
(ESL) design employ established techniques, borrowed from the computer language
program compilers and established E-CAD tools as well as new algorithms such as
advanced operation scheduling, loop unrolling, and code motion heuristics.
Currently, the design of digital systems involves programming of the circuit’s
functionality at the register-transfer level (RTL) level in hardware description
languages such as VHDL and Verilog. However, for custom designs that are
larger than a hundred thousand logic gates, the use of RTL code for specification
and design usually results into years of design flow iterations and verification
simulations. Combined with the short lifetime of electronic products in the market,
this constitutes a great problem for the industry. Therefore, there has been a pressing
need for more abstracted input formats such as C, CCC, and ADA. However, the
programming style of the (hardware/software) specification code has an unavoidable
impact on the quality of the synthesized system. This is deteriorated by models
with hierarchical blocks, subprogram calls, as well as nested control constructs
(e.g., if-then-else and while loops). The complexity of the transformations that
are required for the synthesis tasks (compilation, algorithmic transformations,
scheduling, allocation and binding) of such high-level code models increases at an
exponential rate, for a linear increase in the design size.
During HLS, the input code (such as ANSI-C or ADA) is first transformed into
a control/dataflow graph (CDFG) by a front-end compilation stage. Then various
optimizing synthesis transformations are applied on the CDFG to generate the final
implementation. The most important HLS tasks of this process are scheduling,
allocation and binding. Scheduling makes an as-much-as-possible optimal order
of the operations in a number of control steps or states, parallelizing as many
operations as possible, so as to achieve shorter execution times of the generated
implementation. Allocation and binding assign operations onto functional units, and
variables and data structures onto registers, wires, or memory positions, available
from an implementation library.
A number of commercial HLS tools impose their own extensions or restrictions
on the programming language code that they accept as input, as well as various
shortcuts and heuristics on the HLS tasks that they execute. Such tools are the
CatapultC by Mentor Graphics, the Cynthesizer by Forte Design Systems, the
30 M. Dossis
The HLS scheduling task belongs into two major categories: time-constrained
scheduling and resource-constrained scheduling. Time-constrained scheduling aims
to result into the lowest area or number of functional units, when the task is
constrained by the max number of control steps (time constraint). Resource-
constrained scheduling aims to produce the fastest schedule (the minimum number
of control states) when the maximum number of hardware resources or hardware
area is constrained (resource constraint). Integer linear programming (ILP) solutions
have been proposed, however, their run time grows exponentially with the increase
of design size, which makes them impractical. Heuristic methods have also been
proposed to handle large designs and to provide sub-optimal but practical imple-
mentations. There are two heuristic scheduling approaches: constructive solutions
2 Formal Design Flows for Embedded IoT Hardware 31
Allocation determines the type of resource storage and functional units, selected
from the library of components, to be assigned for each data object and operation
of the input program. Allocation also calculates the number of resources of each
type that are needed to implement every operation or data variable. Binding assigns
operations, data variables, data structures, and data transfers onto functional units,
storage elements (registers or memory blocks), and interconnections, respectively.
Also binding makes sure that the design’s functionality does not change by using
the selected library components.
There are three categories of solutions to the allocation problem: constructive
techniques, decomposition techniques, and iterative approaches. Constructive allo-
cation techniques start with an empty implementation and progressively build the
datapath and control parts of the implementation by adding more functional, storage,
and interconnection elements while they traverse the CDFG or any other inter-
nal graph/representation format. Decomposition techniques divide the allocation
problem into a sequence of well-defined independent sub-tasks. Each such sub-
task is a graph-based theoretical problem which is solved with any of the three
well-known graph methods: clique partitioning, the left-edge technique, and the
weighted bipartite-matching technique. The task of finding the minimum cliques
in the graph, which is the solution for the sub-tasks, is an NP-hard problem, so
heuristic approaches [7] are utilized for allocation.
32 M. Dossis
HLS has been an active research field for about three decades. Early approaches
of experimental synthesis tools that synthesized small subsets of programming
constructs or proprietary modeling formats have emerged since the late 1980s.
As an example, an early tool that generated hardware structures from algorithmic
code, written in the PASCAL-like, digital system specification language (DSL) is
reported in [11]. This synthesis tool performs the circuit compilation in two steps:
first step is datapath synthesis which is followed by control synthesis. Examples of
other behavioral circuit specification languages of that time, apart from DSL, were
DAISY [12], ISPS [13], and MIMOLA [14].
In [15] the circuit to be synthesized is described with a combination of algo-
rithmic and structural level code and then the PARSIFAL tool synthesizes the code
into a bit-serial DSP circuit implementation. The PARSIFAL tool is part of a larger
E-CAD system called FACE and which included the FACE design representation
and design manager core. FACE and PARSIFAL were suitable for DSP pipelined
implementations, rather than for a more general behavioral hardware models with
hierarchy and complex control.
According to [16] scheduling first determines the propagation delay of each
operation and then it assigns all operations into control steps (states) of a finite state
machine. List scheduling uses a local priority function to postpone the assignment
of operations into states, when resource constraints are violated. On the contrary,
force-directed scheduling (FDS) tries to satisfy a global execution deadline (time
constraint) as it minimizes the utilized hardware resources (functional units, regis-
ters, and busses). The force-directed list scheduling (FDLS) algorithm attempts to
implement the fastest schedule while satisfying fixed hardware resource constraints.
2 Formal Design Flows for Embedded IoT Hardware 33
The main HLS tasks in [17] include allocation, scheduling, and binding. Accord-
ing to [18] scheduling is finding the sequence of operations to execute in a specific
order so as to produce a schedule of control steps with allocated operations in each
step of the schedule; allocation defines the required number of functional, storage,
and interconnect units; binding assigns operations to functional units, variables,
and values to storage elements and the interconnections amongst them to form a
complete working circuit that executes the functionality of the source behavioral
model.
The V compiler [19] translates sequential descriptions into RTL models using
parsing, scheduling, and resource allocation. The source sequential descriptions are
written in the V language which includes queues, asynchronous calls, and cycle
blocks and it is tuned to a kind of parallel hardware RTL implementations. The V
compiler utilizes percolation scheduling [20] in order to achieve the required degree
of parallelism by meeting time constraints.
A timing network is generated from the behavioral design in [21] and is annotated
with parameters for every different scheduling approach. The scheduling approach
in this work attempts to satisfy a given design cycle for a given set of resource
constraints, using the timing model parameters. This approach uses an integer linear
program (ILP) which minimizes a weighted sum of area and execution time of the
implementation. According to the authors, their Symphony tool delivers better area
and speed than ADPS [22]. This synthesis technique is suitable for dataflow designs
(e.g., DSP blocks) and not for more general complex control flow designs.
The CALLAS synthesis framework [23] transforms algorithmic, behavioral
VHDL models into VHDL RTL and gate netlists, under timing constraints. The
generated circuit is implemented using a Moore-type finite state machine (FSM),
which is consistent with the semantics of the VHDL subset used for the specification
code. Formal verification techniques such as equivalence checking, which checks
the equivalence between the original VHDL FSM and the synthesized FSM are used
in the CALLAS framework by using the symbolic verifier of the circuit verification
environment (CVE) system [24].
A methodological approach of designing and developing mixed hardware and
software parts of a system known as hardware–software co-design has emerged
about the same time as early HLS tools in the 1990s. The most known examples
of this technology are reported in the following approaches.
The Ptolemy framework [25] allows for an integrated hardware–software co-
design methodology from the specification through to synthesis of hardware and
software components, simulation, and evaluation of the implementation. The tools
of Ptolemy can synthesize assembly code for a programmable DSP core (e.g., DSP
processor), which is built for a synthesis-oriented application. In Ptolemy, an initial
model of the entire system is partitioned into the software and hardware parts which
are synthesized in combination with their interface synthesis.
The COSYMA hardware–software co-synthesis framework [26] realizes an
iterative partitioning process, based on hardware extraction algorithm which is
driven by a cost function. The primary target in this work is to minimize customized
hardware within microcontrollers but the same time to allow for space exploration
34 M. Dossis
More advanced methodologies appeared at the late 1990s and they featured
enhanced input code sets as well as improved scheduling and other optimization
algorithms. The CoWare hardware–software co-design environment [31] is based
on a data model that allows the user to specify, simulate, and produce heterogeneous
implementations from heterogeneous specification source models. This design
approach develops telecommunication systems that contain DSP, control loops, and
user interfaces. The synchronous dataflow (SDF) type of algorithms found in a
category of DSP applications are synthesized into hardware from languages such
as SILAGE [32], DFL [33], and LUSTRE [34]. In contrast to this, DDF algorithms
consume and produce tokens that are data-dependent, and thus they allow for
complex if-then-else and while loop control constructs. CAD systems that allow
for specifying both SDF and DDF algorithms and run scheduling are the DSP-
station from Mentor Graphics [35], PTOLEMY [36], GRAPE-II [37], COSSAP
from Synopsys, and SPW from the Alta group [38].
C programs that include dynamic memory allocation, pointers, and the functions
malloc and free are mapped onto hardware in [39]. The SpC tool which was
developed in this work resolves pointer variables at compile time and thus C
functional models are synthesized into Verilog hardware models. The synthesis
of functions in C, and therefore the resolution of pointers and malloc/free inside
of functions, is, however, not included yet in this work, but left as future work.
2 Formal Design Flows for Embedded IoT Hardware 35
The different techniques and optimizations described above have been implemented
using the SUIF compiler environment [40].
A heuristic for scheduling behavioral specifications that include a lot of con-
ditional control flow is presented in [41]. This heuristic is based on a powerful
intermediate design representation called hierarchical conditional dependency graph
(HCDG). HCDG allows chaining and multicycling, and it enables advanced tech-
niques such as conditional resource sharing and speculative execution, which are
suitable for scheduling conditional behaviors. The HLS techniques in this work were
implemented in a prototype graphical interactive tool called CODESIS which used
HCDG as its internal design representation. The tool generates VHDL or C code
from the HCDG, but no translation of standard programming language code into
HCDG is known so far.
A coordinated set of coarse-grain and fine-grain parallelizing HLS transfor-
mations on the input design model are discussed in [42]. These transformations
are executed in order to deliver synthesis results that don’t suffer from the
negative effects of complex control constructs in the specification code. All of the
HLS techniques in this work were implemented in the SPARK HLS tool, which
transforms specifications in a small subset of C into RTL VHDL hardware models.
SPARK utilizes both control/dataflow graphs (CDFGs) and an encapsulation of
basic design blocks inside hierarchical task graphs (HTGs), which enable coarse-
grain code restructuring such as loop transformations and an efficient way to move
operations across large pieces of code. Nevertheless, SPARK is not designed to
process conditional code where the iteration limits are not known at compile time,
such as while loops.
Typical HLS tasks such as scheduling, resource allocation, module binding,
module selection, register binding, and clock selection are executed simultaneously
in [43] so as to achieve better optimization in design energy, power, and area. The
scheduling algorithm utilized in this HLS methodology applies concurrent loop
optimization and multicycling and it is driven by resource constraints. The state
transition graph (STG) of the design is simulated in order to generate switched
capacitance matrices. These matrices are then used to estimate power/energy
consumption of the design’s datapath. Nevertheless, the input to the HLS tool is
not programming language code but a complex proprietary format representing an
enhanced CDFG as well as an RTL design library and resource constraints.
An incremental floorplanner is described in [44] which combines an incremental
behavioral and physical optimization into HLS. These techniques were integrated
into an existing interconnect-aware HLS tool called ISCALP [45]. The new com-
bination was named IFP-HLS (incremental floorplanner high-level synthesis) tool,
and it attempts to concurrently improve the design’s schedule, resource binding, and
floorplan, by integrating high-level and physical design algorithms.
Huang et al. [46] discuss a HLS methodology which is suitable for the design of
distributed logic and memory architectures. Beginning with a behavioral description
of the system in C, the methodology starts with behavioral profiling in order to
extract simulation statistics of computations and references of array data. Then array
data are distributed into different partitions. An industrial tool called Cyber [47]
36 M. Dossis
A formal approach is followed in [56] which is used to prove that every HLS
translation of a source code model produces an RTL model that is functionally
equivalent to the one in the behavioral input to the HLS tools. This technique is
called translation validation and it has been maturing via its use in the optimizing
software compilers. The validating system in this work is called SURYA, it is
using the Symplify theorem prover and it was used to validate the SPARK HLS
tool. This validation experiment with Symplify discovered two bugs in the SPARK
compilations.
The replacement of flip-flop registers with latches is proposed in [57] in order
to yield better timing in the implemented designs. The justification for this is
that latches are inherently more tolerant to process variations than flip-flops. The
related design techniques were integrated into a tool called HLS-1. HLS-1 translates
behavioral VHDL code into a synthesized netlist. Nevertheless, handling a design
where registers are implemented with latches instead of edge-triggered flip-flops is
generally considered to be cumbersome due to the complicated timing behavior of
latches.
Many portable and embedded computing systems and applications such as mobile
(smart) phones, PDAs, etc., require design for low power and therefore synthesis for
low energy is becoming very important in the whole area of VLSI and embedded
system design. In any case, and particularly for IoT devices the majority of
custom functions that are implemented in special-purpose hardware imply that they
consume much less power than microcontroller equivalent programs. Therefore
it is mandatory that most of the special functions in IoT devices found in areas
of data compression, security, media playing, image/audio (de-)coding must be
implemented using advanced synthesis techniques into specialized hardware for low
power consumption and increased security gains.
During the last decade industry and academia invested on significant amounts
of research regarding VLSI techniques and HLS for low power design. In order
to achieve low energy in the results of HLS and system design, new techniques
that help to estimate power consumption at the high-level description level are
needed, and they will be a great aid in delivering systems with reduced power
consumption such as IoT devices running on batteries. In [58], switching activity
and power consumption are estimated at the RTL level taking also into account the
glitching activity on a number of signals of the datapath and the controller. The
spatial locality, the regularity, the operation count, and the ratio of critical path to
available time are identified in [59] with the aim to reduce the power consumption
of the interconnections. The HLS scheduling, allocation, and binding tasks consider
such algorithmic statistics and properties in order to reduce the fanins and fanouts of
the interconnect wires. This will result into reducing the complexity and the power
consumed on the capacitance of the interconnection buses [60].
38 M. Dossis
So far in this chapter related work in HLS methodologies for embedded IoT systems
was reviewed. From this section onwards, a particular, formal HLS methodology is
analyzed and explained, which is directly applicable on embedded system design,
and it has been developed by the author of this chapter. The techniques of this work
include the front-end compilers which are based on formal compiler generators, the
Formal Intermediate Format (FIF) which encapsulates in a formal way the attributes
of the input algorithms, and the back-end compiler which is built with formal logic
programming relations (or facts in the Prolog language terminology).
The FIF1 was invented and designed by the author of this chapter as a tool and
media for the design encapsulation and the HLS transformations in the C-Cubed
1
The Formal Intermediate Format is patented with patent number: 1006354, 15/4/2009, from the
Greek Industrial Property Organization.
2 Formal Design Flows for Embedded IoT Hardware 39
input program
code
software compila-
back-end compiler
inference rules and
front-end user parameters
compiler
high-level synthesis
FIF compilation FIF loading
verification
hardware
FIF database implementa-
tion
Cycle-acc. testebench
2
This hardware compiler method is patented with patent number: 1005308, 5/10/2006, from the
Greek Industrial Property Organization.
40 M. Dossis
normally found in HLS tools. This whole compilation flow is a formal transfor-
mation process, which converts the source code programs into implementable RTL
VHDL hardware accelerator models. If there are function calls in the specification
code, then each subprogram call is transformed into an interface event in the gen-
erated hardware FSM. The interface event is used so that the “calling” accelerator
uses the “services” of the “called” accelerator, as it is depicted in the source code
hierarchy as well.
The back-end compiler consists of a very large number of logic rules. These logic
rules are coded with logic programming techniques, which are used to implement
the HLS transformations and other processes of the back-end compilation phase.
As an example, one of the latter processes reads and incorporates the FIF tables’
facts into the compiler’s internal inference engine of logic predicates and rules [68].
The back-end compiler rules are given as a great number of definite clauses of the
following equation:
A0 A1 ^ ^ An .where n 0/ (2.1)
where the positional parameters Var_1, : : : ,Var_N of the above predicate “pred-
icate_symbol” are either variable names (in the case of the back-end compiler
inference rules), or constants (in the case of the FIF table statements). The predicate
syntax in Eq. (2.2) is typical of the way of the FIF facts and other facts interact with
each other, they are organized and they are used internally in the inference engine.
Thus, the hardware descriptions are generated as “conclusions” of the inference
engine upon the FIF “facts.” This is done in a formal way from the input programs
by the back-end phase, which turns the overall transformation into a provably correct
compilation process. In essence, the FIF file consists of a number of such atomic
formulas, which are grouped in the FIF tables. Each such table contains a list of
homogeneous facts which describe a certain aspect of the compiled program. For
example, all prog_stmt facts for a given subprogram are grouped together in the
listing of the program statements table.
In the back-end compiler “conclussions” the correct-by-construction hardware
implementations and the cycle-accurate testbench are included, as custom hardware
micro-architectures. This along with other features makes the C-Cubed tool very
suitable for designing custom hardware blocks of IoT embedded devices and
peripherals. Experiments with the tool have shown that it is very suitable for
2 Formal Design Flows for Embedded IoT Hardware 41
small and big data coding, secure functions and cryptography, DSP and computer
graphics, as well as other mathematical blocks, all of which are used in today’s
embedded systems.
The inference engine of the back-end compiler consists of a great number of logic
rules (like the one in Eq. (2.1)) which conclude on a number of input logic predicate
facts and produce another set of logic facts and so on. Eventually, the inference
logic rules produce the logic predicates that encapsulate the writing of RTL VHDL
hardware co-processor models. These hardware models are directly implementable
to any hardware (e.g., ASIC or FPGA) technology, since they are technology
and platform-independent. For example, generated RTL models produced in this
way from the prototype compiler were synthesized successfully into hardware
implementations using the Synopsys DC Ultra, the Xilinx ISE, and the Mentor
Graphics Precision software without the need of any manual alterations of the
produced RTL VHDL code. In the following Eq. (2.3) an example of such an
inference rule is shown:
The meaning of this rule that combines two input logic predicate facts to produce
another logic relation (dont_schedule) is that when two operations (Operation1 and
Operation2) are examined and the first is a predecessor of the second (in terms of
data and control dependencies), then don’t schedule them in the same control step.
This rule is part of a parallelizing optimizer which is called “PARCS” (meaning:
Parallel, Abstract Resource—Constrained Scheduler).
The way that the inference engine rules (predicates relations–productions) work
is depicted in Fig. 2.2. The last produced (from its rule) predicate fact is the VHDL
RTL writing predicate at the top of the diagram. Right below level 0 of predicate
production rule there is a rule at the 1 level, then level 2, and so on. The first
predicates that are fed into this engine of production rules belong to level –K, as
shown in this figure. Level –K predicate facts include of course the FIF facts that
are loaded into the inference engine along with the other predicates of this level.
In this way, the back-end compiler works with inference logic on the basis of
predicate relation rules and, therefore, this process is a formal transformation of
the FIF source program definitions into the hardware accelerator (implementable)
models. Of course in the case of the prototype compiler, there is a very large number
of predicates and their relation rules that are defined inside the implementation code
of the back-end compiler, but the whole concept of implementing this phase is as
shown in Fig. 2.2. The user of the back-end compiler can select certain environment
42 M. Dossis
command list options as well as build an external memory port parameter file as well
as drive the compiler’s optimizer with specific resource constraints of the available
hardware operators.
The most important of the back-end compilation stages can be seen in Fig. 2.3.
The compilation process starts with the loading of the FIF facts into the inference
rule engine. After the FIF database is analyzed, the local data object, operation,
and initial state lists are built. Then the environment options are read and the
temporary lists are updated with the special (communication) operations as well as
the predecessor and successor dependency relation lists. After the complete initial
schedule is built and concluded, the PARCS optimizer is run on it, and the optimized
2 Formal Design Flows for Embedded IoT Hardware 43
Environ-
Building of local data and states lists
ment parame-
ters
Processing of multi-dimensional objects (e.g. arrays)
and environment interface events
1. start with the initial schedule (including the special external port operations)
2. Current PARCS state <- 1
3. Get the 1st state and make it the current state
4. Get the next state
5. Examine the next state’s operations to find out if there are any dependencies
with the current state
6. If there are no dependencies then absorb the next state’s operations into the
current PARCS state; If there are dependencies then finalize the so far absorbed
operations into the current PARCS state, store the current PARCS state, PARCS
state <- PARCS state + 1; make next state the current state; store the new state’s
operations into the current PARCS state
7. If next state is of conditional type (it is enabled by guarding conditions) then
call the conditional (true/false branch) processing predicates, else continue
8. If there are more states to process then go to step 4, otherwise finalize the so
far operations of the current PARCS state and terminate
state 1
operator (FU) 1
Cloud of lll
operator (FU) n
data out
DONE
different machine states. This implies that every operator is enabled by single wire
activation commands that are driven by different state register values. This in turn
means that there is a redundancy in the generated hardware, in a way that during part
of execution time, a number of state-dedicated operators remain idle. However, this
redundancy is balanced by the fact that this option achieves the fastest clock cycle,
since the state command encoder, as well as the data multiplexers are replaced by
single wire commands which don’t exhibit any additional delay, and this option is
very suitable to implement on large ASICs with plenty of resources.
Another micro-architecture option is the generation of traditional FSM C datapath-
based VHDL/Verilog models. The results of this option are shown in Fig. 2.6.
With this option activated the generated VHDL/Verilog models of the hardware
accelerators include a next state process as well as signal assignments with
multiplexing which correspond to the input data multiplexers of the activated
operators. Although this option produces smaller hardware structures (than the
massively parallel option), it can exceed the target clock period due to larger delays
through the data multiplexers that are used in the datapath of the accelerator.
Using the above micro-architecture options, the user of the CCC HLS tool can
select various solutions between the fastest and larger massively parallel micro-
architecture, which may be suitable for richer technologies in terms of operators
such as large ASICs, and smaller and more economic (in terms of available
resources) technologies such as smaller FPGAs.
As it can be seen in Figs. 2.5 and 2.6, the produced co-processors (accelerators)
are initiated with the input command signal START. Upon receiving this command
the co-processors respond to the controlling environment using the handshake
output signal BUSY and right after this, they start processing the input data in
order to produce the results. This process may take a number of clock cycles
46 M. Dossis
data
state vector
Cloud of multiplexer
state regis-
ters and
next state operator (FU)
encoding
logic lll
data
multiplexer
operator (FU)
DONE
data out
and it is controlled by a set of states (discrete control steps). When the co-
processors complete their processing, they notify their environment with the output
signal DONE. In order to conclude the handshake the controlling environment
(e.g., a controlling central processing unit) responds with the handshake input
RESULTS_READ, to notify the accelerator that the processed result data have
been read by the environment. This handshake protocol is also followed when one
(higher-level) co-processor calls the services of another (lower-level) co-processor.
The handshake is implemented between any number of accelerators (in pairs) using
the START/BUSY and DONE/RESULTS_READ signals. Therefore, the set of
executing co-processors can also be hierarchical in this way.
Other environment options, passed to the back-end compiler, control the way that
the data object resources are used, such as registers and memories. Using a memory
port configuration file, the user can determine that certain multi-dimensional data
objects, such as arrays and array aggregates, are implemented in external (e.g.,
central, shared) memories (e.g., system RAM). Otherwise, the default option
remains that all data objects are allocated to hardware (e.g., on-chip) registers.
All of the related memory communication protocols and hardware ports/signals are
automatically generated by the back-end synthesizer, and without the need for any
manual editing of the RTL code by the user. Both synchronous and asynchronous
memory communication protocol generation are supported.
2 Formal Design Flows for Embedded IoT Hardware 47
The generated hardware modules can be placed inside the computing environment
that they accelerate or can be executed standalone. For every subprogram in the
source specification code one co-processor is generated to speed up (accelerate)
or just execute the particular system task. The whole system (both hardware and
software models) is modeled in algorithmic ADA or C code which can be compiled
and executed with the host compiler and linker to run and verify the operation of
the whole system at the program code level. In this way, extremely fast verification
can be achieved at the algorithmic level. It is evident that such behavioral (high-
level) compilation and execution is orders of magnitude faster than conventional
RTL simulations. Moreover, now C-Cubed automatically generates cycle-accurate
C testbenches from exactly the same FSM information that generates the HDL code.
Therefore, using compile and execute these testbenches can be executed on the host
computer in a rapid and correct manner.
After the required co-processors are specified, coded in ADA, generated with the
prototype hardware compiler, and implemented with commercial back-end tools,
they can be downloaded into the target computing system (if the target system
includes FPGAs) and executed to accelerate certain system tasks. This process is
shown in Fig. 2.7. The accelerators can communicate with each other and with the
host computing environment using synchronous handshake signals and connections
with the system’s handshake logic.
There have been a great deal of design and verification experiments with the C-
Cubed framework. In all the experiments it was found that the quality of the
generated HDL modules is very high with increased readability of the code. Among
the many experiments, three small benchmarks are analyzed in this paragraph: a
computer graphics algorithm, a DSP FIR (finite impulse response) filter, and the
classical high-level synthesis benchmark, the second order differential equation
approximation solver. Moreover, the statistics of two more benchmarks, an RSA
crypto-processor and a complex MPEG engine, are included in the discussion of
this chapter.
Table 2.1 shows state reduction statistics with the C-Cubed’s optimizer, PARCS.
Impressive state reduction is achieved, up to 41 %, even with a complex conditional
structure which is found in the line-drawing design (computer graphics benchmark).
Due to the formal nature of the C-Cubed synthesizer only high-level source code—
level compile and execute verifications are needed. However, in order to prove our
argument in practice all synthesized RTL modules were simulated and their behavior
matched, as expected, the behavior of the source code programs. Figure 2.8 shows
a snapshot of the RTL simulation of the computer graphics hardware module, near
the time where the line’s pixels are written into the external memory.
48 M. Dossis
Main Accelerator 1 (+
(shared) local memory)
memory
Host processor(s)
Accelerator 2 (+
local memory)
•••
Table 2.1 FSM state statistics before and after optimization with PARCS
State reduction
Module name Initial schedule states PARCS states percentage (%)
DSP FIR filter processor 17 10 41
RSA crypto-processor 16 11 31
Computer graphics design 17 10 41
MPEG top routine (with 462 343 26
external memory)
Differential equation solver 20 13 35
The verification flow in the C-Cubed framework is formal and integrated with
the synthesis flow. The fact that the input to the tools is executable allows us to
compile the source ADA or C and co-simulate with the testbench. Also, we can
include commands in the high-level testbench in order to automatically and formally
compare simulation outputs of the high-level code with that of the RTL code. The
structure and flow of this cross-checking verification is shown in Fig. 2.9.
2 Formal Design Flows for Embedded IoT Hardware 49
VHDL/Verilog testbench
Apart from the high-level behavioral testbench (at the source code level) the C-
Cubed framework recently offered a formal verification option, by compiling and
rapidly executing the FSM by means of a cycle-accurate testbench (FSM model) in
the C language which is automatically generated by the back-end compiler using
the same internal intelligent FSM models of the optimized hardware modules. The
cycle-accurate testbench allows for setting up inputs, reading outputs and registers,
resetting the engine, and moving to the next state by pressing corresponding buttons
on the keyboard. Thus it is very easy to use and it can increase the confidence of
the provably correctness of the generated FSM (co-processor or standalone custom
logic).
As an example Fig. 2.10 shown the execution screen of the high-level testbench
of the differential equation solver benchmark.
Figure 2.11 shows the RTL simulation of the same benchmark (the result is
obviously the same as with the high-level testbench).
The start of the cycle-accurate testbench simulation of this benchmark is shown
in Fig. 2.12, where the circuit’s inputs are set. After going through the FSM’s states
the screen in Fig. 2.13 shows reading of the outputs which give the same results as
the other verification runs for this test (as it was expected).
The same flow was confirmed for all of this work’s benchmarks, but due to
limitations in paper length they are omitted.
The major contribution of this work is an integrated, formal, rapid, and automated
methodology and set of tools for the automatic synthesis of custom hardware,
which can be used in embedded IoT devices. All of the above characteristics of
the presented method make it suitable for short project time and limited project
budget for designing custom circuit blocks. It is expected that the IoT industry will
be benefited the most by adopting and using such HLS methods, which will make it
competitive to the hard international economy.
Due to the nature of the C-Cubed tools implementation they are particularly
suitable for future extensions and experiments such as low power design, SystemC
testbench generation, and other language input/output interfaces. Also, continuous
improvements of the PARCS scheduler and the associated synthesis transformations
are envisaged and they are planned for the future.
References
1. B. Pangrle, D. Gajski, Design tools for intelligent silicon compilation. IEEE Trans. Comput.
Aided Des. Integr. Circuits Syst. 6(6), 1098–1112 (1987)
52 M. Dossis
64. N. Kumar, S. Katkoori, L. Rader, R. Vemuri, Profile-driven behavioral synthesis for low-power
VLSI systems. IEEE Des. Test Comput. 12(3), 70–84 (1995)
65. R. Martin, J. Knight, Power-profiler: optimizing ASICs power consumption at the behavioral
level, in Proceedings of the Design Automation Conference (DAC), ISBN: 0-89791-725-1, pp.
42–47, San Francisco, CA, 1995
66. I. Issenin, E. Brockmeyer, B. Durinck, N.D. Dutt, Data-reuse-driven energy-aware cosynthesis
of scratch pad memory and hierarchical bus-based communication architecture for multipro-
cessor streaming applications. IEEE Trans. Comput. Aided Des. Integr. Circuits Syst. 27(8),
1439–1452 (2008)
67. M. Dossis, Intermediate Predicate Format for design automation tools. J. Next Gener. Inform.
Technol. 1(1), 100–117 (2010)
68. U. Nilsson, J. Maluszynski, Logic Programming and Prolog, 2nd edn. (John Wiley & Sons
Ltd., Chichester, 1995)
Chapter 3
AXIOM: A Flexible Platform
for the Smart Home
Roberto Giorgi, Nicola Bettin, Paolo Gai, Xavier Martorell, and Antonio Rizzo
3.1 Introduction
R. Giorgi ()
Department of Information Engineering and Mathematics, University of Siena, Siena, Italy
e-mail: [email protected]
N. Bettin
VIMAR SpA, Marostica, Italy
e-mail: [email protected]
P. Gai
Evidence SrL, Pisa, Italy
e-mail: [email protected]
X. Martorell
Computer Architecture Department, Barcelona Supercomputing Center, Barcelona, Spain
e-mail: [email protected]
A. Rizzo
Department of Cognitive Sciences, University of Siena, Siena, Italy
e-mail: [email protected]
model not only provide the capability to manage a flexible number of clients at the
same time as in traditional platforms, but also permit a resilient execution [26, 27].
The issue to define task scheduling and to select in which core the task
computation achieve real-time performance and power-efficiency is provided by the
AXIOM hardware/software infrastructure [2, 10, 13, 14, 24].
In this contribution we also present some initial results that demonstrate the
feasibility of achieving the task distribution across several boards.
The contribution of this chapter are: (1) proposing a more flexible platform based
on open-source, open-hardware, reconfigurable, and scalable embedded platform
for the Smart Home domain; (2) summarizing the key features that could be useful
in such platform for the Smart Home domain; and (3) illustrating some preliminary
results of the early simulated prototype of the AXIOM platform.
Smart Home means buildings empowered by ICT in the context of the merging
ubiquitous computing and the IoT: the generalization in instrumenting buildings
with sensors, actuators, CPS allow to collect, filter, and produce more and more
information locally, to be further consolidated and managed globally according to
business functions and services. A Smart Home is one that uses operational and
IT technologies and processes to make it a better performing building—one that
delivers lower operating costs, uses less energy, maximizes system and equipment
lifetime value, is cyber-secured, and produces measurable value for multiple stake
holders [22, 25].
Major challenges in such environments concern cryptography, self-testing, and
first of all sensor-networks management. Sensor data brings numerous computa-
tional challenges in the context of data collection, storage, and mining. In particular,
learning from data produced from a sensor network poses several issues: sensors
are distributed; they produce a continuous flow of data, eventually at high speeds;
they act in dynamic, time-changing environments; the number of sensors can be
very large and dynamic. These issues require the design of efficient solutions for
processing data produced by sensor networks.
Figure 3.1 shows different home and office scenarios where AXIOM can
help with preventive and interactive maintenance of infrastructures, climate and
temperature management. This management can be remotely controlled helping to
improve the energy efficiency at home, apartments, and company office buildings.
For instance, AXIOM may detect patterns of behavior in a company office building
to adapt climate and light switching to the working way of life of the workers.
We are currently considering a wide range of potential uses both for video-
surveillance and for Smart Home. They range from dynamic retail demand
60 R. Giorgi et al.
The AXIOM platform is architected on the following pillars (see also Figs. 3.2
and 3.3):
P1 FPGA, i.e., large programmable logic for acceleration of functions, soft-IPs,
implementing specific AXIOM support for interconnects and scaling.
P2 General purpose cores, to support the OS and for running parts that make little
sense on the other accelerators.
P3 High-speed, cheap interconnects to permit scalability and deverticalize the
technology, e.g., for toolchains.
P4 Open-source software stack
P5 Lower-speed interface for the cyber-physical world, such as Arduino [5]
connectors, USB, Ethernet, and WiFi
Below we illustrate those pillars more in details.
[P1] In the first phase we will adopt one of the existing solutions such as
the Xilinx Zynq [29] (Zynq is a chip-family, the chip can include a dual ARM
Cortex-A9@1 GHz, [email protected] Gbps to [email protected] Gbps transceivers, low-power pro-
grammable logic from 28 k to 444 k logic cells C 240 to 3020 KB BRAM C 80 to
2020 18x25 DSP slices, PCI express, DDR3 memory controller, 2 USB, 2 Gbe, 2
AXI BUS
“O/S” DRAM
B2B DSM-like HDMI
Controller GPIO
(Board to Board) engine
Arduino
AXIOM-link
“FPGA Sandbox” Shield SHARED DRAM
Connector
Connector
Fig. 3.2 The detailed architecture of the single-node, relying on a Xilinx Zynq chip or a similar
SoC
62 R. Giorgi et al.
SoC1 SoC2
Core1 PL Core1 PL
… …
CoreN CoreN
(GPU) XSM (GPU) XSM
… MEM
… MEM
Fig. 3.3 AXIOM scalable architecture. An instance consisting of two boards, each one based
on the same system-on-chip (SoC). GPU is an optional component. MC memory controller, PL
programmable logic, XSM eXtended shared memory
CAN, 2SDIO, 2 UART, 2 SPI, 2 I2C, 4x32b GPIO, security features, 2 ADC@12bit
1Msps). The reason for the FPGA is to become the central hearth of the board
making possible to integrate all the features, providing customized and reconfig-
urable acceleration of the specific scenario where the board is deployed, providing
the necessary substrate for board-to-board communication. In our roadmap, we
are also considering other options that may be available soon such as the Xilinx
Ultrascale+ [28].
[P2] The general purpose (superscalar) cores can support a number of activities
such as the operating system (system tasks) but also sequential tasks that may need
to be accelerated through Instruction Level Parallelism.
[P3] To keep the cost low we are initially oriented to use the FPGA transceivers
and use a standard and cheap (multiple) connectors such as the SATA connector
(without necessarily use the SATA protocol). Similar solutions had been adopted in
the FORMIC board [18].
[P4] The recent success of SBCs such as the UDOO [19] and RaspberryPi
further demonstrated the need of using open-source software. Linux has already
become a reference example of how open-source software can widen the benefits at
any level. While there is not yet a final consensus on which parallel programming
model is best, we believe that adopting OmpSs [6] can easy the programmability by
providing techniques familiar to the HPC programmer into the embedded computing
community.
[P5] In order to interface with the physical world the platform includes support
for Arduino connectors for general purpose I/O and other standard interfaces such
3 AXIOM: A Flexible Platform for the Smart Home 63
as the USB, Ethernet, and WiFi. Not less important is the capability of interfacing
with sensors and actuators or any other type of external shields as in the Arduino
platform.
Not less important is the possibility of bringing together in a single platform all
those elements and tackling cross-issues, such as a better real-time scheduling, made
possible by the DF-Threads: as the inputs should be available before execution of
the DF-Threads, the system can be more predictable too.
The OmpSs programming model [6] has been introduced with the aim of simpli-
fying the programming of large computing system encompassing heterogeneous
multicore processing elements.
In fact programming models such as MPI are quite difficult for developers that
are not used to parallel programming and porting legacy code is not an easy task. On
the other side, shared-memory systems (such as the nowadays common multicores)
are easier to program as they rely on hardware-based transparent mechanisms in
order to make sure that the machine can exploit the multiple resource, such as
hardware coherence protocols.
AXIOM leverages OmpSs, a task dataflow programming model that includes het-
erogeneous execution support as well as data and task dependency management [4]
and has significantly influenced the recently appeared OpenMP 4.0 specification. In
OmpSs, tasks are generated in the context of a team of threads that run in parallel.
OmpSs provides an initial team of threads as specified by the user upon starting the
application.
Tasks are defined as portions of code enclosed in the task directive, or as user-
defined functions, also annotated as tasks, as follows:
#pragma omp task [clause-list]
{ structured-work |
function-declaration |
function-definition }
A task is created when the code reaches the task construct, or a call is made to a
function annotated as a task. The task construct allows to specify, among others, the
clauses in, out, and inout. Their syntax is
in (data-reference-list)
out (data-reference-list)
inout (data-reference-list)
The information provided is used to derive dependencies among tasks at runtime,
and schedule/fire a task. Tasks are fired when their inputs are ready and their outputs
can be generated.
Dependencies are expressed by means of data-reference-lists. A data-reference
in such a list can contain either a single variable identifier, or also references to
3 AXIOM: A Flexible Platform for the Smart Home 65
3.5.1 OmpSs@FPGA
1
Source to HDL Xilinx tool.
3 AXIOM: A Flexible Platform for the Smart Home 67
branch (“Host C code + Nanos++ runtime call” box in Fig. 3.6). Both the hardware
and the software generation branches are transparent to the programmer.
Figure 3.7 shows a matrix multiply example that has been annotated with OmpSs
directives. This code shows a parallel tiled matrix multiply where each of the tiles is
a task. Each of those tasks has two input dependences and an inout dependence
that will be managed at runtime by Nanos++. Those tasks will be able to be
scheduled/fired to an SMP or FPGA, as it is annotated in the target device directive,
depending on the resource availability. The copy_deps clause associated with
the target directive hints the Nanos++ runtime to copy the data associated
with the input and output dependences to/from the device when necessary.
3.5.2 OmpSs@cluster
OmpSs@cluster is the OmpSs flavor that provides support for a single address space
over a cluster of SMP nodes with accelerators. In this environment, the Nanos++
runtime system supports a master-worker execution scheme. One of the nodes of
the cluster acts as the master node, where the application starts. In the rest of
nodes where the application is executed, worker processes just wait for work to
be provided by the master.
In this environment, the data copies generated either by the in, out, and inout
task clauses are executed over the network connection across nodes, to bring data to
the appropriated node where the tasks are to be executed.
Following the Nanos++ design, cluster threads are the components that allow the
execution of tasks on worker nodes. These threads do not execute tasks themselves.
68 R. Giorgi et al.
They are in charge of sending work descriptors to their associated nodes and
notifying when these have completed their execution. One cluster thread can take
care of providing work to several worker nodes. In the current implementation,
cluster threads are created only on the master node of the execution. Slave nodes
cannot issue tasks for remote execution and thus they do not need to spawn cluster
threads.
In Nanos++, the device specific code has to provide specific methods to be able to
transfer data from the host address space to the device address space, and the other
way around. The memory coherence model required by OmpSs is implemented by
two generic subsystems, the data directory and the data cache, explained below.
Figure 3.8 shows how the different Nanos++ subsystems are organized to manage
the memory of the whole cluster. The master node is the responsible for keeping the
memory coherent with the OmpSs memory coherence model, and also for offering
the OmpSs single address space view. The master node memory is what OmpSs
considers the host memory or host address space, and it is the only address space
exposed to the application. The memory of each worker node is treated as a private
device memory and is managed by the master node.
3 AXIOM: A Flexible Platform for the Smart Home 69
Master node
Host memory
Nanos++
data directory
Nanos++ Nanos++
data cache data cache
Slave 1 Slave N
The data cache component manages the operations needed at the master node
to transfer data to and from worker memories. There is one data cache for each
address space present on the system. Operations performed in a data cache include
allocating memory chunks, freeing them, and transferring data from their managed
address spaces to the host address space and the other way around. Data caches
also keep the mapping of host memory addresses to their private memory addresses.
Memory transfer operations are implemented using network transfers. Allocation
and free operations are handled locally at the master node.
A memory reference may have several copies of its contents on different address
spaces of the system. To maintain the coherence of the memory, the master node uses
the data directory. It contains the information of where the last produced values of
a memory reference are located. With it, the system can determine which transfer
operations must perform to execute a task in any node of the system. Also, each task
execution updates the information of the data directory to reflect the newly produced
data.
The implementation of the network subsystem is currently based on the active
messages provided by the GASNet communications library. In the context of
AXIOM, we will adapt the networking on the communications library provided for
the Zynq platform.
70 R. Giorgi et al.
3.6.1 Methodology
In order to flexibly fit the need of designing both the hardware and the software
of the AXIOM system, we used the COTSon simulator [3]. COTSon can model
the main AXIOM components of Fig. 3.3. Among the important features, COTSon
performs full-system simulation: the designer can run, e.g., an off-the-shelf Linux
distribution and model in a decoupled way the desired functionalities and their
timing behavior. This models a more realistic situation where the OS is interacting
with the user programs: this includes also any interrupts, exceptions, virtual memory
management.
In particular, the key parameters of the modeled cores are described in Table 3.1.
Additionally, the simulator has been extended to support DF-Threads [12]. This
means that the simulator is also modeling the DTS [13], which is implemented on
the programmable logic through the block XSM of Fig. 3.3.
As of the interconnects among SoCs we are currently exploring several options as
offered by the latest technologies. In the COTSon simulator we are performing limit
study experiments assuming that we can achieve enough bandwidth and low latency
at a reasonable cost. This part is explored in detail within the AXIOM project, but
will not be illustrated here.
3.6.3 Experiments
In order to verify the feasibility of running programs not only on the single board
but also on multiple boards thanks to the adopted programming model (OmpSs) and
the underlying runtime system a key point is being able to execute the generated
DF-Threads across the boards. This implies that the memory which is local to each
node (see Fig. 3.2) has to be managed in such a way that it appears as shared.
The XSM block of Fig. 3.2 serves to that goal by bookkeeping the DF-Threads
and by appropriately moving the data where is needed.
We performed two tests to verify that the proposed paradigm can permit the
distribution of the threads while varying matrix size and while varying block size.
We increase the number of SoCs (for simplicity we refer to the single SoC as if
it were a board) and we want to verify if the speedup t1/tN (being t1 the time to
execute the program on a single SoC and tN the time to execute the program on N
SoCs) is close to the ideally linear speedup (Figs. 3.9 and 3.10).
As we can see in Fig. 3.9, as the number of SoCs is increased from 1 to 2 and
then 4, the scalability is particularly good (almost ideal) for higher matrix sizes
(e.g., 320).
We explored the sensitivity to the thread granularity. A larger block size generates
longer DF-Threads to process a matrix block. In Fig. 3.10, we analyzed the situation
for three matrix sizes (n D 400, n D 800) and while the block size b is equal to 10
and 25. When the block size is decreased, more threads are generated, therefore the
parallelism of the computation is higher. In both cases the feasibility of the approach
for distributing threads across the boards is confirmed.
72 R. Giorgi et al.
Speedup (t1/tN)
4
size=400
size=320
size=250
User+Kernel
1
1 2 4 No. of SoCs
(4) (8) (16) (No. of Cores)
Fig. 3.9 Strong scaling for benchmark “Dense Matrix Multiplication” (Square Matrices). Matrix
size varies: 250; 320; 400. Block size is constant and equal to 10. The time used for calculating the
speedup accounts for both the user time and the kernel time
3.7 Conclusions
Speedup (t1/tN)
4
size=800,b=10
size=400,b=25
size=800,b=25
size=400,b=10
2
1
1 2 4 No. of SoCs
(4) (8) (16) (No. of Cores)
Fig. 3.10 Sensitivity of the scaling to the block size of the matrix multiplication benchmark (size
D 400; 800 block-size D 10; 25). When decreasing the block size, more threads are generated
thus increasing the parallelism of the application
References
4.1 Introduction
While the internet was primarily used by human beings a couple of years ago,
a trend shows up, where “intelligent things” use the network infrastructure to
communicate with each other and to exchange data. The aim is to replace the
personal computer, as known in its common form, by something that supports
humans by their daily activities and procedures, without getting perceived directly
[1]. Problematic in this context are the different demands of individual network
nodes regarding the network infrastructure. Efficient communication is affected
by different protocols that are used [2]. To face this challenge, standardization
can help to create preferably huge subnetworks that use a consistent procedure to
communicate. But this method is only meaningful as long as it does not produce
high costs for individual network participants and complexity of the standard
is in a balanced relation to the obtainable benefit. This is not at least related
to the energy that is consumed for the standard-compliant communication. The
connection of basic sensors, e.g., window or door contact switches in the smart
home, would be reduced to absurdity, when a high-cost communication medium,
as, for example, Ethernet is used. High acquisition and operating cost would be the
result. Hence, utilizing a common interface for communication is meaningful only
when requirements of the individual network participants are compatible with the
targeted standard. At this, it should get clear that value has to be attached to the
interconnection of subnetworks via gateways. To enable the communication across
the subnetworks, gateways must be deployed where standardization is not a means
to an end. As the complexity of this consideration, especially for huge networks, is
not negligible, new technologies have to be developed that allow the exploration of
this issue. Particularly to avoid problematic cases which are difficult to investigate
in a real world environment, simulation techniques need to be developed that allow
a safe but accurate observation.
Subject of this paper is the introduction of a concept that starts by developing
a basic gateway. Over the course of time, it can be transferred to a simulator for
the Internet of Things (IoT). To achieve this, the network simulator OMNeTCC is
introduced that can be utilized for the research on the communication infrastructure.
But the target of the paper is not only the simulation of Ethernet networks; it rather
introduces a technique to simulate different communication standards in the IoT.
It further should be made clear that the presented concept is not limited to an
enclosed simulation. If real hardware components, e.g., sensors and actuators are
available, they can be integrated in the simulation environment. This Hardware in
the Loop (HiL) can essentially increase quality and significance of the results, as the
output is not based on probably inaccurate models of the periphery. Furthermore,
HiL enables the analysis of components that are not available at an early stage
of the development cycle. By using the proposed simulation environment, virtual
devices can exist among their physical counterparts. A framework that allows
the easy extensibility of IoT networks is of high importance and HiL can enable
a rapid prototyping. But there are drawbacks. Especially in large networks, the
synchronization between nodes is an important aspect. The presented work enables
further analysis on synchronization techniques between the physical devices and
the HiL environment. Metrics regarding power consumption [3] and performance
[4] can also be considered and analyzed, allowing easy measurements in the entire
environment.
The paper is structured in the following manner: Sect. 4.2 introduces the network
simulator OMNeTCC. Section 4.3 gives an overview of related work. In example
of the EU project “RADIO,” introduced in Sect. 4.4, the requirements of mobile
robot platforms to the communication infrastructure are presented and it is shown,
how to deal with these challenges. The concept of the IoT simulation can be found
in Sect. 4.5. It starts with an introduction to the idea, including the consideration of
HiL and is transferred to a case study, presented in Sect. 4.6. The paper concludes
with Sect. 4.7.
4.2 OMNeTCC
OMNeTCC allows the discrete event simulation of computer networks and other
distributed systems [5]. With the target to model large networks, the CCC based
project tries to fill the gap between research-oriented simulation software and
expensive commercial alternatives, such as OPNET, which is now part of Riverbed
Technology [6]. OMNeTCC allows the hierarchical organization of simulation
models. The number of layers is hereby not limited. This modular structure supports
clarity and facilitates the work with the simulation system. Processes within the
4 Internet of Things Simulation Using OMNeTCC and Hardware in the Loop 79
virtual network can be visualized via a graphical user interface. This includes the
illustration of network graphics, data flow charts, and the possibility of observing
objects and variables during simulation. In OMNeTCC, the structure of the model
is defined using network description (NED) files. Here, parameters are defined for
the individual modules and also their connection to other modules and submodules
is specified. To efficiently manage large networks, definitions can be split into
separate NED files. It is also possible to define parameters for the respective
topologies. In this point, OMNeTCC is distinguished from other graphical editors,
as it is not limited to fixed topologies. The topology is rather modifiable even during
runtime. The user optionally can edit the NED files either via a graphical user
interface or based on text files. OMNeTCC includes a library that can be used for
the CCC based programming of the modules. It has to be differentiated between
two possible implementations: On the one hand, co-routine based programming
generates a thread for each module where the program code is executed. The
respective thread gets the control from the simulation kernel, when a message
arrives. In this case, a thread usually never returns; an infinite loop within the
module continuously handles incoming and outgoing messages. On the other side,
event-processing calls the module-function with the message as a parameter. Here,
the function immediately returns after processing. Event-processing is feasible
especially for extensive simulations, as not every module needs to have its own
CPU stack and memory requirements are reduced. In the context of this paper,
OMNeTCC is used, as it has the following benefits compared to the related work:
• OMNeTCC is extensible. CCC program code can be used to describe func-
tionality of the respective modules. Furthermore it is possible to integrate
OMNeTCC in larger applications by replacing its user interfaces.
• OMNeTCC already contains protocol models like TCP/IP, ATM, and Ethernet.
• The graphical user interface Tkenv supports modelling of complex networks.
• OMNeTCC was developed for the simulation of extensive networks.
• As OMNeTCC is open source, functionality of every part of the simulation can
be comprehended.
Not at least when considering healthcare under the IoT paradigm, the importance
of suitable simulation capabilities becomes clear. The authors of [8] present SimIoT,
a toolkit that can be used to enable experiments on the interactions within an
IoT scenario. As monitoring health is an important aspect in the RADIO project,
presented in Sect. 4.4, SimIoT is relevant in context of the OMNeTCC based
approach presented in this paper.
In context of wireless sensor networks, several approaches exist to simulate these
complex environments. OBIWAN [9] is one of those simulators, focusing on cross-
layer dependencies and the challenges of large networks that are not sufficiently
handled by many of the available simulation tools. The authors present a case study
with several thousand nodes, demonstrating the usage of their simulator in large
networks. OBIWAN is based on OMNeTCC.
There are ambitions to create standards for the interconnection of smart home
devices. When a single device is used to manage the communication within the
smart home, the whole network is vulnerable. The “Thread Group,” as an example,
tries to overcome this issue by creating a networking protocol that encourages the
development of the IoT [10]. Amongst others, the proposed standard is simple to
use, power efficient, and has no single point of failure.
In this context, the Mediola gateway must be mentioned [11]. Its great advantage
is the combination of different smart home products to flexibly automate the
living environment. The consumer can control the different technologies using a
smartphone app. However, the Mediola gateway exactly represents the single point
of failure that was mentioned above.
This paper by contrast presents a framework that also provides gateway function-
ality, but in a decentralized manner. The simulation allows the translation between
different communication technologies, but is not dependent on a single device.
A strategic research roadmap for the IoT is presented in [12]. The authors
mention the challenges of numerous heterogeneous components and emphasize the
need for innovative design frameworks, inspired by HiL. However, HiL is often used
in the context of automotive applications [13–15], but has only minor importance in
the IoT simulation.
To the best of the authors’ knowledge, there is no flexible simulation environment
for the IoT that combines decentralized gateway functionality with HiL, enabling
the design and analyses of large networks.
As demography changes and the population of elderly grow, new paradigms have to
be invented to face the challenges of the increasing life expectation. Dealing with
chronic diseases results in the need for long term care and innovative technologies to
overcome this issue. The classical institutional care hits the brick wall under these
challenges as several problems occur, not at least resulting in high costs. Modern
information and communication technology (ICT) offers new solution approaches.
4 Internet of Things Simulation Using OMNeTCC and Hardware in the Loop 81
The project “RADIO,” funded by the European Union’s Horizon 2020 research and
innovation program, shows up a way to support elderly in their homely environment
[16]. RADIO, as short for “Robots in Assisted Living Environments: Unobtrusive,
efficient, reliable, and modular solutions for independent ageing” is based on
the four main dimensions user acceptance, integrated and power-aware data
collection—transmission—processing, user interfaces, and architecture. It is the
triggering event of the approach presented in this paper and targets the integration
of smart home technology and robotic in ways that the user perceives the technical
equipment as a natural component, as part of the daily life. Hence, a robot gradually
becomes as ordinary as, for example, a radio. To succeed in this challenge, novel
approaches to unobtrusiveness and acceptance need to be developed and transferred
to a system that satisfies the need for integrated smart home technology together
with assistant robot platforms. Instead of utilizing discrete sensing equipment,
RADIO rather uses a robot as a mobile sensor for health monitoring. This robot,
however, presents special challenges to the ICT as it is mobile.
In the context of this paper, the information technology needs to be capable of
handling difficulties regarding the wireless connection. Concepts must be developed
that deal with disturbances and disconnection, where data gets delivered delayed
and possibly from a completely different spatial location. For this purpose, it is
necessary, that suitable data buffers are available and that their integration in the
network can be analyzed. Hence, a framework for the simulation of IoT networks,
as conceptual introduced in this paper, is beneficial insofar, as complex processes
can be broken down. Concepts for problem solving can be developed and transferred
to the final application.
4.5 Concept
OMNeTCC enables the simulation of large networks and allows the integration of
HiL by design. The main challenge of connecting physical devices is its integration
to the scheduling mechanism of the simulation environment. OMNeTCC therefore
provides a real time scheduler that can be extended by the user. The socket
example that comes with the installation of OMNeTCC demonstrates how external
applications can get access to the simulation environment: An extension of the real
time scheduler opens a TCP/IP socket listening on port 4242. The user can connect
to this server with a web browser. The respective HTTP request is visualized in the
GUI and shows how data is transferred via the internet to the web server and then
sent back to the client. This example sufficiently demonstrates how the interaction
between HiL, in form of the client requesting a website, and the scheduler is
performed. It also shows that this integration uses a single entry point, in form of the
extended scheduler, to connect the two environments, the physical and the virtual
world. According to this, the question comes up on how multiple hardware devices
can be added to the simulation at different entry points. In case of IoT devices,
that could mean that different sensors and actuators need to connect to different
82 P. Wehner and D. Göhringer
nodes in OMNeTCC. The socket example does not provide information to face
this challenge, as it only shows how a single external device, the web client, can be
integrated to the simulation environment. To understand this issue it must become
clear that OMNeTCC gets informed about the modified scheduler by an entry in
the initialization file of the respective simulation. As this entry is a general item,
the drawback is that this information affects the entire simulation and hence it is
not possible to provide a second scheduler for a second HiL device this way. This
naturally makes sense as only one scheduler can handle the simulation process. It
is therefore required to develop a mechanism that allows the integration of multiple
external devices, on different network nodes, using only one extended version of the
scheduler. The approach presented in this paper is based on callback functions that
are consecutively invoked by the scheduler. Hence, each node, connecting physical
devices to the simulation environment, must provide a method that informs the
scheduler about relevant events that need to be included in the simulation flow. The
following subsections show how this mechanism is realized in detail.
The interfaces to the external hardware devices are provided in the form
of a shared library. In OMNeTCC, a shared library is created by invoking
opp_makemake with a --make-so flag. It mainly consists of the two func-
tions: virtual void handleMessage(cMessage *msg) and static
cMessage *interfaceFunction(cModule *module, cMessage
*notificationMsg, simtime_t t, cSimulation *sim), whereas
msg is a pointer to the message that must be processed, module is a pointer to the
module that contains the callback function, t is the current simulation time, and
sim is a pointer to the simulation manager object. interfaceFunction() is
the callback function that is assigned to setInterface() of the gateway real
time scheduler class. Its task is to check whether an event of the respective HiL
device needs to get considered by the simulation. The task of handleMessage()
4 Internet of Things Simulation Using OMNeTCC and Hardware in the Loop 83
can be described as follows: The function is called every time a message is present
at the respective module. This message can be (a) an external message coming from
a distant module, (b) the so-called self message that is sent and received within the
same module, or (c) the message that was handed over to the scheduler to inform
the appropriate module about HiL events. Hence, handleMessage() consists of
the following distinction of cases:
if (msg->isSelfMessage()) f
// handle self message
g else if (msg DD hilEvent) f
// handle HiL event
g else f
// handle message from distant module
g
4.5.3 Messages
0x1
123
1
.xml .xml
Fig. 4.1 Message translation example
84 P. Wehner and D. Göhringer
<ir>
<item posD’0’>
<fixed>0x1</fixed>
</item>
<item posD’1’>
<variable>
<uint8>id</uint8>
</variable>
</item>
<item posD’2’>
<bool>
<variable>state</variable>
</bool>
</item>
</ir>
It says that the IR contains the value for the “state” variable at position 2. Using
this information, the destination node can translate the information of the IR to the
format that must be transferred to the wall plug interface.
The presented format of the IR was selected as OMNeTCC supports this
structure in its message files. For the case study, presented in the next section, the
following object is used:
message GatewayMsg
f
int source;
int destination;
int payload[];
g
The integer variables source and destination contain the ids of the sender
and receiver node respectively. Payload is an array that consists of the values of
the IR.
4 Internet of Things Simulation Using OMNeTCC and Hardware in the Loop 85
OMNeTCC provides functions for its dynamic allocation. Adding a new entry
is done as follows:
int oldSize D msg->getPayloadArraySize();
msg->setPayloadArraySize(oldSizeC1);
msg->setPayload(oldSize, newEntry);
The case study shows how HiL can be added to OMNeTCC using the modified
scheduler. There are different techniques on how real hardware can interface with
the simulation environment. Using vendor-specific USB dongles, e.g., for Z-Wave
communication is one option to enable the data transfer between the respective
node and the actual IoT simulator. For the first version of the framework presented
in this paper, simple TCP/IP sockets are used as they provide a high degree of
flexibility. Therefore, two Raspberry Pis, acting as interfaces, are used to manage the
communication on the sender and receiver side. Each Raspberry Pi has a connection
to the OMNeTCC simulation environment via Ethernet. The case study implements
the concept visualized in Fig. 4.2. Therefore, an EnOcean energy harvester [17] is
connected to the first Raspberry Pi using the so-called EnOcean Pi add-on module
[18]. It enables the Raspberry Pi to read incoming EnOcean messages via Universal
Asynchronous Receiver Transmitter (UART). The Raspberry Pi connects to the
socket, opened by the EnOcean interface that was added to OMNeTCC. On the
receiver side, a Z-Wave module, RaZberry [19], connects the second Raspberry Pi
and a Z-Wave wall plug [20]. When the EnOcean switch gets pushed, a message
is transferred via Ethernet to the OMNeTCC simulation where it is wrapped into
the message object presented in the previous section. The respective switch-state is
added to the payload array and then sent to the receiver node, where the message is
transferred to the wall plug using the second Raspberry Pi.
Ethernet
enOcean
Z-Wave
EnOcean
Ethernet
zWave
Raspberry Pi
EnOcean Switch
The case study currently does not include the implementation of the XML trans-
lation mechanism. In future releases of the presented approach, the data exchange
between the sensors and actuators and the actual IoT simulation framework will be
improved and further analyses results will be presented.
4.7 Conclusion
This work in progress paper provides the basis for an IoT simulation environ-
ment including HiL. The network simulator OMNeTCC is used to model the
infrastructure between virtual and physical nodes. By extending its scheduler,
extendibility with further HiL devices is enabled. Although it is too early to present
further simulation results, the authors believe that the presented approach can
help to encourage the research on IoT platforms to face the upcoming challenges,
including the simulation and analysis of distributed and ubiquitous computing. As
OMNeTCC was designed to model large networks, it is suitable for the simulation
of future smart environments. The key to success is hereby the consideration of
physical hardware in the virtual environment, as a simulator is not a universal
solution and might fail in cases where real world data is required to gain feasible
results.
The presented approach moreover features the functionality of a gateway,
where the translation between different communication standards is not limited
to a specific device. By using the intermediate representation, a decentralized
mechanism is developed that transfers relevant data to the respective node where
it is translated to the final communication standard.
In future, effort will be invested to rework the data flow from multiple sources
to multiple destinations in complex networks. In example of a smart home envi-
ronment, it will be demonstrated how the simulation of not available sensors and
actuators can be handled by the presented framework. Also security aspects will be
taken into account. Currently, no specific OMNeTCC library, like iNet, is used to
model the network. In future versions of the presented approach this will become an
essential part of the IoT simulator.
Acknowledgments This project has received funding from the European Union’s Horizon 2020
research and innovation programme under grant agreement No 643892.
References
Sofia Meacham
5.1 Introduction
S. Meacham ()
Bournemouth University, Fern Barrow, Poole, Dorset BH12 5BB, UK
e-mail: [email protected]
analysis processes (Sect. 5.2.2) as well as the resulting high-level system design
(Sect. 5.2.3). The section will finish by identifying the adaptivity requirements
(Sect. 5.2.4). In Sect. 5.3, the proposed pattern-based approach will be presented
with dedicated subsections for the patterns that have been applied (Sects. 5.3.1.1,
5.3.1.2, and 5.3.1.3). The resulting system design and implementation will be
presented in Sect. 5.3.2. In Sect. 5.4, problems that have identified from the above
requirements/design/implementation path will be analysed along with proposed
solutions. In Sect. 5.5, the conclusions and directions for further research will be
discussed.
This case study was set in collaboration between Bournemouth University and the
Technological Educational Institute of Western Greece (TWG), the Embedded Sys-
tem Design and Application Laboratory (ESDA lab) of the Computer Engineering
and Informatics Department. Specifically, the TWG/ESDA Lab has long-lasting
expertise in IoT applications and assisted living systems. The example of their
ambient assisted living (AAL) laboratory in Patras provided significant input to this
work.
Specifically, in this case study, we are considering the requirements gathering
and analysis, system design and implementation for an indoor/outdoor fall-detection
AAL system for a UK care home.
The system will automatically detect various elements of fall-detection such as
the elderly person moving out of the care home or the garden area, detection of no
movement for an extended period of time (8 h) or a sudden acceleration such as
a fall.
General medical information needs to be kept using electronic means so that
patients, their relatives and medical professionals (doctors, nurses and carers) can
access/update and consistently maintain. Security and privacy issues should be
maintained for medical data and each user of the system should have different
privileges in using the stored information. The data should be handled according to
the relevant UK data protection act and ethics rules and considerations for medical
information.
The medical professionals (nurses, carers) should have access to the system for
observing the level and recharging the batteries of the fall-detection system.
Also, the elderly person should be able to have a choice of communicating
directly with corresponding carers, nurses, relatives in addition to the automatic
alarms.
5 Towards Self-Adaptive IoT Applications: Requirements and Adaptivity. . . 91
In the case of a false automatic alarm, the elderly person should be able to
designate that the alarm was false through an appropriately designed interface.
Last but not least, a major requirement for the future would be to add to the
system ‘intelligent’ behaviour wherever appropriate. For example, in case a fall
is detected, monitoring mechanisms should be increased in order to obtain more
information about the criticality of the incident and the patient’s medical condition.
«requirement» «requirement»
Case Study Fall-detection
Requirements Specification
Specification «trace»
Text=”...”
Text=”...” Id=”SS1”
Id=”CS1”
requirements diagrams with the traditional use case modelling was deliberate and
offered a variety of views to the system requirements. Use cases provide the
actor-based description of the system [12] whereas requirements diagrams give a
diagrammatic view that connects requirements with block diagram implementa-
tions, offering a path to traceability/verification as well as providing relationships
between requirements.
In Fig. 5.1, we can see a high-level requirements diagram that consists of three
main categories of requirements: Monitor Environment, which is used to monitor
movement, location and battery levels; Alert Environment, which creates an alert
for five cases (manual alert, fall-detection, no movement detection, out of range and
low battery) and Operating Environment, which can be indoor, outdoor and 24/7
operating system.
In Fig. 5.2, the corresponding high-level SysML block diagram of the system is
presented. A one-to-one correspondence between the requirements in the previous
diagram and the blocks in this diagram is apparent. In addition to this, the ‘flow’ of
events is depicted. The Monitor block monitors the system (Operating Environment
block) and when something abnormal is detected it raises a Trigger to the Alert
block. The Alert block (depending on the specific Trigger that was raised) decides
on the required adaptation and sends an Adapt signal to the Operating Environment
to perform the changes.
5 Towards Self-Adaptive IoT Applications: Requirements and Adaptivity. . . 93
«block» «block»
Alert Environment Operating Environment
Adapt
parts
parts
:Manual Alert
:Indoor Operation
:Fall
:Outdoor Operation
:OutofRange
:24/7 Operation
:LowBattery
«block»
Monitor Environment
Trigger Monitor
parts
:Movement
:Location
:Battery
From the above block diagram, the similarity between our system and the IBM
MAPE-K control loop model [13] for adaptivity is apparent.
In Fig. 5.3, the correspondence between the two models is depicted. The
MAPE-K model consists of a monitor that observes the system and the environment
(the Monitor Environment in our case), an analyser that analyses the monitoring
results, a planning component that decides on an appropriate adaptation action (Alert
Environment) and an execution component that executes the chosen adaptation
action (Alert Environment, changes in the Operating Environment).
Adaptivity is a very important aspect in our fall-detection system and in IoT
applications in general.
There are two types of adaptation: design-time adaptation and run-time adapta-
tion. The design-time adaptation is the simplest form of adaptation and consists of
94 S. Meacham
mechanisms that are known at design time. For example, our current fall-detection
system is designed with design-time adaptation. If a fall, no movement, manual alert
or low battery is detected, then it triggers an alert, and the system responds according
to the predetermined way. For design-time adaptation, case-based reasoning (which
consists of a set of if-then-else statements) can predetermine the system’s reaction
to different situations.
On the other hand, run-time adaptation consists of the dynamic adaptation of the
system according to situations that are discovered at run-time. For example, when
a fall is detected, a medical professional might wish to add more sensors to collect
data for the patient’s health. Which sensors to activate could be given as an option
to the medical professional or could be predetermined in a case-based reasoning
way. In any case, the system should be able to detect that it should change itself and
specifically, the monitoring mechanism should, for example, move from monitoring
only movement to monitoring blood pressure and heart rate.
Also, there are different levels and abilities for run-time adaptation that range
from cases that can be predicted and the adaptation possibility is inherent in the
system (that can be classified as design-time adaptivity) to cases where unpre-
dictable events occur and the system is able to handle them (this is the real run-time
adaptivity). The second case belongs to the field of artificial intelligence and its
methods and is outside the main scope of this paper.
In the following sections, we will present a pattern-based approach to modelling
design-time and run-time adaptivity.
Note that the current fall-detection systems and the system we have developed for
our case study belong to the design-time adaptation type. The run-time adaptation
development is part of our future plans.
For modelling the patterns for our application, SysML block diagrams were
chosen for compatibility with the rest of our system design. Note that most of the
patterns were originally described in UML.
In Fig. 5.4, we can see the Adaptation Detection Pattern [15] applied to our case
study. This consists of an Observer block, which has the responsibility to ‘observe’
the data that are being produced by the Sensor. These Data are stored so that they
get interpreted by the Observer. The Observer can either work on the stored data
or get data directly from the Sensor. The amount of data that are normally being
produced by a Sensor (such as motion sensor) is quite huge and storing them is the
easiest way to allow their processing. In the system, we have several Observers,
one for each Sensor dealing with fall-detection, no movement detection, out of
range, low battery and manual alert which are part of our fall-detection system
1 produces
Analyser = algorithm used to
define if there is a problem or not,
most of the times we compare with «block»
threshold values Sensor
operations
pull():Data
push():Data
In Fig. 5.5, we can see the Case-based Reasoning Pattern [15] applied to our case
study. The case-based reasoning is the simplest reconfiguration mechanism and is
applied when the criteria for reconfiguration is not complex and can be expressed
through if-then-else statements. The central block for this pattern application is
the InferenceEngine which reacts according to a raised Trigger (fall-detection, no
movement, low battery, etc.) and applies the corresponding set of Rules. The Rules
that apply tie together Trigger and Decision. In the original pattern description, the
system can store the Triggers and make the Rules to learn. However, in our case
«block» «block»
InferenceEngine Decision
1 1..*
«block» «block»
FixedRules 1 Rule
1..*
operations operations
apply(e:Trigger):Rule cause:Trigger
action:Decision
1
Note that the name HealthIndicator came from the original pattern used and not from our case
study health-care application and it refers to the health of the observed data.
5 Towards Self-Adaptive IoT Applications: Requirements and Adaptivity. . . 97
«block» «block»
Alert Environment Operating Environment
Adapt
parts
parts
:Manual Alert
:Indoor Operation
:Fall
:Outdoor Operation
:OutofRange
:24/7 Operation
:LowBattery
«block»
Monitor Environment
Trigger Monitor
parts
:Movement
:Location
:Battery
study, we decided not to add any learning capabilities as that would increase the risk
of mistakes/failures which is particularly important for critical applications such as
fall-detection.
It is important to note that this pattern is not directly related to adaptivity. However,
its application is vital for the resulting system design and implementation.
In Fig. 5.6, we can see the Centralised Architecture Pattern applied to our case
study. The original pattern proposed in [6] was referring to centralised architectures
for SoS and contained a central block that would control everything. In our case,
the central block is a Base Station that communicates with the major blocks in the
system. The Alert and Operating Environment blocks directly communicate with
the Base Station in order to handle alerts and perform adaptations. The Monitor
block doesn’t seem to require communications with the Base Station in the current
version of our system as the monitoring mechanisms are static (polling information
from sensors).
In Fig. 5.7, the corresponding low-level SysML BDD of the system is presented
and gives us an idea of the building blocks that are required to perform the basic
operations of the system.
98 S. Meacham
0..*
Medical Personnel
«block»
0..* Fall-detection
System 0..*
Resident
Relative
«block»
MII
Central Block Monitoring, Alert
values
«block» username:String «block» «block»
Base Station password:String Device Batteries
operations
login() «block»
viewInformation() Alarm Button
editInformation() «block»
parts Movement Sensor
:button
parts
«block»
operations :MovementSensor
BS Communicator «block»
pressButton() :accelerometer
Device
parts Communicator values
:speaker «block» speed:metre/s
«block» «block»
:microphone Alarm Cancellation parts time:hours
GPS Map GPS Tracker
Button :speaker
operations :microphone
startCall() parts parts values
endCall() :residentLocation :button unit:miles operations
rerouteCall() Latitude:degrees rerouteCall()
values operations Longtitude:degrees
unit:yards pressButton()
ResidentName:String operations
trackLocation()
geoFencing()
As a whole, three parts make the Fall-detection System function: a Base Station,
Devices and a Medical Information Interface (MII). These directly related to the
centralised architecture pattern diagram of Fig. 5.6, where the Central Control block
(Fig. 5.6) corresponds to the Base Station block (Fig. 5.7), the Monitoring/Alert
Environment blocks (Fig. 5.6) correspond to the Device block (Fig. 5.7). The
Operating Environment block of Fig. 5.6 corresponds to the whole diagram of
Fig. 5.7.
The physical device is a wearable necklace, pendant or wristband assigned to
a single resident in a care home. This device will contain a Movement Sensor,
Batteries, Device Communicator, GPS Tracker and an Alarm Button for manual
alerts. The Movement Sensor block uses an accelerometer and a movement sensor
to monitor and detect abnormal movement. When abnormal movement is detected,
an alert is automatically sent to the Base Station block for the medical personnel
to respond. The GPS Tracker monitors the location of the device in real time and
this information is updated on the Base Station. The Device Communicator allows
conversation between medical personnel and the elderly relative. It consists of both
a microphone to speak through and a speaker to listen. The Device will contain
Batteries which are rechargeable. When a battery is below 5 %, an alert is sent to
the Base Station to inform the medical personnel that the battery needs changing.
The Base Station will act as a central communication point for all devices. The
Base Station will have a BS Communicator which also consists of a microphone
5 Towards Self-Adaptive IoT Applications: Requirements and Adaptivity. . . 99
and a speaker. The Base Station will also allow the medical personnel to view the
location of any resident. The Base Station will also allow the medical personnel to
cancel the alarm if it is not deemed an emergency situation or a situation has been
dealt with.
The Medical Information Interface (MII) stores all medical information of each
resident and can be accessed by all actors: access is controlled by an appropriate
access control system. For example, the relatives shouldn’t be able to modify
medical records. All the corresponding UK laws should apply.
Most popular systems in the market such as Alert 1 [16], Life Call [17] currently
address only some of the above features. In particular, outdoor fall-detection is an
area that is missing from most current fall-detection systems.
There are several problems with our case study and the current fall-detection
systems that are in the market.
First of all, a centralised architecture that assigns all system control to a single
block, the Base Station in our case, will inherently cause problems. By centralising
control, we are creating a single point of failure for the system. If the Base Station
fails, then the whole system will fail. Consequently, a more decentralised approach
is required.
For the decentralisation problem, patterns that have been proposed in [18] and in
[15] should be taken into account. For example, the Decentralised Reconfiguration
Pattern could be applied to enhance the operation of the Base Station. This pattern
allows for a decentralised approach to be adopted for client–server architectures.
In our case, the Base Station acts as a server to adaptation requests and a
decentralisation of its operation would remove it from its current single point of
failure operation.
Another problem that arises from our case study is the use of polling sensor
information as a monitoring mechanism. Polling for information is a continuous
monitoring mechanism that has been used in computing architecture for more than
twenty years and has always been accused for its high cost in time and processing
power. It can be replaced with event-based mechanisms where appropriate. Event-
based mechanisms, however, have the overhead of the extra logic required to create
and handle the events.
There are several patterns that could be applied to improve and replace at times
the polling monitoring. For example, in our case study, the polling of sensor infor-
mation should be applied to the real-time fall-detection part of the system, but for
collecting general health-related patient information such as blood pressure or blood
sugar levels that would be useful for general patient monitoring, passive monitoring
100 S. Meacham
could be applied. With the term passive monitoring, we mean the case when
notifications are sent when a change occurs. The most appropriate pattern for this
type of monitoring is the Content-based Routing Pattern. With the content-based
routing pattern, we route messages across a distributed monitoring infrastructure
based on the content of the message. Clients such as medical professionals or
relatives subscribe to feeds that they are interested in (e.g. monitoring blood sugar
levels in diabetic patients) and they get notifications when there is information
generated. This way, they don’t have to monitor all feeds and unnecessary traffic
is avoided.
Another monitoring mechanism that needs to be explored is the application of the
Sensor-factory Pattern. This pattern is still based on the polling from sensors type
of communication; however, this adds a new dimension of flexibility by enabling
the dynamic addition of new sensors when and where required. For example, in an
emergency situation, we might want to activate more sensors in order to monitor the
patient more closely before the emergency services are in place.
From the above scenarios, it is apparent that there is an increasing trend
to dynamically change monitoring mechanisms at run-time in order to adapt to
changing environmental conditions and requirements, and consequently alternate
appropriately between the adaptivity detection, sensor-factory and content-based
routing monitoring patterns.
The ability to dynamically change monitoring mechanisms is provided by
another pattern, the Reflective Pattern. It is applicable in situations where we cannot
directly observe the internal properties of a component, due to visibility constraints
such as encapsulation or security purposes, and when we want to change the
monitoring mechanism at run-time without affecting the corresponding client. Two
intermediate objects are inserted for this purpose: one is the Metaobject that contains
information about an object; second is the Proxy that, by using the Metaobject
provides a transparent mechanism to intercede during an object’s normal behaviour
and introduce additional behaviour at run-time. It has originated from (and can be
supported by) programming languages with reflective capabilities such as Java, PHP
and Python leading to the use of self-improving software [19].
The proposed method has been evaluated as regards to the compliance of the
designed system with the original requirements and the quality of the final product.
The pattern-based approach offered the general advantages of reusing existing
solutions and tailoring them to the specific application problem. The alternative
would have been to use one of the existing frameworks for adaptation such as
Rainbow [20]. However, that would give us a more restricted solution that would
be difficult to adapt to our requirements, to future requirements and more often than
not would be domain specific.
5 Towards Self-Adaptive IoT Applications: Requirements and Adaptivity. . . 101
On reflection, the system we designed and developed through this approach was
effective as regards to satisfying the fall-detection case study requirements. By
applying three adaptive patterns, we included all the necessary functional parts of
monitoring, alerting and adapting, in a controlled and methodological way.
Two of the patterns that we used (Adaptivity Detection, Case-based Reasoning)
contained inherent scalability and reusability properties. They were designed to
be used repeatedly for more than one monitor/trigger pairs and if-then-else cases,
respectively. For example, the adaptivity block was ‘reused’ for both the case of
movement sensors and no movement trigger pair and for the battery level sensor
and low battery trigger pair. This applies at the design level. At the lower imple-
mentation level, every part was a separate block though. However, reusability and
scalability at the design level is an invaluable property for designing and developing
systems as can be observed by the tremendous amount of work by industries in
techniques such as product line engineering and variability modelling [21].
Our future plans to extend this work involve applicability of the run-time adap-
tivity patterns in the fall-detection IoT application as well as in other application
areas. Formal methods should also be explored as regards to adaptivity properties
to complement and enhance this work as especially for the IoT application domain,
real-time and safety-critical properties are fundamental requirements.
Last but not least, we believe that new frameworks for the future IoT should
be built that would be combined and informed with patterns and that will have
adaptivity requirements as a central point both for the systems to be designed and
the frameworks themselves in order to conform to the changing requirements of the
changing IoT applications of the future.
References
1. World Health Organization, Ageing and Life Course Unit. WHO global report on falls
prevention in older age (World Health Organization, 2008)
2. M. Mercuri, C. Garripoli, P. Karsmakers, P.J. Soh, G.A. Vandenbosch, C. Pace, P. Leroux,
D. Schreurs, Healthcare system for non-invasive fall detection in indoor environment. In
Applications in Electronics Pervading Industry, Environment and Society (Springer, 2016), pp.
145–152
3. Q. Dong, Y. Yang, W. Hongjun, X. Jian-Hua, Fall alarm and inactivity detection system design
and implementation on Raspberry Pi. ICACT 2015, 17th IEEE international conference on
advanced communications technology, July 2015, pp. 382–386
4. F. Busching, H. Post, M. Gietzelt, L. Wolf, Fall detection on the road. 2013 IEEE 15th
international conference on e-health networking, applications and services (Healthcom), IEEE,
Oct 2013, pp. 439–443
5. C. Alexander, The Timeless Way of Building, vol. 1 (Oxford University Press, New York, 1979)
6. S. Perry, Final report on SoS architectural models. Document Number: D22.6. COMPASS FP7
EU Project public deliverables (2014). http://www.compass-research.eu/Project/Deliverables/
D22.6.pdf. Accessed 9 Feb 2016
7. INCOSE, Systems engineering vision 2020, v.2.03 (2007), http://oldsite.incose.org/
ProductsPubs/pdf/SEVision2020_20071003_v2_03.pdf. Accessed 9 Feb 2016
8. Papyrus, Papyrus (2016), https://eclipse.org/papyrus/. Accessed 9 Feb 2016
102 S. Meacham
9. T. Bouabana-Tebibel, S.H. Rubin, M. Bennama, Formal modeling with SysML. 2012 IEEE
13th international conference on information reuse and integration (IRI), IEEE, Aug 2012, pp.
340–347
10. L. Apvrille, Y. Roudier, Designing safe and secure embedded and cyber-physical systems with
SysML-Sec. In Model-Driven Engineering and Software Development (Springer, 2015), pp.
293–308
11. S. Robertson, J. Robertson, Mastering the requirements process: getting requirements right,
3rd edn. (Addison-Wesley, Upper Saddle River, NJ, 2013)
12. D. Kulak, E. Guiney, Use Cases: Requirements in Context (Addison-Wesley, 2012)
13. J.O. Kephart, D.M. Chess, The vision of autonomic computing. Computer 36(1), 41–50 (2003)
14. J. Vlissides, R. Helm, R. Johnson, E. Gamma, Design Patterns: Elements of Reusable Object-
Oriented Software (Addison-Wesley, Reading, MA, 1995), p. 11
15. A. Ramirez, Design Patterns for Developing Dynamically Adaptive Systems, 1st edn. (Google
Books, 2008)
16. Medical Alert Systems j Medical Alert Services for Seniors - Alert1® (2016), https://www.
alert-1.com/. Accessed 9 Feb 2016
17. Medical Alert Systems with FallAlert™ 24/7 Medical Alert Systems (2016), http://lifecall.
com/. Accessed 9 Feb 2016
18. D. Weyns, B. Schmerl, V. Grassi, S. Malek, R. Mirandola, C. Prehofer, J. Wuttke, J. Andersson,
H. Giese, K.M. Göschka, On patterns for decentralized control in self-adaptive systems. In
Software Engineering for Self-Adaptive Systems II (Springer, Berlin Heidelberg, 2013), pp.
76–107
19. R.V. Yampolskiy, Analysis of types of self-improving software. In Artificial General Intelli-
gence (Springer International Publishing, 2015), pp. 384–393
20. D. Garlan, S.W. Cheng, A.C. Huang, B. Schmerl, P. Steenkiste, Rainbow: architecture-based
self-adaptation with reusable infrastructure. Computer 37(10), 46–54 (2004)
21. S. Meacham, F. Gioulekas, K. Phalp, SysML based design for variability enabling the
reusability of legacy systems towards the support of diverse standard compliant implemen-
tations or standard updates: the case of IEEE-802.15. 6 standard for e-Health applications. In
Proceedings of the 8th International Conference on Simulation Tools and Techniques (ICST—
Institute for Computer Sciences, Social-Informatics and Telecommunications Engineering,
Aug 2015), pp. 284–289
Chapter 6
Small Footprint JavaScript Engine
6.1 Introduction
when msgTurnOn occurs, turning the bulb on by calling the device managing
function bulb.on().
1 (function process() {
2 var time = 0;
3 bulb.addEventListener(“timer”, function f() {
4 if(!movementSensor.getValue()) {
5 if (time ++ > 10000) bulb.off(); }
6 else { time = 0; bulb.on(); }
7 });
8 })();
(JSC), a JavaScript engine for WebKit, takes over tens of MB in flash memory
with much higher than 100KB of RAM usage]. On the other hand, fast event
handling and computation would require high-performance JavaScript. Although
there are efforts to develop high-performance, high-memory IoT chips [9], low-
performance, low-memory IoT chipsets would be employed more often due to
cost requirement. Consequently, JavaScript-based IoT platform requires a small
footprint, high-performance JavaScript engine.
In this paper, we performed two jobs. First, we analysed three existing small
footprint JavaScript engines: Espruino (http://www.espruino.com/), Quad-wheel
(https://code.google.com/p/quad-wheel/), and Duktape (http://duktape.org/). We
compared the three engines by assessing their binary size, runtime memory, and
performance, as well as their compatibility of JavaScript tests. We found that only
Duktape correctly supports the JavaScript features, yet with mediocre performance
and memory requirement. The second work we accomplished is enhancing Duktape
with six optimisations (which we call DuktapeC), which leads to a tangible
performance improvement as well as a sharp decrease of the runtime memory.
The rest of this paper is organised as follows. Section 6.2 analyses how the small
footprint JavaScript engines work in diverse perspectives, and then compares their
performance and compatibility with JavaScript features described in the current
standard. Section 6.3 proposes DuktapeC, a better design in terms of binary size,
runtime memory usage, and performance compared to Duktape. Section 6.4 presents
the experimental results to evaluate DuktapeC. Section 6.5 provides summary and
future work.
This section evaluates three small footprint, open source JavaScript engines:
Espruino, Quad-wheel, and Duktape.
Espruino directly interprets a JavaScript code while top-down parsing it. On the
other hand, Quad-wheel and Duktape first generate an intermediate representation
(IR) code for the stack machine and the pseudo register machine, respectively,
which is then interpreted. These execution mechanisms may influence performance.
Because efficient management of the JavaScript objects is directly related to
compact memory usage, we evaluate runtime data structures employed by those
engines. Garbage collection (GC) policies of the engines are also analysed because
they also may affect memory usage. Finally, we check the ECMA-262 standard [6]
coverage.
106 M. Kim et al.
JavaScript ensures type flexibility of variables. While this provides the web develop-
ers the convenience of coding as the developers have no need to be concerned about
variable types, JavaScript engines are required to handle all the objects dynamically.
An object is a container of properties each of which is a pair of name and value.
JavaScript treats even functions and arrays as objects. It is essential for JavaScript
engines to implement this object model correctly. Both data structures and object
representations play important roles in memory usage.
Quad-wheel uses a dedicated structure to represent an object. The structure
includes the followings: the actual type of the object, a red-black tree for saving
properties, an 8-entry array for caching recently used properties, and a reference
counter to be used for GC. Meanwhile, Espruino and Duktape basically employ
similar data structures. They also have a dedicated structure to represent an object
just as Quad-wheel does, however, they connect all of the object nodes by forming
a linked list as shown in Fig. 6.1.
Because linked lists provide convenience of monitoring reachable memories,
wastes on unnecessary memory can possibly be reduced. Each node is generally
comprised of the pointers to other nodes. Consequently, in 16-bit machine environ-
ment, which requires smaller pointers, this data structure gets more advantageous
than in 32-bit machine environment. However, it has a great performance overhead
as a linear search must be conducted every time a query about an object or a property
takes places.
Additionally, Duktape selectively added a hash part to frequently used objects.
This enabled constant-time accesses to frequently accessed property entries.
Improved performance may be expected by this method rather than conducting
a linear search throughout the nodes every time.
Function Object
To evaluate the engines’ memory usage and performance, we have run a micro-
benchmark shown in Fig. 6.2. This micro-benchmark repeats 10,000 times of
serial operations. The operations include property accesses, a function call, and
‘C’ operations between numbers and strings. Those were selected because firstly
they are main components of meaningful semantics in JavaScript code, secondly
property access, in particular, was often found a bottleneck of execution. The result
is shown in Table 6.3. DuktapeC which will be introduced throughout the rest of
this paper was also compared for providing a fair comparison between existing
JavaScript engines. It was experimented on an ARM machine (ARMv7 Processor
rev 10 v7l @1.2 GHz, 1 GB RAM) and the maximum value of heap size was
recorded. It seems that binary size of Quad-wheel is extremely small compared
to other engines. However, because the unimplemented requirements would cost
around 90 KB additionally, it is hard to tell its superiorities in terms of binary size.
Within three engines Duktape takes the smallest heap memory and its binary size is
6 Small Footprint JavaScript Engine 109
Table 6.4 Results of running programs which create respective objects repeatedly
JSC Quad-wheel Espruino Duktape Duktape C (proposed)
Object Heap 17.8 MB 2013 KB 1967 KB 616 KB 601 KB
Time (ms) 19 51 1151 413 371
Array Heap 17.7 MB 5675 KB 3934 KB 1577 KB 1400 KB
Time (ms) 11 142 3,189 848 535
Function Heap 20.1 MB 2014 KB 3934 KB 3497 KB 2881 KB
Time (ms) 15 69 1232 1000 878
String Heap 17.5 MB 6732 KB 983 KB 1636 KB 1493 KB
Time (ms) 16 123 1062 737 502
quite feasible, yet order of 100 times slower than JSC. Therefore, we decided to take
optimisation chances existing in Duktape and propose DuktapeC which has better
performance and footprint while not increasing binary size much.
We experimented with a few more micro-benchmarks extending the area of
testing. Table 6.4 shows results of running programs which repeatedly create
Object, Array, Function, or String, respectively. For every test case,
DuktapeC has shown better performance and lower footprint than original Duktape
or Espruino has. Increase of binary size is only 3 KB from 184 KB originally.
It is interesting that Quad-wheel showed 3–12 better performance than
DuktapeC, where it appears to be the opposite from the result in Table 6.3. We
concluded that this is caused by two reasons. First, the lack of its preparation for
built-in objects and methods. Because Quad-wheel does not support full features
required by standard, it has nothing much to process for start-up which has more
significant effects for shorter programs. Second, Quad-wheel seems to create objects
relatively efficiently. Nevertheless, since experiments with Table 6.4 only focus on
creating objects, they are less meaningful than those with Table 6.3.
Three small footprint JavaScript engines were compared in Sect. 6.2. Out of
those, Duktape fairly satisfies ECMA-262 coverage and offers a compact foot-
print. However, performance issues remain prominent. To solve these issues, this
study proposes several optimisations. Sections 6.3.2–6.3.5 explain those in detail.
110 M. Kim et al.
Strings are frequently used in JavaScript as well. For the sake of Unicode handling,
every string object contains a value called ‘clen’. ‘clen’ refers to the length
of a string in code point. In the UTF-8 encoding scheme, two different Unicode
characters may occupy different number of bytes. Therefore, every string object
created by Duktape contains ‘blen’ string length in byte, as well as ‘clen’ string
length in code point.
String concatenation is a JavaScript operation which creates a new string by
concatenating two strings. The natural way to implement this operation is building
a new string while scanning two input strings linearly. String join also requires a
6 Small Footprint JavaScript Engine 111
linear scan of two strings as with string concatenation. The point is that, to calculate
the clen value linear scan of the strings is being repeated. If we calculate clen
during the linear scan for string operations, we can avoid unnecessary computation.
We improved the performance by suggesting a way to calculate clen effectively.
Moreover, by classifying Unicode strings that require special handling like one
described above and the others of no need for it, it is also possible to remove
calculations of clen because clen is equal to blen for most strings.
When Duktape is interpreting IR, it delivers operand values through the operand
stack. In Fig. 6.5, a JavaScript code c D a & b is converted to an IR instruction
‘bit-and v1 v2’. When this instruction is being executed, the actual values
of virtual registers v1 and v2 are fetched from the operand stack. The problem is,
because the size of the operand stack is variable, the stack can be relocated to a
new memory address in case of overflow. If so, the pointer referencing the top of
the stack also needs to be modified appropriately. Therefore, every access to the
memory pointed by this pointer requires checking if the stack has moved.
By acquiring value of operands using the native stack rather than dynamically
allocated memory region, we removed the checking overhead. For the bitwise
operations or compare operation, instead of accessing the operand stack, values of
the operands are saved as local variables.
Duktape creates all of built-in objects and methods during the initialisation step
as explained before, in Sect. 6.3.1. However, because most of the applications do
not use all of the built-in objects, the memories taken for creating useless built-in
objects end up being a waste. Therefore, this study suggests lazy built-in objects
construction, where creating a built-in object right before when needed. In the
initialisation process, only the essential objects for starting program are created.
The rest are waiting to be created until the engine makes the decision that they are
actually required for running the application.
Each of built-in objects has its flag that indicates if it has been created or not.
The initialisation stage is conducted by setting all of them to 0 at the start, with no
actual instances of the objects created. Every time a reference to a built-in object is
required, it checks the flag finding if the required object has already been created.
If there exists the responding instance, it simply directs to the instance. Otherwise,
it calls the initialisation routine which constructs the required built-in object and
marks its flag. By doing so, unnecessary memory usage is expected to be reduced.
6.4.1 Environment
The execution time for running 26 programs included in the prominent Sunspider
Benchmark suite was measured for evaluation. The execution was conducted on a
®
Linux system (Ubuntu 12.04) equipped with a 64-bit Intel Core™ i7-4770 CPU @
3.40 GHz and 16 GB RAM.
6.4.2 Performance
Figure 6.6 is a graph showing the geometric mean of the speed-up for all benchmark
programs when each optimisation is applied. The rightmost bar named ‘All applied’
indicates the result when all of six optimisations are applied together. Lazy built-in
objects construction made it 1.4 % slower because of time to check if the built-in
object has already created or not. Rather, it is faster for start-up time because it does
not need to create objects that are never used.
Improved string concatenation and join optimisation enhanced the performance a
lot, especially for benchmarks handling strings. Array putprop fastpath optimisation
evenly enhanced, particularly benchmarks which have frequent property accesses.
114 M. Kim et al.
1.4
1.3
1.2
1.1
1.0
0.9
Indirect Improved putprop bitwise op jscompare lazy All applied
threading str concat, fastpath native native builtin
array join
Bitwise operation or compare with native stack optimisation also showed a good
result for benchmarks specialised for those operations, not for ones that use the
value copied to native stack only a time.
6.4.3 Footprint
Table 6.5 shows RAM usage until the end of Duktape initialisation. The second row
is the total memory consumption right after initialisation, and the first row is that
consumed by built-in objects out of total consumption. Built-in objects have quite
a big portion seeing that they take 25.36 KB out of total 44.32 KB. Among those
25.36 KB, 52.88 % was not essential at that moment. While running the application,
if an uncreated built-in object is turned out necessary, it takes additional memory.
To sum up, lazy built-in objects construction led to reduction of RAM usage by up
to 30.26 %.
It is consequent that the binary size increases when adding a new design. Even so,
the total increase of binary size is only 2.8 KB as shown in Table 6.6. As binary
size of Duktape is 184 KB originally, the increase is less than 2 % which is almost
nothing compared to the merits it brings.
6 Small Footprint JavaScript Engine 115
There is an emerging need for small footprint JavaScript engine for the sake of
event-driven programming which is promising in IoT platform. Out of Quad-wheel,
Espruino, and Duktape, this paper proposed several optimisation ideas for Duktape
as Duktape was distinguishable, but still has mediocre performance and this study
implemented the suggested ideas.
By the optimisations suggested through Sect. 6.3, this study has achieved an
increase of performance by 30.5 %, a reduction of footprint by 30.3 %. The increase
of binary size while applying those optimisations was negligible as it was only 2 %
of original size 184 KB.
Such a small footprint JavaScript engine can be exploited as a server-side
software platform as Node.js is. Node.js is embedding the V8 JavaScript engine,
which is an excessively oversized program to be used on small IoT devices.
Therefore, by associating the small footprint engine with libUV which is the I/O
library used in Node.js, a prototype of small-sized server-side software platforms
can be exhibited.
Acknowledgments This research was supported by the Ministry of Trade, Industry and Energy
(MOTIE) through the Electronics and Telecommunications Research Institute (ETRI) (Project
No. 10045344), Global PhD Fellowship Program through the National Research Foundation of
Korea (NRF) funded by the Ministry of Education (NRF-2014H1A2A1019270), and Samsung
Electronics.
References
7.1 Introduction
A computer system (device under attack, DUA) can be the target of a wide variety
of attackers both insider and outsider. In our threat model, an attacker target point
is a given software code (host program) that is executed as a process in an OS
environment through the use of a DUA low architecture layer software acting as a
trusted computing base (TCB). A software entity can act as a TCB when its security
functionality is trusted not to fail (if it fails the whole security policy collapses). As
such, TCB cannot be manipulated by an unauthorized user while it always functions
as intended to. We assume that such an entity exists in our proposed approach and
uses the BIOS operations as well as all system hardware resources via the regular
processor ISA. In the context of the specific work and in order to not pertain to
a specific system configuration, the TCB can be a trusted hardware virtualization
layer, a trusted boot loader or, in general, any kind of a trusted middleware layer.
Trusted Computing Group approaches (including TPM chips) can be further utilized
to attest the TCB security reliability.
We assume that the host OS environment cannot be trusted. The OS has
no protection mechanism against attacks and can be manipulated, using existing
vulnerabilities, by an attacker in order to launch locally or remotely a code injection
attack. Target of such attack is the host program process and goal of such attack is
the alteration of the host program functionality in order to act as an attack vector of
a broader malicious intrusion like malware execution, distribution (worm, Trojan),
administrator privileges acquiring and sensitive data eavesdropping (when the host
program handles sensitive information). The attacker can execute arbitrary code
as an OS process and he can have access to the OS services. Two types of code
injection attacks can be identified on the given computer system: attacks manifested
during host program execution (run-time attacks) and attacks manifested when
the host program is stored in the system physical disk (static attacks). It can be
assumed in our threat model that the computer system non-volatile storage elements
120 A. Fournaris et al.
(physical disk) have trust integrity check mechanisms and all data stored in them are
impervious to malicious data changes. So, a code injection attack is limited to run-
time attacks. During such an attack, the host program executable code is loaded onto
RAM and is executed as a regular process. Since, the OS and its RAM is considered
untrusted (they are vulnerable to attacks), an attacker can profile the host program
process binary code and statically or dynamically inject malicious code in order to
alter the process functionality (the process will operate in a different way than the
one it was built for).
Finally, without loss of generality, we assume that an attacker cannot mount an
unlimited number of code injection attacks on the target host process before been
detected. An evaluation of the tolerance criteria of the attack detection mechanism
is left for future work.
The goal of the proposed methodology is to enhance the toolbox of system security
designers with a new set of shielding techniques. While processors (the ISA of a
processor formulates its functionality and its hardware specifications) are designed
to be generic enough in order to efficiently execute a large spectrum of applications,
our view is quite different. If the capabilities of a processor are intentionally reduced
(by dynamically limiting the processor ISA), then a large class of code injection
attacks will become obsolete or not applicable. This happens because a malicious
software code is typically implemented and compiled using the full ISA of the
system. In other words, a malicious injected code is currently designed to attack
a specific system.
Our vision is to formulate a run-time execution environment with limited capa-
bilities by explicitly and intentionally reducing the processor ISA. Not surprisingly,
someone may argue that by limiting the ISA of a target processor, all applications
(malicious or not) may become not “runnable,” simply because they may contain
specific assembly instructions which are not part of this limited ISA. However, if
the limited ISA of a processor is carefully formulated by including instructions that
are part of the non-malicious host program/process, but not part of the malicious
injected code, then we can end up with a low-level protection scheme that cannot be
bypassed.
Consider, for example, the case of an MUL instruction and let assume that the
target host process does not contain any. If we intentionally remove the commonly
used MUL instruction from the group of supported machine instructions, then all the
malicious codes injected in the host process containing this instruction will simply
become non “runnable.” Another first-class example is the support of any kind of
indirect memory addressing modes which are mainly used to implement pointer-
like operations. In this case, the host process code can be rewritten (either by the
programmer or by employing dynamic binary rewriting techniques) in a way that
does not rely on pointer indirections. However, this will be catastrophic for a typical
7 VirISA: Recruiting Virtualization and Reconfigurable Processor ISA for. . . 121
remains fixed thus enabling the attacker to probe the system and gather useful attack
information.
Overall, the above approaches are static in nature and do not provide a fully
dynamic virtual execution environment that can be arbitrary adjustable to host
process characteristics. Software virtualization offers an interesting expansion to
the above approaches that can lead to strongly isolated execution environment.
However, when viewing a software hypervisor operating on an untrusted OS, then
this hypervisor is a target of attack and cannot be trusted [23, 24]. This issue can be
solved by hardware virtualization environments that operate on architecture layers
lower than the OS kernel (directly on top of the hardware structure). Such structures
can act as TCBs and can support a code injection protection mechanism [25].
More specifically, in this work, we envision a dynamic environment that acts as a
TCB using state-of-the-art full virtualization frameworks and can support random-
ized, dedicated ISA for each host process. In such an approach, there is no need
for instruction encryption since randomization is provided by the TCB. The above
idea can be applicable to many use cases and can be adapted to various application
systems, in an effort to provide a trusted environment inside an untrusted device.
Critical processes can be executed in dedicated ISA with isolated VMs regardless
of the security status and vulnerabilities of the full ISA and host OS. Expanding
the proposed idea to support dedicated VMs (not only assembly instructions), our
solution can be migrated to various platforms including mobile devices or embedded
systems. For example, a prime use case of the proposed approach can be the java
virtual machine (JVM) macro-instructions typically existing in all Android systems.
In such environments, the run-time system using the Dalvik hypervisor on top
of a Linux kernel is able to bundle together (at run-time) groups of Java macro-
instructions. Using the proposed approach, a VirISA java-based virtual execution
environment can be formulated and restricted java instruction set VMs can be
instantiated. In this way, each Android application will run using a dedicated Java
instruction subset. Note that such infrastructure already exists in some Android
systems. Such systems, primary designed for power reduction, can generate one
JVM for each executed application to minimize power consumption. Using the
proposed VirISA idea, the Android virtualization mechanism can be extended in
order to provide strong security and trust.
In the proposed solution, illustrated in Fig. 7.1, the VirISA scheme is structured on
a full scale single or multicore system. Apart from restricted ISA VM generation,
VirISA can provide VM hardware resource allocation to specific cores in the
multicore case. The VirISA virtualization environment can be used in order to
provide multiple VirISA VMs that are isolated between them and can communicate
as separate entities through the VirISA infrastructure. To achieve that, each VM
is equipped with a VirISA software driver capable of providing a secure, trusted
7 VirISA: Recruiting Virtualization and Reconfigurable Processor ISA for. . . 123
UnTrusted VirISA VM
VirISA VM Full ISA
Compiled
Non Critical
Trusted VirISA VM 1 Trusted VirISA VM n PROGRAM A1
….
VirISA VM 1 VirISA VM n
Dedicated ISA1 executable Dedicated ISAn executable VirISA VM Full ISA
Host Host Compiled
Process Y1
…. Process Yn Non Critical
PROGRAM An
interface for communication with other VMs. We assume that VirISA virtualization
environment can be trusted and it is very difficult to be compromised. Based on
the above specification, system operations/processes can be categorized into critical
and noncritical ones. Critical operations involve sensitive information activities
or crucial system activities for the system functionality and must be executed
in a trusted VM. A trusted VM can be generated by the VirISA virtualization
environment using a dedicated, restricted ISA and is assigned to a critical operation
process that is recoded and, thus, executed on this VM. Noncritical operations may
include OS processes and are executed in a separate VM with full ISA support (we
assume that the OS kernel is too complex to be recoded in restricted ISA). Any
attacker’s injecting code to a critical process will be considerably restricted by the
ISA of the trusted VirISA VM and will hardly be executable.
To make the proposed security and trust scheme more practical, the VirISA
virtualization environment can be preferably employed in a multicore processor
so as to assign a VirISA VM to a specific core of the processor and consequently
achieve VM performance overhead reduction.
124 A. Fournaris et al.
Assume that a host program executable code X resides in a physical disk or non-
volatile memory that adopts the VirISA protection mechanism and an execution
request for this program is issued. As Fig. 7.2 shows, the request is initially
transferred to the VirISA run-time system. The executable code is read from the
disk and is analyzed by the VirISA entity in order to be profiled and transformed to
a functionally equivalent executable code Y. The key point is that the Y executable
consists of different assembly instructions (actually, a subset of the supported
system instructions) as compared to the original code X, which was compiled taking
into account the full ISA. The role of the VirISA is to analyze the input code X, to
UnTrusted VirISA VM
VirISA VM Full ISA
Compiled
Trusted VirISA VM 1 Trusted VirISA VM n Non Critical
process A1
VirISA VM 1 VirISA VM n
….
Dedicated ISA1 executable Dedicated ISAn executable
Host Host
VirISA VM Full ISA
process Y1
…. process Yn
Compiled
Non Critical
process An
VirISA driver
Y1 Yn
Generate Dedicated ISA VM Generate Dedicated ISA VM
Transformation Use
Transformation Use
Dedicated ISA1 Dedicated ISA2
Randomization Randomization VirISA
Dedicated Dedicated
ISA1 Choice ISA2 Choice Virtualization
Profiling Profiling
Environment
X1 Xn
Host Program
Executable X1
Full ISA
Host Program
Executable X2
Instruction Set Architecture
….
VirISA VM 1 ISA1
VirISA VM n ISAn
PHYSICAL Host Program
DISK Computer System Hardware/ Processor
Executable Xn
(Trusted)
create a dedicated subset of the processor ISA for X in a random manner and to
transform code X into code Y. Note that the functionality of the two executable
codes remains exactly the same.
When this step is finished, the VirISA virtualization environment creates a new,
dedicated VM (VirISA VMY ) in the system memory that utilizes appropriate system
resources and employs a dedicated subset of the regular ISA. Code Y is executed in
this VM as a regular process and communicates with the rest of the system locally
or remotely through a VirISA software driver that passes all messages to a different
VM using the VirISA virtualization environment. This functionality is shown in
Fig. 7.2.
Note that the OS runs in a separate VM and although it cannot be trusted (as
assumed in our threat model), it remains isolated from the rest of the system through
the VirISA virtualization environment. Obviously, this functionality can be extended
to support more than one OS, each one running in a separate VM assuming that the
VirISA acts as a full virtualization environment. An important characteristic of our
solution is that it is generic enough to be employed to a wide variety of single or
multicore architectures by appropriately adjusting the VirISA environment to the
corresponding target architecture. In case an attacker manages to take advantage of
some OS/system vulnerability and acquires the necessary means to launch a code
injection attack by accessing the system memory, his only option would be injecting
a full ISA malicious code to Y process code (note that process Y is executed
and monitored via its dedicated VMY ). However, code Y uses an unknown to the
attacker, dedicated subset of the regular ISA that will not be compatible with the
injected codes instructions.
Category A Category B
Transform Full ISA code X into Dedicated ISAY
dedicated ISAX code Y specifications
Category C Category D
Code Y
Code Y VM
Key point in the overall concept of the VirISA virtualization environment is the
formulation of a random, dedicated ISA for an input executable code. As noted,
this dedicated ISA will be a subset of the core conventional ISA. This subset will
include instructions enabling the execution of a given host program, but preventing
the execution of an injected code (the underlying VirISA virtualization environment
is responsible for detecting the unsupported instructions/opcodes and issue the
corresponding alert messages using some detection mechanism).
At first glance, someone may argue that the target ISA subset can be created
by excluding from the regular ISA all the machine-level instructions that are not
part of the host executable code. However, since this protection approach can be
7 VirISA: Recruiting Virtualization and Reconfigurable Processor ISA for. . . 127
assembly code inserted into the newly generated executable) of all the other INC
instructions. These instructions will be either realized via the INC ecx instruction
or via some other, dedicated ISA valid, instruction combination (e.g., via an ADD
instruction). Note that all INC instructions are heavily used by a typical compiler.
The same transformation can be applied to other instruction categories, e.g., DEC
(decrease) and PUSH/POP instructions. Another possible transformation is to
randomly choose between the ADD and SUB instructions and allow only one of
them to be included in the generated dedicated ISA subset (row 2 in Table 7.1).
Another beneficial transformation is to convert all the PUSH/POP instructions
to MOV equivalent instructions (or the opposite). Of course, this transformation will
require extra code modifications to appropriately align the top-of-the-stack (TOS).
However, this kind of conversion will have a significant impact in the generated
code, since a large volume of the instructions in a typical application belong to
those two categories. Finally, a heavily influential transformation is to randomly use
one among the register-based addressing modes (only one of them will be part of
the target ISA subset), as can be seen in the last line of Table 7.1.
Overall, we have to point out that the cases illustrated in Table 7.1 are only
indicative so as to briefly illustrate the basic idea of our approach. We have
created full tables (and the required code transformations) taking into account the
majority of x86 assembly instructions. Our analysis revealed that in some cases
removing one instruction from the dedicated ISA subset may require a fairly large
number of additional assembly instructions in order to produce a functionally
equivalent assembly code. For example, this is the case for the XOR (exclusive OR)
instruction which requires ten assembly instructions in order to be realized using
logical NOT/OR/AND operations. Thus, such kind of transformations will have a
great impact in the reported execution time and code size of the newly generated
code resulting in trade-offs between performance/code size and security/protection
capacity. We intent to fully investigate those trade-offs in a future version of this
work.
7.5 Conclusions
In this paper, a code injection protection methodology was sketched that uses
processor ISA subsets in order to generate dedicated virtual execution environments
for each protected process. We proposed the VirISA scheme, acting as a TCB, that is
loaded before the OS kernel and is capable to recode a full ISA executable code into
a randomized, dedicated, and restricted ISA subset executable code with the same
functionality as the original. The VirISA scheme can mount a VM based on the
chosen dedicated ISA so as the recoded program can be safely executed. An attacker
with no knowledge of the chosen restricted ISA will inject full ISA code to such a
process and since the malicious code will include instructions that are not supported
by the limited ISA environment it cannot be functional. The proposed approach
does not need to employ encryption algorithms for randomizing the ISA nor need to
7 VirISA: Recruiting Virtualization and Reconfigurable Processor ISA for. . . 129
retain encryption keys. The VirISA scheme can be used to any off the shelf single or
multicore system and through the ISA restriction methodology can protect against
a wide range of code injection attacks. Currently, the proposed solution is at design
stage and our future goal is to realize a functional prototype for several use cases
(mainly in mobile operating environments) in order to provide actual performance
results under several attack scenarios and extract “performance against protection”
trade-off patterns.
References
1. Aleph One. Smashing the stack for fun and profit. Phrack Magazine. 7(49), (1996)
2. M. Conover, w00w00 on heap overflows, w00w00 Security Team, http://www.w00w00.org/
articles.html (1999)
3. Scut’s team TECO, Exploiting Format String Vulnerability, http://www.team-teso.net/articles/
formatstring, (2001)
4. H. Shahriar, M. Zulkernine, Taxonomy and classification of automatic monitoring of program
security vulnerability exploitations. J. Syst. Softw. 84(2), 250–269 (2011)
5. W. Hu et al., Secure and practical defense against code-injection attacks using software
dynamic translation, in Proceedings of the 2nd International Conference on Virtual Execution
Environments, ACM, New York (2006)
6. G. Kc, A. Keromytis, V. Prevelakis, Countering code-injection attacks with instruction-set
randomization, in Proceedings of the Conference on Computer and Communications Security
(2003)
7. E.G. Barrantes, D.H. Ackley et al., Randomized instruction set emulation to disrupt binary
code injection attacks, in Proceedings of the Conference on Computer and Communications
Security (2003)
8. S. Bhatkar, D. DuVarney, R. Sekar, Address obfuscation: an efficient approach to combat a
broad range of memory error exploits, in Proceedins of USENIX (2003)
9. R.B. Aussel, J. Sailer, Only hardware-assisted protection can deliver durable secure founda-
tions. IEEE Software Magazine. 28(2), 57–59 (2011)
10. A. Baldwin, S. Shiu, Hardware encapsulation of security services, in Proceedings of the
European Symposium on Research in Computer Security (2003)
11. A. De Gloria, VISA: A variable instruction set architecture, ACM SIGARCH Computer
Architecture News. 18(2), 76–84 (1990)
12. K. Hwang, Z. Xu, Scalable Parallel Computing: Technology, Architecture, Programming
(McGraw-Hill, New York, 1998)
13. J. Sanchez, A. Gonzalez, Instruction scheduling for clustered VLIW architectures, in Proceed-
ings of the Symposium on System Synthesis (2000)
14. J. Liu, F. Chow et al., Variable instruction set architecture and its compiler support. IEEE Trans.
Comput. 52(7), 881–895 (2003)
15. C. Corp, Cognigine Corporation, CGN16100 Network Processor User Manual (2002)
16. E.G. Barrantes, D.H. Ackley et al., Randomized instruction set emulation. ACM Trans. Inf.
Syst. Secur. 8(1), 3–40 (2005)
17. A. Sovarel, D. Evans, N. Paul, Where’s the FEEB? The effectiveness of instruction set
randomization, in Proceedings of the USENIX Security Symposium (2005)
18. M. Milenković, A. Milenković, E. Jovanov, Hardware support for code integrity in embedded
processors, in Proceedings of the Conference on Compilers, Architectures and Synthesis for
Embedded Systems (2005)
130 A. Fournaris et al.
19. G. Portokalidis, A.D. Keromytis, Fast and practical instruction-set randomization for commod-
ity systems, in Proceedings of the Annual Computer Security Applications Conference (2010)
20. Pax Team. PaX. [Online]. Available: http://pax.grsecurity.net (2000)
21. Pax Team. PaX address space layout randomization (ASLR)
22. H. Bojinov, D. Boneh et al., Address space randomization for mobile devices, in Proceedings
of the Conference on Wireless Network Security (2011)
23. S. Bratus, P.C. Johnson et al., The cake is a lie, in Proceedings of the Workshop on Virtual
Machine Security (2009)
24. S. Bratus, M.E. Locasto et al., VM-based security overkill, in Proceedings of the Workshop on
New Security Paradigms (2010)
25. C. Gebhardt, C.I. Dalton, A. Tomlinson, Separating hypervisor trusted computing base
supported by hardware, in Proceeings of the Workshop on Scalable Trusted Computing (2010)
Part III
Opportunities, Challenges and Limits
in WSN Deployment for IoT
Chapter 8
Deployment Strategies of Wireless Sensor
Networks for IoT: Challenges, Trends,
and Solutions Based on Novel Tools and HW/SW
Platforms
8.1 Introduction
The research field of the wireless sensor network (WSN) has undergone an impor-
tant evolution process during the last few years along with the progressive inclusion
of the Internet of Things (IoT) as the main foundations for the future of smart and
sustainable cities [1]. The intrinsic nature of a WSN-based system as the integration
of different technologies related to multi-domain research areas (such as low-
power embedded processing architectures, lightweight communication capabilities,
industrial technologies for environmental sensing, and energy-aware mechanisms
for long-term operability of the application) relies on the implementation of novel
and more efficient hardware/software techniques, in order to properly cope with the
requirements and constraints that this type of distributed system pose to researchers
[2]. In this direction, such innovation process also implies new challenges and
more complexity when designing and developing smart applications based on this
heterogeneous technology, starting from the requirement stage up until the final
operational release of the system. However, the creation and optimization of sensor
networks goes beyond robust and low cost platforms, since the node distribution,
communication, and dissemination strategies as well as the cooperative processing
capabilities of hundreds or even thousands of small devices are critical aspects to
assure the actual performance and reliability of the planned application.
This is particularly important during the deployment, commissioning, and in-
field validation phases as a fundamental part to analyze and optimize the real
behavior of the network with respect to what is expected from the theoretical
simulation models. At that stage of the development cycle, wireless communication
technologies and node distribution mechanisms play a relevant role for the estab-
lishment of an overall collaborative platform, so as to integrate a whole correlated
system aside from the individual capacity of the sensor nodes. However, the
issue of optimizing WSNs has been usually approached from the basis of a more
conceptual perspective at the planning phase, in the sense that modeling and
simulation techniques are certainly accomplished albeit a gap with the actual on-
site deployment strategy is still a noticeable aspect that might have a direct effect
on the performance of the sensor network at its operational stage. Therefore, in
this chapter a new perspective of WSN deployment strategies targeting IoT smart
application scenarios is in-depth discussed, trying to address today’s shortfall of
methodologies to efficiently carry out the commissioning, configuration and on-
site performance optimization tasks, and converging deployment capabilities with
runtime enhancement of multi-hop mesh networking mechanisms. New trends and
solutions based on hardware–software support tools are introduced so as to provide
an overall context for accomplishing effective distributed sensor deployments.
The rest of the chapter is organized as follows, starting with a general overview
of state-of-the-art technological trends that contributes to introduce the proposed
concept. Then, an on-site deployment toolset is presented to detail the integration
of optimization techniques in order to achieve an energy-efficient cohesion of
the wireless network as well as the long-term maintainability of the deployed
system. Based on such an optimization process in addition to in situ simulation
capabilities, a dynamic parametrization of network routing mechanisms is proposed,
in combination with the on-site multi-hop mesh communication assessment that is
intended to provide a comprehensive decision-making analysis of the type of routing
strategy to be adopted in a particular scenario. A discussion regarding experimental
results and potential benefits of the proposed system is subsequently clarified, and
finally conclusions as well as future perspectives are also analyzed.
solutions certainly face the problem of deploying WSNs from the point of view
of planning techniques, but not as the result of a proper on-site real deployment,
configuration, and performance evaluation/enhancement methodology.
On the other hand, there are several contributions in the literature that focus on
studying the differences between wireless models and real radio communication,
service, and application behavior by means of using WSN testbed deployments,
such as the work proposed in [7], in which authors attempt to enhance the
simulation engine by analyzing the main mismatches with respect to a real
sensor network test case, so that more realistic simulations can be offered prior
to the final system deployment. The implementation of WSN testbeds is also
a widespread research activity that commonly relies on the indoor deployment
of sensor platforms supported by a laboratory testing infrastructure upon which
researchers can perform controlled experimental tests, such as Motelab or Indriya
[8, 9], where the configuration and monitoring of the nodes is performed by
using backchannel-based management architectures. Such support environments
are mainly intended to provide users with a more structured scheme for testing
hardware and software prototypes before their final implementation into the actual
WSN application scenario, though flexibility, scalability, mobility, and modularity
are usually penalized. The above-mentioned concerns are even more relevant when
referring to the ad-hoc mesh networking essence of the WSNs, whose flexibility,
scalability, and versatility promote their suitability for IoT application contexts.
In fact, heterogeneous networks based on wireless multi-hop mesh approaches
constitute the foundations of current initiatives by the research community for
establishing IoT-based technologies for smart city application scenarios. The effi-
ciency of data dissemination techniques among remote points of the networks
will be certainly defined by the reliability and effectiveness of adaptable routing
mechanisms according to the topology and partitioning strategies to be adopted.
Moreover, energy-efficient routing optimization capabilities are a must for the long-
term feasibility of the WSN deployment. Based on this, modeling and simulation
tools are also proposed in the literature for the performance evaluation of routing
protocols prior to their implementation into wireless sensor and communication
platforms [10, 11].
However, during the deployment, configuration, and tuning process of the dis-
tributed system, in-field routing protocol implementation analysis are to be allowed
for so as to produce a better assessment of the multi-hop data dissemination strategy
to be finally applied, specially taking into consideration how specific constraints
of the target scenario may affect the overall performance of the wireless network
deployment. This would lead to generate on-site optimization approaches in order
to guarantee a high level of system adaptability to the target scenario, which results
in a more efficient and energy-aware implementation.
136 G. Mujica et al.
In this direction, one of the major issues when progressing within the system
development cycle is that there is a lack of well-defined frameworks and tools
focused on facing the aforementioned gap between planning/simulation strategies
and on-site efficient commissioning methodologies. Moreover, the idea of taking
advantage of a comprehensive on-site deployment approach to dynamically opti-
mize or even reconfigure the mesh networking mechanism in situ represents a
very challenging perspective that has not been properly covered yet. The new era
of emerging technologies is creating synergies among IoT and WSN application
contexts that demand the determination of novel methods and toolsets for the
optimization and performance enhancement of collaborative wireless distributed
systems. This can be indeed realized by means of integrating already defined
hardware/software components with new strategies that provide runtime on-site
dynamic optimization capabilities for the target mesh network implementation.
the parameters that are mainly of interest relate to the radio signal strength indicator
(RSSI), link quality indicator (LQI), as well as the link delivery ratio (LDR).
The issue of deploying a WSN in such a way that both the cohesion and the
maintainability of the network can be assured poses important challenges to be
faced, especially when adding energy efficiency as another variable to the problem
analysis. The setup of the sensor nodes not only in terms of the mesh networking
communication mechanisms but also in relation with the platform parametrization
(hardware/software properties and application tuning) might be unified by means
of triggering a collaborative configuration procedure from the mobile on-site
deployment tool, in which the target node executes a frame dissemination task at
MAC level in order to generate two main actions: network connectivity correlation
with its surrounding environment (and thus establishing bidirectional information
for routing purposes), as well as platform setup where specific parameters regarding
application support services (data transmission rate mask, service provision, syn-
chronization, and power mode configurations) and node properties (such as node
weight determination, which refers to the generation of routing metrics and cluster-
based configuration entries, as explained in next sections) are distributed among
its enclosed area. In both cases, the performance verification, reconfigurability,
and maintainability processes could seem to be a subsequent generation of config
dissemination triggers among the sensor nodes that compose the wireless mesh
networking array. However, this scenario becomes a non-trivial execution task and
even less stable scheme when the WSN-based smart system is a conjunction of
points in a large-scale deployment, where problems related to distributed processing
capabilities, network flooding, and power dropping situations may affect the overall
performance and long-term autonomy of the application.
This leads to propose an on-site optimization scheme in which the configurability
and maintainability of the multi-hop distributed system can be efficiently assured.
The basic idea behind such an optimization process relies on the dynamic calcu-
lation of what is considered in this methodology as critical points of the mesh
network (called Cps), upon which the config dissemination scheme is realized
with the most resourceCenergy effective cost. However, the actual efficiency of
this execution process does not only depend on the number of encountered points,
but also on how the sequence of dissemination tasks is performed along the Cp’s
scheme. So let’s first analyze the impact of generating an optimized selection of
Cps. When encompassing mechanisms such as node discovery and flooding actions
across the mesh array, a high level of processing and energy resources is spent in
unnecessary redundant points, whose subsequent performance can certainly produce
an unbalanced resource consumption profile of the system. Instead, by minimizing
8 Deployment Strategies of Wireless Sensor Networks for IoT: Challenges,. . . 139
the number of specific points of the networks that allows obtaining the same
overall dissemination and link correlation scheme, the side effects on the network
performance can be also reduced. Then, the optimization of the type and number of
Cps also relies on the definition of the execution sequence to be carried out at the
deployment and maintenance stage, so as to minimize the level of redundancy when
applying the configuration tasks.
Xp
ftr D ˛ N C Psb N ı .i 1; i/ (8.1)
iD2
140 G. Mujica et al.
Discovery and Link Correlation Scheme Generation Costs After identifying the
target node from the configuration sequence, the on-site deployment support tool
triggers a controlled discovery mechanism in which the surrounding area is evalu-
ated, so as to update the link correlation scheme with those pair-points that have not
been analyzed/configured yet. In this binding phase the mesh network information is
updated (particularly regarding neighbors indexing) both in the involved embedded
nodes and in the deployment tool, so that a dynamic recalculation and refinement
of the deployment models can be performed in situ. During this procedure, the
transactions among the different comprised nodes are computed as the relationship
between the radio transmission power configuration and the energy weight of the
critical point under commissioning and its associated nodes during the transaction
and acknowledgement process. Clear-To-Send-like mechanisms (CTS) for Collision
Avoidance (CA) are also considered within the modeling process so as to properly
express the transaction slots among the involved nodes.
Xm Xm
fsr .e/ D ET .e/ C ER .r/ C Ea .e; r/
rD1 rD1
Xm
C Œ.m r/ Eck .r/ C .r 1/ Es C .n m 1/ Esn (8.2)
rD1
Four main elements can be distinguished within the cost expression shown in Eq.
(8.2). First, the critical node triggering action that involves the discovery mechanism
with the surrounding neighbors. It is represented as the energy resources spent
at the source and destination points during the performed transaction. Then, the
association stage is expressed as redundancy filtering and pair-point establishment,
which includes the energy representation of the recognition execution between
the critical and discovered points. Medium access influence is defined as the
average power during stand-by and active transitory modes of the critical points’
surrounded nodes multiplied by a CA time slot factor. This transaction also allows a
bidirectional neighbor table indexing for subsequent routing optimization purposes.
Finally, the energy weight of passive elements that are not directly involved in the
discovery dissemination process at that point of the deployment sequence is also
included as an overall stand-by offset of the rest of the sensor nodes.
Reconfiguration and Parametrization Cost Based on the Node Correlation Scheme
Once the node association is properly performed from the corresponding node
of the deployment sequence under action, the configuration transaction is then
triggered between the Cp and the correlated node, so as to establish a runtime
parametrization in relation with application level services as well as network settings
for communication and multi-hop purposes, but particularly focusing on link
metrics and node’s weights for the cluster-based routing optimization mechanism.
This stage of the deployment process represents a fundamental part for the dynamic
updating of the network simulation models based on the on-site gathered data, so
that a refinement of the optimization strategy can be accomplished according to a
more comprehensive feedback from the deployment tool. Moreover, the result of
8 Deployment Strategies of Wireless Sensor Networks for IoT: Challenges,. . . 141
this strategy indeed enhances the reduction of flooding schemas that significantly
affect the overall power and resource consumption of the network platform. As
shown in Eq. (8.3), the cost of the configuration transaction is expressed as the
energy weight of the Cp and the target setting-point during the cross configuration
exchange process, in addition to the stand-by energy offset of the nodes that are not
directly involved in the performed action.
One of the main advantages of the proposed method is its platform independence
nature. The system implementation allows developers to adjust the parameters
related to the technology to be used, so as to adapt the provided optimization
methodology to the specifics of the target WSN deployment. This, combined with
the simulation model refinement, is to guarantee the aim of achieving the most
efficient/cost-effective cohesion of the mesh network.
consideration that could seem to be a solution for the optimization problem is the
application of what is named here as swap-based algorithm, which refers to the
assessment of each solution as a combination of every possible NDoSq, which will
lead to compare and obtain the most efficient result for a given deployment scenario.
The main problem of this solution is its performance and scalability in large-scale
WSNs, since the algorithm makes the problem of optimizing a network composed
of n nodes rely on the evaluation of n! possible solutions, which is not time and
computationally feasible for the support tool.
As an alternative to guarantee a trade-off between solution efficiency and
time/processing effort of the mechanism, the concept of bio-inspired optimization
algorithms has been included within the system implementation of the proposed
tool. These types of strategies rely on evolutionary computation to generate a
solution space based on optimal or suboptimal results, by applying natural evolution
and selection principles [16]. In the proposed toolset, a genetic-based algorithm has
been implemented as part of the runtime optimization process, in which several
modifications were integrated in order to adapt the dynamics of this mechanism to
the problem of deploying a WSN by using the proposed methodology.
Considering the process of applying this algorithm to the optimization problem,
the first step is the generation of candidate solutions that are expressed as a
population composed of individuals. Traditionally in genetic algorithms individuals
are represented as strings of binary codes, which might simplify the subsequent
operations and evaluations that the candidate solution has to undergo. However, in
case of the deployment methodology, the genotype of the individual is created as an
array of nodes that corresponds to the NDoSq. Apart from this, in order to evaluate
the degree of aptitude of a candidate solution, the problem cost function proposed
in the modeling process is used in such a way that the higher its value is, the less
the aptitude of the deployment optimization sequence will be (that is, the fitness
expression is defined as fap D 1/fcost ). However, as explained in the experimental
result section, an additional execution factor is included to take into account
the time/processing performance of the solution space (efn DN/(fcost *tc )). During
the evaluation of the individual, the optimization engine performs the different
transactions according to the provided genotype, then based on the redundancy
detection strategy the Cps associated with the initial sequence are generated.
In order to produce a more appropriate population in every generation of
the genetic evolution, the selection process takes place within the optimization
algorithm, in which a number of individuals is selected from the population, and
from such a group the best one of them is chosen for the subsequent crossover
operation. The process is then repeated for a second candidate solution. Both
individuals undergo the process of crossover that is intended to modify the genotype
from one generation to the next one, although allowing for the nature of the
WSN deployment optimization problem. This means that the recombination of the
genotypes will be executed considering that the result of the segment mapping
has to be a sequence of nodes. Thereafter, the mutation operation is carried out
to guarantee that a premature convergence into local optimal solutions is avoided,
so that a level of diversity is maintained throughout the genetic generations. In this
8 Deployment Strategies of Wireless Sensor Networks for IoT: Challenges,. . . 143
has been integrated not only as a fundamental part of the deployment support
toolset but also to evaluate its implementation into hardware nodes such as the
already mentioned modular platform [13], so that a runtime comparative analysis
of the protocol performance with respect to the generated simulation models can be
properly carried out, thus assuring a more adapted solution to the target scenario.
Fig. 8.3 User interface for the deployment optimization strategies (left) and network deployment
scenario for the experimental test case (right)
148 G. Mujica et al.
Fig. 8.4 Routing optimization engine interface and main evaluation action commands
Fig. 8.5 Deployment optimization algorithm parametrization analysis (left) and comparative
analysis of deployment methodologies (right)
maintenance tasks. On the other hand, as the network gets larger and spread, the
redundancy optimization strategy plays a more important role since the associated
cost of the dissemination transactions does not shoot up as it can be in the second
case. The second set of test cases refers to the application of the deployment support
tool chain to the problem of generating an efficient multi-hop mesh network scheme
by using the proposed routing optimization mechanisms.
Currently two different strategies are implemented into the system to be evalu-
ated in the Cookies modular platform: the Cluster-based optimization technique as
well as an optimized version of the flat-based AODV routing strategy. One of the
main goals is to provide users with the ability to compare the performance of both
algorithms in order to analyze their suitability and adaptability to the target scenario.
This experimental case involves 30 nodes forming the WSN shown in Fig. 8.6,
for which the NDoSq was applied to carry out the node configuration tasks. Based on
this, the cluster-based optimization process determines the CHs and the GWs points
(in blue and orange, respectively) that correspond to the hierarchy parametrization,
in which blue lines refer to the main multi-hop paths while green lines involves
secondary routes (the flat scheme is expressed by all the interconnection lines).
Table 8.1 summarizes several route discovery test cases from remote points in
order to realize a comparative analysis of both implementations, by using the data
processed by the deployment support tool. The main parameters that are taken into
account to carry out the experimental comparison are the energy consumption of a
routing path, the cost of discovering and maintaining the communication between
two remote points, and the transmission delay among the network connections,
which are computed as the involved broadcasts of the selected mechanism, the total
amount of broadcast spent and the number of hops associated with the discovery
paths. Nodes represented in square brackets define those situations where the route
reply action is generated by an intermediate point that already had registered a route
to the destination point. It can be noticed that in case of the flat-based routing
mechanism as the number of data dissemination between remote nodes increases
8 Deployment Strategies of Wireless Sensor Networks for IoT: Challenges,. . . 151
Fig. 8.6 WSN experimental test case and cluster formation result
as well as the network gets larger, the flooding level tends to increase considerably
with every discovery process, whereas in the cluster-based optimization strategy this
number increases almost proportional to the scale of the network. In fact, although
the generation of the clustering structure needs an initial packet exchange process
for the hierarchical configuration purposes, the control frame dissemination and
flooding costs of both techniques intersect when the number of pair-points raises 7–8
different requests, which certainly determines the threshold upon which the cluster-
based optimization mechanism produces clearer benefits for the mesh networking
scenario. Moreover, as shown in the experimental results, such differences are more
accentuated when applying the NDoSq based on the Cps parametrization, since
the number of dissemination messages is optimized to assure the overall mesh
networking connectivity schema with a reduced cost.
Therefore, this produces that the intersection point at the threshold value is
obtained more quickly during the operability of the WSN. Another interesting
remark is related to the alternative path optimization process performed by the CHs
that take part in a request route, which use their available clustering information
to generate an adjacent multi-hop interconnection, especially if it provides a more
efficient communication path (adjacent routes represented in brackets).
152 G. Mujica et al.
Table 8.1 Comparative analysis of the routing strategies for the proposed experimental tests
The new era of emerging technologies for WSNs and IoT-based applications poses
important challenges regarding efficient methodologies to optimize and evaluate the
performance of multi-hop mesh networking capabilities. In this direction, a new
perspective for tackling the lack of defined on-site support frameworks to deploy and
maintain wireless distributed systems has been approached in this chapter, in which
a combination of modeling, optimization, and performance analysis mechanisms
are integrated into a unique intelligent tool-chain. This proposed platform tries
to cope with the underlying gap between the planning/simulation stages of the
development process and the real implementation assessment and enhancement
under the actual target scenario, aiming to achieve the long-term operability of large-
scale WSN-based applications in an energy/resource-efficient fashion. The system
implementation has been conceived in such a modular and heterogeneous way that
it can be used in low-rate wireless connectivity environments such as in those
distributed systems composed of IEEE 802.15.4-based networking technologies, as
well as in WSNs with more demanding communication capabilities where protocols
relying on IEEE 802.11 technologies are to be included. This perspective is certainly
thought to support novel trends that come out with the use of mesh networking
and routing optimization strategies in future smart-city implementations, in which
the reliability of the wireless collaborative systems will depend on the quality,
efficiency, and adaptability of the dissemination techniques.
8 Deployment Strategies of Wireless Sensor Networks for IoT: Challenges,. . . 153
References
19. M. Rezaee, M. Yaghmaee, Cluster based routing protocol for mobile ad hoc networks.
INFOCOMP J. Comput. Sci. 8, 30–36 (2009)
20. C. Perkins et al., Ad hoc on-demand distance vector (AODV) routing. RFC 3561 (2003)
21. J.Y. Yu, P.H.J. Chong, M. Zhang, Performance of efficient CBRP in mobile ad-hoc networks
(MANETS), in Vehicular Technology Conference, 21–24 Sept 2008, Calgary, BC, pp. 1–7
Chapter 9
Wireless Sensor Networks for the Internet
of Things: Barriers and Synergies
Mihai T. Lazarescu
9.1 Introduction
Field User
WSN Customers
Sensors
WSN Application
Value
Effort System Integrators
Waste
Complete WSN Platform
Partial Value Partial Value Partial Value
HW FW SW
IoT vision to transform and enrich the way in which we perceive and interact with
the reality often assumes capillary distributed devices for which WSNs continue
to play an important role as one of the key enabling technologies since IoT
paradigm inception. They often need to meet stringent requirements such as long
maintenance-free lifetime, low cost, small size, ease of deployment and configura-
tion, adequate processing of collected data, privacy and safety, and, not the least, fast
and reliable development cycles that evolve on par with the underlying technologies.
These are especially important for environmental monitoring applications, both
closer to human day-to-day live (buildings, cities) and remote (e.g., open nature
and climate monitoring).
As shown in Fig. 9.1, at the top of the WSN value chain are WSN application
customers, whose needs are addressed by system integrators. The latter leverage on
the top of WSN technology chain, where we find WSN platforms which can fully
cover, end-to-end, WSN applications.
WSN platforms and development frameworks play a central role as the primary
interface for accessing the underlying technology, standardization, and research
state of the art. A complete platform includes field device hardware and firmware,
development framework, and an application server (e.g., for data storage, monitor-
ing, and post-processing). Development framework, IP components, and supported
hardware need continuous updates because WSN field evolves fast and these are
an important factor in the final value delivered to end users. Also, development
framework flexibility, reliability, and ease of use are important factors allowing
system integrators and application domain experts to direct most of their effort to
WSN application development, where it is valued most.
9 Wireless Sensor Networks for the Internet of Things: Barriers and Synergies 157
This is a node-centric programming model that ranges from close to hardware and
up to some level of abstraction usually provided by an embedded OS or by a virtual
machine (VM).
Among the OSs, we can list TinyOS [4], programmable in nesC [5] which offers a
good modularization with well-defined interfaces and functional encapsulation that
abstracts implementation details. However, low abstraction level and an event-based
programming style without support for blocking operations increase programming
complexity.
To reduce the complexity, TinyGALS [6] provides FIFOs for asynchronous
message passing on top of the synchronous event-driven model and synchronous
method calls. SOS [7] and CoMOS [8] implement priority queues (the former) and
preemptive message handling (the latter).
SNACK [9] allows to compose applications by combining services provided by
reusable library components. T2 [10] simplifies project reuse and porting on new
hardware platforms by combining a horizontal decomposition (to support multiple
devices) and vertical decomposition that allows to build the application using
hardware-independent functional blocks. OSM [11] extends the TinyOS event-
driven model with states and transitions whose actions depend on both events and
program state.
160 M.T. Lazarescu
These programming models have several important features. One of them is efficient
dynamic reprogrammability of small embedded systems. Maté [18] and ASVM [19]
are small application-specific VMs built on top of TinyOS. Melete [20] extends
Maté to multiple concurrent applications. VMStar [21] allows dynamic update of its
own code or the application. Impala [22] is an example of middleware with efficient
over-the-air reprogramming and repairing capabilities.
VMs also provide platform-independent execution models for WSN applications.
Token machine language [23] models the network as a distributed token machine in
which the nodes are exchanging tokens which trigger matching handlers. This model
can be used to implement higher-level semantics that distance themselves from the
underlying nesC implementation. t-kernel [24] modifies (“naturalize”) application
code at load time to implement OS protection and virtual memory without hardware
support.
1
Mathworks Simulink http://www.mathworks.com/help/simulink/index.html.
2
Mathworks Stateflow—Finite State Machine Concepts http://www.mathworks.com/help/toolbox/
stateflow/index.html.
162 M.T. Lazarescu
Neighborhood-Based Groups
Based on physically neighboring nodes, this type of group is well suited for local
collaboration (recurrent in some classes of applications) and the broadcasting nature
of WSN communication, improving in-group communication. Abstract Regions
[29] and Hood [30] provide programming primitives based on node neighborhood
which often fits the application needs to process local data close to its origin. Hood
implements only the one-hop neighbor concept, while Abstract Regions implements
both topological and geographical neighborhood concepts.
Logical Groups
These groups can be defined based on logical properties, including static properties
like node types, or dynamic, such as sensor inputs, which can lead to volatile
membership.
EnviroTrack [31] assigns addresses to environmental events and the sensors
that received the event are dynamically grouped together using a sophisticated
distributed group management protocol.
SPIDEY language [32] represents logical nodes based on the exported static or
dynamic attributes of the physical nodes, and provides communication interfaces
with the logical neighborhood as well as efficient routing.
State-Centric Groups
These are mostly intended for applications that require collaborative signal and
information processing [33]. Around the notion of collaboration group, program-
mers can specify its scope, define its members, its structure, and the member roles
within the group. Pattern-based groups, such as neighborhood- or logical-based, can
also be defined. Its flexible implementation allows it to be used as building block
for higher-level abstractions.
Database
Database is an intuitive abstraction derived from the main function of the nodes,
which is to collect sensing data. Early implementations like Cougar [34] and
9 Wireless Sensor Networks for the Internet of Things: Barriers and Synergies 163
TInyDB [35] provide support for declarative SQL-like queries. Both attempt energy
optimizations. Cougar processes selection operations on sensor nodes to reduce data
transfers. TInyDB optimizes the routing tree for query dissemination and result
collection by focusing on where, when, and how often to sample and provide data.
SINA [36] allows to embed sensor querying and tasking language scripts with
the SQL queries to perform more complex collaborative tasks than those allowed by
SQL semantics.
MiLAN [37] and DSWare [38] provide a quality of service (QoS) extension to
queries which can be defined based on the level of certainty of an attribute among
those that can be measured by the node with a given accuracy. MiLAN converts
a query in an energy-optimized execution plan that includes the source nodes and
routing tree. DSWare expresses and evaluates the QoS as a compound event made
of atomic events, whose presence/absence define the confidence level.
Although database-like interfaces are simple and easy to use, they are not well
suited for applications that require continuous sensing or with significant fine-
grained control flows.
Macroprogramming
Resource Naming
Spatial programming [41] can reference network resources by physical location and
other properties and access them using smart messages. These contain the code,
data, and execution state needed to complete the computation once they reach the
nodes of interest.
Using SpatialViews [42] the developer can dynamically define a spatial view as
a group of nodes that have properties of interest, such as services and location.
Declarative resource naming [43] allows both imperative and declarative
resource grouping using Boolean expressions. Resource binding can be static
or dynamic and the access to resources can be sequential or parallel.
164 M.T. Lazarescu
We will evaluate how the WSN development tools, tool categories, and method-
ologies reviewed in Sect. 9.2 can be used to reduce overall WSN application cost.
We will also evaluate their potential to work in synergy with other tools in a
comprehensive development platform that is suitable to cover the widening diversity
of WSN applications and keep pace with the rapid technological evolution in the
field.
Abstractions at group- or network-level are meant to hide the inner workings of the
abstracted entity, including its internal communications.
On the one hand, this is positive because it allows the developer to focus on
application logic. On the other hand, the abstractions are often implemented using
dedicated or less common (e.g., Haskell-like) programming languages which may
be difficult to use by application domain experts.
Also, given that significant parts of the application are handled automatically by
the system in order to satisfy higher-level specifications, the developer may not have
the means to understand, evaluate, or improve the efficiency with which these are
implemented by the system.
The tools implementing such abstract flows are typically developed as a close
ecosystem. They are unlikely to share models or IP blocks among them, although
they may use common lower-level abstractions (e.g., Regiment [39] uses TinyOS)
or may be flexible (and simple enough) to allow its implementation as an extension
of other programming languages like Kairos. As such, their development and
maintenance can be rather costly. Moreover, the application projects are difficult
to port between such frameworks, which limits also the permeation of research to
commercial applications.
For these flows, in terms of business we can assume training, support, and design
services.
A distinctive note can be made for model-based design (MBD) frameworks
(see Sect. 9.2.2.1). The developer can focus most of the effort on application
development, for which the tools allow various degrees of liberty. Application entry
interface can be suitable for application domain experts, as demonstrated by the
wide adoption of Stateflow® interface by experts in various industrial domains.
Automated code generation and good integration of the flow with simulation tools
(including hardware-in-the-loop) and target OSs simplify design space exploration
for optimizations and also allow manual optimization of the generated projects.
Integration with existing projects reduces the cost of framework maintenance.
Moreover, they provide an observable development environment where the effects
of changes to framework features (e.g., code generation) or to its components (e.g.,
simulators) can be easily compared for existing and new designs. Research advances
can be evaluated the same way before being included in commercial design flows.
Business models that use these flows can enrich their capabilities using custom IP
blocks.
In the following we will comparatively review some options for WSN node
hardware and for server-side software.
166 M.T. Lazarescu
Its main components are the microcontroller and RF device, either stand-alone or
combined in a single integrated circuit, RF antenna, energy sources, transducers,
printed circuit board (PCB), and package.
9.3.1.1 Microcontroller
There are many families of low and very low power microcontrollers, each covering
a broad range of capabilities such as storage size for programs (FLASH), data (RAM
and EEPROM), and peripherals. Given the diverse and specialized offering, the
design flow should assist the developer in selecting the optimal microcontroller
for the application, since it can influence significantly node cost and energy
consumption.
Microcontroller component package type and size has both a direct impact on
the component cost and an indirect one on PCB cost through its size and number of
pins. PCB size can further influence the size and cost of the sensor node package.
Additionally, most microcontrollers can operate using an internal clock source.
This has no additional component cost or impact on PCB size or complexity, but its
frequency is not very accurate nor stable in time. However, if the WSN application
(or the communication protocol) does not require accurate timing, the internal
oscillator is worth considering.
Thus, microcontroller selection should mainly consider:
• on-board support for hardware interface with the peripherals (e.g., transducer, RF
device), application firmware, and communication protocol;
• the trade-off between package type and its associated direct and indirect costs at
sensor node level;
• adequate support for selected RF communication protocol. Its effects at system
level should be carefully weighed. For instance, accurate timers and receive capa-
bilities significantly increase sensor node cost, microcontroller requirements, and
energy consumption.
9.3.1.2 RF Device
As for the microcontroller, the cost of the RF device significantly depends on its
capabilities. For example, a transceiver will typically cost more and require more
external components than a transmit-only radio.
Modern RF devices provide application data interfaces at different levels of
abstraction. These can range from digital (or analog) signal levels to advanced
data packet management. Although the latter may increase RF device cost, it also
sensibly reduce microcontroller computation and memory requirements, working
with a cheaper and smaller device, and also reduce energy consumption and cost.
9 Wireless Sensor Networks for the Internet of Things: Barriers and Synergies 167
Most RF devices use an external crystal quartz for timing and channel frequency
and may optionally output a clock for the microcontroller. However, this implies
that the system is active only when the RF device is active, which may increase
energy consumption.
Commonly used multihop WSN communication protocols require that all nodes
have receive capabilities, which increase the cost of the RF device. Moreover,
most of them actively synchronize their clocks at least with the neighboring nodes
to reduce the energy spent for idle channel listening, which requires an accurate
time reference constantly running on-board and more microcontroller resources,
all translating to higher device cost and energy consumption. However, if the
application does not require bidirectional communication, an asynchronous medium
access control in a star topology may sensibly reduce node cost and energy
consumption.
Several producers offer general purpose devices that include a microcontroller
and a radio in a single package. These can save PCB space and costs, but the
integrated microcontrollers may be oversized for some applications, especially
those using a smaller communication protocol stacks. The same may apply for the
integrated radio devices.
9.3.1.3 RF Antenna
Antenna influences node cost, size, deployment, and performance mainly through
its size, cost, and RF characteristics. Most antenna features are correlated with
operation frequency, range requirements, and RF properties of the environment.
For instance, star network topologies may require longer RF range to lower the
number of repeaters and gateways. In this case, lower RF frequencies (315/433 MHz
bands or below) can increase the communication range for a given RF link budget.
WSN application requirements may influence antenna characteristics such as
directionality, gain, size, resilience to neighboring conductive objects (tree trunks,
metal bodies). Antenna options can range from omnidirectional =2 dipole, or
a =4 whip (both costly to ruggedize), to helical antennas radiating in normal
mode (NMHA) with a good size-performance trade-off, to PCB trace antennas
(better for higher communication frequencies), and ceramic chip antennas with good
performance but higher cost.
PCB components may also influence antenna performance.
Along with node energy consumption, energy supply is very important for the
overall reliability and exploitation cost of the network.
A first decision concerns the use of energy harvesting or non-regenerative (e.g.,
a primary battery).
168 M.T. Lazarescu
9.3.1.5 Transducers
Transducers are used to sense the properties of interest in the environment surround-
ing the node. Its performance affects the node in several ways. First, the transducer
should have low energy requirements and/or allow (very) low duty cycle operation.
Its interface with the node should not increase exceedingly microcontroller require-
ments. Last but not least, the transducer should not require periodic maintenance,
which may significantly increase the operation cost of the network.
9.3.1.6 Package
Node package protects node components from direct exposure to environment and
defines the node external size, mechanical properties, and physical aspect. Its cost
may increase due to special production requirements and its dimensions. Thus,
special requests, such as transparent windows for light energy harvesting, should
be carefully considered.
It may also provide the means to mount the node in the field, thus the package
should be designed to simplify node deployment and maintenance to reduce the
overall cost per node.
There are many hardware sensor nodes, developed for both research and commercial
purposes.3
Their characteristics are extremely diverse. For example, in terms of average
current consumption they range from a low end of 30 A of Metronome Systems
3
Currently there are over 150 node models listed on Wikipedia https://en.wikipedia.org/wiki/
List_of_wireless_sensor_nodes.
9 Wireless Sensor Networks for the Internet of Things: Barriers and Synergies 169
4
Metronome Systems NeoMote http://metronomesystems.com/.
5
Indrion Indriya_DP_01A11 http://indrion.co.in/Indriya_DP_01A11.php.
6
Xively project http://xively.com/.
7
WikiSensing project http://wikisensing.org/.
170 M.T. Lazarescu
Fig. 9.2 Main stages of the automated WSN application design flow at node level: input of
application behavioral description, automated synthesis of possible solutions (using top-level
behavioral description and library components), behavioral simulation, network simulation, node
programming code and configuration generation. Developer-assisted phases are tagged using a
human body
Figure 9.2 shows a typical WSN application development flow at node level.
The flow receives a high-level node-centric application specification and is well
integrated with external tools, each assisting the developer in specific tasks.
Application-specific behavioral input can range from manual source code input
to automated code generation from MBD abstractions (such as Stateflow® used in
[27] or similar state charts editors [51]) or from UML-based or ad-hoc high-level
modeling flows [52, 53]. Either way, the behavioral input is captured in a specific
view of the top-level component, which also includes the metadata needed by the
subsequent phase of the flow, namely the automated synthesis.
The top-level component and all library components have the same format,
which can include more than one view, e.g., behavioral source code or binary,
simulation models for various abstraction levels or simulation environments. All
views are handled as black boxes by the synthesis engine regardless their format, the
synthesis relying only on component metadata. These can be generated manually or
automatically by MBD flows [27].
The second phase of the flow shown in Fig. 9.2 is fully automated. A hardware–
software system synthesis engine takes the top-level component as input and
processes its metadata (such as requires, provides, and conflicts). These properties
are the starting point for the synthesis process which iteratively attempts to find all
subsets of its library of components that do not have any unsatisfied requirements
9 Wireless Sensor Networks for the Internet of Things: Barriers and Synergies 171
left and, at the same time, satisfy all constraints of the top-level and other
instantiated components. These subsets represent possible solutions for application
requirements and can be further examined or modified by the developer.
For each solution, the synthesis tool can create simulation projects, as shown
in the next steps of the flow in Fig. 9.2. The simulations are set up to run on
external simulators (e.g., OMNeT++ [28]) and can be at various level of abstraction.
Basically this is achieved by extracting and configuring the suitable simulation
views of the components instantiated in solution into simulation projects.
Besides behavioral models, the components and constraints of the solution can
include a bill of materials (e.g., compatible nodes, RF and transducer characteristics,
and microcontroller requirements) or software dependencies on specific compilation
toolchains or underlying OS features.
Finally, the same mechanism is used to generate the projects that can be compiled
using the target tools to create the programs for all WSN nodes. These projects are
typically generated in the format expected by the target tools (most often a make-
based project).
The solutions generated by the synthesis tool can be used as they are, or the
developer can optimize them either by changing the specification and rerunning the
synthesis, or by manually editing the generated projects. Either way, the developer
can use simulations to validate and evaluate the solutions and their improvements.
As mentioned, the benefits of WSN application automated synthesis are com-
pounded by its integration with external tools, such as simulators and target
compilation chains, which can provide inputs or assist the developer in other phases
of the flow. For instance, Fig. 9.2 shows some typical interfaces with middleware
[54, 55], with WSN planning tools [56] or with deployment and maintenance
tools [57].
However, the wide variety of the existing tools and models makes it very difficult
to define an exhaustive set of external interfaces. Moreover, any rigidity of tool
interfaces or operation models is prone to reduce the value of the tool and hamper
its adoption in a context which is characterized by rapid evolution of technology and
models, and which does not seem to be slowed down by standardization efforts or
proprietary API proposals.
In this context, as we will show later on, an optimal approach for tool integration
in the existing and future development flows can be to base its core operation on
a model that is expressive enough to encode both high-level abstractions and low-
level details. Moreover, it is also important to provide well-defined interfaces and
semantics to simplify its maintenance, updates, integration with other tools, and
extensions to other application domains.
The tool covers the following main functions: application input (provide a suitable
interface and processing), automated hardware–software synthesis, and code, con-
figuration, and hardware specifications generation.
172 M.T. Lazarescu
During application specification phase, the developer (or an external tool) provides
architectural requirements and top-level behavior as a design component, which
becomes the main driver for the subsequent hardware–software system synthesis.
WSN application requirements can be expressed mainly in terms of application-
specific behavior and its interfaces, and metadata properties.
As argued above, abstract concurrent state charts are an intuitive and efficient
high-level means to simplify top-level application behavior. For design entry within
this flow, the state chart tool should also allow to specify the interfaces and metadata
for the behavioral part.
Yakindu State Chart Tools8 is a free source integrated modeling environment
based on Eclipse modeling framework (EMF) [60] for the specification and
development of reactive, event-driven systems based on the concept of state charts.
Its features provide significant support for design entry, especially useful for
application domain experts with limited programming experience, such as:
• state chart editing through an intuitive combination of graphical and textual
notation. While states, transitions, and state hierarchies are graphical elements,
all declarations and actions are specified using a textual notation;
• state chart validation that includes syntax and semantic checks of the full model.
Examples of built-in validation rules are the detection of unreachable states, dead
ends, and references to unknown events. These validation constraints are checked
live during editing;
• state chart simulation models that allow the check of dynamic semantics. Active
states are directly highlighted in the state chart editor and a dedicated simulation
perspective features access to execution controls, inspection, and setting of
variables, as well as raising of events;
• code generation from state charts to Java, C, and C++ languages. The code
generators follow a code-only approach. The code is stand-alone and does not
rely on any additional runtime libraries. The generated code provides well-
defined interfaces and can be easily integrated with other target code.
Yakindu was designed for embedded applications with a meta model based on
finite state machines (FSMs), either Mealy or Moore. System behavior is defined
by the active state, which is determined by FSM inputs and history. Yakindu meta
model is similar to UML state chart meta model except for the following differences
which are of particular importance for the flow:
• state charts are self-contained with interfaces defined by events and variables;
• core execution semantics are cycle-driven instead of event-driven, which allows
to process concurrent events and to define event-driven behavior on top;
8
Yakindu SCT project http://www.statecharts.org/.
174 M.T. Lazarescu
Fig. 9.3 State chart-based interface for WSN application specification entry and top-level simula-
tion using a customized Yakindu SCT. The right pane can display simulation data or a tool pane
for state chart editing. The interface of the state chart can be interactively defined on the left pane.
The active state during simulations is highlighted on the state chart in the central pane
during the day. The functional description of this application consists of a periodic
check if the temperature collection is enabled, if it is enabled then checks if 5 min
have passed from previous reading, and if so then it acquires a new reading and
sends it to the communication channel. The whole application behavior can be
encoded in just a few condition checks and data transfers, plus some configuration
requirements to support them (such as timers, a temperature reading channel and
a communication channel). The rest of node application and communications are
not application-specific, hence the developer should not spend effort developing
or interfacing with them. In this flow (see Fig. 9.2), these tasks are automatically
handled by the synthesis engine, which attempts to build a system that satisfies all
specifications by reusing library components, as will be explained later.
The top-level component can include also several types of metadata properties.
For instance, if the 6LoWPAN protocol is a compatibility requirement of the WSN
application, a requirement for 6LoWPAN can be added to top-level component,
regardless if the top-level component functional code interfaces directly with the
field communication protocol. This way, the 6LoWPAN requirement directs the
application synthesis to instantiate the functional components from the library that
provide this communication protocol. However, the synthesis tool will instantiate
only those 6LoWPAN components that satisfy other system requirements that are
collected from both the top-level and other instantiated components.
Library components are central to the operation of the system synthesis engine (see
Fig. 9.4). They are used for:
• definition by the developer of behavior and requirements of node-level WSN
application, modeled as a top-level component;
• definition of library blocks that can be instantiated by the synthesis tool to
compose a hardware–software system that satisfies all design specifications;
• interfaces with OS or middleware services, when needed by application behavior;
176 M.T. Lazarescu
Fig. 9.5 Simplified example of metadata for design specification component and some library
components
In the following we will briefly present the use of the synthesis tool for a
representative legacy WSN application of practical interest, a self-powered WSN
gateway designed for long-term event-based environmental monitoring. Source
code is rather complex and optimized. It can handle in real-time messages and state
for up to 1000 sensor nodes with an average current consumption of about 1.6 mA.
It can also bidirectionally communicate with the application server over the Internet
using TCP/IP sockets through an on-board GPRS modem, and receive remote
updates. Regardless, gateway hardware requirements are very low, comparable to
those of a typical WSN sensor node.
178 M.T. Lazarescu
Fig. 9.6 Example of a simple library component that includes properties and a code view
System WSN
Free SW, Integrator Applications
Hobby, DIY
Fig. 9.8 Ecosystem based on the open WSN platform (for academic research, hobbyists)
and its bidirectional synergy with industrialized platform(s) for commercial WSN application
development
The same platform can be used also by the wider public, as shown by the
growing interest recorded for DIY applications, e.g., in home automation and city
environmental monitoring. In exchange, the platform would gain from extensive
testing, consolidation, porting to popular hardware, improved development tools,
and extensions for innovative applications.
Figure 9.8 suggests a possible ecosystem that includes non-profit and industrial
interested parties, which can help both WSN research and spreading the use of WSN
technologies to solve real life problems.
The ecosystem revolves around a free and open WSN platform. The platform
can include open development tools, like those discussed in Sects. 9.2 and 9.4, server
software and open node hardware, either as nodes or node components, as discussed
in Sect. 9.3.
Being open, the platform facilitates contributions from several sources, such as
academic research, free software community interested in WSN/IoT projects, as
well as industrial partners. The latter may become interested because of the business
opportunities that can be opened by a platform that helps reducing the effort, cost,
and risk of WSN-based solutions.
182 M.T. Lazarescu
For this purpose, Fig. 9.8 suggests a productized version of the open platform,
which adds the necessary level of reliability, testing, and support for the develop-
ment of commercial applications. While the open WSN platform reaches its purpose
in a continuous state of flux, the industrial product requires stability, ease of use,
proprietary IP blocks support, qualified training, and support services.
However, as we argued, developing and maintaining a comprehensive platform
is effort-intensive and requires a broad range of engineering skills that are hard to
bring together by single entities. But these can be naturally attracted by the open
platform, which can serve as foundation to reduce development and maintenance
effort for the commercial version(s).
Additionally, the two versions of the platform facilitate the exchanges between
academia and industry. Interesting research results can be ported easier to derived
commercial platform(s). Conversely is facilitated the contribution of closed source
IPs or improvements to platform infrastructure, library, or tools from commercial
platforms.
Last but not least, a reference platform simplifies the reproduction of research
results as well as collaborative developments.
9.6 Conclusion
Although WSNs are object of extensive scientific and technological advances and
can effectively achieve distributed data collection for IoT applications, their wide
scale use is still limited by a perceived low reliability, limited autonomy, high cost,
and reduced accessibility to application domain experts.
Commercial solutions are often effective in addressing vertical application
domains, but they may lead to technology lock-ins that limit horizontal compos-
ability, and component or design reuse.
We consider WSN platform an essential enabler for effective application design:
fast development with low effort and cost, reliable designs based on extensive reuse,
flow accessible to application domain experts, and offering maintainable extensive
technology coverage.
After examining how existing WSN development tools and flows satisfy
these objectives, we propose a node-level hardware–software development flow.
It revolves on automated system synthesis starting from a high-level application
specification (both behavior and non-functional requirements) and reuses
extensively library components.
We argue that this system can foster synergies between academic research, IoT
and WSN developer communities, and system integrators developing commercial
WSN application, with the distinct possibility of mutual benefit in an ecosystem that
merges open and closed source IPs. We consider synergy important, since effective
and reliable WSN development requires a wide range of engineering expertise that
are difficult to be covered viably by individual players.
9 Wireless Sensor Networks for the Internet of Things: Barriers and Synergies 183
References
1. K. Ashton, That ‘Internet of Things’ thing. Expert view. RFID J. (2009). http://www.
rfidjournal.com/article/view/4986
2. K. Romer, F. Mattern, The design space of wireless sensor networks. IEEE Wireless Comm.
11(6), 54–61 (2004)
3. R. Szewczyk, A. Mainwaring, J. Polastre, J. Anderson, D. Culler, An analysis of a large
scale habitat monitoring application, in Proceedings of the 2Nd International Conference on
Embedded Networked Sensor Systems, SenSys ’04 (ACM, New York, 2004), pp. 214–226
4. J. Hill, R. Szewczyk, A. Woo, S. Hollar, D. Culler, K. Pister, System architecture directions for
networked sensors. SIGARCH Comput. Archit. News 28(5), 93–104 (2000)
5. D. Gay, P. Levis, R. von Behren, M. Welsh, E. Brewer, D. Culler, The nesC language: a holistic
approach to networked embedded systems. SIGPLAN Not. 38(5), 1–11 (2003)
6. E. Cheong, J. Liebman, J. Liu, F. Zhao, TinyGALS: a programming model for event-driven
embedded systems, in Proceedings of the 2003 ACM Symposium on Applied Computing, SAC
’03 (ACM, New York, 2003), pp. 698–704
7. C.-C. Han, R. Kumar, R. Shea, E. Kohler, M. Srivastava, A dynamic operating system
for sensor nodes, in Proceedings of the 3rd International Conference on Mobile Systems,
Applications, and Services, MobiSys ’05 (New York, ACM, 2005), pp. 163–176
8. C.-C. Han, M. Goraczko, J. Helander, J. Liu, B. Priyantha, F. Zhao, CoMOS: an operating
system for heterogeneous multi-processor sensor devices. Redmond, WA, Microsoft Research
Technical Report No MSR-TR-2006-177 (2006)
9. B. Greenstein, E. Kohler, D. Estrin, A sensor network application construction kit (SNACK),
in Proceedings of the 2Nd International Conference on Embedded Networked Sensor Systems,
SenSys ’04 (ACM, New York, 2004), pp. 69–80
10. P. Levis, D. Gay, V. Handziski, J.-H. Hauer, B. Greenstein, M. Turon, J. Hui, K. Klues,
C. Sharp, R. Szewczyk et al., T2: a second generation OS for embedded sensor networks.
Telecommunication Networks Group, Technische Universität Berlin, Tech. Rep. TKN-05-007
(2005)
11. O. Kasten, K. Römer, Beyond event handlers: programming wireless sensors with attributed
state machines, in Proceedings of the 4th International Symposium on Information Processing
in Sensor Networks, IPSN ’05 (IEEE Press, Piscataway, 2005)
12. M. Welsh, G. Mainland, Programming sensor networks using abstract regions, in Networked
Systems Design and Implementation (NSDI), vol. 4, pp. 3–3 (2004)
13. H. Abrach, S. Bhatti, J. Carlson, H. Dai, J. Rose, A. Sheth, B. Shucker, J. Deng, R. Han,
MANTIS: system support for multimodal networks of in-situ sensors, in Proceedings of the
2Nd ACM International Conference on Wireless Sensor Networks and Applications, WSNA ’03
(ACM, New York, 2003), pp. 50–59
14. W.P. McCartney, N. Sridhar, Abstractions for safe concurrent programming in networked
embedded systems, in Proceedings of the 4th International Conference on Embedded Net-
worked Sensor Systems, SenSys ’06 (ACM, New York, 2006), pp. 167–180
15. A. Dunkels, O. Schmidt, T. Voigt, M. Ali, Protothreads: simplifying event-driven programming
of memory-constrained embedded systems, in Proceedings of the 4th International Conference
on Embedded Networked Sensor Systems, SenSys ’06 (ACM, New York, 2006), pp. 29–42
16. A. Dunkels, B. Gronvall, T. Voigt, Contiki: a lightweight and flexible operating system for tiny
networked sensors, in Proceedings of the 29th Annual IEEE International Conference on Local
Computer Networks, LCN ’04 (IEEE Computer Society, Washington, DC, 2004), pp. 455–462
17. C. Nitta, R. Pandey, Y. Ramin, Y-threads: supporting concurrency in wireless sensor networks,
in Proceedings of Distributed Computing in Sensor Systems: Second IEEE International
Conference, DCOSS 2006, San Francisco, CA, June 18–20, 2006 (Springer, Berlin/Heidelberg,
2006), pp. 169–184
18. P. Levis, D. Culler, Maté: a tiny virtual machine for sensor networks, in Proceedings of the
10th International Conference on Architectural Support for Programming Languages and
Operating Systems, ASPLOS X (ACM, New York, 2002), pp. 85–95
184 M.T. Lazarescu
19. P. Levis, D. Gay, D. Culler, Active sensor networks, in Proceedings of the 2nd Conference on
Symposium on Networked Systems Design & Implementation - Volume 2, NSDI’05 (USENIX
Association, Berkeley, 2005), pp. 343–356
20. Y. Yu, L.J. Rittle, V. Bhandari, J.B. LeBrun, Supporting concurrent applications in wireless
sensor networks, in Proceedings of the 4th International Conference on Embedded Networked
Sensor Systems, SenSys ’06 (ACM, New York, 2006), pp. 139–152
21. J. Koshy, R. Pandey, VMSTAR: synthesizing scalable runtime environments for sensor
networks, in Proceedings of the 3rd International Conference on Embedded Networked Sensor
Systems, SenSys ’05 (ACM, New York, 2005), pp. 243–254
22. T. Liu, M. Martonosi, Impala: A Middleware System for Managing Autonomic, Parallel Sensor
Systems, in Proceedings of the Ninth ACM SIGPLAN Symposium on Principles and Practice
of Parallel Programming, PPoPP ’03 (ACM, New York, 2003), pp. 107–118
23. R. Newton, D. Arvind, M. Welsh, Building up to macroprogramming: an intermediate language
for sensor networks, in Proceedings of the 4th International Symposium on Information
Processing in Sensor Networks, IPSN ’05 (IEEE Press, Piscataway, NJ, 2005)
24. L. Gu, J.A. Stankovic, t-kernel: providing reliable OS support to wireless sensor networks,
in Proceedings of the 4th International Conference on Embedded Networked Sensor Systems,
SenSys ’06 (ACM, New York, 2006), pp. 1–14
25. R. Shimizu, K. Tei, Y. Fukazawa, S. Honiden, Model driven development for rapid prototyping
and optimization of wireless sensor network applications, in Proceedings of the 2Nd Workshop
on Software Engineering for Sensor Network Applications, SESENA ’11 (ACM, New York,
2011), pp. 31–36
26. A. Taherkordi, F. Loiret, A. Abdolrazaghi, R. Rouvoy, Q. Le-Trung, F. Eliassen, Program-
ming sensor networks using REMORA component model, in Proceedings of the 6th IEEE
International Conference on Distributed Computing in Sensor Systems, DCOSS’10 (Springer,
Berlin/Heidelberg, 2010), pp. 45–62
27. Z. Song, M.T. Lazarescu, R. Tomasi, L. Lavagno, M.A. Spirito, High-level Internet of things
applications development using wireless sensor networks, in Internet of Things: Challenges
and Opportunities (Springer, Cham, 2014), pp. 75–109
28. A. Varga, R, Hornig, An overview of the OMNeT++ simulation environment, in Proceedings
of the 1st International Conference on Simulation Tools and Techniques for Communica-
tions, Networks and Systems and Workshops, Simutools ’08 (ICST Institute for Computer
Sciences, Social-Informatics and Telecommunications Engineering, Brussels/Belgium, 2008),
pp. 60:1–60:10
29. M. Welsh, G. Mainland, Programming sensor networks using abstract regions, in Networked
Systems Design and Implementation (NSDI), vol. 4, pp. 3–3 (2004)
30. K. Whitehouse, C. Sharp, E. Brewer, D. Culler, Hood: a neighborhood abstraction for
sensor networks, in Proceedings of the 2Nd International Conference on Mobile Systems,
Applications, and Services, MobiSys ’04 (ACM, New York, 2004), pp. 99–110
31. T. Abdelzaher, B. Blum, Q. Cao, Y. Chen, D. Evans, J. George, S. George, L. Gu, T. He,
S. Krishnamurthy, L. Luo, S. Son, J. Stankovic, R. Stoleru, A. Wood, EnviroTrack: towards an
environmental computing paradigm for distributed sensor networks, in Proceedings of the 24th
International Conference on Distributed Computing Systems, pp. 582–589 (2004)
32. L. Mottola, G. Pietro Picco, Logical neighborhoods: a programming abstraction for wireless
sensor networks, in Proceedings of the Distributed Computing in Sensor Systems: Second
IEEE International Conference, DCOSS 2006, San Francisco, CA, June 18–20, 2006 (Springer,
Berlin/Heidelberg, 2006), pp. 150–168
33. J. Liu, M. Chu, J. Liu, J. Reich, F. Zhao, State-centric programming for sensor-actuator network
systems. IEEE Pervasive Comput. 2(4), 50–62 (2003)
34. P. Bonnet, J. Gehrke, P. Seshadri, Querying the physical world. IEEE Pers. Commun. 7(5),
10–15 (2000)
35. S.R. Madden, M.J. Franklin, J.M. Hellerstein, W. Hong, TinyDB: an acquisitional query
processing system for sensor networks. ACM Trans. Database Syst. 30(1), 122–173 (2005)
9 Wireless Sensor Networks for the Internet of Things: Barriers and Synergies 185
10.1 Introduction
assumes the existence of a specific threshold value, with respect to which and based
on the deviation of a particular measurement to that threshold an event can be
defined. Temperature is a characteristic example since exceeding a specific level
(e.g., 40 ı C) can be categorized as an event. However, even in simplistic application
scenarios it is identified that such approaches are inadequate to capture complex
events depending on multiple inputs. Based on this deficiency a new even detection
algorithmic trend is developed utilizing techniques based on pattern recognitions
since all events can be represented as specific patterns.
Respective techniques’ presentation, analysis, and classification are based on par-
ticular set of characteristics which effectively distinguish each approach revealing
relative advantages and disadvantages advocating the use of each one to specific
application scenarios.
Probably the most basic and fundamental differentiation concerns single modality
and multi-modality events [16]. The former concern events the identification of
which is based only on a single characteristic, or type of measurement which
is referred to as modality. In the latter category the event identification is based
on concurrently, combining multiple inputs (e.g., sensors for WSN networks). To
effectively utilize a plethora of different acquired type of signals (i.e., modalities)
192 C. Antonopoulos et al.
Depending on the level of data that is actually fused three different categorizes
can be identified [23]. It is noted that these categorizes effectively represent
abstraction layers typically utilized at application level. Therefore, more layers can
be identified with respect to specific application scenarios while combination of
different categories can also be envisioned and exploited.
Direct level fusion: This category includes algorithms and techniques that fuse
together raw data so as to derive to a decision.
Feature level fusion: In this case features extracted from acquired data (usually in
the form of vectors) comprise the entities that are actually fused and combined
so as to offer higher abstraction knowledge and relative decisions.
Decision level fusion: Finally, different and diverse decisions extracted from initial
algorithms can be fed into a data fusion algorithm leading to even more abstract
indications and conclusions.
Event Detection
Techniques for
WSNs
Pattern
Model Based AI Based
Matching
Map Based
Prototype Fuzzy Logic
Marching Based
Fuzzy ART
Probabilistic
and
Statistical Neural
Models Network
Based
Fixed width
Clustering
Bayesian
Methods
kMEANS
SVM
Decision
Trees
however, comprising probably the most active category, can be further divided into
two subcategories, i.e., supervised and unsupervised learning. Each one of these
subcategories leads to specific approaches as indicated in Fig. 10.1 comprising the
most sophisticated and prominent of the state-of-the-art approaches.
10 Event Identification in Wireless Sensor Networks 195
The main idea upon which respective techniques are based is that maps comprise
a way to accurately represent the physical world and physical phenomena in space
and time. Thus a map uniquely corresponds to an event and adopting an adequate
process it can actually assist in identifying events that occur or have occurred in a
specific environment.
Specifically Khelil et al. [28] present a distributed event detection algorithm
based on Map-based world model (MWM) in which each sensor node forms a
map of its immediate surrounding and sends the resulting model to the sink node
196 C. Antonopoulos et al.
targeting environmental event detection. WSNs, on the one hand, are inherently
embedded in the real world, the goal being to detect specific spatial and temporal
physical world’s ambient characteristics, such as temperature, air pressure, gas
presence, and oxygen density. On the other hand, maps present a powerful/efficient
tool to model the spatial and temporal behavior of the physical world being an
intuitive aggregated view of it. As stated before, the main objective behind the
deployment of WSNs is to create an appropriate model for the physical world.
Therefore, without loss of generality, the authors model the world as a stack of maps
presenting the spatial and temporal distributions of the sensed attributes of interest
in the physical world. Authors argue that the specific techniques are indeed able
to identify event rapidly and accurately. Li et al. [29] propose a distributed event
detection approach based on the creation of a 3D map and an aggregation method.
Authors argue that nodes reside in a three-dimensional environment and therefore
are able to model this environment as a cubic map cell. Such cubic cell maps can be
aggregated in a cluster head or a sink node so as to form an extended cubic cell map
containing all environments monitored. In final stage of the event detection process,
the map of the entire environment represents the event as well as the event location.
event detection methods, and Kerman et al. [30] baseline the results of the static
threshold method against a composite event detection method.
Techniques falling into this category are probably the most straightforward
based on simple if-then-else rules aiming to control whether acquired real time
measurements deviate and to what degree with respect to predefined thresholds
levels. Respective developments tend to exhibit the following characteristics: (1)
it is very easy to implement since they effectively comprise by a set of if-then-else
rules, (2) they usually require specialized and in-depth knowledge of the system of
phenomenon to adequately configure the threshold values, and (3) they tend to be
inaccurate in complex scenarios since they model events as linear functions. Vu
et al. [31] propose a complex event detection threshold-based technique, which
aims to decompose complex events to a set of sub-events of lower complexity.
Therefore an event is identified if all sub-events are identified (occurred either
concurrently or sequentially). For example, an explosion event is decomposed
into two sub-events: (1) the occurrence of a loud noise and (2) the increase of
heat. Consequently the event of an explosion is identified if both aforementioned
events occur concurrently. The particular study offers the possibility of distributed
processing when applied in a wide scale networks and is evaluated in the context
of simulation environment. A distributed event detection threshold-based scheme
for heterogeneous WSNs is presented in [32]. In these cases the authors propose
a two layer clustering approach. Specifically one layer acts as parent-nodes and
the final node acts as the sink node. The study proposes a compete framework
for both data collection and event identification in the context of the COMis
middleware. Another relative event detection approach characterized as consensus-
based techniques is presented in [33], aiming to assist in volcano monitoring
and respective event identification. The authors suggest a complete framework
enabling accurate volcano activity monitoring applied on the well-known (http://
www.willow.co.uk/html/telosb_mote_platform.php) WSN platform.
In [34], a biomedical application of wireless sensor networks is presented
under the assumption that a small wireless node with an accelerometer is attached
to a human wrist, like a wristwatch. The accelerometer provides instantaneous
measurement of acceleration (caused by a person’s movements) that is currently
acting on the device. In this configuration, the accelerometer with accompanying
algorithms can be used to classify the subject’s movement into one of a few
categories. This paper focuses on two threshold-based algorithms, which attempt
to identify movements that are potentially harmful or indicative of immediate
danger to a patient. The first algorithm seeks to identify rapid shaking movements
that usually accompany myoclonic, clonic, and tonic-clonic seizures. Automated,
quick seizure detection has the capability of alerting medical personnel when the
patient is not physically capable of requesting assistance. The second algorithm is
designed to generate an alarm when a patient has sustained an extended period of
inactivity, potentially indicative of coma onset or loss of consciousness triggered
by an acute brain injury. Like shaking movements, detecting inactive periods also
has the potential to alert medical personnel to a problem more expediently than
other means. Upon detecting an abnormal event, both algorithms trigger an auditory
198 C. Antonopoulos et al.
alarm from the wrist-device and transmit an alarm message (with necessary patient
identification) through a ZigBee multi-hop wireless network to a patient monitoring
station controlled by medical personnel.
NED (Noise-Tolerant Event and Event Boundary Detection) [38] represents a
scheme able to identify events as well as the thresholds of events focusing on WSN
networks. It is based on a moving average algorithm so as to minimize noise and
a statistical method for event and event levels identification. A very interesting in-
network event detection algorithm based on statistical metrics is presented in [39].
According to this approach the results of the algorithm are conveyed to the sink node
(or cluster head node) so that the final evaluation is performed. Authors argue that
their proposal is accurate, fault tolerant, and energy efficient through simulation-
based evaluation.
A probabilistic model uses probability theory to model the uncertainty in
acquired data. A probabilistic model describes a set of possible probability distribu-
tions for a set of observed data, and the goal is to use the observed data to convert
the distribution (usually associated with parameters) in the probabilistic model that
can best describe the current data.
Probabilistic event detection methods consist of those methods in which the
probability of event occurrence and other related probabilities and parameters are
computed and assessed based on specific preexisting assumptions, rather than
based on computing and testing statistics derived from sample data sets. Ihler
et al. [11], for instance, develop a probabilistic framework for unsupervised event
detection and learning based on a time-varying Poisson process model that can
also account for anomalous events. Their experimental results indicate that the
proposed time-varying Poisson model provides a robust and accurate framework
to adaptively separate unusual event plumes from normal activity. This model
also performs significantly better than a non-probabilistic, threshold-based event
detection technique.
In the context of this approach, probability theory is utilized to model and
describe events able to be identified and thus accurately indicate the occurrence
of the event. In that context spatio-temporal event detection (STED) [40] comprises
a real time in-network event detection scheme able to detect events using a belief
propagation technique. Resulting implementation has been evaluated both in the
context of real WSN network (utilizing TmoteSky in a small scale network) and in
the context of a simulation environment (able to configure a large scale network).
The main idea of this class is that events form a specific data pattern. Therefore,
an event can be identified if the pattern of the real time acquired data match
the event pattern. To achieve their objective respective techniques depend upon
specific equations which are able to evaluate patterns or tendencies of data and
thus decide on the occurrence or not of a specific event. These techniques share
10 Event Identification in Wireless Sensor Networks 199
the following attributes: (1) are able to handle complex events while searching for
data pattern formation using non-linear equations, (2) they are easily configurable
and adaptable to a wide range of applications, (3) demand specialized knowledge
for the correct configuration of the techniques’ parameters, and (4) they usually lead
to computational intense implementation due to their complexity.
Signatures are created by converting data into feature domain. Having created sig-
natures for specific events, acquired data corresponding to event occurrences can be
reliably distinguished from the rest of the aggregated data. The difference between
prototype and signature matching approaches concerns mainly the methodology
utilized when data are transformed from one domain to another such as frequency
or symbolic domain.
In [10] authors suggest a local event detection scheme utilizing principal
component analysis (PCA) in order to extract the event signature. They also use a
threshold to differentiate event data from no-event data. Respective implementation
is evaluated on MicaZ nodes. Following another perspective Zoumboulakis et al.
[41] define complex events as set of data points effectively defining a pattern and
then events are identified utilizing symbolic aggregate approximation (SAX). The
idea is to transform data into a symbolic domain and then based on minimum
distance estimation between already acquired data patters and real time acquired
data try to estimate whether an event has occurred. The implementation concerns
local application and it is evaluated using a Matlab simulation environment. Another
200 C. Antonopoulos et al.
Bayesian Techniques
SVM classification method consists of two main components: a kernel function and
a set of support vectors. The support vectors are obtained via the training based
upon specific training data. New data are classified using a simple computation
involving the kernel function and support vectors only. In [47], the authors solve
the localization problem with the following modest requirements: (1) existence of
beacon nodes, (2) a sensor may not directly communicate with a beacon node, and
(3) only connectivity information may be used for location estimation (pairwise
distance measurement not required). Requirement (1) is for improved localization
accuracy. Requirement (2) relaxes the strong requirement on communication range
of beacon nodes. Requirement (3) avoids the expensive ranging process pertaining
to specialized sensorial equipment. All these requirements are reasonable for
large networks where sensor nodes are of limited resources. The authors propose
LSVM—a novel solution that satisfies the requirements above, offering fast local-
ization, and alleviating the border problem significantly. LSVM is also effective
in networks with the existence of coverage holes or obstacles. LSVM maps the
10 Event Identification in Wireless Sensor Networks 203
network using the learning concept of support vector machines (SVM). With respect
to the localization problem, a set of geographical regions is defined in the sensor
field and each sensor node is classified into these regions. Then its location can be
estimated inside the intersection of the containing regions. The training data is the
set of beacons, and the kernel function is defined based on hop counts only.
Decision Trees
According to this classification method input data is traversing all possible branches
of a learning tree [7, 48]. The goal of this process is to compare input data features
in relation to different conditions until a specific category is reached. DT-based
approach is particularly important for WSNs since they can effectively address
respective challenges. Characteristics features applied in WSNs include loss rate,
corruption rate, mean time to failure (MTTF), and mean time to restore (MTTR).
Finally a critical requirement posed by such solutions concern the necessity for
linearly separable data while the process of building optimal learning trees is NP-
complete [49].
The specific theory comprises a neural network category performing the work of
clustering. Specifically it concerns the integration of fuzzy logic approach to an
adaptive resonance theory algorithm [50] thus increasing the applicability of that
algorithm. In [51] such an algorithm is presented in order to detect abnormal events,
which is not the common case. In other words, abnormal events can be considered
as outliers. Hence, the main idea is to cluster data and the cluster with the minimum
population are considered events.
group is presented in [53]. Authors in this case propose that isolated nodes aggregate
data and send them to a sink (or cluster) node where these groups are merged
together in order to detect anomalies. Respective implementation is based on CCC
programming language and evaluated on data from the Great Duck Island (sensor
acquiring temperature, humidity, and atmospheric pressure) for detecting any kind
of anomalies.
K-Means
K-Means is one of the simplest unsupervised learning algorithms and most widely
used to solve the well-known clustering problem. K-Means effectively is a numeri-
cal, non-deterministic, and iterative method. K-Means clustering requires assigning
the number of clusters K beforehand. Additionally, it partitions the data set into K
separate groups and every group (cluster) is determined by the distances between
vectors.
The main advantage of K-Means clustering is its pace, as in practice it requires
only a few iterations to converge. Thus, it is a prominent candidate to run in the
sensor node in real time, and is robust and relatively computationally efficient as
long as the K value is adequately low. However, the disadvantages include a fixed
number of clusters which can make it difficult to predict a K value which is sensitive
to the presence of noise data and outliers because they influence the calculation
of the clusters’ centers. Randomly choosing an initial cluster center can result in
different final clusters and as a consequence to an unsatisfactory result, due to
different runs occurring for the same input data. Additionally, this method cannot
handle the highly overlapping data because the clusters do not overlap. However, it
is possible overcome most of these limitations in the preprocessing stage. K-Means
is highly sensitive to the initial placement of the cluster centers. Because of initial
cluster centers are chosen randomly, the K-Means algorithm cannot guarantee a
unique clustering result. Additionally, choosing an ill-fitting initial placement of the
cluster centers can lead to slow converge, empty clusters, and a higher chance of
standing still in bad local minima [54].
In [55] authors use K-Means for detecting leak and burst events relying on
offline techniques which collect loggers’ data from multiple locations. We believe
that detecting such events in real time, with smart sensors nodes, could improve
monitoring operations and save operational costs.
In order to select the adequate event detection techniques in WSN networks, various
performance and behavioral characteristics must be taken into consideration. In this
context aspects like the location where the algorithm is executed (i.e., distributed or
centralized), time constrained requirements, scalability, and sensor characteristics
10 Event Identification in Wireless Sensor Networks 205
Relative model describes how data are handled and the location(s) where the event
detection actually takes place. Historically the approach followed in WSNs assumed
that all sensor data are collected in a central network entity (sink node, base station,
and cluster head) where data were being processed offline. The increasing demand
for time constrained (or even real time) performance in contemporary WSNs has
effectively render such centralized approaches inadequate. Therefore, nowadays two
different models are attracting most of the research interest, specifically (1) local
processing mode and (2) distributed processing model.
A local processing model assumes that all processing occurs in each isolated
node based on each node own capabilities. Therefore, in such implementation no
communication (or limited) is actually required. On the contrary in the context of the
distributed processing model events are actually detected following a cooperative
approach entailing specific communication collaboration amongst nodes. Thus the
fundamental idea of distributed processing model is a collaboration of multiple
nodes towards accurate and reliable event detection.
The scale of an actual WSN can drastically vary from few tens to many hundreds
or even thousands of nodes depending on the specific application scenario. Con-
sequently selected approach must be considering this parameter or be adaptive to
changes of this parameter. Therefore, when a very small scale network is considered
then local data processing could be preferred over a distributed approach posing
some overhead (communication and computation) without actually enhancing per-
formance. However, when the scale of the network, as well as complexity increases,
distributed approaches are clearly more preferable offering better adaptability and
enhanced accuracy and reliability.
efficiently handle heterogeneous data is quite challenging since the increased sensor
space availability analogously augments the dimension of data to be handled thus
requiring sophisticated data processing approaches.
10.6.5 Density
A parameter that can drastically affect event detection performance has to do with
the expected network node density. It is worth noting that despite its importance and
degree of influence it is usually omitted when evaluating respective solutions. On the
contrast authors usually focus solely on scalability which, however, only partially
cover this aspect.
10.7 Conclusions
Having discussed the most prominent approaches and highlighted all respective
main characteristics of each event detection class, this section aims to summarize
our survey and extract useful conclusions. We also hope that this effort can serve as
a roadmap for future research efforts in this research domain. Undoubtedly event
detection comprises a prominent research domain in WSNs, since by definition
in most realistic commercial WSN application scenarios, the main objective is to
recognize specific situations, as opposed to, for example, continuous streaming of
raw data. However, for respective solutions to be effective careful consideration
and adequate attention must be paid to WSN specific characteristics and even more
scares resource limitation drastically differentiating them from any other, resource
rich, wireless technology. Despite, the criticality of this requirement it is found
that many proposal omit to take it into consideration failing to offer sufficient
performance and behavioral characteristics. Probably the most compelling charac-
teristic stemming from the aforementioned requirements has to do with optimal task
allocation amongst nodes clearly advocating distributed strategies especially in wide
scale WSN deployments. Furthermore, from the elicitation effort devoted in this
chapter it has been extracted that applicability of artificial intelligence comprises
one of the most prominent approaches, future event detection algorithms should
pursue offering enhanced capabilities with respect to flexibility and adaptability to a
wide range of real life application scenarios. Additionally, existing implementation
exhibits advanced performance in terms of accuracy and reliability compared
to the rest of classification categorizes. Finally, an aspect often overlooked but
drastically influencing the added value of any relative proposal pertains to the
validation/evaluation environment selected. In that respect the majority of the efforts
rely on simulation-based environments which although offering specific advantages
in early stages of design and development or preliminary performance indications
in wide scale networks suffer from low objectivity, accuracy as well as myopic
consideration of the dynamic nature of real WSNS. Therefore, in conjunction to
the wide availability of powerful WSN platform nowadays, we believe that real
life experimentation of proposed solutions should be an indispensable part of any
relative research or/and development effort.
References
3. M.C. Kerman, W. Jiang, A.F. Blumberg, S.E. Buttrey, Event Detection Challenges, Methods,
and Applications in Natural and Artificial Systems, 14th International Command and Control
Research and Technology Symposium (ICCRTS), Jun 15–17, 2009, Washington, DC
4. D. Li, K.D. Wong, Y.H. Hu, A.M. Sayeed, Detection, classification, and tracking of targets.
IEEE Signal Process. Mag. 19(2), 17–29 (2002). ISSN 1053-5888. doi:10.1109/79.985674
5. M. Zoumboulakis, Pattern matching and detection in extremely resource constrained wireless
sensor networks. Ph.D. Thesis, 2011
6. N.D. Phung, M.M. Gaber, U. Rhm, Resource-aware online data mining in wireless sensor
networks, in Proceedings of the 2007 IEEE Symposium on Computational Intelligence and
Data Mining (CIDM’2007)
7. M.A. Alsheikh, S. Lin, D. Niyato, H.-P. Tan, Machine learning in wireless sensor networks:
algorithms, strategies, and applications. IEEE Commun. Surv. Tutorials 16(4), 1996–2018
(2014)
8. A. Saoji, P. Lambhate, Survey paper on event detection techniques in wireless sensor network
for disaster recovery. Int. J. Eng. Res. Technol. 2(12), 120–124 (2013)
9. M. Bahrepour, N. Meratnia, P.J.M. Havinga, Automatic fire detection: a survey from wireless
sensor network perspective. http://doc.utwente.nl/65223/, Dec 2008
10. J. Gupchup, A. Terzis, R.C. Burns, A.S. Szalay, Model-based event detection in wireless sensor
networks, in Proceedings of the Workshop on Data Sharing and Interoperability on the World-
Wide Sensor Web (DSI) (2007)
11. A. Ihler, J. Hutchins, P. Smyth, Adaptive event detection with time-varying Poisson processes,
in The Twelfth International Conference on Knowledge Discovery and Data Mining (Associa-
tion for Computing Machinery) (2006). Retrieved from 28 Feb 2008
12. T.B. Trafalis, H. Ince, M.B. Richman, Tornado detection with support vector machines. Lect.
Notes Comput. Sci. 2660, 708 (2003)
13. K. Kapitanova, S.H. Son, K.-D. Kang, Using fuzzy logic for robust event detection in wireless
sensor networks. Ad Hoc Netw. 10(4), 709–722 (2012)
14. K. Kapitanova, S.H. Son, K.-D. Kang. Event detection in wireless sensor networks—can fuzzy
values be accurate? in Ad Hoc Networks (Springer, Berlin/Heidelberg, 2010)
15. A. Tavakoli, J. Zhang, S. Son, Group-based event detection in undersea sensor networks, in
The Second International Workshop on Networked Sensing Systems (2005)
16. H. Medjahed, D. Istrate, J. Boudy, B. Dorizzi, Human activities of daily living recognition
using fuzzy logic for elderly home monitoring, in IEEE International Conference on Fuzzy
Systems, 2009. FUZZ-IEEE 2009, Jeju Island, 20–24 Aug 2009
17. E.F. Nakamura, A.A.F. Loureiro, A.C. Frery, Information fusion for wireless sen-
sor networks: methods, models, and classifications. ACM Comput. Surv. 39(3) (2007).
doi:10.1145/1267070.1267073
18. J. Žurauskienė et al., A graph theoretical approach to data fusion. bioRxiv (2015).
doi:10.1101/025262
19. J.I.-Z. Chen, Y.-N. Chung, A data fusion methodology for wireless sensor systems. Int. J.
Comput. Commun. Control VII(1), 39–52 (2012). ISSN 1841-9836, E-ISSN 1841-9844
20. N. Ahmed, Y. Dong, T. Bokareva, S. Kanhere, S. Jha, T. Bessell, M. Rutten, B. Ris-
tic, N. Gordon, Detection and tracking using wireless sensor networks, in Proceedings
of the 5th International Conference on Embedded Networked Sensor Systems (2007).
doi:10.1145/1322263.1322328
21. P. Zou, Y. Liu, An efficient data fusion approach for event detection in heterogeneous wireless
sensor networks. Appl. Math. Inf. Sci. (2015) doi:10.12785/amis/090160
22. P. Manjunatha, A.K. Verma, A. Srividya, Multi-sensor data fusion in cluster based wireless
sensor networks using fuzzy logic method, in IEEE Region 10 and the Third international
Conference on Industrial and Information Systems, 2008 (ICIIS 2008), 8–10 Dec 2008, pp.
1–6. doi:10.1109/ICIINFS.2008.4798453
23. F. Castanedo, A review of data fusion techniques. Sci. World J. 2013, 19 pp. (2013), Article ID
704504. doi:10.1155/2013/704504
10 Event Identification in Wireless Sensor Networks 209
24. S.B. Kotsiantis, Supervised machine learning: a review of classification techniques, in Pro-
ceedings of the 2007 Conference on Emerging Artificial Intelligence Applications in Computer
Engineering
25. M. Donald, D.J. Spiegelhalter, C.C. Taylor, J. Campbell (eds.), Machine Learning, Neural and
Statistical Classification (Ellis Horwood, Upper Saddle River, NJ, 1995)
26. M. Baqer, A.I. Khan, Event detection in wireless sensor networks using a decentralised pattern
matching algorithm. White Paper (2008)
27. C. Zhang, C. Wang, D. Li, X. Zhou, C. Gao, Unspecific event detection in wireless sensor
networks, in International Conference on Communication Software and Networks, 2009
(ICCSN ’09) (2009)
28. A. Khelil, F.K. Shaikh, B. Ayari, N. Suri, Mwm: a map-based world model for wireless sensor
networks, in Proceedings of the 2nd International Conference on Autonomic Computing and
Communication Systems, Autonomics ’08, ICST (Institute for Computer Sciences, Social-
Informatics and Telecommunications Engineering) (2008)
29. M. Li, Y. Liu, L. Chen, Non threshold-based event detection for 3D environment monitoring
in sensor networks. IEEE Trans. Knowl. Data Eng. 20(12), 1699–1711 (2008)
30. M.C. Kerman, W. Jiang, A.F. Blumberg, S.E. Buttrey, The application of a quantile regression
metamodel for salinity event detection confirmation within New York harbor oceanographic
data. J Oper Oceanogr 2(1), 49–70 (2009)
31. C.T. Vu, R.A. Beyah, Y. Li, Composite event detection in wireless sensor networks, in
Performance, Computing, and Communications Conference, 2007 (IPCCC 2007) (2007), IEEE
International, pp. 264–271
32. A.V.U. Phani Kumar, V. Adi Mallikarjuna Reddy, D. Janakiram, Distributed collaboration for
event detection in wireless sensor networks, in Proceedings of the 3rd International Workshop
on Middleware for Pervasive and Ad-hoc Computing, ACM (2005)
33. G. Werner-Allen, K. Lorincz, J. Johnson, J. Lees, M. Welsh, Fidelity and yield in a volcano
monitoring sensor network, in Proceedings of the 7th Symposium on Operating Systems Design
and Implementation. USENIX Association (2006)
34. T.R. Burchfield, S. Venkatesan, Accelerometer—based human abnormal movement detection
in wireless sensor networks, in Proceedings of the 1st ACM SIGMOBILE International Work-
shop on Systems and Networking Support for Healthcare and Assisted Living Environments
(2007), ACM, New York, pp. 67–69
35. A.O. Sykes, An introduction to regression analysis. Chicago Working Paper in Law &
Economics (1993), University of Chicago Law School. Retrieved 4 Oct 2008
36. J. Sauvageon, A.M. Agogino, A.F. Mehr, I.Y. Tumer, Comparison of event detection methods
for centralized sensor networks, in Proceedings of the 2006 IEEE Sensors Applications
Symposium, 2006
37. G. Welch, G. Bishop, An Introduction to the Kalman Filter (University of North Carolina at
Chapel Hill, Chapel Hill, 2006). TR 95-041
38. G. Jin, S. Nittel, Ned: an efficient noise-tolerant event and event boundary detection algorithm
in wireless sensor networks. in 7th International Conference on Mobile Data Management,
2006 (MDM 2006) (2006)
39. C.V. Easwaran, An efficient in-network event detection algorithm for wireless sensor nodes, in
Novel Algorithms and Techniques in Telecommunications, Automation and Industrial Electro
Electronics (Springer, The Netherlands, 2008). ISBN 978-1-4020-8736-3
40. J. Yin, D.H. Hu, Q. Yang. 2009. Spatio-temporal event detection using dynamic conditional
random fields. In Proceedings of the 21st international jont conference on Artifical intelligence
(IJCAI’09), ed. by H. Kitano. Morgan Kaufmann Publishers Inc., San Francisco, CA, pp.
1321–1326
41. M. Zoumboulakis, G. Roussos, Escalation: complex event detection in wireless sensor
networks, in Smart Sensing and Context (Springer, Berlin/Heidelberg, 2007). ISBN 978-3-
540-75695-8
42. F. Martincic, L. Schwiebert, Distributed event detection in sensor networks. International
Conference on Systems and Networks Communication (2006)
210 C. Antonopoulos et al.
43. K.-X. Thuc, K. Insoo, A collaborative event detection scheme using fuzzy logic in clustered
wireless sensor networks. AEU Int. J. Electron. Commun. 65(5), 485–488 (2011)
44. L. Yu, N. Wang, X. Meng, Real-time forest fire detection with wireless sensor networks, in
Proceedings. 2005 International Conference on Wireless Communications, Networking and
Mobile Computing (2005)
45. B. Krishnamachari, S. Iyengar, Distributed Bayesian algorithms for fault-tolerant event region
detection in wireless sensor networks. IEEE Transactions on Computers (2004)
46. M. Moradi, J. Ghaisari, J. Askari, M. Gorji, A new method for detection of a distributed event in
wireless sensor networks, in 2011 19th Iranian Conference on Electrical Engineering (ICEE)
(2011)
47. D.A. Tran, T. Nguyen, Localization in wireless sensor networks based on support vector
machines. IEEE Trans. Parallel Distrib. Syst. 19(7), 981–994 (2008)
48. T.O. Ayodele, Types of machine learning algorithms, in New Advances in Machine Learning
(InTech, Rijeka, 2010)
49. S.R. Safavian, D. Landgrebe, A survey of decision tree classifier methodology. IEEE Trans.
Syst. Man Cybern. 21(3), 660–674 (1991)
50. C.P. Smith, Fuzzy adaptive resonance theory: applications and extensions. Masters Theses,
2015
51. A. Kulakov, D. Davcev, Tracking of unusual events in wireless sensor networks based on
artificial neural-networks algorithms, in International Conference on Information Technology:
Coding and Computing (ITCC’05)—Volume II (2005)
52. C.E. Loo, M.Y. Ng, C. Leckie, M. Palaniswami, Intrusion detection for routing attacks in sensor
networks. Int. J. Distrib. Sens. Netw. 2(4), 313–332 (2006)
53. S. Rajasegarar, C. Leckie, M. Palaniswami, J.C. Bezdek, Distributed anomaly detection
in wireless sensor networks, in 2006 10th IEEE Singapore International Conference on
Communication Systems (ICCS 2006) (2006)
54. M.E. Celebi, Improving the performance of K-means for color quantization. Image Vis.
Comput. 29, 260–271 (2011)
55. M.M. Mohamed Ibrahim, W. WU, Lightweight unsupervised event detection approach in
wireless smart sensors for monitoring water distribution system, in E-proceedings of the 36th
IAHR World Congress 28 June–3 July, 2015
56. D. Janakiram, V. Adi Mallikarjuna Reddy; A.V.U. Phani Kumar, Outlier detection in wireless
sensor networks using Bayesian belief networks, in 2006 First International Conference
on Communication System Software and Middleware (Comsware 2006) (2006), pp. 1–6.
doi:10.1109/COMSWA.2006.1665221
Part IV
Efficient Data Management and Decision
Making for IoT
Chapter 11
Integrating IoT and Fog Computing
for Healthcare Service Delivery
11.1 Introduction
shared pool of resources [23]. Cloud computing offers many advantages from the
user point of view as it provides ubiquitous access to the content and resources
(hardware, data, infrastructure, applications, and service development) without any
need to keep large storage files and maintain powerful computing devices [9].
Through the cloud computing approach, everything is available as a service over the
Internet. The patient can use his/her smartphone as an interface to connect and have
access to the remote medical data or store new content to cloud data centers [12, 27].
Even though the centralized cloud approach enables healthcare professionals to
have ubiquitous access to patients’ medical records away from hospitals and share
large amounts of content even through their smartphones, the centralized nature of
the cloud restricts itself from providing low latency, location awareness, and geo-
distribution that are crucial for the IoT applications [41].
As every device and appliance can potentially be connected to the Internet, it is
predicted that the number of mobile-connected devices will exceed the number of
people on earth and by the end of 2018 there will be 1.4 mobile devices per person
[11] while in 2020, 24 billion devices are expected to be connected in Internet [18].
Though the cloud computing paradigm provides high scalability and can address the
exponential growth of the IoT devices, the need of numerous devices to be connected
to the Internet, communicate with each other, transmit continuously data and retrieve
medical records, stresses further the network and cloud infrastructure. The cloud
computing approach requires constant high speed reliable Internet connectivity
with sufficient bandwidth and low latency [16]. In case that either the bandwidth
is insufficient or any other network failure occurs, cloud can lead to increased
delays and become a single point of failure that the healthcare service provisioning
cannot tolerate. Moreover, the continuous communication of the IoT devices with
the cloud increases energy consumption. Therefore, cloud computing cannot satisfy
the requirements of IoT applications for real-time information processing since
it demands continuous and reliable interactions among the IoT technologies and
healthcare services with low latency. While healthcare service provisioning becomes
more dependent on the network connectivity, network failures may interrupt or delay
the healthcare service delivery with adverse effects in patients’ quality of life even
leading to mortality.
This chapter deals with the aforementioned challenges posed by the cloud
computing through the integration of the IoT technologies and fog computing
paradigm in order to provide reliable healthcare service provisioning. The concept
of transferring the computing intelligence closer to the user, to the edge network,
seems to be the most promising solution for reliable healthcare service provisioning
[35]. Fog computing approach operates on network edge and acts as a bridge
between the end-user devices and the cloud infrastructure of the healthcare provider.
An architectural model is presented that shows how integration is achieved through
the IoT, fog, and cloud technologies cooperation. The main component of the system
model is the fog server that is a virtualized platform based on cloud computing
approach with limited operations, deployed closer to the terminal equipment in
order to enable protocol conversion, data storage, processing, and evaluation.
As fog computing is deployed at the edge network, it can provide enhanced
11 Integrating IoT and Fog Computing for Healthcare Service Delivery 215
Hospitals were the first organizations that incorporated the computing systems
for delivering healthcare applications based on the Hospital Information System
(HIS) architecture [43]. Since the evolution of the ICT and cloud computing
has dramatically changed the way the healthcare services are delivered. The
development of ambient intelligent systems empowered patients to self-manage
their own disease and provide well-being application solutions away from hospitals.
Many research works have been published and a variety of applications have
been implemented ([13, 17, 25, 30, 42, 44], etc.) that enabled patients use medical
sensors, wearable devices, and actuators so as to monitor vital bio-signals such
as blood pressure and body temperature. Moreover, sensors are also used in the
home environment in order to monitor patients’ activities (i.e., internet connected
cameras, accelerometers, gyroscopes, etc.) and environmental conditions (i.e.,
temperature, humidity, luminosity, etc.). The information from sensory devices from
216 F. Andriopoulou et al.
both medical and environmental is transmitted to remote medical centers (in the
cloud) where the information is processed and stored in order to be accessible by
the healthcare professionals. Mobile applications and commercial products have
also been developed that enable wearable sensors such as smartphones and watches
to gather bio-signals or control the movement tracking of user’s daily activities
(i.e., calories burned, heartbeat, steps walked, etc.), providing suggestions, and
prevent aggravation of user’s healthcare conditions (iFall [32], iWander [33], Philips
Hospital to Home [26], Vitaphone [39], and Bosch Telemedicine [8]).
The evolution of the IoT technologies expanded further the opportunities of
the healthcare domain [10]. The RFID technology, key component of the IoT
technology, allowed any object in terms of sensor devices, patients, or appliances
in patent’s environment to be tracked and monitored automatically using an RFID
tag. RFID technology enables the identification of anything supporting location
awareness and geo-distribution [6]. Lu and Liu [22] proposed the insertion of the
IoT technology for healthcare purposes in China. They provided the structure and
the functionality of the IoT in order to provide hospital care and remote real-time
ECG monitoring. Using the RFID technology the healthcare professionals are able
to retrieve medical data from the bedside easily for each patient and provide immedi-
ately assistance whenever an emergency episode occurs. Jara et al. [20] proposed an
IoT based personal diabetes management system in order to monitor patient’s blood
glucose concentration and provide blood glucose management and insulin therapy.
The proposed architecture offers a set of mobile assistance services for healthcare
professionals in order to configure and reporting patient’s health status based on
RFID. It aims to prevent and anticipate the hyperglycemia and/or hypoglycemia
episodes and evaluate the risks of new medications for insulin therapy. In [29], the
authors proposed an IoT approach for supporting rural healthcare applications. A
patient wears an active RFID sensor and whenever the sensor detects an abnormal
value, the doctor of the medical center is informed. Doctor can have access to
patients profile using the RFID that identified the user. This approach could be
adopted for continuous healthcare monitoring since it eliminates in half the energy
consumption. Lee and Ouyang [21] proposed an IoT based intelligent application
for risk factor assessment. The risk factor is calculated through the communication
and cooperation of various IoT devices with correlated data. NightCare system [3]
is an ambient intelligent platform based on the RFID tags for monitoring the state
of a person during the night. RFID sensors are placed into the bed, underneath
the bed, the carpet, and the user’s clothes or integrated with other RFID sensors
(i.e., humidity, fever, etc.) in order to detect and report abnormal events such as the
presence or absence of the user in the bed and demand assistance.
Although the wide acceptance of the RFID technology and the variety of
healthcare applications have been developed, there are limited efforts towards
realizing remote healthcare service delivery since it requires the integration of the
Wireless Sensor Networks (WSNs) with the RFID sensors [2]. This integration faces
the interoperability and translating challenges among the heterogeneous devices and
the multiple network protocol, respectively. In [45], the authors proposed an IoT
gateway (i.e., home-gateway, mobile phone, set-of-box, etc.) in order to deal with
11 Integrating IoT and Fog Computing for Healthcare Service Delivery 217
the interoperability and integration of the heterogeneous IoT devices. These gate-
ways provide a set of functionalities such as interoperability and translating between
the protocols used in various IoT devices. iHome system [40] is an intelligent
home based platform for providing remote monitoring of elderly people. The iHome
consists of the iMedBox, the iMedPack, and the Bio-Patch. The iMedPack and Bio-
Patch are responsible for reminding and monitoring services while the iMedBox
acts as a gateway that provides interoperability and IoT network connectivity. Cubo
et al. [12] proposed an IoT platform based on the cloud approach for Ambient
Assisted Living (AAL) applications that enables remote monitoring and access of
the data generated by sensor and android devices. The data generated by the IoT
devices are aggregated to a gateway that is responsible to transfer the data to the
cloud based platform for processing and remote access. To face the heterogeneity
issues that appeared from the different devices, the gateway incorporated the service
oriented approach in order to orchestrate the devices according to their behavior
and determine the order of the exchanged messages. Tabish et al. [37] proposed
an indoor and outdoor remote ECG monitoring system that supports patients for
normal conditions and emergency cases. In emergency cases, the system provides
live streaming remote monitoring and reading of ECG signals even if it consumes
a lot of energy while in daily conditions the data are stored locally to a smart
gateway and then are transmitted to the cloud server so as to be easily reached by
the healthcare professionals.
As the number of the IoT devices has grown rapidly, the communication among
the IoT devices and the huge amount of data that are transmitted to the cloud
via the internet have increased stretching the network and cloud infrastructure that
cannot satisfy all the requirements of QoS and resource allocation. Fog computing
[16, 41] was introduced in order to reduce the data transferring to the cloud and
the unnecessary communication of all the things that can connect to the internet
and generate data. Aazam et al. [1] proposed the data preprocessing and trimming
before sending to the cloud. A smart gateway is co-located with a smart network,
the fog that performs temporary data storage, data filtering, and processing with a
secure way and according to predefined rules. Fog connects to the cloud in order
to upload the data and then erase the temporary data. In this context, Shi et al. [31]
discussed the characteristics and the features of the fog computing and its benefits
for the healthcare domain. Rahmani et al. [28] proposed an intelligent gateway that
enhances the functionality of the smart gateway and offers local storage, real-time
local processing, and data mining services. The smart e-Health gateway acts as a
bridging point among the medical sensors, the smart appliances in the home of
the user or the hospital, and the cloud platform and copes with interoperability,
reliability, and scalability issues. The smart e-Health gateway can be considered
as a fog computing approach and provides both network interoperability and local
data processing before the data are transferred to the cloud server. Stantchev et al.
[34] proposed a three-layer architecture for supporting elderly people at home. It
integrates IoT, cloud, and fog computing approach enabling any kind of sensors to
connect to the infrastructure. Fog devices provide tasks such as data computing,
data storage, local management of the sensors, and handle mobility. Then, fog
218 F. Andriopoulou et al.
device transmits the data to the cloud for further evaluation from the doctors. In
this approach, the fog device acts as a backup point in case the link to the cloud
is faulty.
Fog computing is a new term coined by Cisco [7] in order to describe the act of
bringing cloud computing closer to the end user. Deploying services closer to the
user’s proximity can provide various advantages including reduction in congestion
and latency, elimination of data transmission in the network infrastructure, improve-
ment of scalability, flexibility, and reassure the security of the encrypted data.
Consequently, the fog computing paradigm can provide efficient delay-sensitive and
healthcare related services that require reliable data transfer with low latency [16].
11.3.1 Definition
The rapidly growing number of IoT devices that generate an increasing amount
of data and consume cloud services have forced many ICT operators to introduce
different approaches in order to provide powerful computing models located closer
to the end user and confront the network strains of data transmission to the clouds.
Cisco defines fog computing as a virtualized platform, built at the edge of the
network, providing computing, storage, and networking services between the end
devices and the cloud servers. Fog computing can be considered an extension of the
cloud computing approach as it incorporates various characteristics and features of
cloud computing paradigm [7].
Vaquero and Roberto-Merino [38] defined fog computing as “a scenario where
a huge number of heterogeneous (wireless and sometimes autonomous) ubiquitous
and decentralized devices communicate and potentially cooperate among them and
with the network to perform storage and processing tasks without the intervention
of third parties. These tasks can be for supporting basic network functions or new
services and applications that run in a sandboxed environment. Users leasing part of
their devices to host these services get incentives for doing so.”
Until now, there is not any standardized definition and architecture of fog
computing despite the fact that many ICT operators are developing architectures that
aim to transfer the data aggregation to an edge server. Most of these architectures use
edge servers as dumb intermediate devices to the cloud. However, fog computing
has more capabilities than an intermediate device since it is an extension of the cloud
approach. Therefore, it should be defined appropriately in order to avoid confusion
with other technologies.
11 Integrating IoT and Fog Computing for Healthcare Service Delivery 219
11.3.2 Characteristics
The integration and cooperation between them is necessary in order to enable big
data analysis and support the creation, deployment, and execution of new healthcare
services in order to provide personalized healthcare services oriented to users’ needs
and preferences based on their current health status.
latency, delay, and jitter. Thereby, it can improve the quality of the healthcare service
and can provide timely response actions and reliable healthcare services without the
need to transfer data to the cloud.
Mobility is a significant characteristic for providing ubiquitous healthcare ser-
vices since the majority of the end users are mobile users that demand to have access
and receive healthcare services wherever they are located. The dense geographical
distribution of fog computing can provide mobility to the end users and can support
properly the wide distribution of the medical data and the IoT devices.
Therefore, the integration of IoT and fog computing for provisioning healthcare
services represents a promising solution that can significantly reduce the data
forwarding and routing across the network infrastructure, resulting in reduced
latency and reliable healthcare service provisioning with enhanced quality.
Fig. 11.1 The architecture of the integration between IoT–fog and cloud computing
The architecture of the integrated IoT based and fog computing approach for
healthcare service provisioning is presented in Fig. 11.1. It should be mentioned
that fog nodes, fog servers, and IoT devices are distributed entities according to
their geographic location while the cloud is centralized and located at the healthcare
provider’s premises.
In this architectural model, the end users are equipped with a variety of IoT
devices such as medical sensors wearable or implanted, devices that monitor
presence, motion, mobile devices, and environmental sensors. IoT devices interact
among each other with different communication technologies such as 3G, LTE,
WiFi, WiMAX, 6Lowpan, Ethernet, or ZigBee. These devices are connected
directly or via wired and wireless communication protocols to a sink node such as
smartphone or computer, known as fog node. The fog node acts as an intermediate
point between the IoT devices and the edge network. Fog nodes support different
communication protocols in order to enable data collection from different IoT
technologies and handle user’s mobility and provide local management of the IoT
and sensory devices. The fog node performs limited computational operators and
provides pushing services for receiving and uploading data. Then, the information
from IoT devices is transmitted to the fog server. Fog server performs protocol
conversion, data storage, processing, filtering, and analysis. According to the data
11 Integrating IoT and Fog Computing for Healthcare Service Delivery 223
evaluation, fog is able to make decisions and provide services to the end users based
on predefined policies and rules without the necessity to interact with the cloud
server due to the fact that the fog server is actually a lightweight cloud server.
However, the fog server has limited hardware capabilities and cannot fully support
the creation of new services and applications. In this context, the fog server has
to interact with the cloud in order to provide prediction models, enable big data
analysis as well as new service execution and orchestration. Therefore, fog cannot
replace the cloud but they have to cooperate in order to provide timely value-added
services to the end user with enhanced QoS. Moreover, the fog server can operate
as a backup mechanism in case the link to the cloud is faulty.
The data which has been processed, analyzed, and temporarily stored in the fog
server can be transmitted to the cloud for permanent storage and further analysis or
if there is not any necessity to be stored, they are removed from the fog server.
The fog server is based on a lightweight approach of cloud computing that is enabled
to provide the basic operations of protocol conversion, data storage, processing,
filtering, analysis as well as application and service provisioning. In order to be able
to provide all the aforementioned functionality, it is composed of the following key
modules, as presented in Fig. 11.2:
• Listener: Listener is permanently “alive” and ready to accept or send messages
for control or download. As soon as it receives a message from fog node, it checks
the validity of the message and the users’ capabilities [4]. The listener forwards
the messages into a queue and wait for authentication by the security and identity
manager and validation of the message by the message broker. If the user is
authenticated and the messages are validated, then, they are forwarded to the
message database. Otherwise, the sender of the message is properly informed
about the cause of failure.
• Security and Identity Manager: It verifies both cloud service providers and
consumers in order to prevent malicious and unauthorized access. It blocks
malicious traffic and manages the overall security of the fog server. Furthermore,
firewalls are used for the detection of intrusions focusing on protecting data,
resources and services from malware, viruses, worms, or trojans.
• Message Database: It is a database where all the validated messages are stored
for recovery and security purposes.
• Decision-Making Module: The decision-making module processes, analyzes,
and evaluates the data aggregated by the IoT devices. According to the evaluation
results, the decision-making module makes decisions about the most suitable
services that should be triggered in order to provide healthcare services and treat
the user [5].
• Message Broker: Message broker is a message bus that is responsible to provide
protocol translation, message analysis, and processing in order to enable message
communication from and to the IoT devices. It is the appropriate messaging
environment for efficient and consistent exchange of information among the IoT
devices as well as the communication establishment with the services provided
by the 3rd party providers [4].
• Service Broker: Service broker interacts with the service registry and policy
handler in order to find, bind, invoke, formulate, execute, and interpret the
required service according to negotiation algorithms and mathematical models
so as to be optimized for each end user and provide the appropriate [4]. Service
broker triggers the message broker so as to provide the required services to the
end user in a transparent and interoperable way.
• Resource and Service Registry: Resource and service registry is a publish/sub-
scribe database where each cloud provider has published their own catalogue
with applications and services for being easily accessed by the service broker.
Moreover, resource and service registry stores all the IoT-enabled physical and
virtual devices that are managed by the same fog server so as to be easily accessed
by the other IoT devices.
• Policy Handler: It contains a repository with all the service level agreements
(SLAs) published by cloud providers. Whenever an end user (consumer) requires
services, the service broker negotiates and matches the consumer’s SLA with the
services each cloud provider offers and finds the most appropriate matching.
This section introduces two use case scenarios for remote healthcare service
provisioning that illustrate the benefits of the integration between IoT, fog, and
cloud computing in the application layer. It is considered that the patient (actuator)
is equipped with an RFID tag medical card that identifies him/her so as to be easily
discovered in a building with multiple users or outdoors. In the actuator’s smart
environment there are various appliances (i.e., IP video cameras, laptops, tablets,
11 Integrating IoT and Fog Computing for Healthcare Service Delivery 225
PCs, TV sets, microphones, and speakers) and environmental sensors (i.e., humidity,
temperature, smoke detector, motion, and alarm). Moreover, a variety of wearable
medical sensors (i.e., pulse oxygen in blood (SPO2), airflow (breathing), body
temperature, electrocardiogram (ECG), glucometer, galvanic skin response (GSR—
sweating), blood pressure (sphygmomanometer), patient position (accelerometer),
and muscle/electromyography (EMG) sensor) are used for healthcare monitoring.
The patient’s position is also captured through accelerometers, IP video cameras,
and motion recognition sensors.
Healthcare service provisioning can be deployed for AAL. Typical examples are
elderly people who usually forget to take their medications, do the predefined
exercises from the doctors, report their healthcare condition to the physicians or
forget the gas open. Sometimes the forgotten event is critical and user’s life may be
at risk. In this use case, we illustrate the benefits of the integration of IoT and fog
computing in order to monitor user remotely and provide notification services such
as reminders for medications and/or warnings or healthcare services for emergency
cases such as fall accidents or an aggravation of user’s health condition. Figure 11.3
illustrates the use case of the daily monitoring and healthcare service delivery.
The environmental and medical data from the sensors may be connected to a
low power single-board computer using IEEE 802.15.4 standard that acts as a sink
node (fog node) (step 1a and 1b). Environmental and medical data from a fog
node are sent to the home-gateway (fog server) for processing and storage (step 2).
The home-gateway (i.e., laptop, PC, etc.) has more computational capabilities
from the sensor devices and can analyze all the aggregated information, perform
complex algorithms, and correlate data in order to detect abnormal events. The term
abnormal is referred to any measurement above the defined normal thresholds or
any odd sound such as an accident inside a home, fall, fire, or medical episode. The
Listener receivers the information, forwards it to a queue and when the validation
and identification process is completed successfully, the data is transferred to
the Message Database. The collected data from diverse IoT devices is processed
and evaluated by a decision framework located to the home-gateway (Decision-
Making module of fog server) using rule-based and machine learning techniques
and the abnormal measurements trigger an alarm system (step 3). In case there
are no abnormal measurements, the data remains locally stored and is transferred
to the cloud whenever it is permitted by the network conditions such as available
bandwidth and network traffic. On the other hand, the alarm system indicates
the source(s) of the alarm(s), the severity of the event and triggers the Service
Broker in order to provide applications and services to the end user. If there is
not any predefined service, then, it interacts with the healthcare cloud provider for
supporting the patient (step 4). In this case, the data is transmitted to the cloud for
permanent storage and further processing based on machine learning algorithms
226 F. Andriopoulou et al.
Fig. 11.3 The use case of daily monitoring for provisioning timely healthcare services with low
latency
of the fall. If the patient is unconscious, injured, or the fall has occurred due to a
medical condition, the home-gateway creates an alarm and triggers the healthcare
provider reporting the severity of the event, the location of the patient and transfers
the collected data. The healthcare provider can further process the data and take
decisions for the treatment plan. Otherwise, the data remains in the local database
of the home-gateway and a report with the event and the medical data are sent to
the cloud and are merged with the patient’s profile. Once the data is uploaded on the
cloud, there is no any other necessity to be stored locally at the fog. Therefore, they
are removed from the fog storage releasing storage space.
Numerous efforts have been undertaken in order to increase road safety, reduce road
accidents and road deaths. eCall system [14] is an initiative to provide immediate
assistance to people involved in a collision wherever they are located in the
European Union [19]. eCall deploys an in-vehicle system that initiates emergency
calls automatically in case of a serious road accident. In order to detect a collision,
the vehicle is equipped with vehicle sensors such as crash sensing sensors that
provide information about the vehicle’s description and its location. Then, through
the cellular network, the Public Safety Answering Point (PSAP) is informed in
order to provide assistance [19]. However, accidents still occur. The transmission
of the data must be reliable and fast, around 14–17 s, in order to provide accurate
service delivery and save lives [15]. In this use case, we illustrate an extended eCall
system that integrates a variety of IoT devices and fog computing in order to provide
quicker response for emergency services and decrease the number of dead or injured
passengers (Fig. 11.4).
Except of the vehicle’s sensors that monitor the vehicle’s current position and
status, a variety of IoT devices are used. Some of these devices include: video
cameras located in traffic lights that calculate the traffic, microphones, speakers,
environmental sensors, and medical wearable sensors that the driver or passengers
use. Vehicle sensors and IoT devices interact with a fog node that collects the
aggregated information from sensors and mobile devices through multiple public or
private access points (i.e., WiFi,3G, LTE) (step 1). The fog node in this case is the
traffic light station that acts as a sink node. The traffic light transmits the aggregated
information from sensors to the fog server. The fog server can be any dedicated
gateway located in public or private buildings (i.e., train terminals, bus stations, bus
stops, etc.). The listener receivers the data from the IoT-enabled devices, forwards
them to a queue, and performs validation processes. If the messages are validated,
then the information is stored temporally to the Message Database and the Decision-
Making Module performs a set of processing, filtering, and analyzing actions (step
2). In case an abnormal event is detected (e.g., a collision or heart attack), the
fog server may either provide services to the end user or dictate the fog nodes to
periodically collect data with a different frequency and from various end devices
228 F. Andriopoulou et al.
Fig. 11.4 The use case of extended eCall services increasing road safety and providing timely
response for road accidents
in order to have a global view of the emergency event (step 3). Moreover, the
information is processed using movement and acceleration patterns that can prevent
other road accidents or traffic problems that may occur as a consequence of the
present accident as well as can send warning messages to the vehicle driver in
order to stop the vehicle or other vehicles and passengers in the nearby area, notify
volunteers to assist the patient or injured passengers, and provide an ambulance
service (step 4). The data remains in the fog server where the volunteers and first
aid responders can have access to the stored data or trigger IoT devices such as
video cameras and microphones to have a look to the scene of the emergency event.
In this context, it may need information from the neighboring fog nodes in order to
map the traffic, detect different vehicles on the same road, detect the ambulances,
and open lanes to pass through the traffic [36]. Once the critical-mission event has
been confronted, the data can be transmitted to the cloud for permanent storage or
if there is not any need to be stored, they are removed from the fog server.
As seen in this use case, integration among IoT technologies, fog, and cloud
computing provides a variety of beneficial features such as location awareness,
low latency and improves the quality of the provisioning services. The cloud
computing approach itself has not the ability to provide reliable data processing for
11 Integrating IoT and Fog Computing for Healthcare Service Delivery 229
11.6 Conclusion
The rapidly growing number of IoT devices that generate an increasing amount
of data and consume cloud services have overstretched the network and cloud
infrastructure. In order to confront the network strains of data transmission to
the cloud, many ICT operators have introduced different approaches for providing
powerful computing models located closer to the end user. Cisco [11] coined the
approach of fog computing in order to optimize the cloud approach and deliver
timely delay-sensitive services to the end user. Since fog computing is deployed
at the edge network, it can provide low latency, geographical distribution, timely
processing of data streaming, and mobility support. Based on these features,
fog computing seems to be the most promising solution for reliable healthcare
applications.
This chapter presents the benefits of the integration of the IoT technologies,
cloud and fog computing paradigm in order to provide reliable novel healthcare
services. A system model is presented that shows how integration and cooperation
among the IoT, fog, and cloud technologies is achieved. The main component of
the system model is the fog server that exploits the cloud computing in order to
enable protocol conversion, data storage, processing, and evaluation. Moreover, the
fog server provides enhanced features including user mobility support, location
awareness, dense geographical distribution, low latency, and delay. These charac-
teristics are significant for provisioning delay-sensitive services such as healthcare
and emergency services. In this context, the integration of IoT and fog computing for
healthcare purposes can provide numerous advantages such as faster and accurate
treatment delivery, reduction of medical costs, improvement of doctor–patient
relationships, and the delivery of treatment. A number of use cases illustrate the
opportunities and the benefits that the integration of IoT, fog, and cloud computing
approach offers for cost effective, efficient, timely, and high-quality ubiquitous
healthcare service delivery. These use cases include daily monitoring and healthcare
service provisioning as well as extended eCall service delivery.
As a conclusion, it should be mentioned that fog computing operates better
than cloud computing in provisioning healthcare applications and services with low
latency, delays, jitter and supports user’s mobility. However, it cannot replace cloud
computing and the cooperation between them is necessary in order to enable big data
analysis, support prevention as well as create and execute new distributed healthcare
services in order to provide personalized treatment oriented to users’ needs and
preferences based on their current health status. Fog has limited computational
230 F. Andriopoulou et al.
power, therefore, it cannot provide the creation and execution environment for the
deployment of new services. Moreover, upgrading the fog server so as to provide
the functionality of cloud would increase the operational costs.
Acknowledgements The present work was undertaken in the context of the “nExt generation
eMergencY commuNicatiOnS - (EMYNOS) project” with contract number 653762. The project
has received research funding from the H2020 European Framework Programme.
References
1. M. Aazam, E.-N. Huh, Fog computing and smart gateway based communication for cloud of
things, in 2014 International Conference on Future Internet of Things and Cloud (FiCloud)
(IEEE, New York, 2014), pp. 464–470
2. H. Alemdar, C. Ersoy, Wireless sensor networks for healthcare: a survey. Comput. Netw.
54(15), 2688–2710 (2010)
3. S. Amendola, R. Lodato, S. Manzari, C. Occhiuzzi, G. Marrocco, Rfid technology for IoT-
based personal healthcare in smart spaces. IEEE Internet Things J. 1(2), 144–152 (2014)
4. F.G. Andriopoulou, L.T. Kolovou, D.K. Lymberopoulos, An integrated broker platform for
open eHealth domain, in Wireless Mobile Communication and Healthcare (Springer, Berlin,
2012), pp. 234–246
5. F.G. Andriopoulou, K.D. Birkos, D.K. Lymberopoulos, u-MCHC: a predictive framework
for ubiquitous management of exacerbations in chronic diseases, in 2013 35th Annual
International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC)
(IEEE, New York, 2013), pp. 6976–6979
6. L. Atzori, A. Iera, G. Morabito, The internet of things: a survey. Comput. Netw. 54(15),
2787–2805 (2010)
7. F. Bonomi, R. Milito, J. Zhu, S. Addepalli, Fog computing and its role in the internet of things,
in Proceedings of the First Edition of the MCC Workshop on Mobile Cloud Computing (ACM,
New York, 2012), pp. 13–16
8. Bosch Healthcare: Health Buddy System (2016). Accessed 30 Jan 2016
9. A. Botta, W. de Donato, V. Persico, A. Pescapé, Integration of cloud computing and internet of
things: a survey. Futur. Gener. Comput. Syst. 56, 684–700 (2016)
10. N. Bui, M. Zorzi, Health care applications: a solution based on the internet of things, in
Proceedings of the 4th International Symposium on Applied Sciences in Biomedical and
Communication Technologies (ACM, New York, 2011), p. 131
11. Cisco Visual Networking Index: Global mobile data traffic forecast update, 2015–2020 (2016).
Accessed 24 Jan 2016
12. J. Cubo, A. Nieto, E. Pimentel, A cloud-based internet of things platform for ambient assisted
living. Sensors 14(8), 14070–14105 (2014)
13. C. Doukas, T. Pliakas, I. Maglogiannis, Mobile healthcare information management utilizing
cloud computing and android OS, in 2010 Annual International Conference of the IEEE Engi-
neering in Medicine and Biology Society (EMBC) (IEEE, New York, 2010), pp. 1037–1040
14. eCall in all new cars from April 2018 (2016). Accessed 28 Jan 2016
15. eCall: Time saved = lives saved (2016). Accessed 28 Jan 2016
16. M. Firdhous, O. Ghazali, S. Hassan, Fog computing: will it be the future of cloud computing?
in Proceedings of the 3rd International Conference on Informatics & Applications, Kuala
Terengganu, pp. 8–15 (2014)
17. G. Fortino, M. Pathan, G.D. Fatta, Bodycloud: integration of cloud computing and body sensor
networks, in 2012 IEEE 4th International Conference on Cloud Computing Technology and
Science (CloudCom) (IEEE, New York, 2012), pp. 851–856
11 Integrating IoT and Fog Computing for Healthcare Service Delivery 231
18. J. Gubbi, R. Buyya, S. Marusic, M. Palaniswami, Internet of things (IoT): a vision, architectural
elements, and future directions. Futur. Gener. Comput. Syst. 29(7), 1645–1660 (2013)
19. Hero: Harmonised eCall European Pilot (2016). Accessed 28 Jan 2016
20. A.J. Jara, M.A. Zamora, A.F. Skarmeta, An internet of things—based personal device for
diabetes therapy management in ambient assisted living (AAL). Pers. Ubiquit. Comput. 15(4),
431–440 (2011)
21. B.M. Lee, J. Ouyang, Intelligent healthcare service by using collaborations between IOT
personal health devices. Blood Press. 10, 11 (2014)
22. D. Lu, T. Liu, The application of IOT in medical system, in 2011 International Symposium on
IT in Medicine and Education (ITME), vol. 1 (IEEE, New York, 2011), pp. 272–275
23. P. Mell, T. Grance, The NIST definition of cloud computing. Commun. ACM 53(6), 50 (2010)
24. D. Miorandi, S. Sicari, F. De Pellegrini, I. Chlamtac, Internet of things: vision, applications
and research challenges. Ad Hoc Netw. 10(7), 1497–1516 (2012)
25. S.K. Mouleeswaran, A. Rangaswamy, H.A. Rauf, Harnessing and securing cloud in patient
health monitoring, in 2012 International Conference on Computer Communication and
Informatics (ICCCI) (IEEE, New York, 2012), pp. 1–5
26. Philips Hospital to Home: Redefining healthcare through innovation in telehealth (2016).
Accessed 31 Jan 2016
27. R. Piyare, S.R. Lee, Towards internet of things (IoTs): integration of wireless sensor network
to cloud services for data collection and sharing. arXiv preprint (2013). arXiv:1310.2095
28. A.-M. Rahmani, N.K. Thanigaivelan, T.N. Gia, J. Granados, B. Negash, P. Liljeberg, H.
Tenhunen, Smart e-health gateway: bringing intelligence to internet-of-things based ubiquitous
healthcare systems, in 2015 12th Annual IEEE Consumer Communications and Networking
Conference (CCNC) (IEEE, New York, 2015), pp. 826–834
29. V.M. Rohokale, N.R. Prasad, R. Prasad, A cooperative Internet of Things (IoT) for rural
healthcare monitoring and control, in 2011 2nd International Conference on Wireless Com-
munication, Vehicular Technology, Information Theory and Aerospace & Electronic Systems
Technology (Wireless VITAE) (IEEE, New York, 2011), pp. 1–6
30. C.O. Rolim, F.L. Koch, C.B. Westphall, J. Werner, A. Fracalossi, G.S. Salvador, A cloud
computing solution for patient’s data collection in health care institutions, in Second Inter-
national Conference on eHealth, Telemedicine, and Social Medicine, 2010. ETELEMED’10
(IEEE, New York, 2010), pp. 95–99
31. Y. Shi, G. Ding, H. Wang, H.E. Roman, S. Lu, The fog computing service for healthcare, in
2015 2nd International Symposium on Future Information and Communication Technologies
for Ubiquitous HealthCare (Ubi-HealthTech) (IEEE, New York, 2015), pp. 1–5
32. F. Sposaro, G. Tyson, ifall: an android application for fall monitoring and response, in Annual
International Conference of the IEEE Engineering in Medicine and Biology Society, EMBC
2009, pp. 6119–6122 (IEEE, New York, 2009)
33. F. Sposaro, J. Danielson, G. Tyson, iWander: an android application for dementia patients,
in 2010 Annual International Conference of the IEEE Engineering in Medicine and Biology
Society (EMBC) (IEEE, New York, 2010), pp. 3875–3878
34. V. Stantchev, A. Barnawi, S. Ghulam, J. Schubert, G. Tamm, Smart items, fog and cloud
computing as enablers of servitization in healthcare. Sensors Transducers 185(2), 121 (2015).
35. I. Stojmenovic, Fog computing: a cloud to the ground support for smart things and machine-
to-machine networks, in 2014 Australasian Telecommunication Networks and Applications
Conference (ATNAC) (IEEE, New York, 2014), pp. 117–122
36. I. Stojmenovic, S. Wen, The fog computing paradigm: scenarios and security issues, in 2014
Federated Conference on Computer Science and Information Systems (FedCSIS) (IEEE, New
York, 2014), pp. 1–8
37. R. Tabish, A.M. Ghaleb, R. Hussein, F. Touati, A.B. Mnaouer, L. Khriji, M.F.A. Rasid, A
3g/wifi-enabled 6lowpan-based u-healthcare system for ubiquitous real-time monitoring and
data logging, in 2014 Middle East Conference on Biomedical Engineering (MECBME) (IEEE,
New York, 2014), pp. 277–280
232 F. Andriopoulou et al.
38. L.M. Vaquero, L. Rodero-Merino, Finding your way in the fog: towards a comprehensive
definition of fog computing. ACM SIGCOMM Comput. Commun. Rev. 44(5), 27–32 (2014)
39. Vitaphone Telemedicine (2016). Accessed 30 Jan 2016
40. G. Yang, L. Xie, M. Mantysalo, X. Zhou, Z. Pang, L.D. Xu, S. Kao-Walter, Q. Chen, L.-R.
Zheng, A health-IOT platform based on the integration of intelligent packaging, unobtrusive
bio-sensor, and intelligent medicine box. IEEE Trans. Ind. Inf. 10(4), 2180–2191 (2014)
41. S. Yi, C. Li, Q. Li, A survey of fog computing: concepts, applications and issues, in
Proceedings of the 2015 Workshop on Mobile Big Data (ACM, New York, 2015), pp. 37–42
42. M. Yuriyama, T. Kushida, Sensor-cloud infrastructure-physical sensor management with
virtualized sensors on cloud computing, in 2010 13th International Conference on Network-
Based Information Systems (NBiS) (IEEE, New York, 2010), pp. 1–8
43. D. Zhang, Z. Yu, C.-Y. Chin, Context-aware infrastructure for personalized healthcare. Stud.
Health Technol. Inform. 117, 154–163 (2005)
44. J. Zhou, T. Leppanen, E. Harjula, M. Ylianttila, T. Ojala, C. Yu, H. Jin, L.T. Yang, Cloudthings:
a common architecture for integrating the Internet of things with cloud computing, in 2013
IEEE 17th International Conference on Computer Supported Cooperative Work in Design
(CSCWD) (IEEE, New York, 2013), pp. 651–657
45. Q. Zhu, R. Wang, Q. Chen, Y. Liu, W. Qin, IOT gateway: bridging wireless sensor networks
into Internet of things, in 2010 IEEE/IFIP 8th International Conference on Embedded and
Ubiquitous Computing (EUC) (IEEE, New York, 2010), pp. 347–352
Chapter 12
Supporting Decision Making for Large-Scale
IoTs: Trading Accuracy with Computational
Complexity
12.1 Introduction
During the last years, there are tremendous improvements in the domain of
embedded devices. To begin with, the new process technologies enable the underline
hardware to become smaller, cheaper, and more powerful. This trend in conjunction
to the improvements at networking infrastructure enables the majority of the
devices to be extended with communication capabilities. Hence, embedded devices
nowadays are able to connect, interact, and cooperate with their surrounding
environment. This new platform paradigm, also known as “Internet of Things”
(IoT), is as a network of objects (or things) capable of detecting and communicating
information between each other.
Defining things and recognizing what a particular thing is and what it represents
in the context of IoT requires a careful analysis of what philosophers, such as the
Aristotle and Philoponus have to say and how their philosophical thoughts can
transcend into the near future. Specifically, in the work “The Categories” Aristotle
gives strikingly general and exhaustive account of things that are beings. According
to this opinion, beings include substance, quantity, quality, as well as relation
among others. Hence, from the philosophical point of view, the word “things” is
K. Siozios ()
School of Physics, Aristotle University of Thessaloniki, Thessaloniki, Greece
e-mail: [email protected]
P. Danassis • N. Zompakis • D. Soudris
School of ECE, National Technical University of Athens, Athens, Greece
e-mail: [email protected]; [email protected]; [email protected]
C. Korkas • E. Kosmatopoulos
Department of ECE, Democritus University of Thrace, Xanthi, Greece
e-mail: [email protected]; [email protected]
not restricted to material things but can apply also to virtual things and the events
that are connected to “things.” In the context of IoT, a “thing” might be defined
as a real (physical) or digital (virtual) entity, which is capable of being uniquely
identified, and that exists and moves in space and time.
The challenge of integrating embedded computing and physical processes with
feedback loops, where physical processes affect computations and vice versa has
been recognized for some time, allowing applications with enormous societal impact
and economic benefit to be developed by harnessing these capabilities across both
space and time domains. Such a pooling of system’s resources and capabilities
together to create a new, more complex system which offers more functionality
and performance than simply the sum of the constituent sub-systems. In the IoT
paradigm, numerous objects that surround us will be on the network in one form
or another. This trend is inline to the projection that in the near future it is
expected that computing and communication capabilities will be embedded in all
types of objects and structures in the physical environment [1]. To do so, flexible
yet efficient protocols, architectures, and technologies are absolutely necessary, in
which information and communication systems are transparently embedded in the
enrolment around us.
While technology and platform capabilities ought to be equally important in
order to design next-generation of smart systems, it is also crucial to manage the
system’s complexity under the constraint posed by the large amounts of data that
these systems will produce. According to a study from Cisco Systems, there will
be as many as 50 billion embedded systems and other portable devices connected
to the internet by 2020. Because these systems are so inexpensive and the networks
so pervasive, they could provide a wealth of data that industry could use to monitor
and improve operations. For instance, by 2020, the digital universe will reach 44
zettabytes—a tenfold increase from 2013 [2]. On top of this, analysts will need deep
knowledge of the specific target application domains to ensure they incorporate the
right data to generate useful insights. Although new methodologies, services, and
design technologies are absolutely necessary to address this challenge, the trend
nowadays is to enable smart things and their services to be fully integrated in the
developed systems by reusing and adapting technologies and patterns commonly
used for traditional local-/wide-area networks. Specifically, the IoT is developing
over time by a way of co-evolution, with technology, applications, and stakeholders’
understanding of the implications driving each other.
The integration of physical processes and computing devices is not new. Embed-
ded systems have been in place for a long time and these systems often combine
physical processes (e.g., through digital/analog sensors) with computing. However,
the core differentiator between an IoT and either a typical control system, or
an embedded system, is the communication feature among system’s components,
which adds (re-)configurability and scalability, allowing instrumenting the physical
world with pervasive networks of sensor-rich embedded computation [3]. The goal
of an IoT architecture is to get maximum value out of a distributed large system
by understanding how each of the individual (sub-)systems work, interface and
are used. This trend is also supported by the continuation of Moore’s law, which
imposes that the cost of a single embedded computer equipped with sensing,
12 Supporting Decision Making for Large-Scale IoTs: Trading Accuracy with. . . 235
processing, and communication capabilities drops towards zero [4]. Thus, it will
be economically feasible to densely deploy networks with very large quantities of
sensor readings from the physical world, compute quantities, and take decisions out
of them. Such a very dense networks offer a better resolution of the physical world
and therefore a better capability of detecting the occurrence of an event; this is of
paramount importance for a number of foreseeable applications.
Apart from the technology-oriented parameters that affect the efficiency and/or
the flexibility of an IoT-based system, the supporting tools are also crucial for deriv-
ing an optimum solution. The current solutions targeting to support the development
of these platforms rely mainly on stand-alone tools that tackle distinct aspects
of the system’s development. Consequently, the constraint propagation among the
employed tool-sets is the current viable way to enable the design of more complex
platforms. Although this concept seems straightforward and promising, it relies
on the fundamental premise that models are freely interchangeable amongst tool
vendors and have interoperability amongst them. In other words, this imposes that
models can be written, or obtained from other vendors, while it is known a priori that
they will be accepted by any vendor tool for performing different steps of system’s
prototyping (e.g., architecture/topology analysis, simulation, implementation, etc.).
On contrast to this “ideal” approach, the existing flows rarely support either model
interoperability or independence between model and software tools. Also, due to
the problem’s complexity, the existing “constraint propagation” design technique
will not be a viable approach for designing large-scale IoT platforms. Towards
this direction, and as research and industry pushes for efficient designs, novel
frameworks that tackle the entire system’s complexity are of high importance [5].
In accordance with this trend, throughout this chapter we introduce a low-
complexity decision-making mechanism targeting to IoT-based systems. For eval-
uation purposes, the efficiency of introduced solution will be demonstrated with
the usage of a smart thermostat usecase that supports the building’s cooling/heating
control.
The studied usecase concerns the climate control of buildings equipped with their
own renewable energy generation elements (e.g., photovoltaic arrays, wind turbines,
geothermal energy, etc.) along with a collection of automatic control elements for
affecting the building thermal characteristics e.g., automatically control the heating,
ventilation, and air conditioning (HVAC) system set-points. Such a solution is part
of home automation—a field that refers to the use of computer and information
technology to control home appliances and features (such as heating and cooling).
Depending on the building’s size, the developed systems can range from simple
remote control to complex computer/micro-controller-based networks with varying
degrees of intelligence and automation, similar to the case depicted in Fig. 12.1. The
popularity of these solutions has been increasing greatly in recent years due to much
236 K. Siozios et al.
a b
HVAC
17: 20 PM
MONDAY
26 C
COOL OFF
Actuators Sensors
Fig. 12.1 The employed smart thermostat (a) component’s view and (b) the functional blocks
Fig. 12.2 Floorplans for the (a) ground and (b) first floor of our smart building
by National Renewable Energy Laboratory [6]), depicts that our solution is subject
to severe and abrupt weather as well as occupant behavior changes.
In order to guide the aggressiveness of introduced framework, the employed
building uses a number of sensors for monitoring temperature values (both inside
and outside the building), as well as the variation of sunshine and humidity. For
our experimentation we assume (without affecting the generality of introduced
solution) that these values are acquired once per 10 min, as the weather data is not
expected to modified considerably within this time period. The analysis discussed
at the rest of this manuscript considers the problem of operating air-conditioners
during the summer period (June, July, and August), in order to cool-climate the
rooms. The objective is to define a solution that takes into consideration both
the energy efficiency and the user comfort satisfying level with the minimal
computational complexity, as compared to existing state-of-the-art control solvers
for similar problem. Furthermore, instead of relevant approaches which mainly rely
on statistical data, the proposed solution does not consider weather forecasts; thus,
the efficient addressing of decision-making problem becomes far more challenging.
In order to describe in more thoroughly the system’s architecture, Fig. 12.3 presents
in UML form the main functionalities performed by the smart thermostats regarding
the general form of the employed usecase. Specifically, starting by collecting a
number of weather-related data (e.g., temperature, humidity, and radiation), as they
were acquired by the weather station, it is possible to analyze the efficiency of
different thermostat configurations. The results are fed as input to the scenario
analysis in order to compute the optimum scenario set in a season basis (winter,
spring, summer, and autumn). Then, the employed controller implements the desired
policies in order to maximize user’s comfort with the minimum energy cost.
Year
December
January Winter
February
Sensor 1
Data Analysis
(temperature)
March Building Person
Octomber Autumn
November
During this phase, alternative techniques for further energy savings (e.g., building
warm-up phase, switch-off heating/cooling in case there is no motion detection) are
also applicable. However, these techniques are beyond the scopes of the analysis
discussed throughout this chapter, as we focus solely at the decision making.
This chapter describes in detail the proposed efficient control system that is easy-
and inexpensive-to-deploy in everyday buildings in order to support the task of
decision making for HVAC systems: no expensive infrastructure or modeling tools
and effort are required. Instead of the typical adopted procedure for developing
decision-making systems for building climate control, which relies on modeling
initially the building dynamics using one of the existing building modeling tools
(e.g., EnergyPlus [7], Modelica [8], etc.) and then developing a model-based control
using the model for the building dynamics, our approach relies on a different
strategy. The objective of our solution is to provide thermal comfort and acceptable
indoor air quality with the minimum possible energy cost. More thoroughly, the
problem at hand is a quite challenging problem where the control system attempts
to exploit “as much as it can” the renewable energy so as to reduce the demand
for non-renewable energy (coming from the grid) or during time-slots of low-cost
tariffs, while maintaining user comfort (i.e., making sure that the building occupants
are satisfied with the in-building temperature and other thermal conditions). This
will be done without requiring the deployment of an “expensive,” elaborate, and
complete sensor infrastructure, a prerequisite for the deployment of state-of-the-art
building climate control systems—each of the constituent systems is provided only
with information about its own state and energy costs.
Despite the significant progress made in optimal nonlinear control theory
[9, 10] the existing methods are not, in general, applicable to large-scale systems
because of the computational difficulties associated with the solution of the
Hamilton–Jacobi partial differential equations. Similarly, model predictive control
for nonlinear systems, a control approach which has been extensively analyzed
and successfully applied in industrial plants during the latest decades [11, 12],
faces also dimensionality issues: in most cases, predictive control computations
for nonlinear systems amount to numerically solving on line a non-convex high-
dimensional mathematical programming problem, whose solution may require a
quite formidable computational burden if on line solutions are required. Another
family of approaches employ optimization-based schemes to calculate the controller
parameters [13]. These approaches require analytical calculation of Jacobian and
Hessian matrices, which in large-scale systems is a very time-consuming process.
Existing simulation-based approaches are not able to efficiently handle systems of
large-scale nature as this requires solving a complex optimization problem with
hundreds or thousands of states and parameters [14, 15].
The previously mentioned problem imposed that novel techniques able to support
efficient decision making with almost negligible computational and/or storage
12 Supporting Decision Making for Large-Scale IoTs: Trading Accuracy with. . . 239
The task of determining the temperature set-points for each thermal zone can be
accomplished by a mechanism that relies on two competing fuzzy inference systems
(FIS). The first one (availability FIS) assesses the “availability” of energy (AE .t/),
while the second one (demand FIS) determines the predicted “demand” for energy
consumption (DE .t/).
The “availability” of energy (AE .t/) is derived based on the weather data,
the available funds for purchasing energy (AF) and the current market’s energy
trading rate .P.t//. Intuitively it is a metric that determines how affordable is
to purchase energy from the grid. On the other hand, the “demand” for energy
consumption (DE .t/) is determined according to the occupants’ thermal comfort.
Intuitively it reflects the occupants’ need to spent more energy depending on their
satisfaction. The aforementioned FIS compete with each other until they reach an
approximate equilibrium AE .t/ ' DE .t/, i.e., being able to afford to spend the
required energy (through the appropriate modification at the thermostat’s set-point)
while taking into account restrictions posed by the occupants’ thermal comfort
violation. To that end we start by determining an initial temperature set-point1 and
use it to compute the predicted occupants’ thermal comfort based on a model for
general thermal satisfaction called predicted mean vote (PMV).2 By modifying
the thermostat’s set-point we change the PMV per room and consequently the
demand for energy consumption (DE .t/). Normally, improving the PMV comes
1
The initial set-point can be a static value for the whole year (e.g., 23 ı C), a plethora of
predetermined values depending on the season, or a set-point derived by another engine (e.g.,
by using an artificial neural network).
2
The PMV model is an index that provides the average thermal sensation according to the
ASHRAE thermal sensation scale Œ3; C3. It was developed by Fanger in the 1970s and stands
among the most recognized thermal comfort models.
240 K. Siozios et al.
Yes
No
Equal?
Initial
Weather AF P(t)
temperature set-point
with a higher cost in energy consumption and that trade-off is the basis at which
our two FIS compete on. For this purpose, the proposed mechanism performs a
binary search3 within the accepted temperature range [18–28 ı C] and appropriately
configures the thermostat’s operational set-point to the temperature that results to
the closest equilibrium. The aforementioned process is depicted in Fig. 12.4. Note
that the “availability” of energy AE .t/ remains constant during a specific time-step,
since this value is independent of the examined set-point.
In the subsequent section we provide additional details on the architecture of the
employed FIS.
An FIS uses fuzzy logic and sets to formulate a mapping between an input space to
an output space. The term fuzzy refers to the fact that the logic involved extends the
classical boolean logic in order to handle the concept of partial truth. Classical logic
assumes the “Principle of Bivalence” which states that every sentence can be either
true or false. In contrast, humans think using “degrees of truth” and linguistic terms
3
Note that the binary search algorithm takes a monotonic function as input. In our case, we ensure
that our function is monotonic by limiting our search space to a specific range [18–28 ı C]. That
way we guarantee that increasing the temperature during the winter and decreasing it during the
summer result in an improvement in the occupants’ thermal comfort.
12 Supporting Decision Making for Large-Scale IoTs: Trading Accuracy with. . . 241
such as “a little” or “too much” instead of absolute values. In order to deal with
these “issues of vagueness,” fuzzy logic assigns any real number between 0 and 1 as
the truth value of a statement. In essence, in fuzzy logic the truth of any statement
becomes a matter of degree, making the FIS a convenient way to create a reasonable
model for a complex system that is tolerant to imprecise data.
An FIS consists of a rule (or knowledge) base and a reasoning mechanism called
fuzzy inference engine. The rule base is a collection of if-then rules provided by
experts that use fuzzy sets in the hypothesis and conclusion part. The inference
engine combines these rules using fuzzy reasoning and produces a mapping from the
input to the output space. Additionally, there is a fuzzification mechanism that trans-
forms the input space into fuzzy sets and a defuzzification mechanism that performs
the reverse procedure, i.e., transforms the fuzzy set obtained by the inference engine
into crisp values on the range of the output space. The aforementioned process is
depicted in Fig. 12.5.
A fuzzy set is defined by a function that assigns to each entity in its domain a
value between 0 and 1, representing the entity’s degree of membership in the set.
Such a function is called membership function (MF). The membership functions
associated with the PMV input variable for the demand FIS are depicted in Fig. 12.6.
More thoroughly, if, for example, the computed PMV is 0:15, then the temperature
is mostly excellent but there will be some people that will feel a bit cold. In essence
these functions represent the vagueness which is the norm rather than the exception
in real life and constitute the basis for converting crisp values to fuzzy sets.
The principal component of each FIS, though, is its rule base, which is used to
formulate the expert’s knowledge. Evaluating a fuzzy rule involves the fuzzification
of the premise, the application of any fuzzy operators and finally the implementation
of the implication operator that gives the consequent of the rule. The fundamental
difference compared to classical boolean rules is that fuzzy rules can be partially
applied, depending on the degree of membership of each premise of the rule.
Aggregating the consequent part of all the rules creates the final output fuzzy
Fuzzifier Defuzzifier
(MF) (Centroid)
Fuzzy Fuzzy
input sets output sets
Fig. 12.6 Membership functions regarding the PMV input of the demand FIS
Availability of Energy (%)
100
80
70
60
50
40
30
20
12
10 100
8 90
70 80
6
50
60
rice (% )
rading P
4 40
Mon 30
th 20
rgy T
s x Ene
2 10
0
le Fund
Availab
Fig. 12.7 Graphical representation of the input/output mapping regarding the availability FIS
set which, after the defuzzification process, provides the final desired output. The
benefit of such approach is its ability to encode apparently complex problems using
just a few simple fuzzy rules, in contrast to exact approaches which usually require
much greater effort.
To help visualize the aforementioned process, Fig. 12.7 depicts the mapping
from the input to the output space regarding the availability FIS. The horizontal
axes represent the inputs of the FIS while the vertical axes represent the output
(availability of energy AE .t/ (%)). The depicted surface incorporates the entire
rule base of the availability FIS. The true elegance of an FIS is its capacity to
encode intuitive linguistic terms into applicable information. For instance, as you
can see from the plot, during the colder (Dec.–Feb.) and hotter (Jun.–Aug.) months
of the year the availability of energy AE .t/ is high in order to cope with the extreme
weather conditions, while when we are low on funds (AF) or when the trading rate
12 Supporting Decision Making for Large-Scale IoTs: Trading Accuracy with. . . 243
for purchasing energy (P.t/) is high then the availability of energy AE .t/ is low in
order to reflect our inability of purchasing energy from the grid.
An analogous process is performed by the demand FIS. The concept in this case
is that the more dissatisfied the occupants are, the more “funds” they should have
in their disposal in order to be able to afford to purchase energy. As you can see, in
contrast to alternative approaches, ours is a human-centric one, since it configures
its aggressiveness according to the occupants’ requirements.
To summarize, the availability FIS assesses how affordable is to purchase energy
according to the current rate, weather, and the available funds, while the demand
FIS determines the amount of energy needed according to the occupants’ thermal
comfort. When these two FIS come to an agreement .AE .t/ ' DE .t//, then we
modify the thermostat’s set-point to the agreed upon temperature. Hence, using
intuitive and linguistic terms, we manage to implementing a flexible yet efficient
decision-making mechanism for smart thermostats.
The communication infrastructure plays a key role at the IoT platform, since it
provides the necessary information transfer gathered by the sender nodes and pro-
cessed by local embedded processing nodes to the destination (e.g., actuators or next
level of processing cores). Since different application domains impose variations
in terms of data transferring problem, various protocols have been proposed at the
context of IoT. Table 12.1 summarizes some representative approaches and provides
a qualitative comparison in terms of various supported features.
Typically, such communication links can be classified either as constrained, or
unconstrained networks. Specifically, an unconstrained network is characterized
by high-speed communication links (e.g., wired network). On the other hand,
constrained networks support relatively low transfer rates (typically smaller than
1 Mbps) and large latencies, as offered by, e.g., IEEE 802.15.4 (ZigBee) protocol.
The differences between these two concern the hardware capabilities: in the former
category the objective is to provide the better services by exploiting all the hardware
capabilities offered; in the latter approach the devices are limited by low energy
availability, since they are usually battery powered, bandwidth as low as 300 Kbps
and computational power as low as few MHz. Due to the power saving constraints
posed by the employed usecase, the communication link studied throughout this
chapter (similar to the majority relevant implementations) relies on unconstrained
network infrastructure.
Another crucial parameter for selecting the optimum communication infrastruc-
ture relies on the topology of the links (e.g., mesh, star, and point-to-point), as
well as the maximum distance between nodes. Various constraints that are posed
by the target application domain usually introduce guidelines about the selection
of optimum communication infrastructure. Regarding the network, it is realized
244
with a two-level hierarchical approach, where the sensors located inside each room
are supported through a local router, while the second level of abstraction provides
packet routing through a central gateway (e.g., a gateway might collect information
from the entire building). The smart thermostat industry historically has generated
small amounts of data, as they were captured from the corresponding weather and
activity sensors, respectively.
Apart from the topology, the desired functionality for data transfer is also
affected by the employed communication protocol. For the scopes of our usecase,
a new application-specific (fully customizable) communication protocol has been
implemented. The functionality of this protocol is completely reactive, as it waits
for the arrival of any packet to be processed. For every packet which is received,
its type has to be analyzed. Our approach supports five packet types, as they are
summarized in Table 12.2. Specifically, in case the packet type is HELLO, then the
corresponding acknowledge (ACK) packet is created, which contains information
about the employed DATA packet size (depending on the link’s implementation), as
well as its origin and destination nodes. The START and STOP packets denote the
starting and finishing of data transfer between source and destination nodes. This
is especially crucial since many of the available communication protocols (as they
were discussed at Table 12.1) support only P2P links; thus an established link cannot
be shared with other nodes. The weather/occupant’s information is transmitted in
DATA packets, while control messages (e.g., link configuration, desired link speed,
selected encryption scheme, etc.) are sent in CONTROL packets. As a response to
these packets, the node confirms their proper receive with an ACK packet.
Throughout this chapter, we applied the previously mentioned communication
scheme as part of the underline IEEE 802.15.1 protocol in order to support the data
transfers between distributed sensors and low-performance processing nodes.
12.6 Evaluation
This section provides a number of experimental results that quantify the efficiency of
the introduced framework. By appropriately computing the temperature set-points
per thermal zone it is feasible to considerably improve the energy consumption and
the occupants’ thermal comfort. The experimental setup for our analysis consists
of five buildings, as it was presented in Sect. 12.2. Without loss of generality both
the proposed implementation and the reference control solutions adopt a 10-min
time-step, i.e., each thermostat is configured once per 10 min. Additionally, we
consider that people occupy the buildings only during the operating hours, while
the distribution of people per room varies during the day as it is summarized in
Table 12.3.
Each building is equipped with a number of weather sensors that monitor
indoor/outdoor air temperature, humidity, and radiant temperature values. Further-
more photovoltaic (PV) panels are also employed in favor of minimizing the energy
cost. Depending on the energy requirements the buildings can interact with the main
grid in order to purchase or sell energy. The problem cannot be considered trivial
due to the intermittent behavior of the solar energy, the uncertain dynamics of the
buildings, and the need to meet the thermal comfort constraints for the micro-grid
occupants. More thoroughly, the optimal operation for HVAC systems pre-assumes
a mechanism that is able to handle in a closely coupled manner the increased
number of thermal zones and cooling/heating strategies. This is a typical multi-
objective problem, where the reduction of energy cost and the maximization of
thermal comfort are in conflict with each other. Therefore, no single optimal solution
can be found in these problems. Instead, a set of trade-offs that represent the best
possible compromises among the objectives have to be computed. Regarding our
experimentation, we consider that each of these cost metrics is of equal importance.
The target buildings are located in Crete (Greece), whereas our experimentation
relies on real weather data [6]. Figure 12.8 plots the variation of the external air
temperature and humidity values, as they have been acquired by the building’s
sensors. According to this figure, the variation of the external air temperature ranges
between 14.6 and 37.2 ı C, while the corresponding range for the external relative
humidity and radiant temperature are 7.9–38.8 % and 0–47 KW/m2 , respectively.
Therefore, proper selections of temperature set-points per thermal zone are abso-
lutely necessary in order to minimize overall cost.
Fig. 12.8 Variation of temperature and humidity values for the summer period
40
Fmincon
Pattern Search
35
Proposed
30
25
PPD (%)
20
15
10
0
06:00 07:00 08:00 09:00 10:00 11:00 12:00 13:00 14:00 15:00 16:00 17:00 18:00 19:00 20:00 21:00
Hours
16
Fmincon
Pattern Search
14
Proposed
Energy Consumption (kWh)
12
10
0
06:00 07:00 08:00 09:00 10:00 11:00 12:00 13:00 14:00 15:00 16:00 17:00 18:00 19:00 20:00 21:00
Hours
search solution seems to improve further the energy consumption, it also leads to
higher PPD values; thus, it could not be though as an overall good approach (by
taking into consideration both of the cost metrics). Note that similar results for
energy consumption and thermal comfort are also retrieved for the rest days of our
experiment.
Finally, in order to discuss the overall efficiency of our decision-making frame-
work, as compared to existing approaches, we quantify the total cost for the entire
3 month experiment (summer period). As we highlighted previously, the selected
experiment duration (summer period) exhibits increased temperature and humidity
12 Supporting Decision Making for Large-Scale IoTs: Trading Accuracy with. . . 249
Fig. 12.11 Overall cost of alternative decision-making mechanism for the summer period
values, which should be considered during the building cooling procedure. For this
analysis, both occupant’s thermal comfort and the total energy cost are equally
considered. The results from this experiment are summarized in Fig. 12.11. For
demonstration purposes, these results are plotted in normalized manner over the
results derived from pattern search solver. Based on this analysis, we might conclude
that our solution is by far more efficient as compared to pattern search solver
(average improvement by 8–16 %), while the Fmincon solver achieves an additional
average enhancement by 8 %. Apart from the efficiency of alternative solvers
to compute the optimum (or optimal) temperature set-points, the computational
complexity of these approaches is also of high importance. We have to notice that the
proposed solution can compute the output much faster than the existing approaches.
12.7 Conclusions
Acknowledgements The research leading to these results has been partially funded by the
European Commission FP7-ICT-2013.3.4, Advanced computing, Embedded Control Systems,
under the contract #611538 (Local4Global, http://www.local4global-fp7.eu/). Also, this work
presented is partially supported by the FP7-2013612069-2013-HARPA EU project.
References
monitoring of the system. On the distributed approach the CPU load is segmented,
aiming to achieve balanced resource expenditure amongst nodes, primarily related
to energy consumption [3].
Several data classification algorithms have being proposed and utilized towards
event detection problem resolution with fuzzy logic systems and Bayes Networks
[4, 5] comprising two prominent categories. Fuzzy logic is a well-adapted algo-
rithmic framework for multi-sensor scenarios. It effectively tackles uncertainty and
inaccuracy and it can be built based on experts’ experience. It is also of significantly
lower computational cost compared to other approaches such as support vector
machines advocating respective utilization in WSNs and CyberPhysical systems.
The use of fuzzy systems in classification problems has also been highlighted by
several research efforts [5, 6]. The imprecise sensors’ values, the complexity of
accurately determining thresholds, when more than one parameters are involved, in
an event detection scheme as well as the potentially conflicting rules, are some of
the reasons highlighting the inadequacy of crisp values approach to describe WSN
events. Fuzzy logic, on the other hand, can address these challenges more efficiently
than crisp logic.
As a proof of concept, in this chapter we consider as a use case scenario a
healthcare assessment application, able to evaluate the health status of a monitored
person, while a fuzzy inference system (FIS) is utilized to accurately and reliably
classify the health status. The healthcare application serves as a use case study.
The healthcare domain is a critical, for many reasons, domain posing significant
challenges. Respective difficulties pertain to the fact that heterogeneous sensor
values are semantically related, and thus they have to be appropriately merged so
as to derive a safe conclusion. There are two main factors of paramount importance
in any WSN related application scenario. Firstly the detection of abnormal situations
and the emergent response, and secondly the minimization of false alarms rate.
In that respect, the use of fuzzy logic seems to offer a well-fitted solution [6].
In addition, fuzzy logic can efficiently handle sensors measurements’ fluctuations
(due to sensors’ hardware imprecision), thus leading to a reduction of false alarms
rate compared to conventional approaches like crisp logic. However the output
of the fuzzy logic system requires that the pattern of the input values is always
in time while only a marginal deviation between their timestamp and that of the
FIS is acceptable. These two assumptions are at stake in case of wireless sensor
networks, as varying and unreliable delay as well as the packet loss ratio (and in
general networking related phenomena) can compromise reliable execution of the
fuzzy system. Hence, the vital importance of health related applications poses the
necessity for comprehensive study regarding efficient FIS under several networking
conditions. In addition techniques that can reduce the effect of network quality of
service to the algorithm’s performance (i.e., centralized distributed approach) also
represent critical objectives. The error prone nature of the wireless communication
is a notorious constraint in all cases and even more in demanding scenarios such
as healthcare applications considered here. Consequently, both the nature of the
13 Fuzzy Inference Systems Design Approaches for WSNs 253
The main objective of this section is to highlight the most important fuzzy
logic definitions and concepts required, so as to better introduce the design and
implementation approaches presented in the following sections. Therefore it is not
intended to provide a thorough or comprehensive introduction in the theory of
fuzzy logic. In 1965, Zadeh [7] introduced Fuzzy Theory as a method for handling
inaccuracy and uncertainty in many practical problems. The classic Set Theory is
based on the fundamental principle that an item either does or does not belong to a
specific set. In contrast, fuzzy logic expands the answer to the above question, as it
accepts that an element can both belong to a set and not belong to the same set, with
respect to its degree of involvement in it. Therefore, the fuzzy logic is a valuable
extension of the classical binary (true or false) logic.
Consequently, the imprecision or ambiguity is the core of fuzzy sets and fuzzy
logic. The introduced fuzzy sets are essentially a generalization of the classical sets.
Furthermore, people usually do not think in terms of just symbols and numbers,
but with vague/fuzzy terms. These fuzzy rules define categories which are not
completely separated and well-defined sets. The alteration from one category to
another is gradual, and the transition occurs when condition(s) related to a specified
class occur.
In essence, fuzzy sets are functions that reflect a variable which is a member of
the set, in the range [0, 1]. This value indicates the degree of correlation between
the variable and the fuzzy set. When this degree is zero (0), it indicates that the
value does not belong to the set, whereas when it is one (1), then it means that this
value fully represents the fuzzy set. This degree is determined by the membership
function of the fuzzy set, as a fuzzy set is fully described by its membership function.
In practice the function participation can be extracted from:
1. Subjective assessments
2. Ad-hoc and simplified forms
3. Incidence and probabilistic
4. Natural measurements
5. Learning and adaptation processes (e.g., neural networks).
The simplest of these membership functions are formed by straight lines. Typical
respective examples include the triangular and trapezoidal membership functions.
Gaussian membership function is also widely used, and it can be structured in the
form of a single or synthesis if different Gauss distributions. The Gaussian can
254 S. Dima et al.
be often used in fuzzy sets because of its normality. It also has the advantage of
maintaining non-zero values at all points. There are also a lot of polynomial curves,
which can be used as membership functions like Z or sigmoidal (S).
Another critical characteristic concerns the specialized variables encountered in
fuzzy logic theory. Specifically, in such cases variables’ values are not numbers, but
words or phrases in a natural or artificial language. These values are represented by
fuzzy sets and therefore the linguistic variables are also known as fuzzy variables.
In order to understand a fuzzy logic based mechanisms it is also important to define
fuzzy reasoning. Also denoted as fuzzy inference, it is a process through which
vague conclusions can be extracted. In other words it represents a computing system,
which evaluates fuzzy rules in the form: “if x a then y D b,” via fuzzy procedures.
A FIS is one of the most widespread applications of fuzzy logic. Such a system
consists of the following parts:
1. A number of unclear rules of the form IF-THEN (fuzzy knowledge base).
2. A fuzzy reasoning engine.
3. A fuzzification unit, which converts the input data to fuzzy sets.
4. A defuzzification unit, which converts fuzzy conclusions/decisions in a specified
format.
The fuzzy knowledge base, apart from fuzzy rules, usually contains a numerical
database section which is required so as to extract processed results. The rules
are usually taken by experts or/and by simulation procedures. The fuzzy reasoning
engine is the core of the fuzzy system and contains the logical decision making.
The fuzzification unit performs the following tasks:
– Measures the (non-fuzzy) values of the system’s
– Displays areas of change of the inputs’ values at appropriate supersets
– Fuzzifies the incoming inputs’ values. It converts them in a fuzzy linguistic form.
The defuzzification unit performs the following two operations:
– Displays areas of change of the outputs’ variables in respective supersets
– Defuzzify the results given by the fuzzy reasoning engine. It converts them into
deterministic (non-ambiguous) format, for further use by subsequent systems or
decision processes.
In the processing level the variables expressed by classical numbers are intro-
duced to the system. These variables are going through the fuzzification process,
which translates classical data (crisp values) into fuzzy quantities. These fuzzy
quantities are expressed in the form of linguistic variables. Then these fuzzy
variables are inserted into the fuzzy rule engine, where through fuzzy rules, set by
the stage of the knowledge base, fuzzy conclusions are produced. These conclusions
are in the form of linguistic variables. At the last stage of the process, the last
variables are converted into crisp values, via the defuzzification unit.
There are three prevalent methodologies that can be applied in the fuzzy logic:
Mamdani systems, the diagrammatic method, and the Sugeno type systems [8].
13 Fuzzy Inference Systems Design Approaches for WSNs 255
Design and implementation techniques presented in this chapter follow the Mam-
dani system. To compute the output of this FIS given the inputs, one must go through
six steps:
1. Determining a set of fuzzy rules
2. Fuzzifying the inputs using the input membership functions
3. Combine the fuzzified inputs according to the fuzzy rules to establish a rule
strength
4. Finding the consequence of the rule by combining the rule strength and the output
membership function (implication)
5. Combine the consequences to get an output distribution (aggregation)
6. Defuzzify the output distribution
Finally two prominent defuzzification methods are as follows:
1. Maximum Defuzzification Method. According to the method of clarifying max-
imum, the discrete value is corresponding to the maximum affinity value of the
final result. If there is more than one of these values is taken as the case may
either the average (middle-of-maximum) or the maximum value the (largest-of-
maximum) or the minimum value (smallest-of-maximum).
2. Centroid Defuzzification Method. According to the method of centroid, the
discrete value is resulting from the center of gravity of the final function of the
fuzzy output parameter.
In current literature there are several applications which utilize the fuzzy logic and
targeting in WSN environments. Specifically, in [10], a fuzzy rule based system
for fire detection is proposed, based on environmental values, while in [11] a
fuzzy logic system for controlling home appliances is proposed, so as to create
the smart home environment. The same use case scenario is considered in [6],
where the authors offer a valuable analysis, targeting reduction of false alarms
13 Fuzzy Inference Systems Design Approaches for WSNs 257
at home in safety. In the same way, Medjahed et al. have also presented in [17] a
fuzzy logic system targeting recognition of daily activities, considering ubiquitous
healthcare scenarios. However, both papers do not consider networking challenges,
i.e., potential packet loss, or untimely arrivals of packets.
All these challenges are going to be analyzed, taking into consideration a use case
scenario for health monitoring [18]. A network driven event detection scheme,
which is based on fuzzy logic techniques, is described in detail. More specifically,
the main objective of the use case scenario is that sensors from a body area
network and from monitoring individual’s surroundings are processed in order to
detect the individual’s distress situations [19]. The accuracy of the implemented
fuzzy system is evaluated assuming a reliable and robust communication method
[18]. Furthermore, this fuzzy system is assumed to be deployed in a critical WSN
environment. Therefore, the level of reliability of the communication model should
be examined in order to derive a safe decision [20]. For these purposes, a second
fuzzy system is implemented to provide the rate of network confidence, expressing
the robustness and the reliability of the network. Hence, the proposed mechanism
is composed of two main modules: assessment of health status and evaluation of
network confidence and reliability.
The working set of input fuzzy variables in the proposed distress situation detection
algorithm is comprised of: Sound Class (SC) recognition, Heart Rate (HR), Activity
(A), Fall recognition (F), and Time (T) while health status (HS) is the resulting
output variable. The membership functions are described in Table 13.1, while an
indicative representation of the sound class and the health status is presented in
Figs. 13.1 and 13.2. The sound signals are gathered and processed independently so
as to recognize normal sounds (speech) or alarm sounds (screaming) and are labeled
on a log scale according to their alarm level. The membership functions are defined
on each input variable as trapezoidal, triangular, and singleton functions. According
to [19], the limits of each membership function are determined. The thresholds for
the individual’s parameters are defined by physicians and can be easily adjusted. The
260 S. Dima et al.
1
Degree of membership
0.8 possible-alarm
alarm
0.6 normal
no-signal
0.4
0.2
0 5 10 15 20 25 30
sound-class (db)
core of the fuzzy system is the rule based system, which leads the inference system
to produce the fuzzy outputs. Using the number of linguistic variables for each input,
the total number of rules is calculated to be 192 (4 3 4 2 2). A subset of them
is selected experimentally so as to prevent degradation of the system’s accuracy
and predictability, while cutting down the total number of rules, which facilitate
complexity and network resource expenditure reduction. The fundamental rules (20
in total) have been extracted using medical studies [21] as references and have been
evaluated by physicians.
13 Fuzzy Inference Systems Design Approaches for WSNs 261
Degree of membership
function of the health status 1
output alarm
0.8
no-alarm
0.6
0.4
0.2
0
0 20 40 60 80 100
status(%)
By evaluating this set of rules using random attributes within the predefined
limits, merging rules, and using physician’s expertise we extracted the following
19 rules (Table 13.2).
The utility of fuzzy logic can be shown with an indicative example. Assuming
the following values for each fuzzy input: Sound Class: 6.24 (limits 0–30), Heart
Rate D 100 beats per minute, Activity D 56 (limits 0–100), Time D 9 a.m, and
Fall D 0 (0: false, 1: true). In such a scenario, since the value of heart rate is quite
high the crisp logic will conclude that there is an abnormal situation. However,
according to fuzzy logic the well-being is 80.2 % (Fig. 13.3), clearly contradicting
the result of the crisp logic.
Taking into account the demanding scenarios, a critical aspect not typically con-
sidered is that as the health status identification is an event-driven application, it
requires accurate and time constrained data delivery. Otherwise the fuzzy system
may use the previous value of a sensor or a mean value of the previous readings.
However, as it is extracted through respective measurements, in such a case
the output of the fuzzy system is strongly affected by the network performance
capabilities and robustness parameters. This is a significant input related to network
conditions that we have to take into consideration, so as to trigger the most
suitable action scenario. As an example, the detection of a distress situation during
monitoring elderly people should be recorded in a medical database, so as to update
his medical history. If all inputs are not updated due to poor network conditions,
this alarm situation will have low confidence rate. Therefore the output should not
be taken into consideration. Data accuracy is a metric of the service quality that the
network offers to applications. In our use case scenario, data accuracy is critical as a
metric of confidence level. Data accuracy (DA) is related to the delay (D), the packet
loss ratio (PL), and the packet delay variance (jitter) (J).
262
1
Degree of membership
0.8 low
medium
0.6 high
0.4
0.2
The limits of each network reliability related input as denoted in Figs. 13.4, 13.5,
and 13.6 are configured in order to satisfy the minimum requirements of healthcare
applications as described in [22] and [23]. For this reason, the packet loss ratio
cannot exceed 3 % at health applications. Otherwise the application is out of its
main goal. The data accuracy output is depicted in Fig. 13.7. Gaussian membership
functions are used because they provide a smooth transition between the different
levels. In addition, Gaussian membership functions facilitate continuously differen-
tiable hyper surfaces of a fuzzy model. These functions facilitate theoretical analysis
of fuzzy systems as they have derivatives of any grade. At the same time, it is
noted that network conditions considered above are rather demanding as expected to
apply in industrial or medical environments. These parameters are strongly affected
264 S. Dima et al.
1
low
Degree of membership
medium
0.8
high
0.6
0.4
0.2
0 0.5 1 1.5 2
packet loss (%)
1
low
medium
Degree of membership
0.8
high
0.6
0.4
0.2
0 1 2 3 4 5
jitter (ms)
by the communication protocols and traffic flow. Therefore, in cases of very low
network reliability, suggestions for changing network parameters are essential. For
the implementation of this system a subset of rules has been used (Table 13.3).
1 low
medium
Degree of membership 0.8 high
0.6
0.4
0.2
0 20 40 60 80 100
data accuracy (%)
has a value below 25 %, then the application will not satisfy its fundamental
characteristics. Such an indication is critical in taking the decision for the optimum
action and should be considered as the triggering event for the reconfiguration of
network conditions and/or the reexamination of all nodes’ existence (i.e., a sensor
station may be energy-depleted). Another reaction would be the modification of the
sampling periods and/or the initiation of a new synchronization sequence. On the
contrary, if the network confidence is high (>80 %), the health status will have an
acceptable value and thus appropriate actions should be recommended based on his
vital conditions. In this case, the sampling periods should also change at the highest
rates so as to monitor continuously, the critical situation. If the data accuracy level
is within the two thresholds, this means that the network confidence is average. If
this is due to network deterioration, this value will exceed the lower threshold and
downgrade further the network’s status. Otherwise, transient network failures may
be responsible for the low level of data accuracy. However, this does not affect the
application’s goal and will be corrected immediately. In both cases the actor should
control the transmission process on demand so as to recheck data accuracy. If data
accuracy insists on fluctuating in average levels, then this implies deterioration of
the network, so the operations of the first case scenario should be performed.
In the proposed use case scenario the set of input fuzzy variables (Sound Class,
Heart Rate, Activity, Fall Detection, and Time) and the resulting output (Health
Status) have been presented. The described FIS is implemented in a WSN embedded
platform, and is evaluated under a networking simulation scenario [24, 25].
More specifically, the input variables are collected by the related sensor nodes
and are used as input to the FIS. Mamdani’s model is considered for this fuzzy
system. These values are transmitted to the Fuzzy Cluster Head Node (FSHN),
which is responsible for executing the whole FIS. After all vital and environmental
inputs have been fuzzified, the minimum implication method is applied to each rule,
taking the fuzzified inputs and applying them to the antecedent of the fuzzy rule in
order to derive its weight. The outputs of all rules are aggregated using the maximum
method [26]. The aggregated output fuzzy set is defuzzified using the centroid
of gravity method [26] and the output is a crisp number. The aforementioned
procedure is presented in Algorithm 1. The aforementioned functions of fuzzy logic
(aggregation, implication, and centroid of graph) can be utilized to any FIS (e.g.,
environmental or industrial applications).
268 S. Dima et al.
implication
The algorithm presented above can be executed in a resource rich node which is
called FCHN. The heart, sound, activity, time, and fall sensor node (HSN, SSN,
ASN, TSN, and FSN) are responsible for acquiring the respective data values.
According to this centralized approach, these values are transmitted to the FCHN,
which also serves as the fusion cell, which performs the FIS algorithm. The role of
each node in the centralized scenario is described in (Algorithm 2). However, if we
assume that a realistic size sensor network consists of tens or hundreds of nodes,
restrictive limitations must be taken into consideration. The number of messages
sent to the cluster head and the processing load of the data mining tasks, require
increased processing capabilities and increase the probability of network congestion
as well. Hence a decentralized application of a data mining algorithm is needed,
in order to achieve more efficient operation and minimize network performance
degradation. Driven by this observation the next chapter aims to address this
necessity offering both a general analysis of respective approaches and presenting a
specific design and implementation with respect to the Health Status FIS utilized as
proof of concept throughout this chapter.
13 Fuzzy Inference Systems Design Approaches for WSNs 269
and their processing. In the distributed approach, as we have already mentioned, one
node from the FSNs is responsible for evaluating the rules’ weights and for applying
the implication method. This node is called coef_FSN. We assume that for a given
topology the heart sensor is closer to the other fuzzy nodes. Hence for this topology
the heart sensor is the coef_FSN. The remaining fuzzy related nodes sense their
values and fuzzify them according to the membership functions, while the FCHN
takes as input the two weights (maxalarm – maxnotalarm, see Algorithm 1). The
functionality of each fuzzy related node in the distributed approach can be derived
from the Algorithm 3.
As described in the previous sections the proposed FIS for event detection in the
healthcare domain has been implemented in a centralized and distributed way,
utilizing the well-known WSN embedded platform of TelosB (http://www.sentilla.
com/moteiv-transition.html) nodes. The two approaches are evaluated on top of
13 Fuzzy Inference Systems Design Approaches for WSNs 271
The number of nodes is considered twenty-five. In each case one node is considered
the cluster head node (FCHN) and five nodes are related to the fuzzy process (Fuzzy
Sensor Nodes FSN). FSNs values represent heart rate, sound class, activity rate,
fall, and time, respectively. The remaining nodes (19 in total) are the Non-FSNs,
whose purpose is to simulate a realistic scenario, where numerous nodes coexist,
and expectedly some of them are irrelevant to the FIS objective and thus effectively
disturb the direct transmissions of the FSNs to the FCHN. One-hop communication
model is considered.
The packet generation rate of the FSNs nodes (tf1) is tuned from 0.25 to 3 s,
while the Traffic Factor of the remaining nodes (tf2) is tuned from 0.25 to 4 s. The
fuzzy timer (ft) parameter represents the execution frequency of the fuzzy algorithm,
indicating the time between two consecutive executions. It must be noted that the
input data considered are the latest received FSN packets. Therefore, depending on
algorithms frequency and channels errors, the data utilized may not be up to date,
due to network delay or packet loss, revealing another critical trade-off. The fuzzy
timer is predefined at 4 s.
The most indicative evaluation metrics are presented as follows:
• Packet loss ratio
• Energy consumption profile
• Percentage of not updated fuzzy processes: The algorithm’s performance
depends on the freshness of input data. However this requirement is challenged
by the considered wireless medium. Therefore, an important evaluation metric
is the number of executions of the fuzzy algorithm with not updated input data.
If the last generated fuzzy inputs have not been received by the FCHN or the
coef_FSN when the fuzzy timer expires, then the fuzzification will be executed
with old inputs (i.e., not updated).
Particularly in Fig. 13.10 we observe that the packet loss in the distributed
approach is about 20 % when tf2 has a value of 0.25 s, while it varies from 3
to 8.5 % when the network is quite relaxed (tf2 D 4 s). Concurrently, high packet
loss ratios occur when the Non-FSNs generate and transmit packets in a higher rate
introducing congestion in the network. The traffic that the FSN nodes introduce to
the rest of the network is negligible and do not contribute the overall packet loss
ratio. In the more relaxed scenarios, where the tf2 is more than 1 s the packet loss
decreases to lower than 4 %. Respectively in the centralized scenario we observe
packet loss around 75 % in the more stressed scenarios, while it varies from 55 to
272 S. Dima et al.
Fig. 13.10 Packet loss ratio in the centralized and distributed approach
65 % when the generation rate decreases (tf2 D 4 s). In the centralized approach the
packet loss is higher because all the nodes send directly their data to the FCHN.
As anticipated, the distributed implementation balanced the traffic flows among
the network as the FSNs nodes forward their fuzzified results to the coef_FSN,
while the Non-FSNs send directly their data to the FCHN. Moreover an important
computational task of the FIS has been executed to the FSNs and to the coef_FSN,
and thus the FCHN is not overloaded with the reception of all the incoming packets
and the whole processing. As a result, the congestion effects were minimized for
all the Traffic Factors. Additionally in the distributed approach, the number of
transmissions decreases since the generation packets from the coef_FSN are not
transmitted to the FCHN. They are fuzzified locally and are used as input to the
implication method, with the received fuzzified values from the 4 remaining FSNs.
Figure 13.11 shows the ratio of the energy consumed by the CPU and the
radio over the total energy spent for each of the 6 FSNs for both centralized and
decentralized approach. The energy consumption gain of the distributed scenario
can be easily observed. The results of the consumed energy in these nodes are
similar while varying tf1 value, however, these figures consider a tf1 value of 1 s.
Node 6 is the FCHN in both cases, while node 1 has been selected as the coef_FSN
in the distributed implementation. On the one hand, in the centralized approach
the FCHNs processing load is overloaded since it is responsible for executing
the FIS while the FSNs nodes only sense and transmit their value. On the other
hand, in the distributed approach all the FSN nodes are responsible for the sensing
and the fuzzification of the sensed values, while the coef_FSN is responsible for
getting this data, for applying the implication method and for sending the two
weights (alarm, not-alarm) to the FCHN. Finally, the FCHN is responsible for
the reception of the Non-FSNs and the coef_FSN packets, and the defuzzification
13 Fuzzy Inference Systems Design Approaches for WSNs 273
method. As we can see the CPU utilization is almost evenly balanced among all
the nodes in the distributed implementation. Especially nodes 1 and 6 represent
the two major processing elements and this is obvious to their CPU utilization.
However the CPU utilization has been balanced among the nodes, we should assure
that the total energy is not increased. From Fig. 13.12, it is observed that the
overall energy is significantly reduced in the decentralized scenarios even if there
is a slight increase in the radio consumption. For instance, the total energy that is
consumed in the 6 nodes in the distributed approach has been decreased by a factor
of 62.5 % compared to the centralized approach. The reason for the radio energy
consumption increase is the output of each task of the FIS has a bigger payload
than the payload of the raw sensor values and therefore the FSNs transmit longer
packets. It should be noted that the CPU utilization includes also the CPU energy
for executing the code for transmission and receive and for handling the interrupts
between the monothread. This means that the CPU utilization is not only the energy
for executing the FIS, which leads to a significant difference in the CPU utilization,
as shown in Fig. 13.12. The processes handling required by the Contiki OS and
passing required information between the communications and processing threads
lead to the observed CPU utilization increase.
The next metric is application oriented, and depicts how the network health
affects the FIS’ performance. High ratios of packet loss lead to FIS’s execution
with outdated values (not updated fuzzy processes). In Fig. 13.13 the number of
the fuzzy processes that were executed with invalid inputs (old values) is in all
274 S. Dima et al.
scenarios considerably lower in the distributed scenario. The increase of tf2 has a
significant inversely analogous result on NU fuzzy processes. A decrease of the NU
fuzzy process with respect to tf2 can be noted up to 0.5 s. Further increase of tf2
(i.e., reducing the Non-FSN packet workload) has rather diminishing effect on NU
fuzzy process, as indicated by the slope of the respective graphs. This is because the
networking conditions are more relaxed in this case. In the most stresses scenarios
(tf2 D 0.25 s) the difference in the ratios of the not updated fuzzy process varies
from 5 to 7 % when tf1 value varies from 3 to 0.25 s, respectively. This behavior
is almost similar for the remaining tf2 range, except of the most relaxed scenarios
(tf2 > 3 s) where the difference between the two implementations is negligible.
13.6 Conclusions
References
16. D. Istrate, J. Boudy, H. Medjahed, J.L. Baldinger, Medical remote monitoring using sound
environment analysis and wearable sensors. Biomed. Eng. Carlos Alexandre Barros de Mello
(Ed.), InTech, DOI: 10.5772/7852. http://www.intechopen.com/books/biomedical-engineer
ing/medical-remote-monitoring-using-sound-environment-analysis-and-wearable-sensors
17. H. Medjahed, D. Istrate, J. Boudy, B. Dorizzi, in Human Activities of Daily Living Recognition
Using Fuzzy Logic for Elderly Home Monitoring. IEEE International Conference on Fuzzy
Systems (2009)
18. S.-M. Dima, C. Antonopoulos, J. Gialelis, S. Koubias, in A Network Reliability Oriented Event
Detection Scheme for Wireless Sensors and Actors Networks. The International Conference on
Industrial Technology, IEEE (2012)
19. H. Medjahed, D. Istrate, J. Boudy, B. Dorizzi, in A Fuzzy Logic System for Home Elderly
People Monitoring (EMUTEM). Proceedings of the 10th WSEAS international conference on
Fuzzy systems (2009). pp. 69–75
20. P. Rafiee, G. Latif Shabgahi, Evaluating the reliability of communication networks(WAN)
using their fuzzy fault tree analysis – a case study. J. Math. Comput. Sci. 2(2), 262–270 (2011)
21. M. Mahfouf, M.F. Abbod, D.A. Linkens, A survey of fuzzy logic monitoring and control
utilisation in medicine. Artif. Intell. Med. 21(1–3), 27–42 (2001)
22. O. Gama, P. Carvalho, J.A. Afonso, P.M. Mendes, Quality of service in wireless e-emergency:
main issues and a case-study. Paper presented at the 3rd Symposium of Ubiquitous Computing
and Ambient Intelligence 2008
23. S. Ullah, B. Shen, S. Riazul Islam, P. Khan, S. Saleem, K. Sup Kwak, A study of MAC
protocols for WBANs. Sensors 10(1), 128–145 (2010)
24. S. Dima, D. Tsitsipis, C. Antonopoulos, J. Gialelis, S. Koubias, in FLOGERA: A Fuzzy
Logic Event Recognition Algorithm in a WSN Environment. 2012 8th International Wireless
Communications and Mobile Computing Conference (IWCMC), (2012), pp. 850–855. doi:
10.1109/IWCMC.2012.6314315
25. S.-M. Dima, C. Panagiotou, D. Tsitsipis, C. Antonopoulos, J. Gialelis, S. Koubias, Performance
evaluation of a WSN system for distributed event detection using fuzzy logic. Ad Hoc Netw.
23, 87–108 (2014)
26. R.R. Yager, D.P. Filev, Essentials of Fuzzy Modeling and Control (Wiley, New York, 1994)
Part V
Use Cases for IoT
Chapter 14
IoT in Ambient Assistant Living Environments:
A View from Europe
23.7 million in 2010 to 62.4 million in 2060 [1]. At the same time, critical advances
in the medical domain offer valuable tools to the senior population allowing them to
stay active for as long as possible. However, extending the life time expectation
of the general population is unavoidably accompanied by increased frequency
of chronic disorders manifestation. Such occurrences greatly degrade life quality
and at the same time emphasize the need for advanced AAL technologies and
deployments. It is important to note that respective needs apply both to the user
and their equally old spouses or relatives that undertake the responsibility of care
provision, effectively extending the range of people requiring AAL services.
Additionally, moving beyond specific chronic disorders, AAL includes other
equally important aspects under the umbrella of new solutions towards improving
the quality of life, supporting health needs, facilitating concepts such as “aging
well” or “healthy aging,” and maintaining the social participation of the elders.
All the above clearly indicate a new rapidly growing market for health devices and
services that support seniors in their home environments. Provision of such services
must cover a wide range of requirements including medication schedule reminders,
monitoring of vital signs, and dispatching of medical alerts in the case of emergency
situations such as falls and accidents, affective monitoring, urging people to stay
active and creative and many more.
Based on the aforementioned EU report, the number of elderly people in need of
constant care and attention will increase significantly in the near future. Another
observation advocating the extensions and enhancement of AAL technologies
relates to the fact that contemporary approaches and services are and will be ren-
dered totally inadequate. Specifically, hospitalization, nursing homes, or employing
personal care givers at home for a continuously increasing population percentage
are not a viable solution due to practical [2], economical [5], and psychological [4]
reasons. Another perspective of paramount importance, yet most of times ignored by
existing approaches is that AAL services (and not only for elderly people but also in
general) are a highly personalized, multiparametric and multifaceted challenge not
able to be addressed solely by existing approaches.
AAL IoT solutions, on the other hand, acknowledge and even capitalize on
the fact that what a person may need or expect from home monitoring can be
quite diverse. On one hand, a typical category is the users suffering from specific
medical conditions. In that respect, the actual condition (e.g., kinetic difficulties,
heart conditions, brain conditions, etc.) and the needs for each specific user are
diverse (or diversified) and thus a “one size fits all” solution is not adequate. On
the other hand, AAL need to also cover cases where home monitoring is needed
because he/she spends a lot of time on its own and a general monitoring on the
user’s well-being is desired. Furthermore, home monitoring requirements gaining
active interest focus on safety issues (e.g., the user forgot to turn off the oven or
close a window/door before going to sleep). Such cases although not directly related
to medical conditions also comprise services of high added value for the general
population [6].
14 IoT in Ambient Assistant Living Environments: A View from Europe 283
For all the above reasons, AAL represents a fundamental research domain that has
drawn massive attention. Moving to the more technical aspects, AAL rather than
being a technology itself, AAL encompasses IoT approach, embedded networked
devices and sensors, algorithms, and diverse ICT technologies to support people
in their preferred environment. Such interdependencies and collaborations amongst
different ICT domains further enhance the added value of respective research efforts
and deployments. Another aspect differentiating AAL development from other ICT
advancements concerns the requirement to pose minimum intrusion thus yielding
significant added value of allowing the person to be self-reliant and independent.
Furthermore, as AAL approaches are applied into more and more scenarios they
also move beyond the human factor and focus on a wide range of characteristics of
the environment itself characterizing typical IoT platforms.
Specific areas towards which AAL technologies extend include security, surveil-
lance, energy consumption, and remote access attracting increasing interest. Addi-
tionally, in many cases people (especially elderly) tend to spend significant part
of each day away from home. Consequently, a home monitoring system able to
detect events related to safety and security (i.e., a window/door left open, the oven
is left on, etc.) could be an invaluable tool [7, 8]. Power consumption monitoring
pertaining to security, well-being, economy as well as carbon footprint control
services comprise another critical aspect of nowadays AAL enabled by IoT capa-
bilities with energy demand-response programs support [9, 10] representing also
research objectives of high added value. In order for the aforementioned services
to be implemented significant advancements in ICT fields such as wireless sensor
networks (WSN) regarding ultra-low power consumption embedded systems and
miniaturization [11, 12] are required. Based on the respective observations over the
last years both the number of available WSN platforms offering different capabilities
and the range of different sensors’ support continuously increase moving towards
a holistic home environment platform. However, high degree of heterogeneity
in all prominent technological areas still remains a critical challenge prohibiting
widespread utilization [13, 14]. Finally, one of the latest trends in AAL technologies
receiving active interest from the European research community (e.g., Horizon 2020
research projects calls) is help provision with daily activities, based on monitoring
activities of daily living (ADL) and issuing reminders [15], as well as helping
with mobility and automation [16]. Exploiting novel sensor modality such as video
processing, audio processing as well as processing approaches such as fuzzy logic
and affective modeling offer enhanced monitoring and control capabilities. Finally,
such technologies promote sociability amongst users sharing common interest,
activities, and hobbies or with their family, friends, doctors, and caregivers [17, 18]
highlighting further the interconnection with IoT approaches.
284 C. Panagiotou et al.
This section describes mainly active projects funded by the EU regarding the AAL
domain under the IoT paradigm. The projects are presented under the view of the
objectives and the expected impact addressed by common or similar calls which
will be used as a common ground. The majority of the described projects (five out
of six) have been accepted in “PHC-19-2014—Advancing active and healthy ageing
with ICT: service robotics within assisted living environments” call [19] while the
last one has been funded under the “FP7-ICT-Challenge 5: ICT for Health, Ageing
Well, Inclusion and Governance” call.
In the PHC-19 call, the EU identifies and highlights the needs that the increasing
ageing European population has to deal with. Namely, issues regarding risk of
cognitive impairment, frailty, and social exclusion with considerable negative
consequences for their independence, quality of life, including that of those who
care for them, and for the sustainability of health and care systems. The call
focuses on the development of robotic services applied in the context of AAL and
particularly for supporting ageing population. The key concepts that need to be
addressed regard modularity, cost effectiveness, reliability, flexibility, applicability
to realistic settings, and acceptability by the end users.
The outcomes of the projects funded under the PHC-19 call are expected to
contribute with respect to validation of the benefits offered by the developed robotic
services, the reduction of the time spent in institutional medical care, and the
improvement of quality of life.
RAMCIP Project The RAMCIP (Robotic Assistant for MCI Patients at home,
Grant Agreement no: 643433) [20] scope is to research and develop real robotic
solutions for assistive robotics for the elderly and those suffering from mild cogni-
tive impairments (MCI) and dementia. The desired functionalities are given through
the development of a service robot with high-level cognitive functions. These
functions are driven through modeling and monitoring of the home environment,
the user and other co-located persons, allowing the robot to take optimal decision
regarding when and how to provide assistance, in a proactive and discreet way [21].
The proposed system’s core is an autonomously moving service robot with an
on-board touch screen and a dexterous robotic hand and arm. The objectives of
the project can be summarized in developing a service robot that will be capable
of understanding actions, complex activities, and behavior of multiple persons in
the user’s home and provide proactive, discreet, and optimal assistance to the
user. Furthermore, the project deals with establishing advanced communication
channels between the user and the robot. Another key objective of the project is
the development of advanced physical interaction between the robot and the home
environment in order to support assistance activities that involve physical interaction
between the robot and the user. These key functionalities that the RAMCIP robot
will deliver are briefly presented in Fig. 14.1.
14 IoT in Ambient Assistant Living Environments: A View from Europe 285
The service approach of the system through the cloud structure is expected to
deliver the required flexibility as addressed by the call objectives. Moreover, the
interfaces that deliver the interaction with external devices will provide modularity
that is required to make the system flexible and adaptable to user needs and
characteristics. Safe results about the cost effectiveness of the system cannot be
made since the system is yet under development. Finally, the last objectives of
the call that refer to the reliability, the applicability to realistic setting, and the
acceptance by the end users will be investigated during the trials of the project.
MARIO Project The MARIO project (Managing Active and healthy aging with
use of caRing servIce robots, Grant Agreement no: 643808) [24] addresses the
difficult challenges of loneliness, isolation, and dementia in older persons through
service robots. The main objectives of MARIO pertain to an improved interaction
with end users and assisted living environments in order to enable iterative
development and preparation for post-project uptake. The project aims to support
and receive “robot applications” similar to the paradigm offered by community
for smartphones so as to empower development and creativity, enable the robot
to perform new functionalities over time, and support discovery and improve
usefulness for end users through cost effective solutions.
From the ICT point of view, the project incorporates advances in machine learn-
ing techniques and semantic analysis methods to make the robot more personable,
useful, and accepted by end users [25].
The challenges that the project tries to address as highlighted in [26] concern:
1. Effectively assessing persons with dementia in the community provided they
are suitable users for the robot (especially in countries with less developed
community care structures).
2. Finding optimum trade-off between the needs and preferences of caregivers and
end users while most efforts so far are focused solely on the caregivers.
3. Identifying meaningful activities and potential forms of achieving social connect-
edness that will add genuine value to the daily life of a person with dementia.
4. Designing a dementia-friendly interface that allows for a sufficiently compre-
hensive range of functionalities without being overwhelming or disorienting for
a person with dementia will be essential for the successfully implementation of
a genuinely empowering use of the technology.
5. Realistic assessment of the benefits of robot assisted care over traditional
approaches to care, without implicit endorsement of a technological imperative.
MARIO claims to offer opportunities to progress beyond the current state of the
art in the five following innovation areas:
1. Integration of robot semantics with existing structured and unstructured data,
leveraging on current data integration practices such as the linked data principles,
W3C semantic web standards Resource Description Format (RDF), SPARQL,
and rule interchange format (RIF), semantic web-oriented machine reading, and
ontologies.
288 C. Panagiotou et al.
Two in-depth validation trials will be carried for the overall scientific assessment
of the ENRICHME system aiming at identifying the potential impact of the
system in supporting the active and healthy ageing of European citizens. Data on
system sensibility and sensitivity will be compared with those already available in
the literature and current elderly housing facilities. Physiological indexes will be
analyzed versus other parameters (e.g., motion, behavioral, clinical, video analysis,
14 IoT in Ambient Assistant Living Environments: A View from Europe 289
Social Intelligence
automation and notifications will build upon those services, thus, in the following,
we provide some context of how those services currently operate.
ROBOT-ERA The objective of the Robot-Era project (Implementation and inte-
gration of advance Robotic systems and intelligent Environments in real scenarios
for the ageing population, Grant Agreement no: 288899) [30] is to develop,
implement, and demonstrate the general feasibility, scientific/technical effective-
ness, and social/legal plausibility and acceptability by end users of a plurality of
complete advanced robotic services. These services will be integrated in intelligent
environments, which will actively work in real conditions and cooperate with real
people and between them to favor independent living, improve the quality of life,
and the efficiency of care for elderly people.
14 IoT in Ambient Assistant Living Environments: A View from Europe 291
ROBOT-ERA aims to enhance the quality and the acceptability of current robotic
services and deliver new functionalities and services with increased performance.
Its scope is pursued by exploiting previous knowledge on robotics and ambient
intelligence technologies, cognitive-inspired robot learning architectures, elderly
user-needs, and methodology of design for acceptability. These keystones are
fundamental for the real deployment in order to find the most appropriate and
successful solutions and overcome actual barriers to the exploitation of robotic
services [31, 32].
The system intends to provide a personalized medical support to the users
in a continuous manner, by leveraging the use of companion robots, distributed
sensors in the environment, and a cloud platform. Exploiting the cloud robotics
paradigm, computation-intensive tasks are assigned to the cloud. Therefore, access
is achieved to a vast amount of data and the storage capabilities are increased. The
indoor user localization and environmental monitoring algorithms are developed
and offloaded onto the cloud considering the Software as a Service (SaaS) paradigm.
This architecture improves the robot’s functionalities without increasing the on-
board computational load. Furthermore, different users and robotic agents are able
to use the proposed services not being preoccupied about software maintenance.
The list of the implemented SaaS that the project offers is reported below:
1. User indoor localization based services
2. Care reminding services
3. Environmental monitoring services
Modern cloud approaches are also applied in the ROBOT-ERA project through
the SaaS model. SaaS, as leveraged by ROBOT-ERA, has become a key requirement
for the evolving IoT solutions. The applicability of the system along with accept-
ability rate from the users will be tested during the pilots that will be performed in
Peccioli (Italy) and Örebro (Sweden).
Having analyzed the technical and the societal objectives for each EU funded
project, in this section we illustrate the in-field trials and planned use-cases of each
project. For a fair and meaningful comparison, we narrow down the set of projects
to those that are based on mobile robotic platforms for AAL environments. This
leaves at our disposal five projects: RADIO [28], RAMCIP [20], growmeup [22],
Mario [24], and ENRICHME [27]. Note that in this selection we include only active
projects.
The purpose of this section is to reveal how the use-cases are selected, what is
the common ground and the differences between the selected use-cases among the
projects and eventually if there are use-case scenarios that are overlooked by the
292 C. Panagiotou et al.
projects’ workplan. The reason that we concentrate in the selection of the use-cases
and the in-field trials is that these aspects of the projects represent a first-class metric
for validating the technology readiness level (TRL) produced in each case. Below is
our characterization for each project.
Finally, we have to mention at this point that our assessment is restricted to
the information that is available in the corresponding projects’ websites (including
related information such as press releases, public deliverables, and project presenta-
tions). Any aspects of the projects that are not covered in their websites and probably
described in the detailed technical annexes of the projects are out of scope for this
chapter.
RADIO The RADIO project sets forward a novel approach to acceptance and
unobtrusiveness in AAL environments. The underlying idea is that the sensing
mechanism is not discrete but it acts as an obvious and accepted part of the user’s
daily life. More specifically, the sensing mechanism consists of an integrated smart
home and the assistant robot system. According to RADIO, the robotic system
must be considered as an unobtrusive “pet” and in this way, sensors do not need
to be discrete and distant or masked and cumbersome to install. In other words,
the sensing mechanism must be perceived as a natural component of the smart
home/assistant robot functionalities.
The target population of RADIO technology is elderly people without any
significant physical or mental impairment. By collecting and analyzing behavioral
data, doctors can diagnose cognitive impairment symptoms early and take timely
remedial actions. As such, the end users are able to maintain their independent life,
prolong the time spent at home, and improve their quality of life. In RADIO, the
robot also acts as the contact point for home automation conveniences, such as
lights that can be switched on and off. Additional activities of daily life (ADL) and
mood recognition methods ranges from the time spent out of the house or carrying
out a given activity in it, to sleeping patterns, to recognizing whether the end user
has changed clothes, washed, or other crucial indications required by the doctors.
Finally, the RADIO robot is designed to recognize the mood of the users by means
of both speech and facial characteristics analysis.
The RADIO approach will be evaluated at actual elderly care facilities and
under realistic conditions at clinical partners’ premises. Moreover, technical testing
is also planned in two full-scale smart home apartments with multiple rooms. In
particular, the RADIO consortium includes three clinical piloting partners that will
run four sets of experiments in three phases. The first phase, called formative
phase, will be carried out in an early stage of the project with elderly end users
in a hospital dedicated to neuro-motor rehabilitation of patients. The second phase,
called intermediate phase, will run in the same hospital, while the third phase, called
summative phase, includes two sets of experiments: one at a healthcare provider
and geriatric center and one at the private homes (outside of any medical care
institutions) of end users who have volunteered to participate in the RADIO piloting
plan.
14 IoT in Ambient Assistant Living Environments: A View from Europe 293
Overall, it can be considered that the RADIO project includes a rich piloting plan
that is sufficient enough to ensure a mature end solution. This is because the clinical
objectives of the projects will be tested in three different environments with different
parameters and requirements, while technical objectives will be further validated in
two smart home environments. What is also interesting is that the piloting plans are
spread across the whole duration of the project allowing a complete and iterative
evaluation of the RADIO system. Apart from the above objectives, installing the
RADIO in different environments and premises will also validate the flexibility and
ease of installation of the prototype.
RAMCIP The RAMCIP project follows a different mentality. It is based on robotic
assistant at home; in contrast to the RADIO approach in which the robot acts
more as an “observer.” As noted, the target population in RAMCIP is patients
with MCI and dementia. The approach relies on a robotic platform consisting of
an autonomous moving robot with an on-board touch screen and dexterous robotic
hand and arm. The robot is considered as a service-centric machine with cognitive
functionality. This functionally is driven through modeling and monitoring of the
home environment, the user and other co-located persons, allowing the robot to take
optimal decision regarding when and how to provide assistance.
In essence, the RAMCIP project aims to develop a service robot (i.e., a home
assistance to the user) capable to understanding the behavior and activities of the
monitored persons. The project also deals with providing entertainment functions to
the users, e.g., access to social media, teleconferences with relatives or caregivers
as well as other, more practical assistive functionalities such as bringing objects to
the user or picking up objects from the floor.
The RAMCIP project includes a detailed demonstration/validation plan with
multiple pilot trials. In the foreseen trials, elderly people will be assessed by medical
doctors and psychologists in order to be categorized into two groups: the control
group and the clinical group. The patients suffering from MCI and Alzheimer’s
disease (AD) will be assigned to the clinical group. The control group will consist
of normal elderly persons and this group will be used to assess the normal person–
robot interaction. With this approach, potential problems related with normal aging
process will be defined and separated from MCI/AD dedicated problems. This is
of paramount importance and within the RAMCIP project, a detailed analysis is
performed to study the inclusion/exclusion criteria of each group.
The evaluation of the project’s advances will be performed in two pilot sites.
More specifically, in two neurological instructions specializing in several neurode-
generative diseases such as Alzheimer’s disease, dementia, multiple sclerosis, and
epilepsy. It can be considered that the field areas covered by the piloting partners
are capable to specify/validate/demonstrate the user-centric technology of RAMCIP
project. Moreover, the project set forward a unique approach to improve the social
294 C. Panagiotou et al.
life of the patients. This has a real social impact since this is the main and most
important problem in the target patients group of the project.
GrowMeUp Similar to the RAMCIP project, the GrowMeUp target is to build a
service-centric robotic platform aiming to increase the years of independent and
active/autonomous living, thus the quality of life of older persons. In contrast to the
RAMCIP project, the target population group is people with light physical or mental
health problems (at the age of 65C) who live alone at home and can find pleasure
and relief in getting support or stimulation to carry out their daily activities over the
ageing process.
In more details, in the GrowMeUp approach the robotic system will be able to
learn the older persons needs and habits over time and enhance (‘grow up’/scale up)
its functionality to compensate for the elder’s degradation of abilities, to support,
encourage, and engage the older persons to stay longer active, independent, and
socially involved while carrying out their daily life at home.
The envisioned technology heavily relies on machine learning mechanisms that
will enable the GrowMeUp service robot to extend and increase its knowledge
continuously over time. In addition, cloud based technologies are utilized to share
and distribute the gained knowledge with multiple other robots, so that other
robots making use of the cloud, can learn from the experience of each other and
thus increase their own functionality/competencies and at the same time reduce
learning effort. The daily activities support will be provided in a human like way
characterized by behavior and emotional understanding, intelligent dialoguing, and
personalized services provision.
The GrowMeUp prototypes will be tested in one big healthcare site that includes
fully operational apartments and in the private homes of elderly people managed
by a home care service provider. The two trials have been carefully selected so
as elderly persons can live with the greatest possible independence and activity.
The trial workplan is organized in two main phases: the pre-trials and the final-
trials phases. Both phases will last for a remarkably long duration (3 and 9 months,
respectively) revealing that the project follows an iterative and thorough evaluation
plan. In other words, the project workplan includes ample room to identify new user
needs and requirements, to suggest corrective measures to any encountered problem,
and finally to propose refinements or use-case scenarios’ adaptations.
It is important to note that the GrowMeUp trials involve a multidisciplinary
team including technical directors, social workers, social animators, psychologists,
nurses, and direct action helpers. Also during the final trials, for each one of the
elderly, a virtual care team will be assigned consisting of minimum three carers
and one younger person (family relative or volunteer at the end user institution in
the age of 15–18). As such, it can be considered that the project has a sustainable
exploitation strategy since the generated technology will be validated by a large and
multidisciplinary team in real environments and for a long duration.
MARIO The MARIO project will also build a service oriented robotic platform.
The aim of the project is to provide a solution to loneliness, isolation, and dementia
14 IoT in Ambient Assistant Living Environments: A View from Europe 295
in older persons. The underlying idea of the project is to increase the self-perception
and brain stimulation of monitoring elders through the robot. Similar to the previous
projects, MARIO includes an extensive and long running piloting plans that are
overlapped with the validation and R&D activities of the project.
There are three piloting partners in the project namely, a nursing unit, a social
care and community support unit, and a hospital unit specializing in comprehensive
geriatric assessment.
Overall, the project has a clear commercialization strategy and specific effort is
devoted to bring the MARIO solution to the end users through market deployment,
e.g., by addressing licensing and integration aspects. As also noted, this direction is
also supported by the fact that MARIO will set forward a framework for receiving
“robot applications” similar to the app community for smartphones. As such, this
will enable the robot to perform new functionalities over time, improve usefulness
for the end users while lowering costs.
ENRICHME As in the previous three projects, the ENRICHME project relies on
an interactive, service-oriented, and mobile robot. The target population group is
elderly people suffering from MCI. As noted, the project relies on three main pillars:
robot, ambient, and social intelligence. These three concepts are realized through a
robot with safe navigation, monitoring, and interaction with the person along with
home automation and ambient sensing for long-term monitoring of human motion
and daily/weekly/monthly life activities. In essence, a prime target of ENRICHME
is to act as an enabling tool to enrich the social activities of the patients and as a
result their quality of life.
The project includes two piloting phases: testing in AAL laboratories and
validation at the elderly facilities. The first one will be performed in two different
sites and its aim is to provide user feedback to the development activities of the
project in order to improve the final prototype. The second one will be performed in
three different sites and its aim is to offer the final assessment of the ENRICHME
prototype. It is important to note that all trial sites will be provided by the project
partners. Another important aspect is that the final validation phase will run for 12
months in three different sites simultaneously.
A Critical View Although the analyzed projects have different technical and
societal objectives and in the most of the cases different target population groups, the
common ground in all of them is that they include a rich and long running piloting
plan. More specifically, in all cases the piloting/trials approach includes multiple
phases that are spread across the whole duration of the project. This common to
all projects approach ensures, to the extent that it is possible, that the projects will
deliver a mature and close to market technology.
Another common parameter that must be highlighted is that the consortia include
the correct balance between ICT and medical/clinical experts. The largest number
of the medical/clinical partners is in the ENRICHME projects (five partners in
total). Among all projects, almost 35 % (on average) of the partners belong to the
296 C. Panagiotou et al.
medical/clinical field. This is of added value, since the end solutions delivered by
each project will be assessed by real-life end users, namely not only by elderly
persons, doctors, and nurses but also by social workers, psychologists, and any kind
of direct action helpers and caregivers.
While at the time of writing the mentioned projects are running for almost 1 year,
it would be interesting to repeat the current analysis at the end of the lifetime of
the projects. This will allow us to put the results and achievements of each project
side-by-side and draw more concrete results and conclusions about this relatively
new field of research, i.e., robotic assistance in AAL environments. Such evaluation
will be interesting to be performed in all aspects of the projects (apart from
the achievement of the technical objectives) including commercial achievements,
achievements in medical assessment technology, etc.
14.5 Conclusions
This chapter presented how the IoT paradigm is realized on the AAL domain
through a thorough study of EU funded projects. Initially, it has been highlighted the
societal impact of the AAL advancements and how they are benefitted by the IoT
evolution. Current trends are captured by restricting the survey on recent projects
that five of them are still active and one of them has been recently completed. The
projects have been described based on the objectives they address as defined by the
respective calls. The main scope of the chapter was to identify and highlight the
technological pillars that IoT paradigm shares with the AAL domain along with the
respective ICT and societal advancements. A big part of the chapter was dedicated
on the presentation of the use-cases and the planned in-fields trials of each project.
Thereby, a primary evaluation of each project’s TRL level has been attempted.
References
1. European Commission, The 2012 Ageing Report. Economic and Budgetary Projections for the
27 EU Member States (2010–2060) (European Economy, Feb 2012)
2. T. Panagiotakopoulos, A. Theodosiou, A. Kameas, Exploring ambient assisted living job
profiles. Proceedings of the 6th International Conference on Pervasive Technologies Related to
Assistive Environments, 2013
3. Centers for Disease Control and Prevention, Chronic Disease Overview: Costs of Chronic
Disease, http://www.cdc.gov/chronicdisease/
4. A.M. Holmes, P. Deb, The effect of chronic illness on the psychological health of family
members. J. Ment. Health Policy Econ. 6, 13–22 (2003)
5. Centers for Disease Control and Prevention, Chronic Disease Overview: Costs of Chronic
Disease, http://www.cdc.gov/nccdphp/overview.htm
6. G. Van Den Broek, F. Cavallo, C. Wehrmann, AALIANCE Ambient Assisted Living Roadmap.
Ambient Intelligence and Smart Environments (IOS Press, Amsterdam, 2010)
14 IoT in Ambient Assistant Living Environments: A View from Europe 297
30. ROBOT-ERA Project, Implementation and integration of advanced robotic systems and
intelligent environments in real scenarios for the ageing population, http://www.robot-era.eu/
31. M. Bonaccorsi, F. Lauraa et al., Design of cloud robotic services for senior citizens to improve
independent living in multiple environments. J. Artif. Intell. Soc. Econ. (2015)
32. P. Dario, A synoptic glance and main objectives. Robot-Era presentation, 2013
Chapter 15
Software Design and Optimization of ECG
Signal Analysis and Diagnosis for Embedded
IoT Devices
T
wave
P
wave
U
Q
wave
S
15 Software Design and Optimization of ECG Signal Analysis and Diagnosis. . . 301
One of the most common heart malfunctions is arrhythmia [2]. In this case the
heartbeats differently compared to its normal rhythm and while the phenomenon
is not always critical, in other cases it can lead to strokes or heart failure. Given the
severity of the latter cases, arrhythmia and its detection using the ECG signal is a
well-studied domain. Recently, new techniques from the machine learning domain
have been adapted [3, 21, 22] and as a part of this work we utilize such a machine
learning-based ECG analysis flow to be incorporated in the IoT node under design.
To efficiently design and employ machine learning techniques an enriched
and descriptive input data set of phenomenon under analysis is needed. For the
purposes of this study, data from the MIT-BIH arrhythmia database [4, 20] were
used. The database is composed of 48 half-hour excerpts of two-channel (two leads)
ambulatory ECG recordings, obtained from 47 subjects. Of these, 23 recordings
were chosen at random from a collection of over 4000 24-h ambulatory ECG
recordings, serving as a representative sample of routine clinical recordings. The
remaining 25 recordings were selected from the same set to include a variety of
rare but clinically important phenomena [2] (complex ventricular, junctional, and
supraventricular arrhythmias), which would not be well represented in a small
random sample. The subjects included 25 men aged 32–89 years and 22 women
aged 23–89 years. Approximately 60 % of the subjects were inpatients and 40 %
outpatients.
A crucial advantage of the MIT-BIH database is that it also provides annotations
for each record, where cardiologists have designative a label for each individual
heartbeat included in the record. There are approximately 110,000 annotations.Two
arrhythmia groups are examined in this analysis, “Normal” (N) and “Abnormal,”
which includes all the different types of arrhythmia as they have been indicated by
doctors.
The original signal xŒn is first passed through a halfband high-pass filter gŒn
and a low-pass filter hŒn. After filtering, half the frequencies of the signal have
been removed, thus half the samples can be discarded according to Nyquist’s rule.
The signal is downsampled by 2, simply by discarding every other sample. This
constitutes one level of decomposition and can mathematically be expressed as
follows:
X
yhigh Œk D xŒn gŒ2k n
n
X
ylow Œk D hŒ2k n
n
where yhigh Œk and ylow Œk are the outputs of the highpass and lowpass filters,
respectively, after downsampling by 2.
This operation halves the time resolution since only half of each filter output now
characterizes the entire signal. At the same time, the frequency resolution is being
doubled, as each filter output now spans only half the frequency of the input. The
above procedure can be repeated for further decomposition.
Support vector machines (SVMs) are machine learning algorithms, which analyze
data and recognize patterns based on the statistical learning theory. They are used
for classification and regression analysis. Given a set of training examples, each
labelled as belonging to one of two categories (supervised learning), an SVM
training algorithm builds a model that assigns new examples into one category or the
other, making it a non-probabilistic binary linear classifier. Extending this notion, in
this work they will be employed as means of distinguishing whether a heartbeat is
exhibiting arrhythmia or not.
In a binary classification problem where input data belong to two classes, a
hyperplane can be defined which is the geometrical division or separation between
the two classes. The SVM algorithm will try to deduce the optimal hyperplane,
called maximum margin hyperplane that best divides the classes. This is achieved by
discovering the hyperplane that has the largest distance to the nearest training data
point of any class, since in general the larger the margin, the lower the generalization
error of the classifier. The decision of the optimal hyperplane is fully specified by a
(usually small) subset of the data which defines the position of the separator. These
points are referred to as the support vectors and hence the name of the classifier.
While the original problem may be stated in a finite-dimensional space, it
often happens that the categories to discriminate are not linearly separable in that
space. For this reason, it is proposed that the original finite-dimensional space be
mapped into a much higher-dimensional space, making the separation possible in
15 Software Design and Optimization of ECG Signal Analysis and Diagnosis. . . 303
that space. To achieve this mapping, a kernel function is used. Commonly chosen
kernel functions are non-linear ones such as choices for a kernel function such as a
polynomial one with order greater than one, Gaussian radial basic function (RBF)
which is used in this work and hyperbolic tangent (tanh).
The first essential part of creating an ECG analysis IoT node is defining the exact
components of the flow and exploring different design alternatives which are better
suited for the current case study. This exploration is performed on high, algorithmic
level and is executed offline on devices with high computational capabilities in
order to explore the biggest possible subset of the design space within a reasonable
time frame. Consequently, in this section, the overview of the ECG analysis flow is
presented and then the focus is changed to each individual sub-part and the strategies
to best define its structure.
Figure 15.2 illustrates the structure of the proposed analysis steps for heartbeat
classification. A digitized ECG signal is applied as the input to the system. A
filtering unit is used as a preprocessing stage, to remove baseline wander and noise
from the ECG signal. The filtered signal is then passed to the heartbeat detection
unit, which attempts to locate all the heartbeats contained in the input ECG signal.
Next in the flow, is the segmentation unit, where the input signal is segmented
into single heartbeats, accordingly with the information extracted from the previous
stage. In order to achieve greater classification performance, a feature extraction
unit is included. There, for each produced heartbeat, a feature vector is extracted,
containing a smaller number of elements than the ECG samples forming the
heartbeat. This vector serves as input for the classification stage, where the heartbeat
is classified as either “N” (normal) or “ABN” (abnormal) by a single classifier.
Q
S
Along with the MIT-BIH annotated ECG records, a library of software for
physiologic signal processing and analysis is provided by PhysioNet [6]. The initial
stage of this study was implemented in Matlab environment, and so the WFDB
Toolbox for Matlab[7] was used for the reading and processing of the database.
The power line interference and the baseline wandering are significant noise sources
that can strongly affect the ECG signal analysis. The Matlab function filter./ was
used to filter the signals with a band-pass filter of bandwidth 1–50 Hz. The signals
were band-pass filtered at 1–50 Hz [8].
Firstly, the wqrs function[9] is applied to the signal, which gives us the locations of
all QRS complexes found in the signal. This information along with the ECG signal
are the inputs to ecgpuwave function, which gives us the exact position of all the R
peaks found in the signal. QRS detection, especially detection of R wave in heart
signal, is easier than other portions of ECG signal due to its structural form and high
amplitude.
Each R peak detection corresponds to the detection of a single heartbeat.
The ecgpuwave program introduced in [10] has been validated on the Common
Standards in Electrocardiography Multilead database [11] and the MIT-BIH QT
database [12] and its performance in detecting significant points in ECG signals
is comparable to those given by experts.
Having located the R peaks of each heartbeat waveform, we can proceed to segment
the ECG signal into single heartbeats. To do that, we have to decide on a window
width, which having as center the detected position of the R peak, will cover the
whole of the heartbeat waveform. We choose a window width of 257 samples, as
suggested in [3].
As a feature extraction mechanism we use DWT [13], since it has been proven to
produce very accurate results. The wavelet base for the DWT is Daubechies of order
15 Software Design and Optimization of ECG Signal Analysis and Diagnosis. . . 305
2 (db2) [14] and we perform four levels of decomposition as proposed in [3]. The
Matlab function wavedec./ was used to perform the wavelet analysis on the signal,
and functions appcoef ./ and detcoef ./ were used to extract the approximation and
detail coefficients, respectively.
The DWT is used to compute compressed parameters of the heartbeat data which
are called features. These parameters characterize the behavior of the heartbeat.
The method of using a smaller number of parameters to represent the heartbeat is
particularly important for recognition and diagnostic purposes. The four levels of
decomposition produce eight sets of coefficients each one for four levels of detailed
and four levels of approximate coefficients. Since the heartbeat on which the DWT
is applied consists of 257 samples, the number of wavelet coefficients for the first,
second, third, and fourth level are, respectively, 130, 66, 34, and 18. Thus, 494
wavelet coefficients are obtained for each heartbeat. The final feature vector that
serves as input to the classification stage resulted from a design space exploration
performed on all combinations of these eight sets of coefficients, as will be discussed
later on.
15.2.2.5 Classification
The last stage of the structure consists of a binary classifier, which labels each
heartbeat as either “Normal” or “Abnormal.” In this study, we focus on using an
SVM classifier [15], mainly due to its ability to support non-linear classification
with efficient accuracy and computation cost. The Matlab interface of LIBSVM
[16], a library for SVMs, was used for the implementation of the SVM classifier.
As kernel function, we use the radial basis function (RBF). This kernel non-
linearly maps samples into a higher-dimensional space so it, unlike the linear kernel,
can handle the case when the relation between class labels and attributes is non-
linear, with smaller complexity in the model selection than the polynomial kernel
does. There are two parameters, C and , which need to be tuned, so that the model
which best predicts the unknown data is selected. Parameter is set to 1=k, where k
means the number of attributes in the input data, and parameter C is set to 1, which
is the default option recommended by LIBSVM.
The training process of the SVM model can be done offline. Having defined a
training data set and a testing data set for evaluation, we perform Design Space
Exploration on the different choices of input feature vectors of the ECG signal in
order to designate the best SVM model for arrhythmia detection (different feature
sets generate different SVM models).
A high level view of the process to decide upon the feature vector which gives the
model with the best performance results is depicted in Fig. 15.3. The training phase
306 V. Tsoutsouras et al.
15.2.3.1 Creating and Input Data Set for SVM Design Space Exploration
In order for the different SVM models to be produced, an input data set has to
be appropriately formulated using the 45 selected ECG records from the MIT-BIH
database. This input data set will be afterwards divided to produce its training and
testing sub-parts. As the previous flow indicates, all records were firstly filtered, the
R-peaks were located, and then the records were segmented into single heartbeats,
forming a set of 104,581 heartbeats. As stated before, for each heartbeat we need
a vector of attributes and a target value. The vector of attributes used is the feature
vector which contains the DWT coefficients of the heartbeat and is formed at the
feature extraction stage. As target value, we use the label given for each heartbeat
in the annotation files.
The problem detected at this point of the analysis is that there is a mismatch in
the heartbeats detected in a recording by the functions provided in the toolkit and
the heartbeats annotated by the doctors. In Fig. 15.4, the black circles indicate the R
peaks defined by the doctors. The green circle shows a correctly detected R peak, a
“True” beat, which is a detection close to an R peak annotation. A faulty detected R
peak, a “False” beat, is one which is far from the corresponding R peak annotation
(red circle). “Missed” beat is considered an R peak which the detector failed to
detect (the second black circle).
We overcome this problem by forming a procedure that allows us to match the
correctly detected heartbeats with their corresponding labels in the annotation files.
We use the distance from the actual R peak to decide on the type of detection,
comparing it to a defined threshold T. A statistical analysis over the whole database
15 Software Design and Optimization of ECG Signal Analysis and Diagnosis. . . 307
was conducted to estimate the duration of the QRS complex, and its median value
was found approximately 0.11 s. With a sampling frequency Fs D 360 Hz, the QRS
complex is approximately 40 data samples wide. We define the threshold T as half
the duration of the QRS complex, that is, 20 samples.
Our input consists of two time series; one consists of the detected heartbeats
using the provided R peak detection functions (D_times) while the other consists
of the annotated heartbeats provided by medical experts (A_times). Beginning from
the first elements of each time series, the procedure goes as follows: we compare
the detected beat i_D with the annotated beat i_A. If their absolute distance is less
or equal than T, then we have matched a detected heartbeat with an annotated one.
Consequently, the detected beat under examination is characterized as “True,” and
both time series indexes are increased in order to move to the next heartbeats. If
the annotated heartbeat proceeds the detected for more than T samples, then it is
characterized as a “Missed” beat, and its index is increased to move on to the next
annotated beat. If the detected heartbeat proceeds the annotated for more than T
samples, then it is characterized as a “False” beat, and its index is increased to
examine the next detected beat.
This procedure allows us to match the true detected heartbeats with their
corresponding labels in the annotation files. As for the falsely detected heartbeats,
we set the target value as “Abnormal.” This seems as a logical assumption, but
to validate this choice, we train a classifier with only true detected heartbeats and
evaluate it under false heartbeats testing scenarios. The result was that about 86 % of
the heartbeats were indeed classified as Abnormal. Of course, the missed heartbeats
are not taken into consideration, since they are not detected during the heartbeat
detection stage.
308 V. Tsoutsouras et al.
Finally, we have a data set of 104,581 heartbeats (100,231 true heartbeats and
4350 false heartbeats), along with a vector of their corresponding target values, and
a matrix with the DWT coefficients for each heartbeat. Half of the heartbeats are
used as the training data set for the SVM model, and the rest of the heartbeats are
used as the testing data set.
A design space exploration is performed over all combinations of the eight sets of
DWT coefficients produced in the feature extraction stage. To reduce exploration
time, DWT is calculated only once, producing a vector containing all sets of
coefficients for each heartbeat detected in the database. An iteration takes place,
choosing a different combination of these sets to serve as feature vector, and
producing a different classifier. The goal is to produce a classifier with
Number of correctly classified points
• maximized accuracy Total number of points
• minimized computational cost
In this initial stage, the computational cost was not measured as the absolute
execution time of classification on the platform used, but it was rather computed
theoretically as the product of the number of support vectors and the size of feature
vector, since this is the number of multiplications required for a heartbeat to be
classified [15].
15 Software Design and Optimization of ECG Signal Analysis and Diagnosis. . . 309
3e+06
2.5e+06
2e+06
Computational cost
1.5e+06
1e+06
500000
f
on o
Regi lity
a
optim
0
86 88 90 92 94 96 98 100
Accuracy (%)
Figure 15.5 presents the results of the design space exploration, regarding
accuracy and computational cost. As we can see, in almost all cases the accuracy is
above 97 %, with only a few exceptions. The best result comes from the feature
vector which only contains the approximate coefficients of the fourth level of
decomposition. In this case, we have an accuracy of 98.9 %, a feature vector of
size 18, and 2493 support vectors.
Up to this point the focus was towards the design and optimization of the
different parts of the ECG analysis and arrhythmia detection flow. This process has
been performed using high level tools such as Matlab, which inherently provide
implementations of the various functional blocks required to perform both building
and testing of the various components of the ECG processing flow.
The proceeding goal is having designated these components to further define
ways in order to port them to target embedded IoT device which is much more
constrained in terms of available off the self source code implementations and
computational resources. Consequently, this section summarizes all the necessary
decisions to support the aforementioned requirement.
310 V. Tsoutsouras et al.
The online ECG signal processing and classification is the real-time part of the
analysis that will be implemented on the embedded platform, while the offline
training procedure (see Fig. 15.3) is considered to already have been implemented
on some other platform. So far all the analysis was implemented in high level
using Matlab. At this point, the different stages of the analysis flow have to be
implemented in C, as described below, and combined into a single program. The
program reads sample by sample a digitized (at 360 samples per second) ECG
signal. The analysis flow is executed for every set of 3000 samples that is read
which is a limitation imposed by the source code responsible for R-peak detection
(Sect. 15.1.1) as it has been provided by Physionet [4].
312 V. Tsoutsouras et al.
15.3.2.1 Filtering
The input signal, consisting of 3000 samples, is firstly filtered. For the filtering stage,
the same FIR filters that were used in the Matlab environment are implemented in C.
For the implementation of the heartbeat detection stage, we adapt the window to
cover the PR and the QT intervals (Fig. 15.1). Based on statistics over the ECG
waveform [19], we decide on a window of 86 samples before the QRS onset, and
170 samples after the QRS onset (window width of 257 samples). Comparing the
output of the two implementations up to this stage, we see that the resulted heartbeat
is satisfactory in both the Matlab and the C implementation, as demonstrated in
Fig. 15.8 for a random ECG waveform. The heartbeats detected in the 3000-sample
signal are passed one by one to the next stages.
For the stage of feature extraction the Matlab function wavedec./ is implemented
in C. We use Matlab function wfilters./ to acquire the wavelet decomposition low-
pass and high-pass filters associated with wavelet Daubechies of order 2 (“db2”).
We apply symmetric-padding (boundary value symmetric replication) to the signal,
since it is the default DWT extension mode of Matlab. Then, the convolution of
15 Software Design and Optimization of ECG Signal Analysis and Diagnosis. . . 313
1.4
1.2
1
ECG amplitude(Volts)
0.8
0.6
0.4
0.2
−0.2
1.5 2 2.5 3 3.5 4 4.5
Time(sec)
Fig. 15.8 Heartbeat segmentation output for random ECG waveform: the green circles show the
beginning and end of the heartbeat as determined by the Matlab implementation, and the red circles
indicate the beginning and end of the heartbeat as determined by the implementation in C
the signal with each filter is implemented to produce the approximation and detail
coefficients for each of four levels of decomposition, according to the following
process:
Given a signal s of length n, the DWT consists of log2 n stages at most. The first
step produces, starting from s, two sets of coefficients: approximation coefficients
CA1 and detail coefficients CD1. These vectors are obtained by convolving s with
the low-pass filter Lo_D for approximation, and with the high-pass filter Hi_D for
detail, followed by dyadic decimation (downsampling). The length N of each filter
is equal to the order of the Daubechies wavelet. The signals F and G are of length
n C 2N 1 and the coefficients cA1 and cD1 are of length floor..n 1/=2/ C N:
The next step splits the approximation coefficients cA1 in two parts using the same
scheme, replacing s by cA1, and producing cA2 and cD2, and so on (Fig. 15.9).
This stage is implemented parametrically in terms of the coefficients that
compose the feature vector of the heartbeat used in the classification stage. For each
decomposition level, the coefficients produced are stored in a matrix if they are part
of the final feature vector, or else they are only used for the computation of the next
decomposition level. The process stops whenever all required coefficients have been
produced.
15.3.2.5 Classification
For the final stage of classification, we use the LIBSVM library which includes the
source code of svmtrain./ in C. We convert the SVM model under examination
produced by the same function in the Matlab environment into the format that is
used in the C implementation, using a generator. In the beginning of the program,
the function load_svm_model./, which is included in the LIBSVM library, is called
to load the SVM model from that file that we have created. The SVM model is
314 V. Tsoutsouras et al.
only created once in that initialization section of the program, and used in the
classification stage for each heartbeat.
In Fig. 15.10 the overall exploration framework is illustrated. This includes the
exploration phase conducted in the Matlab environment, meaning the DSE which
resulted in a set of Pareto solutions. In the customization phase, having selected
a desirable solution, the feature vector is set accordingly and the corresponding
SVM model is produced by a generator which converts the Matlab SVM model to
the appropriate format for the C implementation. Finally, the runtime phase is the
implementation of the algorithm in C, for the configuration selected, conducted on
the Galileo board.
The complete data flow of the IoT-based ECG monitoring design must support
data communication to a back-end server which will perform data aggregation and
monitoring of the entire IoT-based system. In the presented case study, the Galileo
Board, which serves as the wearable IoT device, is connected via Ethernet to the
network in order to transmit the output data of the application over Internet to
the database of the back-end server. The information sent consists of the output
of the classification stage, which indicates the detection of either a “Normal” or an
15 Software Design and Optimization of ECG Signal Analysis and Diagnosis. . . 315
From the offline training procedure, we get the SVM model which is being used at
the classification stage of the analysis flow (see Fig. 15.3). The configurations of this
model derived from the design space exploration for the SVM tuning. The metrics
taken into consideration for the selection were, as mentioned there, accuracy and
computational cost.
316 V. Tsoutsouras et al.
100
90
80
% of total execution time
70
60
50
40
30
20
10
0
84660 125216 151476 192720 205170 360400 592956 821340 1051520 1282050 1781632 1790904 1799280 1968330 2691792
44874 90468 140192 171430 205156 306210 435656 710424 936600 1163500 1494990 1782960 1797758 1810188 2442382 2941930
computations
Fig. 15.11 Scaling of execution time in accordance with the computations required in each
configuration
Fig. 15.12 Average percentage of total execution time for each stage for the three categories of
examined SVM models
References
1. Electrocardiography, https://en.wikipedia.org/wiki/Electrocardiography
2. F.I. Marcus, J.N. Ruskin, B. Surawicz, Arrhythmias. J. Am. Coll. Cardiol. 10(2), 66A–72A
(1987)
3. E.D. Übeyli, ECG beats classification using multiclass support vector machines with error
correcting output codes. Digital Signal Process. 17(3), 675–684 (2007)
4. R. Mark, G. Moody, MIT-BIH Arrhythmia Database Directory (Massachusetts Institute of
Technology, Cambridge, 1988). Available online from: http://www.physionet.org/physiobank/
database/mitdb/
5. R.J. Martis, U.R. Acharya, L.C. Min, ECG beat classification using PCA, LDA, ICA and
discrete wavelet transform. Biomed. Signal Process. Control 8(5), 437–448 (2013)
322 V. Tsoutsouras et al.
6. A.L. Goldberger, L.A. Amaral, L. Glass, J.M. Hausdorff, P.C. Ivanov, R.G. Mark, J.E. Mietus,
G.B. Moody, C.-K. Peng, H.E. Stanley, Physiobank, physiotoolkit, and physionet components
of a new research resource for complex physiologic signals. Circulation 101(23), e215–e220
(2000)
7. M.U. Guide, The Mathworks, Inc., vol. 5, p. 333, Natick, MA (1998)
8. Ojha, D. K., & Subashini, M. (2014). Analysis of Electrocardiograph (ECG) Signal for the
Detection of Abnormalities Using MATLAB. World Acad. Sci. Eng. Technol. Int. J. Med.
Health Pharm. Biomed. 8(2), 114–117.
9. W. Zong, G. Moody, Wqrs-single-channel QRS detector based on length transform. Physionet
(2003). http://wwwphysionetorg/physiotools/wag/wqrs-1htm
10. P. Laguna, R. Jan, E. Bogatell, D. Anglada, QRS detection and waveform boundary recog-
nition using ecgpuwave. PhysioToolkit Open Source Software for Biomedical Science and
Engineering, in Proceedings of the 5th EAI International Conference on Wireless Mobile
Communication and Healthcare. ICST (Institute for Computer Sciences, Social-Informatics
and Telecommunications Engineering), pp. 50–53 (2002)
11. P. Laguna, R. Jané, P. Caminal, Automatic detection of wave boundaries in multilead ECG
signals: validation with the CSE database. Comput. Biomed. Res. 27(1), 45–60 (1994)
12. R. Jané, A. Blasi, J. García, P. Laguna, Evaluation of an automatic threshold based detector of
waveform limits in Holter ECG with the qt database. Comput. Cardiol. 24, 295–298 (1997)
13. I. Daubechies, The wavelet transform, time-frequency localization and signal analysis. IEEE
Trans. Inform. Theory 36(5), 961–1005 (1990)
14. I. Daubechies et al., Ten Lectures on Wavelets, vol. 61 (SIAM, Philadelphia, 1992)
15. C. Cortes, V. Vapnik, Support-vector networks. Mach. Learn. 20(3), 273–297 (1995)
16. C.-C. Chang, C.-J. Lin, Libsvm: a library for support vector machines. ACM Trans. Intell. Syst.
Technol. (TIST) 2(3), 27 (2011)
17. Tsoutsouras, V., Azariadi, D., Xydis, S., & Soudris, D. (2015, December). Effective Learning
and Filtering of Faulty Heart-Beats for Advanced ECG Arrhythmia Detection using MIT-
BIH database. In Proceedings of the 5th EAI International Conference on Wireless Mobile
Communication and Healthcare. ICST (Institute for Computer Sciences, Social-Informatics
and Telecommunications Engineering), pp. 50–53
18. M.C. Ramon, Intel Galileo and Intel Galileo Gen 2 (Springer, New York, 2014)
19. G.D. Clifford, F. Azuaje, P. McSharry, Advanced Methods and Tools for ECG Data Analysis
(Artech House Publishing, London, 2006)
20. G.B. Moody, R.G. Mark, The impact of the mit-bih arrhythmia database. IEEE Eng. Med. Biol.
Mag. 20(3), 45–50 (2001).
21. P. de Chazal, M. O’Dwyer, R.B. Reilly, Automatic classification of heartbeats using ECG
morphology and heartbeat interval features. IEEE Trans. Biomed. Eng. 51, 1196–1206 (2004)
22. P. de Chazal, R. Reilly, A patient-adapting heartbeat classifier using ecg morphology and
heartbeat interval features. IEEE Trans. Biomed. Eng. 53(12), 2535–2543 (2006)
Chapter 16
Design for a System of Multimodal
Interconnected ADL Recognition Services
16.1 Introduction
acquisition component, the feature extraction component, and the SVN engine under
a single acoustic event detection service and not provide an interface for the acoustic
features or, even more so, for the audio signal. We have based our decision on
the observation that we re-analyse the lower-level feature extraction output into a
higher-level acoustic event output that is more informative and more straightforward
to be consumed by other services.
Let us now assume that we later decide to apply a fusion algorithm that combines
audio and vision. The extracted audio-visual events represent the same real-world
events as the acoustic and visual events that they fuse, except that they are associated
with a higher confidence and/or carry more attributes than either. In such a situation
our previous decision to bundle acoustic event extraction as a single service and not
as an extraction–classification pipeline restricts us to event-level fusion and makes
it impossible to apply feature-level fusion algorithms. On the other hand, if we were
to use event-level fusion anyway, the finer-grained feature-level services would be
unnecessary overheads.
Naturally, real-world scenarios are bound to be even more complex. To give
another example, consider a system for our ADL monitoring application that
comprises the following components:
• Waking up and getting out of bed is recognized in the depth modality
• Moving around the house is tracked in the depth modality
• Moving around the house is tracked and the person moving is identified in the
image modality.
In this scenario, subsequent fused image/depth analysis both confirm and add
attributes (the identity of the person) to the original getting-out-of-bed event. A
system that measures the time it takes to transfer out of bed will need both the
onset of the first event and the subsequent supporting information. However, this
system of analysis components cannot be tried under a single service that log the bed
transfer ADL, since movement tracking will also be useful for logging numerous
other activities.
Further applications can also be envisaged, such as proactively offering automa-
tions that are relevant to the current ADL context. The design of this application
as an extension of a medical monitoring application is straightforward, since it is
based on analysing high-level ADL logs. Other applications, however, might require
more concrete data and, thus, more flexibility regarding the components of the
architecture that they will need to access. In general, the choice of how to best wrap
the analysis components and pipelines of such components balances between micro-
services that expose thin slices of functionality and heavier services that wrap larger
sub-systems. Naturally, there can be no ideal solution and each application must use
its own requirements to explore the design space.
ADL recognition is based on the recognition of events in (possibly multiple)
audio-visual signals and on heuristics that characterize sequences or other compo-
sitions of events as more abstract ADL events.
In this article, we first present the audio (Sect. 16.2) and visual (Sect. 16.3)
sensors and corresponding recognition methods that are typically used in our
16 Design for a System of Multimodal Interconnected ADL Recognition Services 325
[2, 4]. What is important to note is that the frame size and the selected features
depend on each other, so that a different frame stream, using different frame size,
would need to be produced for a different short-term feature extraction component.
This observation suggests a very strong coupling between audio acquisition
and short-term feature extraction. Furthermore, short-term feature extraction results
in a drastically smaller stream than the original audio signal. This reduces the
communications overhead of providing the short-term feature stream as a service,
by comparison to providing the raw audio signal.
16.3.1 Preprocessing
In our application area, stereoscopic or structured light visual sensors are used
to provide both colour and 3D depth information channels. Both channels are
preprocessed in order to provide better representations of the scene. Colour is
transformed and normalized in order to achieve colour consistency and lighting
conditions independence. In addition, de-noising and hole removal is applied
on each depth frame in order to provide the next steps with smoother depth
representations.
This submodule aims to function not only as a triggering functionality for initial-
izing the visual analytics workflow but also as a baseline estimator of the user’s
spatial information. The adaptation of motion detection as a separate submodule is
twofold: (a) to enhance the performance of the next visual analytics steps (e.g. make
the background estimation more robust) and (b) to minimize the computational
complexity of the whole visual workflow by triggering the respective submodules
only when necessary.
16 Design for a System of Multimodal Interconnected ADL Recognition Services 329
Motion detection is capable of checking the existence of motion within the visual
information. For each processing time unit (i.e. video frame), a single thresholding
rule is adopted for extra low computational complexity, in order to infer the
existence of motion. If no motion is detected, then the background model is updated
as described in the next paragraph. For better performance, separate channels are
used in order to estimate the motion of each frame: depth-based distance metrics
along with three different colour-space distance metrics. A simple weighted average
fusion approach is used to generate the final two-dimensional distance metric that
is used in the thresholding criterion that detects the motion area. The result of this
procedure is a bounding box of the motion area.
Before combining the different modalities it is important to note that visual
registration is applied, in order to align the different representations of the same
scene into one common spatial representation. Especially between the depth and
colour channels it is very important to apply such geometric transformations, since
the two channels are heavily misaligned on most sensors.
The goal of this submodule is to detect and track the exact positions of the pixels
associated with the person’s silhouette. Towards this end the following algorithmic
stages are adopted:
• Background modelling The goal here is to estimate a statistical model that
describes the background of the visual information, so that it is subtracted in the
main visual analysis steps. The background subtraction submodule is triggered
from the motion detection service as described in the previous paragraph. As
soon as the module is triggered, the following steps are executed:
– the (detected as “motion”) frames are captured to memory
– contrast and light normalization is applied to remove unwanted dependencies
– gamma correction is applied
– the background model is extracted using the MOG operator [5]
– the outline of foreground objects is finally estimated using a set of morpho-
logical operations [10]
• Tracking The goal of this step is to model the moving object’s dynamics in order
to track the exact position of the user.
• Semisupervised learning At each stage a clustering algorithm is applied based on
the current estimated background, the feedback from the tracking algorithm as
well as the raw depth info of the current frame, in order to decide on the final
silhouette estimate.
330 T. Giannakopoulos et al.
Given the position and exact shape of the user’s silhouette, a series of supervised
and unsupervised machine learning approaches is applied in order to:
• extract a set of predefined activities (stand up, sitting, lying in bed, walking,
running, eating, etc.). Towards this end, annotated data are used to train the
respective classifiers.
• extract body keypoints using supervised models.
• detect faces and extract facial features. Also, if provided, the supervised database
stores facial features of known users and the respective module also extract user
ID (identification).
• extract clothing-related information (i.e. if the user has changed clothes since her
last appearance on the sensor) [9].
• estimate metrics related to the user’s ability to walk. Towards this end, unsu-
pervised temporal modelling is adopted as the means to extract measures that
quantify the gait: average speed, time required to walk four metres, etc.
Apart from the audio and visual workflows that extract respective high-level
information and metadata regarding activities and measures, the early and late
fusion approaches are used to extract information from the combined audio and
visual modalities.
One example is combining facial features (cf. Sect. 16.3.4) with acoustic features
(cf. Sect. 16.2.2) in the context of a speaker diarization method that extracts user
labels based on speech and facial cues [8]. In this early fusion example, the acoustic
and visual feature vectors are fused. By contrast, late fusion approaches as used
for behaviour recognition. In particular, multimodal events can be recognized by
combining events in each modality that represents the same physical event.
Based on our analysis of the ADL recognition methods above (Sects. 16.2 and 16.3),
we will now proceed to bundle the relevant components into services and to specify
these services’ information outputs and requirements. These services will be used
as the building blocks of our ADL recognition architecture in this section.
Our usage scenario is set in an assisted living environment with static sensors
and a mobile robot which acts as a mobile sensing platform. In this setting, the
clinical requirement is to monitor ADLs in order to report aggregated logs about
the occurrence of specific ADLs, signs of physical activity, as well as performance
measurements such as time needed to get off the bed or to walk a given distance [7].
16 Design for a System of Multimodal Interconnected ADL Recognition Services 331
1
Please cf. http://www.turtlebot.com for more details.
2
The robot operating system (ROS) is a set of software libraries and tools for developing distributed
applications in robotics; please cf. http://www.ros.org for more details.
3
MQTT is an extremely lightweight publish/subscribe messaging middleware for the Internet of
Things; please cf. http://mqtt.org for more details.
332 T. Giannakopoulos et al.
Speaker
Mid-term Diarization
feature
Audio Short-term extraction
feature Mood
Acquisition Recognition
extraction
Acoustic
Event
Audio Sensing Service Detection
Acoustic analysis
ADL Recognition
The services and interfaces design described here is also depicted in Fig. 16.2.
16.5 Conclusion
Acknowledgements This project has received funding from the European Union’s Horizon 2020
research and innovation programme under grant agreement No 643892. For more details, please
visit the RADIO Web site http://www.radio-project.eu
References
1. R. Bencina, P. Burk, PortAudio-an open source cross platform audio API, in Proceedings of
the International Computer Music Conference, Havana, pp. 263–266 (2001)
2. T. Giannakopoulos, pyAudioAnalysis: an open-source Python library for audio signal analysis.
PloS One 10(12) (2015)
3. T. Giannakopoulos, S. Petridis, Fisher linear semi-discriminant analysis for speaker diarization.
IEEE Trans. Audio Speech Lang. Process. 20(7), pp. 1913–1922 (2012)
4. T. Giannakopoulos, A. Pikrakis, Introduction to Audio Analysis: A MATLAB Approach
(Academic Press, London, 2014)
5. P. KaewTraKulPong, R. Bowden, An improved adaptive background mixture model for real-
time tracking with shadow detection, in Video-Based Surveillance Systems (Springer, New
York, 2002), pp. 135–144
6. H.G. Kim, N. Moreau, T. Sikora, MPEG-7 Audio and Beyond: Audio Content Indexing and
Retrieval (Wiley, New York, 2006)
7. RADIO Project: Deliverable 2.2: Early detection methods and relevant system requirements.
Tech. rep. (2015), http://radio-project.eu/deliverables
8. N. Sarafianos, T. Giannakopoulos, S. Petridis, Audio-visual speaker diarization using Fisher
LINEAR semi-discriminant analysis. J. Multimed. Tools Appl. 75(1), 115–130 (2016)
9. D. Sgouropoulos, T. Giannakopoulos, G. Siantikos, E. Spyrou, S. Perantonis, Detection
of clothes change fusing color, texture, edge and depth information, in E-Business and
Telecommunications (Springer, Berlin, 2014), pp. 383–392
10. D. Sgouropoulos, E. Spyrou, G. Siantikos, T. Giannakopoulos, Counting and tracking people in
a smart room: an IoT approach, in Proceedings of the 10th International Workshop on Semantic
and Social Media Adaptation and Personalization (SMAP 2015) (IEEE, New York, 2015)
11. G. Siantikos, D. Sgouropoulos, T. Giannakopoulos, E. Spyrou, Fusing multiple audio sensors
for acoustic event detection, in Proceedings of the 9th International Symposium on Image and
Signal Processing and Analysis (ISPA 2015) (IEEE, New York, 2015), pp. 265–269
12. G. Siantikos, T. Giannakopoulos, S. Konstantopoulos, A low-cost approach for detecting
activities of daily living using audio information: a use case on bathroom activity monitoring,
in Proceedings of the 2nd International Conference on Information and Communication
Technologies for Ageing Well and e-Health (ICT4AWE 2016), Rome (2016)
Chapter 17
IoT Components for Secure Smart Building
Environments
17.1 Introduction
As with almost any birth, evolution and market penetration of a new technology or
combination of technologies wave, related acronyms and buzzwords are widely used
in numerous research, development, and marketing contexts, often with slightly
different or overlapping meanings. Typically, this inevitably introduces a form of
blur, as this may be easily identified in relative existing literature, professional
networks discussions and product descriptions, at least until maturity of concepts
and of basic technology components is unambiguously captured by prevailing
standards, products, and large scale installations, creating the basis of a common
language agreement among the various stakeholders. Still, terms with wide meaning
and technology coverage will continue to exist; think, for example, what could
possibly anyone mean when mentioning “internet” or “web” technologies, in
general. Focusing on the M2M/IoT/WoT terms, definition efforts can be found in
numerous places, just noting a few most reputable sources or source collections
in [1–6]. The generality of their main “seamless integration and interaction of
physical and virtual objects” common ground makes evident that the concept is
neither new nor it will probably cease shortly to include almost everything under
this global connectivity vision. What is actually new is the available set of specific
technologies as enabling components of this vision, as well as the real existing
numbers today, and their short- and mid-term projection regarding the penetration
and deployment of such objects and applications in everyday’s business and people
activities; a development which has its roots mainly on the radical cost and power
and the various scalability versus usability tradeoffs in the commissioning process
of building automation systems, KNX offers 4 different configuration modes an
installer might use in order to deploy a system, grouped in system (S) mode and easy
(E) mode configuration profiles. The most versatile S-mode requires the usage of the
ETS tool suite, in order to setup all advanced characteristics of each device profile,
while the other configuration modes are based on simplified procedures (e.g., button
push) or tools. Currently, KNX does not specify security mechanisms apart from a
clear text password that may lock the configuration of a device.
The LonWorks technology is described by the ISO/IEC 14908, parts 1–4 and
EN14908, parts 5 and 6 set of standards [10]. It is also a full-fledged control
system, supporting various lower level networking stacks, including IP, with a
network variable (NV) transfer and binding mechanism and an object oriented
structure of the configuration and application layer service set definition on top of
them. Application layer services include services for network variable propagation,
generic message parsing, network management and diagnostics, as well as external
protocol packet tunneling over the LonWorks network. Secure communications are
supported, based on pre-configured shared keys, while configuration is achieved by
specialized tools such as the Echelon’s IzoT commissioning tool.
DALI is a lighting control system defined under the various parts of IEC
62386 standard [11]. DALI was designed to replace 1–10 V analog systems and
proprietary digital systems such as digital serial interface, providing communication
and control of multiple devices such as ballast, transformers, and other lighting
equipment through a simple two wire physical interface. Its protocol architecture is
simple master–slave commanding that supports besides basic switching, functions
such as dimming, color control, and scene setting in unicast, broadcast, or group
wise communications. Hierarchies can be built based on a 64-node addressing
capability of subnets interconnected with hubs/routers, as well as through gateways
interconnecting DALI systems to higher level control buses, such as KNX and
BACnet. There is no security mechanism specified in the DALI standard, and the
configuration of DALI systems and segments is achieved through specialized but
simple tools that may query and set the parameters and the connections between
master controller and slave device functions.
M-Bus is defined in the parts of EN13757 standard [12], and is being used for
water, gas, electric and heat meters in buildings. It is also a simple master–slave
protocol supporting low rate wired and sub-GHz wireless media in star topologies
(WM-Bus), with primitive configuration space requirements and encryption support
based on AES and pre-configured keys.
More recent but mature wireless counterparts used in the domain today, already
considered as part of the wider IoT concept, are systems based on ZigBee, EnOcean,
and ZWave.
ZigBee [13] builds on top of IEEE 802.15.4 wireless standard, by adding
specifications for the network (NWK) and application (APL) layer structures. The
ZigBee-PRO NWK supports multi-hop cluster tree and mesh topologies, with
unicast, broadcast, groupcast, many to one, and source routing features in order
to efficiently support large networks. The application layer model is defined on top
17 IoT Components for Secure Smart Building Environments 339
of NWK, connected through the application support sub-layer (APS) and consists of
the main ZigBee device object (ZDO) responsible for overall node management, and
a series of individually addressable application end points/functional units that are
grouped in various application profiles and are collections of functionality clusters
specified from the ZigBee cluster library (ZCL). Application objects communicate
directly through binding and exchange of commands and attribute values. ZigBee
supports a distributed and a centralized security model for authentication and
encryption, at network or application link level. ZigBee provides definitions for
home and building automation profiles, and has been already accepted by ASHRAE
as an official wireless BACnet transport.
EnOcean technology [83] penetrated the market by innovating mainly in
extremely low resource devices with low duty cycle or infrequent and sporadic
communication patterns, with its battery-less wireless design proposals that
are powered by ambient energy through energy harvesting and smart energy
management techniques. In its wireless medium it uses the ISO/IEC 14543-3-
10 standard—part [15] of the KNX setup to the network layer definitions, including
security provisions. At the application layer it introduces its own data model,
structured in generic and equipment specific profiles, accessed by specialized
configuration tools for remote commissioning and management. EnOcean wireless
devices can be integrated to BACNet, KNX, and LonWorks backbone system
infrastructures.
ZWave [14] is a wireless device ecosystem focused mainly on the home
automation market. It uses the sub-GHz ITU G.9959 [84] for its radio layers, a
mesh supporting networking structure, and a clearly defined simple command-based
application layer for multivendor interoperability. It supports encryption based on
AES128, but not as a mandatory feature.
Platform and technology independent information integration, interoperability
and unified web access, besides simple IP level connectivity, has been a requirement
in the domain for many years, too, addressed mainly through the BACnet/WS,
oBIX, OPC-UA, and IEEE 1451 frameworks, as well as from the more recent
initiative of the Haystack project.
BACnet/WS has been added in the ASHRAE standard initially to provide a
service oriented architecture (SOA) based access and manipulation of data existing
in servers through web services using XML formatted data, SOAP, and HTTP. Its
data model is not bound to BACnet only and can theoretically be used to access
an interface of any other control system. It was a simple model, based on tree
structure of nodes and references, containing properties or other nodes which could
be read or written, but not created or deleted through the WS API. Recently, a new
series of addendums to the standard have been approved, introducing the BACnet
Extended Data model (XD), deprecating SOAP, and providing RESTful web
services and other capabilities including JSON encodings, resource creation and
deletion, multiple resource access, CSML device descriptions, semantic information
model and discovery and more, as well as adopting the security and authorization
mechanisms to the state of the art, including TLS, OAuth 2.0, and PKI certificate
management.
340 C. Koulamas et al.
the 6lo WG context. Deeper multi-hop wireless IPv6 topologies and end to end
connectivity was then made possible by the specification of the RPL routing
protocol [24], addressing explicitly identified routing requirements from specific
application domains, including home [25] and building automation [26], while
multicast capabilities are specified by MPL [27], as an outcome of the same WG.
With the accomplishment of the very first step towards IoT, i.e., this of direct internet
connectivity, the next move, already conceived being towards the Web of Things
(WoT), was to incorporate into the higher layers of constraint nodes, the known
HTTP and REST architectural elements, in a seamless way, leading thus to the
creation of the Constrained Application Protocol (CoAP) [28] from the IETF CoRE
WG. CoAP provides efficient definitions for all CRUD mechanisms for handling
resource hierarchies, for distributed resource discovery and multicast requests, for
URI schemes, option mappings, and cross-proxying with HTTP, as well as for a
lightweight reliable transport layer based on UDP, in avoidance of the complexity
and the pitfalls of TCP in this kind of systems. In support of secure web transfers,
the “coaps” URI scheme is registered as the equivalent of “https,” normatively
requiring the usage of DTLS [29], and more precisely, designating as mandatory
the support of the RawPublicKey mode. Important specifications accompanying
the core CoAP are this for observation streams management [30]—providing for
the final “N” in the CRUDN method set—these for large data block transfers [31],
group communications [32], and web linking [33], as well as for resource directories
(CoAP-RD) [34] that may provide a fine grained network resource registry, either
independent or in combination with standard multicast DNS (mDNS) [35] or DNS
Service Discovery (DNS-SD) [36] deployments, assisting also to the “sleepy nodes”
problem solutions [37]. Following the established trend to efficiently port existing
protocols, disciplines, and tools from the wider internet to its constrained subset,
noticeable efforts that are gaining fast acceptance from the research community and
the industry are the creation of binary encoding formats such as CBOR [38] which
is seamlessly coupled with JSON [39] as it is based on, and extending the latter’s
data model, as well as current proposals [40, 41] of using CoAP, CBOR, and hashes
for the manipulation of Management Information Base (MIB) modules specified
in YANG [42], transferring the access model of RESTCONF [43]. Finally, in the
front of establishing secure architectures with efficient mechanism and protocol
choices for the system provisioning and operation [44–46], besides the exploitation
of transport level security with DTLS, application level security mechanisms,
encodings and frameworks are currently proposed, such as OAuth 2.0 [47], DCAF
[48], and OSCOAP [49], using the encodings specified in [50, 51], being roughly the
CBOR-based equivalent of the JavaScript Object Signing and Encryption (JOSE)
encodings.
Leveraging on the above IETF infrastructure, various industrial alliances incor-
porate selected components into their existing architectures or define new frame-
works. ZigBee alliance introduced ZigBee/IP [52] in support of the IEEE 2030.5-
2013/Smart Energy profile v2.0 [53], utilizing TLS, mDNS/DNS-SD, PANA,
and MLE frameworks on a TCP/UDP over RPL/6LoWPAN stack. Open Mobile
Alliance Lightweight M2M (OMA LWM2M) [54] is the lightweight variance of
342 C. Koulamas et al.
During the past, the main point under consideration in industrial and building
automation applications and systems (BAS) design, installation, and maintenance
was device interoperability and interoperation, served by the development of open
17 IoT Components for Secure Smart Building Environments 343
IPSO
OIC Objects
Legacy AL Objects
Objects OMA
LwM2M
AL Security
Legacy Transport
CBOR
Tunneling CoAP
DTLS
Legacy
Network UDP
IPSO
Objects Legacy
OIC OPC oBIX
AL
OMA Objects Objects Objects
Objects
LwM2M
AL Security
CBOR JSON
CoAP HTTP
DTLS TLS
UDP TCP
As long as the lower protocol components are agreed, the remaining major points
of required attention are the realization of mappings between the various possible
application level object models, as well as performance issues of specific component
implementations.
OMA LwM2M—thus implicitly with IPSO objects, too. However, in Fig. 17.3, an
example of a mapping between a BACNet Analog Input and an IPSO generic sensor
objects is presented, where it is evident that each model may include additional
aspects of behavior of the modeled entity, which can be never mapped.
Nevertheless, having a common access, observation and encoding agreement
such as CoAP with JSON/CBOR beneath different application layer structures, the
cost of implementing more than one model, simply as different, complementary, or
merged views of the device’s or segment’s functionality is, at least, not prohibitive
in a first place.
On a different axis, execution loads and energy consumption performance [73,
74] of resource constrained embedded devices are important aspects in deter-
mining the minimum acceptable cost. During the development and integration of
components in the various architectural or operational options, the bottleneck in
performance was always introduced by the enablement and execution of security
supporting operations. In a 16 MHz MSP430x-based platform, the activation of
17 IoT Components for Secure Smart Building Environments 347
DTLS imposed an increase of about 250 % in the roundtrip delay of a single CoAP
transaction and a relative decrease in the maximum throughput in a point to point
link. More importantly, the time it took the two nodes to establish a session key
was no less than 9.68 s using the PSK (Pre-Shared Key) mode of DTLS with the
TLS_PSK_WITH_AES_128_CCM_8 cipher suite, while in RawPublicKey mode
with TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8, it topped at more than
38 s, delays that are considerably large resulting in nodes being unresponsive until
the key establishment phase is concluded, with amplifying effects in case that the
DTLS session needs to be re-handshaked.
The software delay problem is more evident in ECs defined over binary extension
fields GF(2k ) since operations in such fields do not fit optimally in most of existing
processor instruction sets. Implementing in software Elliptic curve cryptographic
operations, apart from the work presented here, has shown that in low end embedded
system C (ATMega128, MSP430) scalar multiplication operation is performed
in around 1 s (e.g., in tinyECC, nanoECC libraries) [75, 76] while in high
end embedded system processors like the ARM Cortex M series [77, 78] scalar
multiplication is performed with a few tenths of msec. In an effort to find a
solution in the above problem, the hardware/software co-design of EC cryptographic
primitives is also explored. So, apart from software implementation of an ECC
protocol, a hardware IP core accelerator for the computationally intensive EC
operation of scalar multiplication is introduced in the embedded system design
flow. The goal of this approach is to achieve an increase in ECC operations speed,
reduction in power consumption, and stronger security compared to purely software
solutions (better protection against side channel attacks [79]).
There exist a wide range of scalar multiplication algorithm variations, however,
one of the most promising one, that provides protection against simple power
analysis attacks (a category of side channel attack that exploit hardware power
consumption leakage), is the Montgomery Power Ladder (MPL) Algorithm. The
algorithm performs scalar multiplication Q D sP, where s is an element of a GF(2k )
field and P is the base point of an Elliptic Curve, in a balanced way and supports
parallelism of point operations. To achieve that, it uses point addition R0 C R1
and point doubling 2R0 or 2R1 . Taking into account that each point of the EC is
represented by its coordinates [P:(x,y) in the affine coordinate plane or P:(x,y,z)
in the projective coordinate space] belonging to GF(2k ), each point operation is
analyzed in a series of GF(2k ) operations (GF(2k ) multiplication, addition, and
squaring) following the group law [80]. By using the Lopez–Dahab projective
coordinate space, we analyzed the interdependences between the needed GF(2k )
operations for point addition or doubling and estimated which of those operations
can be performed in parallel and in what execution order. Our goal is to group the
GF(2k ) operations needed for a single MPL round in parallelism stages regardless
of the point operation that they implement. Each parallelism stage is concluded in
one clock cycle and all GF(2k ) operations of the stage are performed in parallel.
All parallelism stage outcomes must be calculated by reusing (for each parallelism
stage) a parallelism stage module implemented in hardware.
348 C. Koulamas et al.
Register File
Parallelism Stage Module
External Environment (PSM)
GF(2k) Multipliers
Multiplexers
I/O interfaces
Decoders
Building automation systems and smart applications built on top of them has been
already a commodity, with a long history of evolution. General principles of today’s
IoT and WoT nomenclature were already present through a vast set of available
competing or complementary technologies with which object level interactions and
web presence of device data were possible. The significant difference and step
forward comes from the advancement of wireless technologies and of specifica-
tions and standards that enable resource efficient implementations of IP and web
technologies down to the resource constrained peripheral devices. This latter step
provides already the basis for feasible agreement on common stacks, acceptable
to this special range of devices, at least up to the application layer protocols and
350 C. Koulamas et al.
References
20. G. Montenegro, N. Kushalnagar, J. Hui, D. Culler, Transmission of IPv6 packets over IEEE
802.15.4 networks (IETF RFC 4944, Sept 2007)
21. J. Hui, P. Thubert, Compression format for IPv6 datagrams over IEEE 802.15.4-based networks
(IETF RFC 6282, Sept 2011)
22. Z. Shelby, S. Chakrabarti, E. Nordmark, C. Bormann, Neighbor discovery optimization for
IPv6 over low-power wireless personal area networks (6LoWPANs) (IETF RFC 6775, Sept
2012)
23. P. Thubert, An architecture for IPv6 over the TSCH Mode of IEEE 802.15.4e (6TiSCH WG
Internet Draft draft-ietf-6tisch-architecture-09, Nov 2015)
24. T. Winter, P. Thubert, A. Brandt, J. Hui, R. Kelsey, P. Levis, K. Pister, R. Struik, J.P. Vasseur,
R. Alexander, RPL: IPv6 routing protocol for low-power and lossy networks (IETF RFC 6550,
Mar 2012)
25. A. Brandt, J. Buron, G. Porcu, Home automation routing requirements in low-power and lossy
networks (IETF RFC 5826, Apr 2010)
26. J. Martocci, P. De Mil, N. Riou, W. Vermeylen, Building automation routing requirements in
low-power and lossy networks (IETF RFC 5867, June 2010)
27. J. Hui, R. Kelsey, Multicast protocol for low-power and lossy networks (MPL) (IETF RFC
7731, Feb 2016)
28. Z. Shelby, K. Hartke, C. Bormann, The constrained application protocol (CoAP) (IETF RFC
7252, June 2014)
29. E. Rescorla, N. Modadugu, Datagram transport layer security version 1.2 (IETF RFC 6347,
Jan 2012)
30. K. Hartke, Observing resources in the constrained application protocol (CoAP) (IETF RFC
7641, Sept 2015)
31. C. Bormann, Z. Shelby, Block-wise transfers in CoAP (CoRE WG Internet Draft, draft-ietf-
core-block-18, Sept 2015)
32. A. Rahman, E. Dijk, Group communication for the constrained application protocol (CoAP)
(IETF RFC 7390, Oct 2014)
33. Z. Shelby, Constrained RESTful environments (CoRE) link format (IETF RFC 6690, Aug
2012)
34. Z. Shelby, M. Koster, C. Bormann, P. van der Stok, CoRE resource directory (CoRE Internet
Draft, draft-ietf-core-resource-directory-05, Oct 2015)
35. S. Cheshire, M. Krochmal, Multicast DNS (IETF RFC 6762, Feb 2013)
36. S. Cheshire, M. Krochmal, DNS-based service discovery (IETF RFC 6763, Feb 2013)
37. T. Zotti, P. van der Stok, E. Dijk, Sleepy CoAP nodes (CoRE WG Internet Draft, draft-zotti-
core-sleepy-nodes-04, Sept 2015)
38. C. Bormann, Concise binary object representation (CBOR) (IETF RFC 7049, Oct 2013)
39. D. Crockford, The application/JSON media type for JavaScript object notation (JSON) (IETF
RFC 4627, July 2006)
40. P. van der Stok, A. Bierman, CoAP management interface (CoRE WG Internet Draft, draft-
vanderstok-core-comi-09, Mar 2016)
41. M. Veillette, A. Pelov, S. Somaraju, R. Somaraju, Constrained objects language (draft-veillette-
core-cool-00, Nov 2015)
42. M. Bjorklund, YANG—A data modeling language for the network configuration protocol
(NETCONF) (IETF RFC 6020, Oct 2010)
43. A. Bierman, M. Bjorklund, K. Watsen, RESTCONF protocol (Network WG Internet Draft
draft-ietf-netconf-restconf-09, Dec 2015)
44. L. Seitz, S. Gerdes, G. Selander, M. Mani, S. Kumar, Use cases for authentication and
authorization in constrained environments (IETF RFC 7744, 29 Jan 2016)
45. S. Gerdes, L. Seitz, G. Selander, C. Bormann, An architecture for authorization in constrained
environments (IETF draft-ietf-ace-actors-02, 19 Oct 2015)
46. S. Gerdes, Managing the authorization to authorize in the lifecycle of a constrained device
(ACE WG Internet Draft, draft-gerdes-ace-a2a-01, Sept 2015)
352 C. Koulamas et al.
47. L. Seitz, G. Selander, E. Wahlstroem, S. Erdtman, H. Tschofenig, Authorization for the internet
of things using OAuth 2.0 (ACE WG Internet Draft draft-ietf-ace-oauth-authz-01, Feb 2016)
48. S. Gerdes, O. Bergmann, C. Bormann, Delegated CoAP authentication and authorization
framework (DCAF) (ACE WG Internet Draft, Oct 2015)
49. G. Selander, J. Mattsson, F. Palombini, L. Seitz, Object security of CoAP (OSCOAP) (ACE
WG Internet Draft, draft-selander-ace-object-security-03, Oct 2015)
50. J. Schaad, CBOR encoded message syntax (COSE WG Internet Draft, draft-ietf-cose-msg-10,
Feb 2016)
51. E. Wahlstroem, M. Jones, H. Tschofenig, CBOR web token (CWT) (ACE WG Internet draft,
Dec 2015)
52. ZigBee IP/920IP, http://www.zigbee.org/zigbee-for-developers/network-specifications/
zigbeeip
53. IEEE 2030.5-2013, IEEE adoption of smart energy profile 2.0 application protocol standard,
http://standards.ieee.org/findstds/standard/2030.5-2013.html
54. Open Mobile Alliance (OMA), Lightweight M2M specification v1.0 (2014), http://
openmobilealliance.hs-sites.com/lightweight-m2m-specification-from-oma
55. IPSO Smart Object Guideline, Smart objects starter pack, v1.0 (Sept 2014), http://www.ipso-
alliance.org/
56. IPSO Smart Object Guideline, Smart objects expansion pack, v1.0 (Oct 2015), http://www.
ipso-alliance.org/
57. OCF/Open Interconnect Consortium (OIC) Specifications V1.0, http://openconnectivity.org/
resources/specifications
58. Thread, http://threadgroup.org/
59. OneM2M standards for M2M and the internet of things, http://www.onem2m.org/technical/
latest-drafts
60. Management Enablement (OMA), TS-0005-V1.0.1, OneM2M technical specification
61. CoAP Protocol Binding, TS-0008-V1.0.1, OneM2M technical specification
62. Security Solutions, TS-0003-V1.0.1, OneM2M technical specification
63. Base Ontology, TS-0012-V-0.7.0, OneM2M technical specification
64. Home Appliances Information Model and Mapping, oneM2M-TS-0023-v0.1.0, OneM2M
technical specification
65. oneM2M and OIC Interworking, oneM2M-TS-0024-v0.1.0, OneM2M technical specification
66. oneM2M and AllJoyn Interworking, oneM2M-TS-0021-V-0.0.1, OneM2M technical specifi-
cation
67. F. Kerasiotis, C. Koulamas, G. Papadopoulos, Developing wireless sensor network applications
based on a function block programming abstraction. 2012 IEEE International Conference on
Industrial Technology (ICIT), Athens, Mar 2012, pp. 372–377
68. F. Kerasiotis, C. Koulamas, C. Antonopoulos, G. Papadopoulos, Middleware approaches for
wireless sensor networks based on current trends. 4th Mediterranean Conference on Embedded
Computing (MECO), 2015
69. C. Koulamas, S. Koubias, G. Papadopoulos, Using cut-through forwarding to retain the real-
time properties of profibus over hybrid wired/wireless architectures. IEEE Trans. Ind. Electron.
51(6), 1208–1217 (2004)
70. G. Bovet, J. Hennebert, A web-of-things gateway for KNX networks. Smart SysTech 2013
European Conference on Smart Objects, Systems and Technologies, June 2013, Erlangen,
Germany
71. M. Jung, J. Weidinger, C. Reinisch, W. Kastner, C. Crettaz, A. Olivieri, Y. Bocchi, A
transparent IPv6 multi-protocol gateway to integrate Building Automation Systems in the
Internet of Things. Proceedings of the IEEE International Conference on Internet of Things
(iThings 2012), Besancon, France, Nov 2012
72. S.C. Park, W.S. Lee, S.H. Kim, S.H. Hong, P. Palensky, Implementation of a BACnet-ZigBee
gateway. 8th IEEE International Conference on Industrial Informatics (INDIN), 2010
17 IoT Components for Secure Smart Building Environments 353
18.1 Introduction
The idea of a fully functional smart home has been a dream since the mid of the
twentieth century. The first trials started in the 1960s with the use of domestic
smart devices, but this has become a reality only during the last decades. Smart
home, as a term, was also introduced in 1984 by the American Association
of Housebuilders. Since then, things have dramatically changed with significant
advances in the domain of intelligent building control. More specifically, houses,
schools, and offices security can be drastically enhanced through electrical and
electronic equipment while their energy footprint minimized with inner climate
control which maximizes the comfort and safety of the occupant. This can be
K. Christopoulos
Department of Computer and Informatics Engineering, Embedded System Design and
Application Laboratory, Technological Educational Institute of Western Greece, Patras, Greece
School of Science and Technology, Digital Systems and Media Computing Laboratory, Hellenic
Open University, Patras, Greece
e-mail: [email protected]
C. Antonopoulos ()
Department of Computer and Informatics Engineering, Embedded System Design and
Application Laboratory, Technological Educational Institute of Western Greece, Patras, Greece
N. Voros
Technological Educational Institute of Western Greece, Embedded System Design
and Application Laboratory (ESDA), Antirio, Greece
T. Orfanoudakis
School of Science and Technology, Digital Systems and Media Computing Laboratory, Hellenic
Open University, Patras, Greece
Most Building Automation Systems (BAS) consist of wired buses or wireless broad-
cast networks, which connect high-level controllers. Initially, bus systems were
developed in the field of computers and protocols for BAS such as the X10 protocol
which offered a limited number of instructions, low data rate while characterized by
compatibility problems. The second stage of development with bus systems such as
EIB, LON, and other proprietary systems with devices from different manufacturers
aimed for better compatibility. Currently, in the third development stage, there is
further market penetration for bus systems, increased degree of system integration
and an increasing use of the radio frequency (RF) bus systems (Fig. 18.1).
In BAS, there is a wide range of technology platforms and protocols a user/de-
signer/developer can select from. Each of them has pros and cons. Amongst them,
most popular are those offering open protocols and support a large number of
devices, as well as those that offer device interoperability. Cost, energy consump-
tion, and bandwidth are also essential parameters, as well as the programming
language(s) and the maximum number of connected devices supported. The most
popular home automation wired and wireless platforms are detailed in the following
sections.
18.3.1 BACnet
18.3.2 LON
18.3.3 KNX
KNX [4–9, 11] is an open, worldwide standard used for more than 25 years. The
KNX building automation system was developed at the beginning of 1990s by
the European Installation Bus (EIB). In 1999, EIB Association, Batibus Club
International (BCI, France), and the European Home Systems Association (EHSA,
Netherlands) have been merged. The result of this merging is a new associa-
tion called “KNX Association.”The supported standards for KNX are shown in
Table 18.1. The KNX association nowadays consists of more than:
• 400 manufacturers in 37 countries
• 48200 KNX Partners in 139 countries
• 360 KNX Training Centers in 59 countries
• 120 Scientific Partners in 30 countries comprised of Universities all over the
World
18 Building Automation Systems in the World of Internet of Things 359
Standard
58384 addressable devices, whereby many 32385 devices per domain. Several
Number of bus devices devices have realised several input/output input/output points are often 127 MS/TP masters
points implemented in a device
700 meters per galvanic unit, possible to 1200m MS/TP Twisted Pair
Expansion
extend complete system by many kilometers cable
Various types with twisted twin
Twisted twin core cable, Powerline, Radio, IP BACnet IP, BACnet LonTalk,
Transmission medium core cable, Powerline, Radio,
network individual sections of Optical fibre or BACnet MS/TP
Infrared, Fibre glass
Building Managment
Building Management Automation, Lighting, Lighting, blind control, heating,
Automation, HVAC plants, fire
blind control, heating, ventilation access ventilation access control,
Applications control panels, smart elevators,
control, media, security, monitoring, monitoring, visualisation and load
intrusion detection and access
visualisation and load management management control systems
Maximum Data Rate 9,6 kbit/s 78 kbit/s 10/100 Mbit/s full duplex
The technology used in modern KNX devices is compatible with that of the
old EIB system, so all devices bearing either the KNX or the EIB logo are
mutually compatible. The KNX certification process ensures seamless cooperation
and communication amongst different products of different manufacturers used
in different applications. This ensures a high degree of flexibility concerning the
extension and the modification of installations and wide scale deployments.
Similarly, to other typical complex standardized protocols, KNX uses more than
one physical layers:
• KNX TP (separate bus cable)
• KNX PL (existing mains network)
• KNX RF (via radio signals)
• KNX IP (via Ethernet or Wi-Fi)
The KNX installation can be configured with a manufacturer-independent tool
called Engineering Tool Software (ETS) [4]. Thus, the KNX system avoids typical
problems of other standardized systems (e.g., BACnet, LonWorks) where each
manufacturer has a special configuration tool, while it is often not possible to use
one manufacturer’s tool for devices (supporting the same protocol) made by another
vendor. The ETS tool is managed by the KNX association and the manufacturers
only have to add a plug-in to it.
In contrast to other protocols, KNX is independent of any hardware or software
technology meaning that it can be realized on any microprocessor platform.
360 K. Christopoulos et al.
18.4.1 Z-Wave
18.4.2 ZIGBEE
ZigBee PRO (http://www.zigbee.org/) [11] offers full wireless mesh, low power
networking capable of supporting more than 64,000 devices on a single network.
It provides standardized networking designed to connect an extended range of
devices from different manufacturers into a single control network, transcending
interoperability issues with older versions. The latest version of ZigBee Home
Automation standard, which is fully interoperable with the previous versions,
adds several important new features that improve the battery lifetime for security
sensors (with sensor lifetime over 7 years), standardize device pairing and simplify
installation and maintenance. These features have significant impact on operational
and equipment costs for the service providers, and on quality of service for the
consumers. The Green Power feature of ZigBee PRO allows battery-less devices to
securely join ZigBee PRO networks. It is the eco-friendliest way to power ZigBee
products such as sensors, switches, dimmers, and many other devices.
Bluetooth (https://www.bluetooth.com/what-is-bluetooth-technology/bluetooth) is
contained in many devices. It has higher data bandwidth than ZigBee and Z-wave. In
Bluetooth 4 version (Bluetooth Low Energy or BLE) there is a significant decrease
in power consumption. The latest version of the protocol, Bluetooth 4.2, makes
Bluetooth a promising wireless technology for the IoT.
18 Building Automation Systems in the World of Internet of Things 361
It is one of the most reliable and secure wireless standards. BLE Secure
Connection includes Federal Information Processing Standards (FIPS) (https://en.
wikipedia.org/wiki/Federal_Information_Processing_Standards) approved encryp-
tion, granting the ability to encrypt connections between devices under P-256
elliptic curve public-key cryptography. According to the ABI Research (https://
www.abiresearch.com/) the market share for smart home applications, such as
lighting, security, and energy management, based on Bluetooth will increase at a
faster rate than any wireless technology over the next 5 years.
Bluetooth 4.2 uses the Internet Protocol Support Profile (IPSP) to connect
Bluetooth Smart sensors to the Internet in order to send and receive transmis-
sions through gateways via IPv6 (https://el.wikipedia.org/wiki/IPv6) and 6LoW-
PAN (https://en.wikipedia.org/wiki/6LoWPAN, http://www.ti.com/lit/wp/swry013/
swry013.pdf).
The basic topology used within a Bluetooth ecosystem is the piconet, in which
a master device can be interconnected with up to seven slaves. When there are
more than two piconets interconnected to each other, the topology is referred to as
scatternet (Fig. 18.3). A critical advantage compared to any competitive technology
stems from the fact that BLE capitalizes on the wide acceptance and wide spread of
previous versions of Bluetooth protocol. Therefore, even nowadays BLE interfaces
are integrated in essentially any mobile phone, tablet, wearable device, etc., offering
a huge precedence in dominating relative markets.
18.4.4 EnOcean
18.4.5 Wi-Fi
18.4.6 THREAD
When it comes to making a decision on choosing the appropriate BAS for a house
or a building, there is a significant number of parameters that should be considered.
The major requirements mainly needed are outlined in the sequel:
• Basic BAS operation support. Tasks such as scheduling occupancy, adjusting
setpoints, troubleshooting complaints, responding to alarms, or checking of
the system should be as simple and as intuitive as possible. It is essential to
accomplish them in a fast and easy way and from any available terminal or remote
device.
• Low energy consumption. The current demands must be constantly, accurately
measured and analyzed, in order to have an effective and environment-friendly
use of energy. BAS must provide facilities and services that will allow both
monitoring and decision making in an efficient way.
18 Building Automation Systems in the World of Internet of Things 363
• Assurance of high quality indoor living. Comfort management is one of the major
requirements that must also be taken into account. Depending on the type of
the inhabitant, it can range from simple environment monitoring to environment
adjustment according to the need of people having chronic diseases, e.g., people
having asthma.
In order to support the aforementioned requirements, there are several features
that need to be supported and must be identified beforehand, since there is a wide
variety of technology platforms or protocols on which a BAS can be build on. It
is also important for the system integrator to be informed about the type of the
building, i.e., whether it is a commercial or a residential one or any other type of
different use. Furthermore, the region where the building is located, as well as the
characteristics of the people who might be living or working there, should be taken
into consideration.
As far as building automation is concerned, several of the protocols already
described can cover one or more control levels. There is a three-level hierarchical
model for automation and control systems [7], upon which building automation
protocols can be employed. The first one is the field level which contains the
connected sensors and actuators. The second one is the automation level, which
includes all the applications that can be automated in a building. The last is the
management level where control, operation, and monitoring take place. Figure 18.2
shows the three-level hierarchical model and indicates the level in which each
standard can be used.
364 K. Christopoulos et al.
Nowadays, there are about 25 billion connected devices [10] on the Internet and it is
estimated that by 2020 that number will be up to 50 billion. In a BAS, sub-networks
employing different communication protocols have the ability to connect to the
Internet either directly or through gateways. The same applies when we have to
connect different sub-networks with each other in a single installation. The goal, in
this case, is to use a protocol suite, which covers the majority of the installed devices
and their corresponding applications within the specific context. Furthermore, a
protocol suite must cover all or most of the communication media (twisted pair,
power line, and radio frequency) and internet protocol (IP)-based networking. The
interconnection of all BAS is realized through a main router with the appropriate IP
gateway of each communication protocol as shown in Fig. 18.3.
In a new building, the use of a wired decentralization protocol like a bus system is
strongly recommended. This approach offers critical advantages such as reliability,
connectivity, and facilities for future improvements. For instance, if one unit of a
bus system fails, the remaining system continues to operate without any problem in
contrast to a centralized one. An Ethernet cable CAT 6 should also be placed near
TVs, computers, IP cameras, security systems, and anywhere else where it may be
useful to connect via a high-speed interface appropriate for media applications and
communication to application servers. This makes possible for remote access and
control of the installation covering any future needs.
On the other hand, in cases such as a reconstruction or a renovation, there are
different approaches depending on the variety of uses. In such circumstances, the
use of wireless home automation protocols offers significant practical advantages.
However, it would be essential to have a combination of wireless and wired
communication media with the same or different protocols.
During the last years, wireless protocols have been improved and they are leading
the IoT paradigm. They have an extended use and one of the most pronounced
objectives is energy efficiency. Ultra-low power devices with current demands as
low as few A offer a gain of 10–15 years battery life with a small coin cell battery.
They can be even more efficient by incorporating intelligence enabling to turn into
sleep mode power hungry components (e.g., radio interface, processing unit, and
mechanical parts) yielding even less power consumption. Furthermore, each device
tends to be more and more complex since they are composed of multiple sensors.
Finally, there is no need to have a wiring infrastructure running from a central
controller to switches and keypads throughout the house in order to enjoy a more
connected home.
The most recent trend is towards a direct IP addressability of every single node
of a wireless network, as in the case of THREAD (described in Sect. 18.4.6) for
example, which allows a more immediate communication between the end nodes.
Apart from THREAD, IPv6 communications are now also used in newer Bluetooth
versions as well as Wi-Fi. IPv6 is able to offer a complete cover across all different
networks in a home/building automation. However, native IPv6 implementations
often prove to be too complex and resource demanding for typical hardware
encountered in IoT platforms coming from the words of embedded systems and
WSNs characterized by extremely limited resources in all aspects. A prominent and
widely tested solution is the 6LoWPAN (https://en.wikipedia.org/wiki/6LoWPAN,
http://www.ti.com/lit/wp/swry013/swry013.pdf), effectively comprising an imple-
mentation for IPv6 specifically targeting platform with scares resource availability
(e.g., IEEE 802.15.4, ZigBEE, etc.) allowing each sensor to have its own IP address
and in this way realize the ultimate objective of IoT approach.
of its tools is ETS Professional for the “S-Mode” components which are the same
for all the KNX products, regardless the manufacturer.
Clients Clients
IP NETWORK
KNX/IP Routing
KNX/TP
9600 bit/s KNX/TP
PS/Ch
PS/Ch
DEVICE
1.1.1 DEVICE
1.2.1
DEVICE
1.1.2 DEVICE
1.2.2
DEVICE
1.1.3 DEVICE
DEVICE 1.2.3
1.1.4 DEVICE
DEVICE 1.2.4
1.1.7
DEVICE DEVICE
1.1.5 1.2.5
DEVICE
1.1.6
LINE
LINE
computers, and smart phones to communicate with KNX devices in order to provide
services to the end user. A typical example of KNX/IP Tunneling is shown in
Fig. 18.8.
Using of a simple IP/KNX Router it is not easy to have access over the Internet
to a KNX installation without support from an Information Technology (IT) expert.
However, typically building automation is an unknown field for IT experts. A
solution for this sector would be a translator connecting both worlds without the
need for each party to have insight of other side. KNX Association has recognized
this trend and developed the corresponding solution “KNX Web Services” (KNX
WS) [8], which is realized using web services like oBIX, OPC UA, and BACnet-
WS. Web services are self-contained modular software components that can be
described, published, and activated via the web. Usually, they are employed by
applications and not by persons. Thus, a simple and multi-faceted communication
between web services and systems of building automation is possible.
18 Building Automation Systems in the World of Internet of Things 371
Clients Clients
IP NETWORK
KNX/IP Tunnelling
KNX/IP ROUTER
LC 1 .1 .0
LC 1 .2.0
PS/Ch
PS/Ch
DEVICE DEVICE
1 .1 .1 1 .2.1
DEVICE
1 .1 .2
DEVICE
1 .2.2
DEVICE
1 .1 .3 DEVICE
1 .1 .4 DEVICE
DEVICE
1 .1 .7 1 .2.3 DEVICE
1 .2.4
DEVICE
1 .1 .5
DEVICE
1 .2.5
DEVICE
1 .1 .6
LINE
LINE
temperature and heart rate, as well as room air quality (CO2 ) and humidity. A
wired protocol is also available in the field level which is supported by KNX and
it is responsible for the functionality of home automation. It basically triggers the
appropriate functions according to the signals received from the sensors.
The programming of the automation functions is located at the automation level.
Last but not least is the management level, where the monitoring and control
of AAL House is realized. This is where a controller, LogicMachine Re:Actor
V3 (http://openrb.com/logicmachine-reactor-v3/), is located, which contains all the
interfaces for the heterogeneous communication protocols of the AAL House and
is also in charge of the interaction between the different protocols. The controller
is also connected to the Internet and it offers the possibility of remote control and
visualization of the AAL House. An overview of the AAL House infrastructure is
presented in Fig. 18.9.
As already mentioned above, special groups of population can benefit from living
in a smart home environment. Currently, there are protocols and sensors (mainly
wireless coming from the CyberPhysical and Wireless Sensor Network domains)
which are used for monitoring individuals through special parameters of their body.
These could be adopted and integrated into the KNX installation in such a way that
the greatest comfort and safety is achieved. So far, KNX has the ability to regulate
heating and air-conditioning systems, so as to reach the desired room temperature
18 Building Automation Systems in the World of Internet of Things 373
with energy efficiency. But this could also be done automatically, according to the
special needs of a person which are determined by biological parameters using Z-
Wave, ZigBee, and BLE sensors.
Remote control of room functions or making phone calls through the room’s
sound system and voice demand are also typical examples how inhabitants with
kinetic disorders can benefit from the infrastructure and services offered by AAL
House. In addition, alert generation is also supported in case of a fall is identified
or in cases of rapid change in the body’s physiologic parameters (e.g., in body
temperature or in electrocardiography parameters).
AAL House smart home infrastructure allows also the monitoring of a wide
range of parameters related to environment, such as humidity and CO2 monitoring.
Especially for the case of emergency, like a fire, AAL House is equipped with
devices and services that allow automatic door unlock, lighting of safety path, and
automatic call of fire department.
In addition, the KNX/IoT technology developed for AAL House allows the
integration of services like medicine notification, monitoring and report of eating
habits, etc. Additional services for elders like water tap overflow identification and
respective notification triggering or turning off the oven are also supported.
Figures 18.10 and 18.11 presentthe main control panel of the AAL House
through which the aforementioned services are being monitored and controlled.
The AAL House supports also a new trend in home automation which is called
Geofencing allowing the definition and monitoring of virtual fences within the house
(as well as close surrounding areas). This is especially important for people suffering
374 K. Christopoulos et al.
from dementia related diseases. In addition, the Geofencing service of the AAL
House allows KNX related actions such as turning off of lights, electrical appliances,
ventilation, central heating, and air-conditioning.
From a technical point of view, all the services offered by the ALL House are
strongly dependent on the underlying infrastructure which combines KNX with
wireless sensor technologies like the ones presented in Sect. 18.4. The heteroge-
neous technologies hosted by AAL House are a proof of concept of combining the
worlds of KNX of Things and IoT in the context of a BAS.
18.10 Conclusion
most popular BAS protocol) with the IoT paradigm. The proposed architecture
has been implemented in the context of a real world Ambient Assisted Living
environment: a fully operational residence for supporting elders and persons with
chronic diseases, where KNX/IoT devices have been employed for developing state-
of-the-art services.
The work presented in this chapter is the foundation of future research in the
area of BAS. In the near future, we plan to design and implement an extension
of the proposed infrastructure, so as to enrich and enhance the offered services
with artificial intelligence [12]. For that purpose, a cloud-based platform will be
developed that will allow the transition from “smart” to “intelligent” homes and
buildings.
References
A RAMCIP, 284–285
AAL environments. See Ambient assistant Robot-Era project, 290–291
living (AAL) environments AXIOM
Activities of daily life (ADL) recognition, 283 COTSon simulator, 70
acoustic analysis dense matrix multiplication, 71–72
audio acquisition, 325 FPGA, 58
audio pattern analysis, 325–327 home and office scenarios, 59, 60
mid-term feature extraction, 325–327 OmpSs programming model
Raspberry implementation, 331 data-reference-lists, 64
short-term feature extraction, 325–326 intra-and inter-node technologies, 65
TurtleBot2 implementation, 331 Mercurium compiler, 65
bed transfer ADL, 324 Nanos++ runtime system, 65
fused audio-visual analysis, 330 OmpSs@cluster, 67–69
image/depth analysis, 324 OmpSs@FPGA ecosystem, 65–67
monitoring application, 324 Smart-HUB, 58
visual content task scheduling, 59
behaviour and activity detection, 330 thread management, 63–64
depth and colour visual analytics
workflow, 327, 328
motion detection, 328–329 B
sensing components, 331 BACnet, 337, 345–346, 357
silhouette tracking, 329 BAS. See Building automation systems
Adaptivity patterns, 94, 101 (BAS)
Address space layer randomization (ASLR), Bipartite-matching technique, 32
123–124 Building automation systems (BAS)
ADL recognition. See Activities of daily life ethernet cable CAT 6, 365
(ADL) recognition IP gateway, 365
Ambient assistant living (AAL) environments IPv6 communications, 366
ENRICHME system, 288–289 6LoWPAN, 366
Growmeup architecture, 285–287 wired decentralization protocol, 365
healthy aging, 282 wired protocols
ICT domains, 281 BACnet, 357
MARIO project, 287–288 KNX, 358–359, 366–374
PHC-19 call, 284 LonWorks platform, 357–358
RADIO system, 289–290 wireless home automation protocols, 366
E
D eCall service
Daily monitoring, healthcare services, emergency services, 227
225–227 PSAP, 227
DALI, 337 Eclipse modeling framework (EMF), 173
Data-flow (DF) threads, 63 Electrocardiogram (ECG)
Data fusion analysis flow
algorithmic approach, 192–193 classification, 305
Decentralised reconfiguration pattern, 99 feature extraction, 304–305
Decision making heartbeat classification, 303
challenges and motivation, 238–239 heartbeat detection, 304
Cisco systems, 234 heartbeat segmentation, 304
communication links, 243–245 Matlab function filter (), 304
evaluation SVM design space exploration,
air temperature and humidity values, 305–309
246–247 arrhythmia detection, 301
energy consumption, 247–248 characteristic ECG tracings, 300
photovoltaic panels, 246 chest leads, 300
total energy cost, 248–249 discrete wavelet transform, 301–302
variation of, thermal condition, 247–248 limb leads, 300
FIS (see Fuzzy inference systems (FIS)) MIT-BIH database, 301
smart thermostat waveform, 300
Index 379
G J
Gateway (GW) status, 144 Java virtual machine (JVM), 124
GAUT HLS tool, 36
Global sensor networks (GSN), 169
K
KNX, 337–338
H AAL House, 371–374
Hardware in Loop (HiL), 78 advantage, 367
Haystack project, 340 certification process, 359
Healthcare service provisioning, 225–227 ETS tool, 359
Hierarchical conditional dependency graph installation, 359
(HCDG), 35 KNX association, 358
High-level synthesis (HLS) KNX/IP Routing, 369–370
allocation and binding, 29 KNX/IP Tunneling, 369–371
CALLAS synthesis framework, 33 operation modes, 367, 369
CDFG, 29 physical layers, 359
CODESIS tool, 35 standards, 358, 359
commercial tools, 29–30 topology for, 366, 367
COSYMA hardware-software co-synthesis Web Services, 367, 368
framework, 33–34
Cyber tool, 35–36
L
FDLS algorithm, 32–33
Left-edge algorithm, 32
GAUT HLS tool, 36
Link delivery ratio (LDR),
HCDG, 35
137–138
Index 381
Link quality indicator (LQI), 137–138 Montgomery Power Ladder (MPL) algorithm,
Logical NOT/OR/AND operation, 130 347
LonWorks technology, 338 Multi-hop wireless IPv6 topologies, 341
6LoWPAN protocol, 175
Low power design
body biasing N
forward body biasing, 16 Network description (NED) files, 79
reverse body biasing, 16 Network-level programming
speed/leakage ratio tuning, 16 database, 162–163
on standard bulk processes, 17–19 macroprogramming, 163
substrate biasing, 16–18 metaprogramming abstractions, 164
triple-well process cross-section, resource naming, 163
15–17 Node Deployment Sequence (NDoSq), 139
clock gating, 12
dynamic voltage/frequency scaling, 12–13,
17–19 O
GALS design style, 13–15 OBIWAN, 80
power gating, 11 Olympus HLS tool, 34
OMNeT++
advantages, 79
M co-routine based programming,
Machine learning 79
Bayesian network, 201–202 EnOcean Pi, 85
decision trees, 203 event-processing, 79
fuzzy logic techniques, 200–201 HiL interfaces, 82–83, 85
K-means clustering, 204 home automation related networks,
neural network, 201 79
support vector machines, 202–203 installation of, 81
unsupervised algorithms, 203 message translation example, 83–85
Macroprogramming. See Network-level modified scheduler, 82
programming NED files, 79
Mamdani systems, 254 OBIWAN, 80
Management Information Base (MIB) Raspberry Pi, 85
modules, 341 real time scheduler, 81
Map-based world model (MWM), 195–196 SimIoT, 80
Maturity analysis socket example, 81–82
critical view, 295–296 OmpSs programming model
ENRICHME system, 295 data-reference-lists, 64
GrowMeUp architecture, 294 intra-and inter-node technologies, 65
MARIO project, 294–295 Mercurium compiler, 65
RADIO system, 292–293 Nanos++ runtime system, 65
RAMCIP, 293–294 OmpSs@cluster, 67–69
M-Bus, 337 OmpSs@FPGA ecosystem, 65–67
MBSE, 91 Online ECG signal processing and
Medical information interface (MII), 99 classification
Mediola gateway, 80 execution time, 316, 321
Medium access control (MAC) layer, 137–138 feature extraction, 312–313
Membership function (MF), 241 filtering stage, 312
Mesh networks, 137, 150 heartbeat detection, 312
Model-based approach heartbeat segmentation, 312, 313
arithmetic techniques, 195 LIBSVM library, 313–314
MWM, 195–196 Matlab SVM model, 314, 315
probabilistic/statistical model, 196–198 Open Building Information Exchange (oBIX),
Model-based systems engineering (MBSE), 91 340
382 Index
micro-benchmark, 108–109 T
Node.js, 104 TelosB node, 270–271
Quad-wheel, 105–109 Thread Group, 80
runtime data structure, 106 Trusted computing base (TCB), 121
speed-up results, 113, 114
string concatenation, 110–111
string join, 110–111 V
total memory consumption, 114 V compiler, 33
Smart e-Health gateway, 217–218 VirISA environment
Smart Home architecture, 124–125
AXIOM (see AXIOM) ASLR, 123–124
home and office scenarios, 59, 60 code injection attack, 119, 120, 122, 123,
networked sensors and actuators, 60 131
SBC, 58 countermeasures, 120
Smart-HUB, 58 functionality, 126–127
Smart thermostat ISR, 123
component view, 235–236 JVM, 124
floorplans, 236–237 permutation rules, 128–130
functional blocks, 235–236 threat model, 121–122
HVAC, 235, 238, 246, 247 Virtual machine/middleware, 160
UML encoding, 237–238
SPARK HLS tool, 35, 37 W
Sugeno type systems, 254 Wireless sensor networks (WSN)
Support vector machines barriers and synergies (see Barriers and
binary classification problem, 302 synergies, WSN)
design space exploration, 305–309 deployment strategy (see Deployment
finite-dimensional space, 302 strategy, WSN)
kernel function, 303 event detection algorithms (see Event
maximum margin hyperplane, 302 detection algorithms)
training algorithm, 302
SURYA validating system, 37
SysML diagram, 92 Z
SystemCoDesigner method, 36 ZigBee cluster library (ZCL), 339
Systems-on-Chip (SoC), 4 ZigBee device object (ZDO), 339