Professional Documents
Culture Documents
highlights
A generic ecosystem for MCS services based on a publish/subscribe middleware.
High-performance publish/subscribe processing middleware.
Selective and data-driven acquisition of sensor data on mobile devices.
Evaluation based on an MCS air quality monitoring campaign.
This is in line with cloud-centric IoT solutions where data analytics, CUPUS comprises two main software components: a mobile
storage and real-time processing are performed in the cloud [5]. A broker responsible for data filtering/aggregation on mobile devices,
crucial feature of MCS applications is their ability to inform users and cloud broker for continuous big stream processing within
in near real-time about their surroundings [6]: users can receive an IoT cloud. CUPUS has unique features compared to other
context-related notifications and alerts affecting their decisions MCS platforms: It supports selective and flexible acquisition and
and behavior while being mobile. filtering of sensor data on mobile devices, efficient continuous
For example, an MCS traffic monitoring application involves processing of sensor data streams within the cloud, and near real-
numerous individuals who continuously contribute location data time delivery of notifications from the cloud to mobile devices.
to cloud servers which estimate traffic conditions by processing CUPUS is tailored to the requirements of mobile and resource-
a large number of location readings in real-time. The users can constrained environments with a goal to reduce the overall energy
opt to continuously provide their location data in exchange of consumption, from data acquisition to data transmission and
the ability to track traffic conditions on their mobile devices. delivery, while controlling the MCS data density, both in space and
Traffic statistics can be used by city officials to detect highly- time. This is achieved by filtering or aggregating data close to its
congested roads and traffic hotspots, or to correlate this data, e.g., production place and by suppressing the data transmission from
with air quality. The sensed location data is typically provided to mobile devices into the cloud when there is no global interest in the
cloud servers autonomously and periodically, and can be classified produced sensor data, or when there are redundant data sources
as opportunistic sensing: It can potentially quickly drain out the located, e.g., within the same geographical area.
battery on mobile devices and lead to certain geographical areas CUPUS supports content-based publish/subscribe, both within
being densely covered by sensor readings, while other areas may the cloud and on mobile devices. It is not reinventing the
suffer from lack of available data readings [7]. Moreover, the publish/subscribe principles, but is rather adjusting the well-
aggregated traffic data provided to users from the cloud needs to known content-based advertisesubscribepublish interaction
be up-to-date and may frequently change. pattern, originally proposed in the SIENA event-based system [12],
In view of the previously depicted usage example, we can to an MCS ecosystem. Our solution leverages the power of the
identify the following challenges as vital for the evolution of MCS crowd (1) to enable selective and data-driven acquisition of sensor
applications: Since MCS applications run in dynamic environments data on mobile devices in accordance with the global and real-
comprising sensors, various mobile devices and the cloud, it is time requirements for such data and (2) to enable individual
vital to achieve energy-efficient and context-aware orchestration of near real-time environment awareness with a personalized user
the sensing process with data transmission from sensors through notification mechanism. The major paper contribution is the
mobile devices into the cloud, as well as from the cloud to design of a generic ecosystem for MCS services based on a
mobile devices. In other words, both the sensing process and publish/subscribe middleware and the implementation of high-
data transmission from mobile devices to the cloud need to be performance publish/subscribe processing components, both for
controlled so that valuable data is collected when it is indeed mobile devices and the cloud.
required by an MCS application. In addition, end-to-end data To demonstrate the usability of the proposed MCS ecosystem
propagation delay represents a key quality measure from the users and to evaluate CUPUS performance in real-world deployments,
perspective since frequent changes of user context can quickly we have built an application for crowd-sensed air quality moni-
make information obsolete or irrelevant. Other open MCS issues toring [13]. We present the results of an experimental evaluation
are identified in [8] as follows: the need for standardization, of CUPUS performance by using a real sensor dataset collected dur-
enabling complex data mining, integrating cloud capabilities and ing an air quality measurement campaign organized in July 2014 in
moving towards fog computing. Zagreb, Croatia. The experiment evaluates the scalability of CUPUS
Publish/subscribe middleware offers the mechanisms to deal components, both on mobile devices and the cloud, as well as the
with the previously identified challenges: It enables filtering of elasticity of the cloud broker. We also measure the average sensor
sensor data on mobile devices, forwarding of this data into the data propagation delay, from the sensing process until notification
cloud, efficient continuous processing of large data volumes within delivery to mobile devices, to assess the usability of CUPUS in real-
the cloud, and near real-time delivery of notifications to mo- world deployments.
bile devices. Publish/subscribe is a well-established infrastruc- The paper is structured in the following way: Section 2 in-
ture for continuous data processing and push-based messaging troduces the MCS ecosystem enabled by the CUPUS middleware.
in distributed environments with the ability to efficiently pro- Section 3 presents implementation details of the CUPUS middle-
cess large amounts of data due to simple subscription languages ware, both regarding the mobile broker and cloud broker com-
and efficient matching algorithms [9]. We have already iden- ponents. We introduce the use case for air quality monitoring in
tified publish/subscribe middleware as a key enabler for MCS Section 4, which is used to compare CUPUS to the standardized
ecosystems [10,11] and in this paper we provide a comprehensive messaging protocols for IoT in Section 5. The results of an exten-
evaluation of our publish/subscribe solution named CloUd-based sive experimental evaluation of the CUPUS middleware are given
PUblish/Subscribe (CUPUS) in terms of scalability and data prop- in Section 6. Section 7 provides an overview of related work by
agation delay. CUPUS is an open-source publish/subscribe mid- comparing prominent MSC platforms, while Section 8 concludes
dleware designed for mobile IoT environments developed within the paper and gives pointers to future work.
the framework of the FP7 project OpenIoT, Open Source blueprint
for large scale self-organizing cloud environments, which builds an 2. Mobile crowd sensing ecosystem
open-source cloud platform for the IoT.1 Its modular design suc-
cessfully tackles MCS challenges regarding elastic utilization of a An MCS ecosystem needs to provide the means for collecting
cloud environment while complex data mining tasks can be intro- sensor data from mobile devices over large geographical areas
duced by specialized components. where devices may generate the data either with or without
explicit user actions. Due to huge volumes of sensor data, a cloud
infrastructure is suitable for the implementation of an elastic,
1 CUPUS is one of the core OpenIoT platform components published under the scalable and modular MCS ecosystem. All components responsible
LGPL licence and is available at the Github infrastructure of the OpenIoT project for processing of integrated data streams steaming from various
(https://github.com/OpenIotOrg/openiot). data sources are located in the cloud, while data sources and
A. Antoni et al. / Future Generation Computer Systems 56 (2016) 607622 609
also that the set of subscriptions on a Mobile Broker is dynamic available communication means (typical communication protocol
which further affects its processing performance. The received set is the Bluetooth protocol). The communication between the sensor
of subscriptions provides vital information for the management of service and the mobile broker service is implemented through the
attached sensors since it instructs the Mobile Broker to interact Android internal intent broadcasting and filtering mechanism. We
with an adequate data source to acquire data which is potentially have reused the standard Android mechanism for intra-application
needed for an MCS task. After the data is acquired, additional communication between different application components and
preprocessing is performed to assess whether the obtained data inter-application communication between different applications
should be sent to the cloud or not. The two step management (e.g., if some other application on the device is using the data ac-
process is necessary because the Mobile Broker first needs to quired from the ecosystem or from the physical sensor). The mobile
determine which sensors should be turned on, and in the second broker service communicates with the mobile broker entity using
step we are preprocessing the obtained data to check whether it the mobile broker API. It runs in the background and updates GUI
triggers additional processing and a publication event to deliver elements when necessary (e.g., when a new notification is received
the data to the Cloud Broker. and should be displayed to the user) and also sends publications if
The second task is concerned with push-based delivery of pub- the data acquired from local sensors is needed by the ecosystem.
lications from the cloud to mobile devices [18] which creates most The Mobile Broker data processing engine performs the match-
problems to programmers [19]. In addition, it can incur large en- ing of received sensor reading with a set of local subscriptions to
ergy costs since a recent study shows that periodic transfers in mo- determine whether the obtained data should be sent to the cloud
bile applications which account for only 1.7% of the overall traffic broker or not. We have developed the matching algorithm using
volume contribute to 30% of the total handset radio energy con- two different subscription data structures because it is not clear
sumption [20]. Thus hereafter we briefly report two solutions that which approach offers better processing performance on Android
we have tested to enable delivery of notify messages in the CUPUS devices: Subscriptions received from the Cloud Broker are stored
system: (1) persistent TCP connection, and (2) Google Cloud Mes- either in a linked list or a subscription forest similar to the one used
saging. by the Cloud Broker. Pre-processing of a newly created publication
Persistent TCP connections are the simplest mechanism to ends when a first matching subscription is found in the structure
implement, but can cause significant overhead as keep-alive because the publication should be forwarded to the Cloud Broker.
messages are needed to maintain an active connection which The linked list has obvious shortcoming because the complexity
prevents the processor from going into a sleep mode. Furthermore, of the matching process is O(n) in the worst case. Since we expect
mobile operators typically block client requests to mobile phones. to receive similar subscriptions relevant to MIO-generated data as
For a fully push-based message delivery mechanism in mobile enabled by the announce mechanism, it is possible that in practice
environments we have used the Google Cloud Messaging (GCM) the matching process will not be performed on all elements of
service. GCM is a service provided by Google running as an in- the list. An additional benefit from using the linked list is reduced
termediary between application servers (Cloud Brokers in case of complexity regarding its management (i.e. adding or deleting a
CUPUS) and mobile devices running the Android OS. GCM uses a subscription to the structure).
simple message format limited to 4 kB. A mobile service does not The forest structure is similar to the subscription structure used
need to be in an active state to receive such notifications since the by the Cloud Broker. The difference is in the possible depth of the
Android OS starts or wakes up the service upon a received message. structure, because we have observed that an Android application
The mechanism does not create, handle or destroy any additional can become unstable with forests of high depth. During matching
connections, which makes it a mobile push mechanism without only root subscriptions are matched to a publication, because if a
additional overhead. Since the support for the GCM service is an publication does not match a root subscription, it cannot match
integral part of the Android OS, GCM only requires that a radio in- any of its leaf subscriptions. The matching complexity is O(log n),
terface is online, and allows the processing unit to go to the power but in real world scenarios it tends to O(1). The shortcoming of
save mode. The GCM mechanism is used by various Google appli- the forest structure is additional overhead caused by increased
cations on mobile devices and reuses the same connection for the structure management time.
delivery of all messages, thus reducing the communication over- In Section 6 we compare the propagation delay of notification
head to the minimum. The main drawback is limited availability messages with either TCP/IP or GCM over WiFi and 3G links, as
(only for Android OS) and dependency on a third party solution. well as performance of the matching processes within the mobile
Fig. 4 depicts the architecture of the Mobile Broker Android ap- application with two different subscription structures.
plication. The application consists of two background services (a
sensor and mobile broker service), Graphical User Interface (GUI) 4. Use case application: urban crowd sensing for air quality
for controlling the services and presenting live data, and mobile monitoring
broker entity. The main task of the sensor service is to acquire sen-
sor readings from connected sensors. The communication between Air pollution is a serious threat in urban environments with
a physical or virtual sensor and the sensor service depends on the significant negative impact on human health. Therefore, air quality
A. Antoni et al. / Future Generation Computer Systems 56 (2016) 607622 613
Fig. 5. Wearable sensors for air quality monitoring and smartphones running the monitoring application.
Fig. 6. Web application depicting a subset of data collected on July 7th, 2014.
Table 2
Comparison between the CUPUS middleware and standardized messaging protocols.
CUPUS middleware MQTT protocol CoAP
requirements identified in [25,26]: solution architecture, support a device of interest. A CoAP server supports resource discovery. Al-
for various platforms and applications, standardization efforts, though its subscription mechanism is quite different than the one
modeling of information flow, support for discovery of objects (e.g., used by the MQTT protocol, expressiveness of the subscription lan-
devices, resources, measuring capabilities, etc.), query support and guage is similar, with a major difference that in the CoAP protocol
data processing support. Table 2 summarizes the comparison. each device handles its own subscriptions unlike the MQTT proto-
As the MQTT protocol is a minimalistic publish/subscribe pro- col where all subscriptions are handled by the MQTT broker.
tocol standardized by OASIS, this results in available implementa- Messaging footprint. To compare the messaging footprint of
tions for various platforms (Arduino, Android) and programming the three analyzed IoT messaging solutions, we count the number
languages (Java, C, Python). Similarly to the CUPUS middleware, of messages exchanged within an MCS application assuming that
MQTT uses a central processing component that matches user sub- only a part of the sensor data is needed by the application
scriptions with incoming publications; however, the CUPUS mid- and its users. We have used the SenseZGAir dataset in this
dleware offers an expressive subscription language compared to simulation experiment, while subscriptions are generated at
the hierarchical topic-based subscriptions offered by the MQTT random to achieve a subscription coverage between 30% and 90%.4
protocol. In contrast to the CUPUS middleware which uses the an- After selecting subscriptions which achieve a satisfactory level of
nounce mechanism to discover objects that can respond to a user coverage, all sensor readings were published and processed by all
subscription, MQTT entities always send acquired data to a broker, three solutions. Since subscriptions were generated in a random
regardless of its usefulness. In addition, the MQTT protocol does fashion, we have performed 1000 iterations of each experiment to
not consider more complex data stream processing functions (e.g., obtain the distribution of messaging footprint which includes all
average, sum) to be offered as part of the protocol: it only forwards messages communicated by data sources and messages controlling
messages published on defined topics from the broker to interested data acquisition.
users. Since CoAP is not designed to natively support MCS applica-
The CoAP protocol is another well-known and standardized tions, mostly because of its nature where clients communicate di-
messaging solution which implements the Observer pattern, a rectly with data sources publishing data over a CoAP server, we
communication paradigm used by constrained devices in IoT appli- assumed in the experiment that a single MCS application server
cations that benefit from direct communication channels between will consolidate all data readings from mobile sensors and de-
devices. More details on how to achieve ad hoc communication us- vices running CoAP servers to act as a single point-of-entry for
ing CoAP in various environments, often protected by firewalls, can end-users. Thus, an end-user subscribes at the MCS server for de-
be found in [27]. CoAP has a decentralized architecture and lacks a sired information, and the MCS server creates individual CoAP
central processing component, meaning that each data source pro- subscriptions on mobile devices to be able to forward data to
cesses and delivers data to all interested clients when the observe
pattern is used. A centralized component of the CoAP protocol is
the Resource Directory that serves as a directory to discover avail- 4 Subscription coverage means that a subscription is defined on a sensor reading,
able devices, i.e., CoAP servers, so that a user can make a request to subsequently causing that the reading produces at least one notification.
616 A. Antoni et al. / Future Generation Computer Systems 56 (2016) 607622
(a) High publishing load. (b) Medium publishing load. (c) Low publishing load. (d) Very low publishing load.
Fig. 12. The cloud broker configuration during an experiment with varying publishing load.
618 A. Antoni et al. / Future Generation Computer Systems 56 (2016) 607622
(a) Matching time compared to the number of subscriptions. (b) Matching time compared to the publication frequency.
(a) Energy consumption compared to the (b) CPU and memory consumption (c) CPU and memory consumption compared
publication frequency. compared to the number of subscriptions. to the number of sensors.
of the engine, due to high load on a single matcher, the splitting subscription constraint is constructed using a random value and
event is triggered causing a sudden high propagation delay. It is one of the relational operators (, , =). The results of the first
interesting to observe the configuration changes in case of 292 experiment (Fig. 13(a)) show that the forest structure enables
publications per second although the number of used matcher better matching time compared to the list of subscriptions,
processes is constantly one. One can notice that this graph does especially when a small number of subscriptions is processed by a
not contain any changes which represent the splitting or merging Mobile Broker. When a large number of subscriptions is processed,
events, concluding that the processing load of the matcher is the difference in performance between the two data structures is
below the threshold for creating a new matcher. The experiment reduced due to the matching function optimization which searches
with low publishing load depicted in Fig. 12(c) started with two for a single matching subscription. Note that the smartphone used
matchers running in parallel, but the Cloud Broker rearranged its in this experiment could not handle more than 400 subscriptions.
configuration to use only one matcher since it was sufficient to The main reason is limited support for recursion in the devices
process all incoming messages. In the experiment with very low process virtual machine (Dalvik). However, a large number of
load depicted in Fig. 12(d) we can see that a single underloaded subscriptions is not expected to be matched on a Mobile Broker
matcher processes all publications. The data propagation time is in practice due to the announce mechanism.
higher than expected due to unsuccessful merge requests. In the second experiment, we measure the matching time while
We can conclude that dynamic matcher configurations in case varying the sampling period to obtain sensor readings from 100 to
of adequate computing resources can keep the data propagation 2000 ms while processing a constant number of 100 subscriptions
delay in the cloud below 1 s, even in the case of merging and which were generated at random, as in the previous experiment.
splitting events which cause significant overhead. Fig. 13(b) shows that the matching time is not significantly affected
by the sensor sampling rate, as it depends mostly on the number
6.2. Mobile broker evaluation of active subscriptions on the Mobile Broker.
Furthermore, in the third experiment we measure the aver-
To evaluate the matching process on the Mobile Broker we age power consumption of the CUPUS Android application while
have performed scalability tests with an increasing number of sub- matching 500 publications with a fixed number of 100 subscrip-
scribers and with different subscription data structures, as defined tions. During the experiment we varied the publication sam-
in Section 3.2. Additionally, we have measured the resource con- pling rate from 1/100 to 1/2000 ms. The PowerTutor application
sumption on a mobile device during the data acquisition and pre- [28] was used for measuring the application power consumption.
processing steps. Experiments were conducted using a Samsung Fig. 14(a) depicts the obtained experimental results. Similar to [29],
Galaxy S4 smartphone with the Android Jelly Bean 4.3 operating the power consumption decreases exponentially when decreasing
system. the sampling rate. Similar to the findings in [30,31], high sampling
The matching time is the processing time required to determine frequencies increased the power consumption since devices are
whether a received sensor reading satisfies constraints of at not allowed to enter a low power mode.
least one subscription which is active on the Mobile Broker. Fig. 14(b) and (c) show CPU and memory usage when the
The matching time is measured while varying the number of number of subscriptions and built-in sensors as data sources in
subscriptions from 100 to 400 while keeping the publication rate the experiment increases. The CPU usage in this experiment is
constant at 1 s. The set of active subscriptions is generated at measured in jiffies, which are defined as the time between two
random within the limits of sensor sensing capabilities. Each ticks of the system timer interruption. Obviously, it is not an
A. Antoni et al. / Future Generation Computer Systems 56 (2016) 607622 619
Table 3 when using TCP/IP. The situation is similar when using GCM but
Measuring the delay on wireless interfaces (WiFi and 3G).
only in case of low notification frequency. The end-to-end data
TCP-WiFi (s) GCM-WiFi (s) WiFi [32] propagation delay of 12 s should be acceptable for most MCS use
1 s interval 0.294 0.286 cases, e.g., environmental or traffic monitoring application, which
1.5 104 0.068 s
0.1 s interval 0.255 0.215 require relatively simple continuous processing operators on
TCP-3G (s) GCM-3G (s) GPRS [32] sensor data stream as those provided by typical publish/subscribe
subscription languages.
1 s interval 0.752 0.394
0.47.16 s
0.1 s interval 0.612 11.47
7. Related work
absolute time interval unit, since its duration depends on the
frequency of clock interruptions on a particular hardware platform. There are a large number of MCS applications published in
From both graphs we can notice that the CPU consumption the literature which utilize mobile IoT sensing. The overview
generally grows when increasing the number of subscriptions or and comparison of such applications are available in [6,1]. The
sensors generating publications. However, memory usage remains authors of [33,1] identify the need for a unified architecture for
at a constant level since the processing of a newly created MCS applications, and provide an outline of such architecture.
publication does not require an additional amount of memory Here we want to depict the main characteristics of MCS platforms
when the number of active subscriptions is fixed. which are comparable to the proposed MCS ecosystem which is
The previous experiments show that the processing delay on to our knowledge the first solution to leverage the well-known
a Mobile Broker is in the range of milliseconds and thus does announcesubscribepublish pattern in the context of large-scale
not significantly influence the end-to-end data propagation delay, and context-aware MCS applications.
while it scales well to an increasing number of data sources, The CenceMe [34] project is one of the early works on sensing
publication frequency and number of active subscriptions. to infer information related to human activity which was the first
to combine presence inference with sharing of this information
6.3. Delay on wireless links through social networks. This approach enables personal visualiza-
tion of human activity with a possibility for group interaction, but
As MCS applications are used on mobile devices, we need does not require a near real-time processing approach proposed by
to measure the data transmission delay introduced on wireless CUPUS. PEIR, the Personal Environmental Impact Report, is one of
links. Note that detailed performance of wireless communication the first platforms for opportunistic sensing [35] which estimates
is outside the scope of this paper; instead we measure the personal exposure to pollution and environmental impact based
overhead introduced by a wireless communication link to evaluate on location data sampled from user mobile phones. PEIR architec-
end-to-end propagation delay for MCS applications. A detailed ture is purely clientserver where mobile devices are applied for
analysis of performance characterization in real heterogeneous sensor data collection and are automatically uploaded to the server
wired/wireless network is given in [32]. We have measured the for further processing. The collected data and exposure metrics are
delay in terms of data propagation time when pushing data objects available for personal usage and can be viewed through a web in-
from the Cloud Broker to a Mobile Broker running on a mobile terface. The PEIR system is also not real-time in nature such that it
device. The data is pushed sequentially every 1 or 0.1 s while the does not sent notifications to users and does not offer data filtering
CUPUS middleware is not under heavy load. options on mobile phones.
The experiments are performed on both WiFi and 3G mobile Medusa [36] is an interesting framework for collecting user ex-
device interfaces and the obtained results are shown in Table 3. periences from users who contribute sensor data for self-reflection
In parallel to the obtained results we provide the baseline or environmental awareness. A requestor gives tasks to smart-
performance of the WiFi and GPRS communication technology phone users to acquire and annotate sensor data while Medusa
presented in [32]. As the baseline we use half of the Round Trip focuses on ensuring the privacy of sensor data contributions. It is
Time (RTT) for end-to end paths (Ethernet-to-WiFi and Ethernet- also not real-time and does not deal with the problem of redundant
to-GPRS), irrespective of the application layer. Both the TCP/IP and data.
GCM solution show approximately the same performance over Lifestreams is a modular and open source platform designed to
WiFi links irrespective of the data publication rate. When the explore and analyze personal data streams captured from mobile
interval between publications is large, the delay is a bit larger phones [37]. In particular, Lifestreams modules include feature ex-
because the device enters a power save mode. However, on 3G traction from raw sensor data, feature selection, inference and data
links, the results are a bit different. TCP/IP shows approximately visualization. It is built on top of Ohmage, a personal data collection
the same performance irrespective of publication frequency, while platform for the acquisition of a rich and heterogeneous dataset
GCM suffers from a larger delay when the data is published from mobile devices, both in an opportunistic and participatory
frequently. Thus, GCM is not the best strategy for push-based data way. Lifestreams main goal is to identify key behaviors and trends
delivery to mobile devices in case of high messaging frequency on which are relevant to an individuals health as well as to enable
a 3G interface. However, it performs well with lower publication researchers from health domains to identify behavioral-indicators
frequencies and is usually not blocked by mobile operators. Note from large volumes of raw and heterogeneous data streams. In that
that for comparison we provide the baseline performance of a respect it needs to collect as much data as possible from an indi-
2G mobile network (GPRS), while we tested the delay using a 3G vidual and thus has different goals compared to CUPUS.
mobile network. The MobiSense [38] platform is used for activity recognition
To conclude, we can estimate the true end-to-end data and applies the clientserver implementation with asynchronous
propagation delay in CUPUS by combining the delay measured messages used for adjusting the sensing task assignments.
under high Cloud Broker load with the data propagation delay MobiSense uses topic-based messaging for adjusting the sampling
on wireless links. It represents the time period which a user can frequency of sensors, stores the data locally and uploads it when
experience when using CUPUS in MCS applications to receive the network connection is available, but compared to CUPUS, it is
sensor readings acquired by other users and relevant to his/her not used for data acquisition and data filtering on mobile devices,
context. The propagation delay can be in the range of 12 s nor for delivery of near real-time notifications.
620 A. Antoni et al. / Future Generation Computer Systems 56 (2016) 607622
Another example is Pogo [39], a middleware infrastructure sup- or other mobile devices. Sheng et al. [49] present theoretical and
porting easy access to sensor data on mobile phones. Pogo is built simulation results to evaluate algorithms for determining energy-
upon the principles of publish/subscribe, it uses simple topic-based efficient sensing schedules of moving sensors while our approach
subscriptions to manage access to sensor data and reports signifi- provides the means to implement such algorithms in real systems.
cant energy gains due to topic-based filtering of sensed data on mo- We have already identified publish/subscribe middleware as
bile devices. CUPUS also aims to achieve energy-savings on mobile an adequate enabler of MCS applications [10] where we present
devices and sensors by suppressing the transmission of redundant the two-tier communication model comprising cloud brokers and
and irrelevant data into the cloud and by adjusting the sensing pro- mobile brokers. The initial version of this paper is published in [11]
cess. which proposes an MCS ecosystem based on the publish/subscribe
primitives and focuses on evaluating CUPUS performance on
In the work reported in [40], the authors propose a multidi-
mobile devices. This paper is significantly different from [11], both
mensional context-aware social network architecture for mobile
in terms of contribution and content because this paper presents
crowd sensing applications. They propose a mobile ecosystem that
an overall evaluation of CUPUS in the context of an MCS application
integrates context information from multidimensional sources and
for air quality monitoring.
provides semantic matching of collected data for personalized un-
derstanding of user requirements, which can improve data delivery 8. Conclusion
rate and reduce energy consumption on mobile devices.
Another example is Mobile Sensor Data EngiNe (MOSDEN) [41], The paper presents an ecosystem for MCS which relies on the
a collaborative mobile sensing framework for developing and CloUd-based PUblish/Subscribe middleware (CUPUS) to acquire
deploying opportunistic sensing applications. MOSDEN is designed sensor data from mobile devices. We outline the underlying model
to operate on Android-based smartphones and capture and and design decisions of the CUPUS middleware which enables
share sensed data between multiple distributed applications flexible and controllable data acquisition from MIOs, as well as near
and users. By supporting processing and storage on end user real-time processing of sensor data streams along with delivery of
smartphone devices, the platform aims to reduce the necessary notifications from the cloud to mobile devices. The middleware
data transmission to a centralized server, consequently achieving is energy-efficient as it suppresses the transmission of sensor
bandwidth and energy efficiency. The problem of energy efficiency readings from MIOs and filters out either redundant or irrelevant
in MCS applications is addressed in [42] where the authors present sensor readings. To demonstrate the applicability of the proposed
an approach for model-driven adaptive environmental sensing. ecosystem, we present an environmental monitoring application
They aim to reduce the amount of redundant sensor readings by built on top of CUPUS. It integrates a wearable gas sensor which
maintaining local models of expected sensor readings on mobile communicates over a Bluetooth connection with a smartphone
running a mobile application to regulate and relay sensor readings
devices and pushing updates to the back-end server only when
to the cloud back-end. The mobile application also receives air
predicted values do not match actual sensor readings, which
quality alerts from the cloud in real-time in accordance with user
consequently reduces the amount of communication between
preferences and context.
client devices and a back-end data collection server. This approach
We present the comparison of the CUPUS middleware with two
is complementary to the selective and flexible acquisition and standardized messaging solutions, the MQTT protocol and CoAP,
filtering of sensor data on mobile devices proposed in the CUPUS with respect to MCS application requirements. Our experimental
middleware. results with real user traces collected during an air quality
The CitiSense project [43] aims to monitor environmental measurement campaign in the City of Zagreb show that our MCS
conditions and air pollution to which users are exposed to during solution is scalable when increasing the number of subscriptions
their daily activities. The mobile phone analyzes the data from a which are processed in parallel under constant publication load,
small wearable sensor to provide real-time feedback to the user while it also adapts well to varying publication load. Additionally,
about the ambient air pollution. All collected data is sent to the our measurements show that the end-to-end data propagation
backend server for further analysis and visualization so that users delay observed by end users is within the range of 12 s, which
can observe their personal historical data. It is vital to notice is acceptable for typical MCS usage scenarios. Evaluation of the
that the CitiSense real-time alerting functionality is performed mobile application has shown that it is scalable and energy-
exclusively based on local readings from sensors connected to efficient even when processing a large number of subscriptions in
mobile phones, and does not enable real-time data sharing parallel and sensor readings with relatively high publication rates.
between the users to distribute alerts due to readings collected by Furthermore, the processing time on a mobile device is within the
other users. In that respect it does not require any (near) real-time range of 10 ms for typical loads which does not represent a major
notifications from the backend server to mobile devices. overhead for the end-to-end data propagation delay while offering
To summarize, publish/subscribe middleware is used mainly for an overall energy-efficient MCS performance.
As future work we plan to investigate hierarchical broker
either data dissemination within wireless sensor networks [44],
architectures which use mobile brokers on sensor nodes, while
or for data acquisition from stationary Internet-connected ob-
mobile devices could act as gateways for a number of sensors
jects [45,46]. There are few publish/subscribe solutions addressing
and their mobile brokers, e.g., in fog environments. We are
MIOs as well as their interaction with the cloud. The authors of [47]
currently in the process of adapting our middleware to run on large
propose a publish/subscribe platform for opportunistic data collec- cloud infrastructures and we need to perform large-scale tests to
tion from stationary sensors which is an approach the most simi- investigate the influence of cloud management solutions on the
lar to ours. They present a hiking trail application where mobile CUPUS processing performance and data propagation delay.
phones are applied as mules to selectively gather data from sta-
tionary sensors, in contrast to our middleware which enables col- Acknowledgments
lecting of environmental data from mobile and wearable sensors
carried by users and control over the sensing coverage and battery This work has been partially carried out in the scope of the
usage for devices in an MCS application scenario. Lim et al. [48] project ICT OpenIoT Project FP7-ICT-2011-7-287305 co-funded by
focus on energy-efficient data acquisition from multiple sensor the European Commission under FP7 program. This work has been
streams such that they choose the most favorable source with re- supported in part by the Croatian Science Foundation under the
spect to continuous queries, but in contrast to our solution do project number 8065 (Human-centric Communications in Smart
not relate the processing performed on one device with the cloud Networks).
A. Antoni et al. / Future Generation Computer Systems 56 (2016) 607622 621
References [28] L. Zhang, B. Tiwana, Z. Qian, Z. Wang, R.P. Dick, Z.M. Mao, L. Yang,
Accurate online power estimation and automatic battery behavior based
power model generation for smartphones, in: Proceedings of the Eighth
[1] R.K. Ganti, F. Ye, H. Lei, Mobile crowdsensing: current state and future
IEEE/ACM/IFIP International Conference on Hardware/Software Codesign
challenges, IEEE Commun. Mag. 49 (11) (2011) 3239.
and System Synthesis, CODES/ISSS10, ACM, New York, NY, USA, 2010,
[2] B. Guo, D. Zhang, Z. Yu, Y. Liang, Z. Wang, X. Zhou, From the Internet of things pp. 105114.
to embedded intelligence, World Wide Web 16 (4) (2013) 399420. [29] C. Perera, A.B. Zaslavsky, P. Christen, A. Salehi, D. Georgakopoulos, Capturing
[3] J.A. Burke, et al., Participatory sensing, in: Proc. of WSW06 at ACM SenSys sensor data from mobile phones using global sensor network middleware,
2006, ACM, 2006. in: PIMRC, IEEE, 2012, pp. 2429.
[4] A. Zaslavsky, P. Jayaraman, S. Krishnaswamy, ShareLikesCrowd: Mobile [30] C. Thompson, D.C. Schmidt, H.A. Turner, J. White, Analyzing mobile application
analytics for participatory sensing and crowd-sourcing applications, in: 2013 software power consumption via model-driven engineering, in: C. Benavente-
IEEE 29th International Conference on Data Engineering Workshops, ICDEW, Peces, J. Filipe (Eds.), PECCS, SciTePress, 2011, pp. 101113.
2013, pp. 128135. [31] A. Krause, M. Ihmig, E. Rankin, D. Leong, S. Gupta, D. Siewiorek, A. Smailagic, M.
[5] J. Gubbi, R. Buyya, S. Marusic, M. Palaniswami, Internet of things (IoT): A vision, Deisher, U. Sengupta, Trading off prediction accuracy and power consumption
architectural elements, and future directions, Future Gener. Comput. Syst. 29 for context-aware wearable computing, in: Proceedings of the Ninth IEEE
(7) (2013) 16451660. International Symposium on Wearable Computers, ISWC05, IEEE Computer
[6] N.D. Lane, E. Miluzzo, H. Lu, D. Peebles, T. Choudhury, A.T. Campbell, A survey Society, Washington, DC, USA, 2005, pp. 2026.
[32] A. Botta, A. Pescap, G. Ventre, Quality of service statistics over heterogeneous
of mobile phone sensing, Commun. Mag. 48 (9) (2010) 140150.
networks: Analysis and applications, European J. Oper. Res. 191 (3) (2008)
[7] L. Skorin-Kapov, K. Pripuzic, M. Marjanovic, A. Antonic, I. Zarko, Energy
10751088.
efficient and quality-driven continuous sensor management for mobile [33] G. Chatzimilioudis, A. Konstantinidis, C. Laoudias, D. Zeinalipour-Yazti,
iot applications, in: 2014 International Conference on Collaborative Com- Crowdsourcing with smartphones, IEEE Internet Comput. 16 (5) (2012) 3644.
puting: Networking, Applications and Worksharing, CollaborateCom, 2014, [34] E. Miluzzo, N.D. Lane, K. Fodor, R. Peterson, H. Lu, M. Musolesi, S.B. Eisenman,
pp. 397406. X. Zheng, A.T. Campbell, Sensing meets mobile social networks: The design,
[8] A. Botta, W. de Donato, V. Persico, A. Pescape, On the integration of cloud implementation and evaluation of the cenceme application, in: Proceedings
computing and Internet of things, in: 2014 International Conference on Future of the 6th ACM Conference on Embedded Network Sensor Systems, SenSys08,
Internet of Things and Cloud, FiCloud, 2014, pp. 2330. ACM, New York, NY, USA, 2008, pp. 337350.
[9] G. Mhl, L. Fiege, P. Pietzuch, Distributed Event-Based Systems, Springer, 2006. [35] M. Mun, S. Reddy, K. Shilton, N. Yau, J. Burke, D. Estrin, M. Hansen, E. Howard, R.
West, P. Boda, PEIR: the personal environmental impact report, as a platform
[10] I. Podnar Zarko, A. Antonic, K. Pripuic, Publish/subscribe middleware for
for participatory sensing systems research, in: Proc. ACM/USENIX Int. Conf.
energy-efficient mobile crowdsensing, in: Proceedings of the 2013 ACM
Mobile Systems, Applications, and Services, MobiSys, Krakow, 2009.
Conference on Pervasive and Ubiquitous Computing Adjunct Publication, [36] M.-R. Ra, B. Liu, T.F. La Porta, R. Govindan, Medusa: A programming framework
UbiComp13 Adjunct, ACM, New York, NY, USA, 2013, pp. 10991110. for crowd-sensing applications, in: Proceedings of the 10th International
[11] A. Antonic, K. Rozankovic, M. Marjanovic, K. Pripuzic, I. Podnar Zarko, A Conference on Mobile Systems, Applications, and Services, MobiSys12, ACM,
mobile crowdsensing ecosystem enabled by a cloud-based publish/subscribe New York, NY, USA, 2012, pp. 337350.
middleware, in: Proc. of the 2nd International Conference on Future Internet [37] C.-K. Hsieh, H. Tangmunarunkit, F. Alquaddoomi, J. Jenkins, J. Kang, C.
of Things and Cloud, FiCloud-2014, 2014. Ketcham, B. Longstaff, J. Selsky, B. Dawson, D. Swendeman, D. Estrin, N.
[12] A. Carzaniga, D.S. Rosenblum, A.L. Wolf, Design and evaluation of a wide-area Ramanathan, Lifestreams: A modular sense-making toolset for identifying
event notification service, ACM Trans. Comput. Syst. 19 (3) (2001) 332383. important patterns from everyday life, in: Proceedings of the 11th ACM
[13] A. Antonic, V. Bilas, M. Marjanovic, M. Matijasevic, D. Oletic, M. Pavelic, I. Pod- Conference on Embedded Networked Sensor Systems, SenSys13, ACM, New
nar Zarko, K. Pripuzic, L. Skorin-Kapov, Urban crowd sensing demonstrator: York, NY, USA, 2013, pp. 5:15:13.
Sense the zagreb air, in: Proc. of the 22nd International Conference on Soft- [38] P. Wu, J. Zhu, J.Y. Zhang, MobiSens: A versatile mobile sensing platform for
ware, Telecommunications and Computer Networks, SoftCOM2014, 2014. real-world applications, Mob. Netw. Appl. 18 (1) (2013) 6080.
[14] Martina Marjanovi, Lea Skorin-Kapov, Kreimir Pripui, Aleksandar An- [39] N. Brouwers, K. Langendoen, Pogo, a middleware for mobile phone sensing,
toni, Ivana Podnar arko, Energy-aware and quality-driven sensor man- in: Proceedings of the 13th International Middleware Conference, Middle-
agement for green mobile crowd sensing, J. Netw. Comput. Appl. (2015) ware12, Springer-Verlag New York, Inc., New York, NY, USA, 2012, pp. 2140.
[40] X. Hu, X. Li, E.-H. Ngai, V. Leung, P. Kruchten, Multidimensional context-aware
http://dx.doi.org/10.1016/j.jnca.2015.06.023.
social network architecture for mobile crowdsensing, IEEE Commun. Mag. 52
[15] M. Sadoghi, H.-A. Jacobsen, BE-tree: an index structure to efficiently match
(6) (2014) 7887.
boolean expressions over high-dimensional discrete space, in: Proc. of the [41] P.P. Jayaraman, C. Perera, D. Georgakopoulos, A.B. Zaslavsky, MOSDEN: A
2011 ACM SIGMOD, ACM, New York, NY, USA, 2011, pp. 637648. scalable mobile collaborative platform for opportunistic sensing applications,
[16] L. Golab, M.T. Ozsu, Issues in data stream management, SIGMOD Rec. 32 (2) CoRR abs/1405.5867.
(2003) 514. [42] N. Nikzad, J. Yang, P. Zappi, T.S. Rosing, D. Krishnaswamy, Model-driven
[17] S. Tarkoma, J. Kangasharju, Optimizing content-based routers: posets and adaptive wireless sensing for environmental healthcare feedback systems,
forests, Distrib. Comput. 19 (1) (2006) 6277. in: 2012 IEEE International Conference on Communications (ICC), IEEE, 2012,
[18] I. Podnar, M. Hauswirth, M. Jazayeri, Mobile push: Delivering content to pp. 34393444.
mobile users, in: J. Bacon, L. Fiege, R. Guerraoui, A. Jacobsen, G. Mhl (Eds.), [43] E. Bales, N. Nikzad, N. Quick, C. Ziftci, K. Patrick, W. Griswold, Citisense: Mobile
in Proceedings of the 1st International Workshop on Distributed Event-Based air quality sensing for individuals and communities design and deployment of
Systems, DEBS02, 2002. the citisense mobile air-quality system, in: 2012 6th International Conference
on Pervasive Computing Technologies for Healthcare, PervasiveHealth, 2012,
[19] I. Warren, A. Meads, S. Srirama, T. Weerasinghe, C. Paniagua, Push notification
pp. 155158.
mechanisms for pervasive smartphone applications, IEEE Pervasive Comput.
[44] P. Costa, C. Mascolo, M. Musolesi, G.P. Picco, Socially-aware routing for
13 (2) (2014) 6171.
publishsubscribe in delay-tolerant mobile ad hoc networks, IEEE J. Sel. Areas
[20] F. Qian, Z. Wang, Y. Gao, J. Huang, A. Gerber, Z. Mao, S. Sen, O. Spatscheck, Commun. 26 (5) (2008) 748760.
Periodic transfers in mobile applications: network-wide origin, impact, and [45] E. Souto, G. Guimaraes, G. Vasconcelos, M. Vieira, N. Rosa, C. Ferraz, J. Kelner,
optimization, in: Proceedings of the 21st International Conference on World Mires: a publish/subscribe middleware for sensor networks, Pers. Ubiquitous
Wide Web, WWW12, ACM, New York, NY, USA, 2012, pp. 5160. Comput. 10 (1) (2005) 3744.
[21] H.-Y. Liu, E. Skjetne, M. Kobernus, Mobile phone tracking: in support of [46] O. Jurca, S. Michel, A. Herrmann, K. Aberer, Continuous query evaluation over
modelling traffic-related air pollution contribution to individual exposure distributed sensor networks, in: ICDE, 2010, pp. 912923.
and its implications for public health impact assessment, Environ. Health 12 [47] X. Tong, E.C.H. Ngai, A ubiquitous publish/subscribe platform for wireless
(2013). sensor networks with mobile mules, in: DCOSS, 2012, pp. 99108.
[22] U. Hunkeler, H.L. Truong, A. Stanford-Clark, MQTT-SA publish/subscribe [48] L. Lim, A. Misra, T. Mo, Adaptive data acquisition strategies for energy-efficient,
protocol for wireless sensor networks, in: 3rd International Conference on smartphone-based, continuous processing of sensor streams, Distrib. Parallel
Communication Systems Software and Middleware and Workshops, 2008. Databases 31 (2) (2013) 321351.
[49] X. Sheng, J. Tang, W. Zhang, Energy-efficient collaborative sensing with mobile
COMSWARE 2008. 2008, pp. 791798.
phones, in: INFOCOM, 2012, pp. 19161924.
[23] Z. Shelby, K. Hartke, C. Bormann, The constrained application protocol (coap),
RFC 7252, RFC Editor, June 2014.
[24] K. Hartke, Observing resources in coap, Internet-Draft draft-ietf-core-observe-
Aleksandar Antoni is a Ph.D. student and Research Asso-
16, IETF Secretariat, December 2014.
ciate at the University of Faculty of Electrical Engineering
[25] K. Framling, S. Kubler, A. Buda, Universal messaging standards for the iot and Computing. He was a research intern at the Digital En-
from a lifecycle management perspective, IEEE Internet Things J. 1 (4) (2014) terprise Research Institute (DERI), National University of
319327. Ireland, Galway (2011). He has experience of participat-
[26] A. Antonic, M. Marjanovic, P. Skocir, I. Podnar Zarko, Comparison of the CU-
ing in projects funded by the EU Framework Programme,
PUS middleware and MQTT protocol for smart city services, in: Telecommu-
Croatian Ministry of Science, Education and Sports or in-
nications (ConTEL), 2015 13th International Conference on, 2015, pp. 18.
dustry. His interests comprise large-scale distributed sys-
http://dx.doi.org/10.1109/ConTEL.2015.7231225.
tems, real-time data stream processing and information
[27] S. Kubler, K. Frmling, A. Buda, A standardized approach to deal with firewall retrieval and recommender systems.
and mobility policies in the IoT, Pervasive Mob. Comput. 20 (2015) 100114.
622 A. Antoni et al. / Future Generation Computer Systems 56 (2016) 607622
Martina Marjanovi received her M.Sc. degree in infor- of IEEE Computer Society, IEEE Communications Society and IEEE Geoscience &
mation and communication technology from the Univer- Remote Sensing Society. His interests comprise algorithms and data structures,
sity of Zagreb in 2013. Currently she is a Ph.D. student and large-scale distributed systems (publish/subscribe, P2P networks), real-time data
Research Associate at the Department of Telecommuni- stream processing, big data, information retrieval and information filtering systems
cations, Faculty of Electrical Engineering and Computing, (recommender systems).
University of Zagreb. She was a guest student at the Vienna
University of Technology (TU Wien) in 2012. Her interests
comprise mobile crowd sensing architectures and applica-
tions, contextual services and quality of service in Internet Ivana Podnar arko is an Associate Professor at the
of Things. University of Zagreb Faculty of Electrical Engineering
and Computing. She was a Guest Researcher (2000) and
Research Associate (2001) at the Technical University of
Kreimir Pripui received his Ph.D. degree in computer Vienna, and a Postdoctoral Researcher (20052006) at
science from the University of Zagreb in 2010. Currently the Swiss Federal Institute of Technology in Lausanne
he is an Assistant Professor at the Department of (EPFL). Her research interests are in the area of large-scale
Telecommunications, Faculty of Electrical Engineering and distributed information systems, in particular, data stream
Computing, University of Zagreb. He spent academic processing and publish/subscribe middleware, Internet of
year 20062007 at the Distributed Information Systems Things, recommender systems and information retrieval
Laboratory at EPFL (Ecole Polytechnique Fdrale de in decentralized environments. Currently she leads the
Lausanne), Switzerland, as a scholarship holder of the University of Zagreb team which participates in the EU-funded FP7 project
Swiss Government scholarship for university, fine arts and OpenIoT: Open Source Solution for the Internet of Things into the Cloud. She has
music schools for foreign students. He has experience of published around 50 scientific papers in journals and conference proceedings in the
participating in projects founded by the EU Framework area of distributed information systems and serves as a peer reviewer for a number
Programme, Croatian Ministry of Science, Education and Sports or industry. He of international journals and conferences. She is a member of the IEEE and Section
has co-authored over 25 scientific journal and conference papers. He is a member Chair of the IEEE Communications Society Croatia Chapter.