87
CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring Aigerim Zhalgasbekova Computer Science and Engineering, master's level 2017 Luleå University of Technology Department of Computer Science, Electrical and Space Engineering

CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

  • Upload
    others

  • View
    12

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

CollMule: An Opportunistic Data

Collection System for IoT-based Indoor Air

Quality Monitoring

Aigerim Zhalgasbekova

Computer Science and Engineering, master's level

2017

Luleå University of Technology

Department of Computer Science, Electrical and Space Engineering

Page 2: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

Luleå University of TechnologyDepartment of Computer Science, Electrical and Space EngineeringPERCCOM Master Program

Master’s Thesis inPervasive Computing & COMmunications

for sustainable development

Aigerim Zhalgasbekova

COLLMULE: AN OPPORTUNISTIC DATA COLLECTION SYSTEMFOR IOT-BASED INDOOR AIR QUALITY MONITORING

2017

Supervisors: Professor Arkady Zaslavsky (CSIRO)Assistant Professor Saguna Saguna (Luleå University of Technology)Assistant Professor Karan Mitra (Luleå University of Technology)Dr. Prem P Jayaraman (Swinburne University of Technology)

Examiners: Professor Eric Rondeau (University of Lorraine)Professor Jari Porras (Lappeenranta University of Technology)Associate Professor Karl Andersson (Luleå University of Technology)

Page 3: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

This thesis is prepared as part of an European Erasmus Mundus programmePERCCOM - Pervasive Computing & COMmunications for sustainable development.

This thesis has been accepted by partner institutions of the consortium (cf. UDL-DAJ, no1524,2012 PERCCOM agreement).

Successful defense of this thesis is obligatory for graduation with the following national diplo-mas:

• Master in Complex Systems Engineering (University of Lorraine)

• Master of Science in Technology (Lappeenranta University of Technology)

• Degree of Master of Science (120 credits) –Major: Computer Science and Engineering,Specialisation: Pervasive Computing and Communications for Sustainable Development(Luleå University of Technology)

Page 4: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

ABSTRACT

Luleå University of TechnologyDepartment of Computer Science, Electrical and Space EngineeringPERCCOM Master Program

Aigerim Zhalgasbekova

CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air QualityMonitoring

Master’s Thesis

2017

86 pages, 35 figures, 17 tables.

Examiners: Professor Eric Rondeau (University of Lorraine)Professor Jari Porras (Lappeenranta University of Technology)Associate Professor Karl Andersson (Luleå University of Technology)

Keywords: Internet of Things (IoT), Opportunistic Sensing (OppS), Analytic Hierarchy Pro-cess(AHP), Indoor Air Quality Monitoring

Opportunistic sensing advanced methods of IoT data collection using the mobility of data mules,the proximity of transmitting sensor devices and cost efficiency to decide when, where, how andat what cost collect IoT data and deliver it to a sink. This thesis proposes, develops, implementsand evaluates the system and algorithm called CollMule which builds on and extend the 3DkNN approach to discover, negotiate, collect and deliver the sensed data in an energy- and cost-efficient manner. The developed CollMule software prototype uses Android platform to handleindoor air quality data from heterogeneous IoT devices. The CollMule evaluation is based onperforming rate, power consumption and CPU usage of single algorithm cycle. The outcomesof these experiments prove the feasibility of CollMule use on mobile smart devices.

Page 5: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

ACKNOWLEDGEMENT

Certainly, by this moment, the last two years are the brightest years of my life. I have acquiredthe huge amount of new knowledge, experience and a lot of new friends. At the same time, thesetwo years were pretty tough for me as I had to study even harder than ever before. Fortunately,I have been surrounded by great people who have always been there when I needed their support.

I would like to thank the PERCCOM consortium for giving me such an opportunity to be thepart of this master program. All the universities, professors, lessons, students, travellings and ex-perience obtained during this program influenced significantly to an evolution of my personality.

I want to express my gratitude to Professor Arkady Zaslavsky, Doctor Saguna, Doctor KaranMitra and Doctor Prem Prakash Jayaraman for their guidance, responses, help and patience dur-ing this work.

I am very grateful for the support of my research I got from LTU and CSIRO.

Many thanks to my parents, younger brother, and relatives for their priceless support in allmy endeavours!

Special thanks to Tamara and Victor who spend the last semester with me in Skelleftea workingon our thesis projects. I really appreciate your support and the time spent together during thissemester.

PERCCOM happens once in a lifetime, that gives such valuable gifts as new incredible friendsfrom all over the world. Thank you, Olga Rybnytska, Nhi, Giang, Chandara, Atefe, Henrique,Manish, Emil, Valentin, Joseph, Felipe, Carlos, Mustaqim, Rafiul, Victor and Tamara for shar-ing with me wonderful moments during these two years! Skellefteå, May 29, 2017

Aigerim Zhalgasbekova

Page 6: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

5

CONTENTS

1 Introduction 101.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101.2 Research Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121.3 Research Questions and Objectives . . . . . . . . . . . . . . . . . . . . . . . . 131.4 Research Contributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141.5 Research Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141.6 Sustainability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161.7 Thesis Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

2 Background and Related Work 182.1 Internet of Things (IoT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

2.1.1 IoT definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182.1.2 IoT elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202.1.3 IoT applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

2.2 Opportunistic Sensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222.2.1 Data Collection Approaches . . . . . . . . . . . . . . . . . . . . . . . 232.2.2 Techniques for cost-efficient sensors identification . . . . . . . . . . . 292.2.3 Multiple Criteria Decision Making . . . . . . . . . . . . . . . . . . . . 32

2.3 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

3 CollMule Algorithm 343.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343.2 Metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

3.2.1 Battery Level Estimation Model . . . . . . . . . . . . . . . . . . . . . 363.3 Ranking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

3.3.1 AHP definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423.3.2 AHP model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

3.4 CollMule Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

4 CollMule Architecture 534.1 System Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

4.1.1 Mule Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554.1.2 Sensing IoT Device Architecture . . . . . . . . . . . . . . . . . . . . . 56

4.2 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

5 Implementation, Results and Evaluation 595.1 Prototype Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

Page 7: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

6

5.1.1 Testbed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595.1.2 Assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 615.1.3 Mule prototype implementation . . . . . . . . . . . . . . . . . . . . . 615.1.4 Sensing IoT device prototype . . . . . . . . . . . . . . . . . . . . . . 635.1.5 Communication between mules and sensors . . . . . . . . . . . . . . . 65

5.2 Experimental k size identification . . . . . . . . . . . . . . . . . . . . . . . . 665.3 System Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

5.3.1 Latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695.3.2 Power Consumption . . . . . . . . . . . . . . . . . . . . . . . . . . . 715.3.3 CPU Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

5.4 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 735.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

6 Conclusion and Future Work 766.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766.2 Future work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

Page 8: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

7

List of Figures

1 Smart city full of smart and sensing IoT devices. . . . . . . . . . . . . . . . . . 112 Motivating Scenario. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 DSRM Process Model [25]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 The Internet of Things emergence between 2008 and 2009 [31]. . . . . . . . . 195 The IoT evolution [32]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 The elements of the IoT [37]. . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 The MULEs three tier architecture [52]. . . . . . . . . . . . . . . . . . . . . . 248 a) energy consumption b) query latency comparisons of 3DkNN with KBT [66]. 309 Sensor selection in a three dimensional area. . . . . . . . . . . . . . . . . . . . 3410 Illustration of periods involved in the calculation of the power consumption of

our model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3811 Illustration of advertising period. . . . . . . . . . . . . . . . . . . . . . . . . . 3912 Illustration of connection period. . . . . . . . . . . . . . . . . . . . . . . . . . 4013 AHP model for CollMule. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4414 System Topology. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5315 CollMule System Architecture. . . . . . . . . . . . . . . . . . . . . . . . . . . 5416 Mule Architecture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5517 Sensing IoT device layer Architecture. . . . . . . . . . . . . . . . . . . . . . . 5718 The sensing set with Raspberry Pi a) 3; and b) 2. . . . . . . . . . . . . . . . . 6119 Flow of the app’s process. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6220 The meter used for measuring current during the advertisement and connection

modes of a sensing IoT device. . . . . . . . . . . . . . . . . . . . . . . . . . . 6321 BLE Advertising Packet Structure. . . . . . . . . . . . . . . . . . . . . . . . . 6422 Local Name Structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6523 Communication between mules and sensors. . . . . . . . . . . . . . . . . . . . 6524 Communication between mules and sensors during simultaneous connection. . 6625 Experimental setup on the second floor plan. . . . . . . . . . . . . . . . . . . . 6726 Computational Latency vs k size. . . . . . . . . . . . . . . . . . . . . . . . . . 7027 Collection Latency vs k size. . . . . . . . . . . . . . . . . . . . . . . . . . . . 7028 Power Consumption of the prototype with different k size of sensor set. . . . . 7129 CPU usage of the prototype with different k size of sensor set. . . . . . . . . . 72

Page 9: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

8

List of Tables

1 Related Works. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 Random Index (RI) [86] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433 Metrics scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444 Example values of sensor metrics. . . . . . . . . . . . . . . . . . . . . . . . . 455 Paired comparison matrix on the intermediary layer (among the factors). . . . . 456 Paired comparison matrix on the bottom layer (among alternatives with respect

to the Distance). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467 Paired comparison matrix on the bottom layer (among alternatives with respect

to the RSSI). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468 Paired comparison matrix on the bottom layer (among alternatives with respect

to the power level). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469 Aggregated matrix composed of priority vectors of the bottom layer and the

priority vector of intermediary layer. . . . . . . . . . . . . . . . . . . . . . . . 4710 List of Notations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4811 Information about used hardware. . . . . . . . . . . . . . . . . . . . . . . . . 6012 Current consumed by sensing sets with Raspberry Pi 2 and 3. . . . . . . . . . . 6313 Experiments data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

Page 10: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

9

ABBREVIATIONS AND SYMBOLSLTU Luleå University of TechnologyIoT Internet of ThingsOppS Opportunistic SensingICT Information and Communications TechnologiesUS EPA United States Environment Protection AgencyWHO World Health OrganizationEC European CommissionMEP Ministry of Environmental ProtectionEPD Environment Protecting DepartmentIAQ Indoor Air QualityRFID Radio-Frequency IdentificationIBSG Internet Business Solutions GroupIERC European Research Cluster on the Internet of ThingsWSN Wireless Sensor NetworkOppN Opportunistic NetworkingMCS Mobile Crowd SensingOSDC Opportunistic Sensing Data CollectionMULE Mobile Ubiquitous LAN ExtensionsAP Access PointkNN k Nearest NeighboursMANET Mobile Ad-Hoc NetworkMCDM Multiple Criteria Decision MakingMAUT Multiple Attribute Utility TheoryAHP Analytic Hierarchy Process

Page 11: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

10

1 Introduction

This chapter introduces the main areas in this thesis, which are linked to the Internet of Thingsand opportunistic sensing paradigms. The chapter presents the motivation and defines the aimsof this research work. Further, the thesis contributions are highlighted. Also, this chapter in-cludes a section that introduces the sustainability aspects of this thesis.

1.1 Introduction

The modern world of technologies develops rapidly and brings considerable changes to humanlife. Gradually, everything that surrounds people in their everyday life becomes smart and makesit easier and more comfortable. Such smart things that already exist are smart devices (e.g smart-phones, tablets, watches, TV), smart transportation (e.g cars, buses, trains), smart buildings (e.ghouses, business centres, shopping malls). They serve a human user in automatic and collabora-tive manner while the user does not need to make big efforts to exploit them. They communicatewith each other, thereby, creating a network that can also interact with the world. This is en-abled via the Internet of Things (IoT) that interconnects different objects [1] like smartphones,watches, cars, sensors, etc. According to Gartner [2], this year (2017) the number of connectedthings which will be used all around the world will reach 8.4 billion (see Figure 1). This numberhas increased from 2016 to more than 31% and will grow up to 20.4 billion by 2020. This cancause to concern about the amount of energy consumed by these devices. However, the IoTcan also become one of the crucial drivers of green Information and Communication Technolo-gies (ICT), if there is an increased focus on energy efficiency [3]. According to GeSI’s reportSMARTer2030 [4], ICT can facilitate to reduce the amount of global CO2 emissions by 20%till 2030. Therefore, academia, industry, and government are interested in developing the IoTtechnologies and systems that introduce sustainable development to the world.

In [3], authors highlight green ICT principles leading to energy efficiency improvement of theIoT area. One of the principles is a length minimization of the wireless data path. It is im-portant especially for IoT systems gathering and transferring an enormous amount of data viawireless connections. The principle can be achieved using opportunistic sensing (OppS) [5, 6]which utilizes the opportunity of collecting data about an environment from IoT devices (sen-sors) using mobile smart gadgets (e.g smartphones, tablets, etc) carried by people, without theirdirect involvement. Thus, there is no need in predefined infrastructure and additional hardware.Moreover, as the devices and sensors communicate directly without mediator hops, it reducesthe usage of bandwidth and, consequently, energy consumption.

Page 12: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

11

Figure 1. Smart city full of smart and sensing IoT devices.

The world’s rapid development has also brought negative consequences. One of them is airpollution. Therefore, the knowledge of air quality status becomes vital, because it affects ourwell-being. There are many people suffering from numerous diseases caused by poor air qualitylike respiratory and cardiovascular diseases. Moreover, the recent research states that the num-ber of premature deaths caused by polluted air reached 5.5 million a year [7].

Notably, modern people spend, on average, about 90% of their time indoors where pollutant lev-els are substantially from few times to hundreds of times higher than outdoors [8, 9]. There arehundreds of identified hazardous pollutants contained in the air of our living environment. Onlysix of them are considered as the most common in our daily lives and, therefore, well studied.These are carbon monoxide (CO), nitrogen dioxide (NO2), ground-level ozone, sulfur dioxide(SO2), particulate matter (PM) and lead (Pb)[10]. Research studies [11, 12, 13, 14, 15, 16, 17]provide a comprehensive information about their effects on human health and environment.There are regulatory limits of these pollutants that vary according to the governments and or-ganizations in different countries. Thus, their standards are declared differently by the UnitedStates Environment Protection Agency (US EPA), the World Health Organization (WHO), theEuropean Commission (EC), the Chinese Ministry of Environmental Protection (MEP) and theEnvironment Protecting Department (EPD) of Hong Kong [18].

It is important to monitor the indoor air quality (IAQ) for assessing the danger to human healthbased on the above-mentioned standards. Therefore, its monitoring is widely studied in recentresearch works. Moreover, it is broadly used as an application for deployment of different IoTsystems such as [19, 20, 21, 22, 23]. These utilize sensors that detect concentrations of the

Page 13: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

12

pollutants.

1.2 Research Motivation

Nowadays, smart buildings are being equipped with an increasing number of IoT devices. Mostof these are powered with a battery that has a strictly limited life. Therefore, they need tobe recharged periodically. The energy consumption of this large number of IoT devices is achallenging issue. To extend the IoT devices’ battery lifespan, there is a need to save the energyconsumed by them. For example, within IAQ monitoring the IoT devices have two primaryfunctions which consume a large amount of power. These are (1) sensors measuring air pollutantlevels and (2) data transferring between the IoT device and a gateway. Recently, research hasbeen conducted regarding both of them. The solution for the former is to schedule a dutycycle of the devices which may eliminate unnecessary process execution. A solution for thelatter is to use energy efficient approaches of data collection like OppS. It enables techniqueswhereby sensors negotiate with smart mobile devices passing them by and upload data which isdelivered in energy efficient manner. However, the OppS approaches need to be further extendedto enhance the efficiency and prolong the device’s life. Let’s assume the following scenario.

Motivating Scenario This scenario presents how an OppS approach can be applied to IAQmonitoring (see Figure 2). Let’s assume that the monitoring system is deployed in the build-ing of the Luleå University of Technology1 (LTU) in Campus Skellefteå. It is considered thatnumerous IoT devices sensing different air characteristics are situated in the building. Its usersare the staff and students who usually carry their smart devices like a smartphone with themwhile moving within the building. Assume some of them suffer from a respiratory disease likeasthma. Therefore, it is vital for them to know the air quality in the rooms where they study orwork.

For example, let’s follow the possible path of a student suffering from asthma named Kyle, who

changes his location during the usual academic day. He has classes in different auditoriums,

lunch in a student kitchen, just a rest somewhere during breaks between the classes. During

this time, his smartphone directly gathers data from sensors around him. Thereby, Kyle always

knows the air quality of his current location. Moreover, he can share the data gathered by the

smartphone with his peers and professors who can also help Kyle in finding the air quality in

other parts of the building. However, they can bother about their gadget’s power level, becausedata gathering consumes a considerable amount of its energy. It can prevent them to continue

1https://ltu.se

Page 14: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

13

Figure 2. Motivating Scenario.

exploitation of the system. Therefore, there is a need to reduce the consumptions that can attractpeople to participate in data gathering.

1.3 Research Questions and Objectives

This section presents the questions and hypotheses that are addressed and sets objectives thatshould be achieved in this research.

1. What are the main challenges, research gaps and problems in the area of IoT andOppS that this research can address? How is effective data collection important?The research challenge is an investigation of current challenges in IoT and the approachesand technologies recently used for developing the OppS systems consisting of smart mo-bile devices.Investigate state-of-the-art in IoT and OppS.

2. How to collect data from IoT devices in efficient manner? What should be done toenhance efficiency of data collection from IoT devices?The next challenge is to propose and develop a new approach for gathering real-time datafrom the IoT devices in energy-efficient manner.Develop an algorithm to collect data efficiently from heterogeneous sensing IoT devices

situated in the environment with a specific focus on built environments.

3. How effective is an approach proposed by this research?This objective involves the implementation of the proposed algorithm in the IoT-based

Page 15: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

14

IAQ monitoring system. Its performance is evaluated through conducting experiments onreal life scenarios.Evaluate the system implementing the algorithm in application to IAQ monitoring.

1.4 Research Contributions

Considering aims defined in previous section, the research contributions can be described asfollows:

1. Existing challenges in IoT were revealed to prove the relevance of this research. Recentsolutions in OppS systems were analysed to develop this research on top.

2. An algorithm called CollMule [24] was proposed and developed for efficient sensor datacollection using mobile smart device. It discovers nearby sensors, evaluates them con-sidering different metrics, selects a set of the most cost-efficient ones and collects datafrom them. Thereby, It prevents unnecessary attempts to connect to and gather data fromsensors which are inappropriate in terms of different requirements like distance, signalstrength, power level and accuracy (the colours of sensors illustrated on the Figure 1 meandifferent efficiency). Thus, it reduces the number of connections, that leads to decrease ofoverall energy consumption.

3. CollMule system [24] implementing the proposed algorithm was deployed and tested onreal life scenario. The obtained results were analysed to evaluate its performance.

The outcome of this research allows to reduce energy consumption and, in perspective, dataredundancy of the sensor data collection systems. Thus, one of the main benefits, the energy-and cost- efficient system we developed brings to its users, is a reduction of billing cost for theamount of consumed energy. In addition, our paper [24] was accepted to the 17th NEW2AN/ruSMART conference.

1.5 Research Methodology

This thesis follows a Design Science Research Methodology (DSRM) [25]. That represents aresearch process in six-steps iteration illustrated on the Figure 3: problem identification andmotivation; the objectives definition for a solution; design and development; demonstration

Page 16: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

15

of the product; evaluation; and communication through publishing the results. The steps aredefined in this research as follows:

Figure 3. DSRM Process Model [25].

1. Identifying and highlighting the main challenges in the IoT and OppS areas, and studyingexisting approaches that can be incorporated in CollMule system.

2. Defining objectives for the development of the CollMule system.

3. Design and development of the CollMule algorithm and system for addressing the identi-fied research problems.

4. Implementation of the CollMule system in application to IAQ monitoring and its demon-stration.

5. Evaluation of the prototype by testing it via collection of sensed data from real IoT de-vices and identification of possible shortcomings. Jump back to the third step for the nextiteration.In order to evaluate the prototype, its performing rate, power consumption and CPU usageof single algorithm cycle are measured. In addition, for comparison, a power and CPUutilization values of a commercial BLE connection application are provided. The Coll-Mule system is compared to a simple system where sensors broadcast messages whichare caught opportunistically by mule.

Page 17: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

16

6. Publishing results of the research.Our paper [24] will appear in proceedings of the 17th NEW2AN/ruSMART, St. Peters-burg, Russia, August 28-30, 2017.

1.6 Sustainability

Considering that PERCCOM program [26, 27] involves studies ICT for sustainable develop-ment it is important to highlight the sustainable aspects of our research work. In this section, weprovide the definition to the term sustainability in order to introduce it to the reader. Then, wegive an explanation of how our work contributes to it.

The modern concept of the term "sustainable development" is rooted to Brundtland Report [28]where it is stated that development is considered sustainable in case "it meets the needs of thepresent without compromising the ability of future generations to meet their own needs" [29].However, today it is oriented more on economic, social and environmental aspects of the mod-ern world development. Therefore, [30] has suggested that "the term ’sustainability’ should beviewed as humanity’s target goal of human-ecosystem equilibrium (homeostasis), while ’sus-tainable development’ refers to the holistic approach and temporal processes that lead us to theend point of sustainability." Consequently, a three-pillar or three-dimensions approach is ap-peared to describe it. Moreover, this method is used to analyse the role of new technologies insustainable development. We also describe the contribution of this thesis in terms of these threepillars.

Our project brings benefits to all three dimensions of sustainability:

• Ecological: it directly relates to reducing CO2 emission as it provides an efficient ap-proach for sensor data collection that will potentially decrease energy consumption of theIoT systems. In addition, this reduction leads to extension of battery life thereby decreas-ing wastes and the number of batteries needs to be recycled.

• Social: due to the power usage reduction the frequency of recharging user’s devices isreduced. Also, the user does not need to be concern about the memory space of the devicetaken for data collection because it is reduced due to data gathering only from sensorsproducing appropriate data.

• Economical: our work decreases the energy consumption, therefore, it reduces the ex-penses on natural resources which relate to economic assets. Furthermore, it enhances thequality of life through IAQ Monitoring.

Page 18: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

17

1.7 Thesis Outline

This section briefly introduces the following chapters of this thesis report.

• Chapter 2 provides literature review of works in the field of the Internet of Things andOpportunistic Sensing in order to reveal current challenges.

• Chapter 3 presents a new approach for sensor data collection proposed by this thesis.

• Chapter 4 describes an architecture of the proposed system and its components.

• Chapter 5 gives a detailed description of the system implementation and conducted exper-iments which results are also analysed there. In addition, it discusses the implementationcomplication and its limitations.

• Chapter 6 concludes the thesis outcomes and discusses future work that can be accom-plished to improve the proposed system.

Page 19: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

18

2 Background and Related Work

The previous chapter has introduced the research area of this thesis. That includes the Internetof Things (IoT) and Opportunistic Sensing (OppS) paradigms. This chapter introduces themto the reader. The IoT section gives definition to the paradigm and reviews its elements andapplications. The OppS section provides an introduction to the emergence of this paradigm, itsdefinition, and challenges. Moreover, the recently developed systems that address the OppS is-sues are reviewed here in order to determine a problem that has not been addressed yet. Further,this section discusses techniques that can cover the identified challenge. In addition, it considersapproaches that can be used to tackle this problem.

2.1 Internet of Things (IoT)

Internet of Things (IoT) plays a huge role in the modern world. It is a major enabling technologyfor future smart cities. In this section, we review this paradigm and its components.

2.1.1 IoT definition

The Internet of Things (IoT), or Internet of Objects [31], was proposed as a concept by KevinAshton in 1999. He referred it to interconnected objects with radio-frequency identification(RFID) technology [32]. However, there is still no exact definition of the IoT paradigm today.Many visions were presented during these years, some of them are discussed further. For in-stance, the Cisco2 Internet Business Solutions Group (IBSG) in 2011 presented it as the pointin time when the number of "things or objects" connected to the Internet exceeded the worldpopulation. Moreover, IBSG assumes it happened between 2008 and 2009 [31] (see Figure 4).

European Research Cluster on the Internet of Things (IERC) generally defines the IoT as "dy-namic global network infrastructure with self-configuring capabilities based on standard and in-teroperable communication protocols where physical and virtual "things" have identities, phys-ical attributes, and virtual personalities and use intelligent interfaces, and are seamlessly inte-grated into the information network" [33]. The definition of "things" changes with evolution ofthe technology depicted on Figure 5.

Authors of [1] highlight three perspectives of IoT visions:

2www.cisco.com

Page 20: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

19

Figure 4. The Internet of Things emergence between 2008 and 2009 [31].

Figure 5. The IoT evolution [32].

• Things-oriented - focused on the "objects" and on approaches for their identification andintegration;

• Internet-oriented - adapting IP to make anything addressable and reachable from any-where;

• Semantics-oriented - utilizing semantic technologies for data managing, storing and rep-resenting in the continuously growing network of things.

They state that the IoT is a combination of these visions [1, 34].

To summarise, the IoT implies an infrastructure of smart devices (e.g. smartphones, tablets,laptops etc.) connected to the world-wide network where they communicate and exchange data

Page 21: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

20

with other "objects". Moreover, it allows to sense and remotely control such "objects" as sensors[1, 35], and also process any received information without human intervention [36].

2.1.2 IoT elements

The IoT systems do not have standardized list of the components they can contain. However,[37] defines six elements which deliver the IoT functionality (see Figure 6):

Figure 6. The elements of the IoT [37].

• Identification within the IoT paradigm implies naming (setting an ID and address) andmatching services with their demand;

• Sensing means data collection from the network objects (smart sensors, actuators, wear-able devices) and send it to some central sink like database or cloud;

• Communication includes technologies linking all objects together while consuming lowpower like WiFi, Bluetooth, Z-wave, LTE-Advanced and etc.;

• Computation represents processing units (e.g. microprocessors and micro-controllers likeArduino, Raspberry Pi, Intel Galileo) and software applications (e.g. Contiki and TinyOS)which execute computational ability of "things";

• Services perform some work for different applications;

• Semantics refer to the ability of knowledge extraction (recognition and analysis of data)using different machines in a smart way [37].

The first three elements are also highlighted in [1] as a class of the enabling technologies. [36]also emphasized other five IoT components from the more high-level perspective:

• Radio Frequency Identification (RFID),

Page 22: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

21

• Wireless Sensor Networks (WSNs),

• addressing schemes,

• data storage and analytics,

• visualization.

Indeed, the first four technologies perform features of the communication, sensing, identifica-tion and semantics elements described above. Noteworthy, WSNs play one of the crucial rolesin the IoT paradigm as they bring a wide range of applications [1, 38] through capability ofsensing different environmental phenomenon. However, WSNs within the IoT paradigm differsfrom the conventional ones in terms of using more smarter devices instead of simple sensorsconstrained with only sensing abilities. These devices have computational ability and consist ofseveral different sensors. Therefore, they can make certain decisions autonomously and providedifferent services [39]. Further, in this thesis, they are called sensing IoT devices.

Thus, the elements defined by [37] can be considered as basic components of the IoT systems.Further, this thesis takes into account these components during development of the proposedsystem.

2.1.3 IoT applications

The wide capabilities of the IoT bring an opportunity to apply it in all spheres of human life in or-der to enhance its quality. The major areas where the IoT is currently being integrated are smarthomes/buildings, smart cities, environmental monitoring, healthcare, smart business/inventoryand product management, security and surveillance [40]. The general application scenario im-plies a system containing smart devices, sensors for different measurements communicatingwith each other and some central station via RF technologies like WiFi, Bluetooth Low Energy(BLE), ZigBee and etc. The station collects and analyses data from them. According to theanalysis, it can make some decisions and notify the system to perform some action. Thereby,the system needs a minimal human involvement to the data processing. There are still manyfields where the IoT can be introduced to contribute towards their improvement and automation.We have chosen to apply our system to indoor air quality monitoring.

Page 23: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

22

2.2 Opportunistic Sensing

Networking within IoT can be divided into infrastructure-based and opportunistic types. Theformer one uses fixed network topology with centralized data management. In contrast, thelatter one represents infrastructure-free and decentralized ad hoc networks [41]. Initially, op-portunistic networking (OppN) term emerged in Ad Hoc Networks. It allows communicationamong nodes which do not have a pre-established link between them, moreover, they mighteven be connected to different networks. Thereby, in OppN there is no need to know the net-work topology. However, the price of such networks is an extra delay in packets delivery, that istaken by conduction of the path towards a destination. Nevertheless, OppN can be exploited in awide range of delay-tolerant applications. For example, it can provide connection to the globalnetwork in rural and developing areas without existing networks [42]. Moreover, ad hoc con-nections can be easily established between the IoT devices using short-range radio technologieslike Bluetooth, WiFi and NFC to share information among them like in example described by[41].

Further, the idea of OppN is evolved to opportunistic sensing (OppS) paradigm in the era ofWSNs and the IoT paradigm. The main reason for this evolution is a possibility to collect dataabout an environment without any pre-defined infrastructure. For instance, OppS can be a con-nection of IoT devices to the global network in rural and developing areas. Furthermore, it isacceptable for the smart cities in the case when there is no need for real time communication.Even though, there is a delay in data transmission the OppS paradigm satisfies the IoT systemsfor data exchange between the IoT devices and platforms where the immediate delivery is notnecessary. For example, the fullness of a trash can is not an urgent situation as there are otheravailable cans nearby so the data can be reported to a sanitary department with a reasonablylong delay [43].

OppS is also popularly known as crowdsensing, community sensing or Mobile Crowd Sens-ing (MCS) [5, 44, 6]. The former term refers to the use of advantage brought by the crowd togather necessary sensor data from available mobile and wearable devices [6]. In fact, the nexttwo terms have the same meaning as crowdsensing. Community sensing is subdivided to par-ticipatory and opportunistic sensing. The first one requires direct involvement of users into thedata collection process. On the other hand, OppS is an almost autonomous process where deci-sions about participation in sensing are made by mobile devices with minimal user involvement[5, 6]. Such decisions are based on the situation defined by different conditions like sensingtask requirements and user context [6]. The MCS is just a broad name for community sensingparadigms coined in [5]. An increase in a number of smart devices carried and wearable bypeople brings an opportunity to use the power of the crowd in order to explore an environment.

Page 24: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

23

It became possible because these devices contain a diversity of sensing, computing and com-munication features. Thereby, they can produce data about environment themselves that can becollected for its further exploitation. Moreover, they can play the role of a bridge for linkingother objects to global network [5]. Thus, crowdsensing can cover a wide monitoring area indensely populated areas that can lead to reducing an amount of hardware and energy consump-tion.

Currently, there is no standard definition of OppS. Though, many research papers like [44,6, 45, 46] discuss it during recent years. A short and simple definition is provided in [47]:OppS "is seen as a way to gather information about the physical world in the absence of a stableand permanent networking infrastructure." That means data collection within a network with-out any pre-defined topology, moreover, which might change dynamically. Further, OppS havebeen broadly defined in [48] revealing its functions as "a paradigm for signal and informationprocessing in which a network of sensing systems can automatically discover and select sensorplatforms based on an operational scenario, determine the appropriate set of features and opti-mal means for data collection based on these features, obtain missing information by queryingresources available, and use appropriate methods to fuse the data, resulting in an adaptive net-work that automatically finds scenario-dependent, objective-driven opportunities with optimisedperformance." Fundamental steps involved to OppS procedures are data collection, storage, andupload [49]. Our study is mainly focused on the former process. The paper [50] highlightsthe main features of the OppS: sensing, transmission, analysis of big sensory data and decisionmaking. OppS systems face challenges like coverage [51], sensing quality [50, 49], resourcecost, privacy, security and data integrity [49].

In the following subsections, we describe existing data collection strategies and projects thattry to tackle the problems discussed above.

2.2.1 Data Collection Approaches

Most of the Opportunistic Sensing Data Collection (OSDC) frameworks follows one commonarchitecture called MULE (Mobile Ubiquitous LAN Extensions) three-tier architecture [52] (seeFigure 7). It is an abstraction of three layers that can be adapted to different scenarios.

• A top tier represents the devices providing access to the global network. The role ofsuch devices can be played by access points (APs)s which are deployed in the convenientlocations with network connectivity and power supplier. They allow to synchronise thedata collected by middle layer with the central data station.

Page 25: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

24

Figure 7. The MULEs three tier architecture [52].

• A middle one is composed from moving agents called mule nodes that are mobile deviceshaving a larger storage capacity comparing to sensor nodes and short-range wireless radiotechnology to communicate with the sensors and networked APs.

• A bottom tier consists of static wireless sensor nodes which are randomly distributedwithin an area.

The number of tiers in this abstract architecture can merge into one device. For instance, usingLTE mobile smart devices can play as the top and intermediary levels. Moreover, for the modernnetwork topologies, we can interpret the top tier as central stations like servers and clouds. Thisarchitecture corresponds to opportunistic sensing idea about collecting data without a definednetwork infrastructure. Notably, the data mule systems are considered as energy conservationmobile-based scheme in WSNs [53]. The system architecture of OSDC projects presented inthe Table 1 relate to the MULEs three-tier architecture.

Many research works addressed the OppS challenges mentioned previously, we review someof the recent ones. These projects use mobile devices to collect data opportunistically. For in-stance, the authors of [54] evaluate two BLE approaches using smartphones for OSDC. Theyare advertisement- and connection-based. In the case of the former approach, a sensor nodebroadcast packets including information about itself and fragments of the sensed data. While,in the latter method, these packets contain only sensor information. Such messages are calledadvertisements in the case of both approaches. The data is transferred in the connection-basedmethod after establishing a connection. Moreover, this paper proposes models of analyticalcurrent consumption, sensor node lifetime and a maximum amount of collected data. They are

Page 26: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

25

Table 1. Related Works.

Project names LocationCommunicationTechnologies

Used

DataGathering

Device

ProblemsAddressed

Algorithm forData

Collection

SystemPerformanceEvaluation

OpportunisticSensor DataCollection

withBluetooth

Low Energy[54]

outdoor BLE smartphonespower

consumptionestimation

no

via theoreticalcalculation of

the currentutilization

DataCollectionAlgorithm

Based on theSamplingFrequency(DC-BSF)

[55]

outdoor not specifiedmobilesensingdevices

coverageeffectiveness,

dataredundancy

regiondivision

algorithm,estimates howfrequently togather data

via estimationof coveragerate and dataredundancy

WiFi-Amber[46]

outdoor/indoor

WiFiDirect/Hotstop

smartphones

privacy,security, user

resourceutilization and

sensingeffectiveness

no N/A

SCmules [43] outdoor not specifiedmobilesmart

devices

data value,memory

utilization

no, however itweighs

gathered datato detect lessvaluable to

discard

via measuringcollection ratewith respect tostorage limit,

time andnumber of

data centres

SenseMyCity[45, 56]

outdoorBluetooth,

WiFi and GPSsmartphones

data upload,urban

movementdetection,

privacy andsecurity,

participantengagement

no

via measuringnumber ofdays using

SneseMyCityapplication,number of

sessiongathered perparticipant,day time.week day

Gateway[57, 58]

outdoor

WiFi,Bluetooth,

ZigBee,3G/LTE

smartphones

integration,harmonizationand interoper-

ability ofdifferent com-

municationprotocols and

standards

no

via measuringCPU,

memory,battery usage

CollMuleindoor/outdoor

short rangeradio

mobilesmart

devicesresource cost

algorithmselecting a set

of mostcost-efficient

neighbors

via measuringlatency,energy

consumptionand CPU

usage

Page 27: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

26

based on a real behaviour of BLE devices. S. Aguilar et al identified that sensor node lifetime forthe advertisement-based approach is four times longer than in connection-based one. However,the data amount that can be transmitted during contact in the former method is really limited toless than 42 kB. Moreover, in terms of energy consumption per collected bit connection-basedis more efficient than the advertisement-based one. The project does not implement an OSDCsystem in the real world scenario. The approaches are evaluated using the proposed theoreticalmodels.

Y.Ma et al in their paper [55] target to increase network coverage and decrease data redun-dancy in an application where mobile sensing devices embedded into taxis to collect data aboutenvironment, as in such networks the nodes are not uniformly distributed that causes bad cover-age in the sparse regions where taxis drive frequently (e.g. shopping malls, airport, train station,etc.) and data redundancy in the opposite kind of regions. Also, it is supposed to improveresource consumption by reducing the amount of data to collect. The authors propose a datacollection method where they use two algorithms: Region Division Algorithm (R-DA) and DataCollection Algorithm Based on the Sampling Frequency (DC-BSF) that they developed. Theformer divides an entire area of interest on three regions grading them depending on the densityof vehicle trajectory. This is calculated by counting a number of trajectories in each cell grid(the smallest unit of the area) considering the pre-sampling data. To identify the rate of similar-ity they use the traditional K-means clustering algorithm. For the second algorithm, the authorsof [55] assume that in their network each sensor stores dynamically changing information ta-ble with its current location, sampling frequency and data to collect and transmit. Thereby, itchecks the region and sampling interval grade of its location. Then it exchanges data with othersensors in the region and checks a content of the current grid data. The paper [55] simulatesthe network to verify the performance of the latter algorithm. It measures coverage rate anddata redundancy according to the co-efficiency of the sampling frequency. The results show thatits data redundancy outperforms the alternative algorithm significantly when the coverage ratedifference is negligible.

Another framework is WiFi Amber [46] that is a missing object tracking system involving

• device with WiFi communication playing role of a tag to an object like WiFi beacon;

• smartphone apps for reporting about missing object and tracking them (on the devices ofusers who request for missing object and users who volunteer to track it);

• and cloud server for managing the system.

The application on a volunteer’s smartphone works autonomously and is activated when re-

Page 28: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

27

ceives a signal from the cloud server. WiFi Amber uses WiFi Direct to have efficient sensingcoverage. In order to enhance energy efficiency, it applies WiFi "probe request" and "proberesponse" mechanisms based on a particular Service Set Identifier (SSID). Thereby, when vol-unteer app receives a request from the server, it broadcasts a probe request with specified SSIDof a missing object and waits for a response from a tag with matching identity. In addition, WiFiAmber propose a cryptographic key system to keep privacy and make the tracking secure.

SWDCP-SCmule scheme [43] (Social Welfare Data Collection Paradigm based on Storage-Constrained Oblivious Data Mules) propose a system where mobile smart devices called mulescollect data from nearby sensing devices embedded in Smart City infrastructure and carry it untilhaving an access to a data centre to upload the data there, which then notifies responsible depart-ment to proceed appropriate actions. The project addresses memory limitation of the mules anddata redundancy with respect to the data centres. To deal with former one the authors proposedto weight the collected data, therefore they assign unique priorities to the smart devices formingthe priority table. Using it SCmules identify data that needs to be stored of discarded based ongreedy principle. Moreover, the system also assigns priority to the mules in order to minimizesimilar data uploaded to the data centres. The priority assignment is made using Simulated An-nealing for Priority Assignment Algorithm (SA-PA algorithm) that is proposed in [43]. It setsthe priorities automatically assuming optimization targets and SCmule’s location that is learnedfrom its past trajectory using a machine learning method called metaheuristics. In this paper,the performance evaluation of the system proves that the proposed algorithm assigns prioritiesproperly by dint of experiments on datasets with respect to three different optimization targetswhere the degree of enhancement provided by it is compared with respect to the storage limit,time and the number of data centres in Smart City. Moreover, comparison of SCmules to muleswithout storage-constraint shows that the good priority assignment obtained by SA-PA algo-rithm allows diminishing the bad influence of storage-constraint. Consequently, the use of thisalgorithm can reduce the redundancy rate, thereby increasing the energy efficiency and networklifetime.

SenseMyCity is an opportunistic MCS tool used for exploring urban life processes [45, 56]run since 2011. The system consists of devices that sense the surrounding environment andthose that gather the information from former ones via Bluetooth, and a server where all datais forwarded [56] opportunistically via WiFi. The project intends to provide an energy effi-cient, private and secure data collection framework with minimal user interaction. However, theperformance of this system with respect to energy effectiveness seems to be lower than of theprevious system, because it only uses an opportunistic technique to gather information. Here,the problem of data collection from cheap and inaccurate sensors that meet most of OppS plat-forms is solved on a data processing stage that is done on the server side, while it does not

Page 29: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

28

assume the problem of data similarity at all. That leads to inefficient use of bandwidth andconsequently battery power. Nevertheless, in the recent paper [59] the creators of SenseMyCityconfirm that data collection and storage needs to be optimized.

The authors of [57, 58] propose a smartphone-centric system called Gateway. The role of gate-way between sensing technologies and the Internet and Cloud connection belongs to smartphoneapplication which is able to interact with surrounding technologies using multi-communicationstandards, opportunistically gather and distribute data and dynamically provide services. Thisframework aims to make interoperability between devices having different communication in-terfaces like Bluetooth, WiFi, 3G/LTE and ZigBee. It does not follow any algorithm to collectdata. It simply connects to the nearby devices. The performance evaluation of the softwareapplication is done by measuring the CPU, memory and battery utilization on different smart-phones in low and high load scenarios. It reveals the energy consumption limitations. Theauthors suppose that development of more efficient hardware of radio interface and the batterywill be a solution. However, they have not assumed a lot of factors that effects on the perfor-mances in terms of the power exploitation like bandwidth usage and data redundancy. As theprevious project, it does not consider using efficient methods for gathering data.

The research projects described above belongs to data collection frameworks using OppS prin-ciple that means connection to and gathering data from nearby devices in the networks withoutany pre-defined topology. All of them aim to cope with different challenges that OppS systemsface like storage and energy constraints, coverage, privacy, and security. We have noticed thataddressing the first two problems they mostly try to reduce the amount of redundant data in or-der to decrease memory usage on the gathering devices and bandwidth during transferring thisdata to the server or cloud. However, they do not consider that communication between sensingand gathering device also consumes the significant amount of energy. We believe that the ef-fectiveness of data collection can be enhanced on this stage. For this purpose, the mobile smartdevice should gather data selectively only from the cost-efficient sensing devices. Thereby, thenumber of needless connections and the amount of redundant data can be diminished. To thebest of our knowledge, there are no projects that offer something similar for OppS in IoT.

In the next subsection, we consider different techniques that can be used to solve the identi-fied challenge.

Page 30: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

29

2.2.2 Techniques for cost-efficient sensors identification

Our intention is to develop an efficient approach for data collection from sensors using datamules. We suppose that sensors which data should be collected must be cost-efficient withrespect to the data collector. It means that the latter does not waste its energy on trying to gatherdata from sensors which are too far to connect or not reliable. Thereby, considering that the mulemoves in space and time it needs to determine a set of sensors which corresponds to a certainlevel of reliability at that moment. Thus, it can be related to similarity problem as the sensorsmust meet the same requirements. There is an existing approach for searching similar (closest)objects to a Point of Interest (POI) called k nearest neighbour (kNN) query. It is widely usedin WSNs for performance optimization aimed to reduce power consumption of sensors, theirvulnerability to failure and variation of their availability [60]. A brief description of kNN queryand its processing techniques are introduced here.

kNN queries Initially, kNN query was used in database applications for searching similaritiesefficiently [61, 62]. In WSNs it is also found to be useful for energy efficient aggregationof sensor data. kNN query discovers k closest sensors to a POI called query point [60]. Ingeneral, kNN query processing approaches can be classified as 1) infrastructure-based and 2)infrastructure-free. The former ones rely on a network infrastructure for query propagation andprocessing. The infrastructure-free class does not depend on any pre-established infrastructure,instead, it uses well-designed routes in order to collect data [63].

1. Routing phase;

2. kNN boundary estimation phase;

3. Query dissemination and data collection phase [64]

Below, we discuss some of the methods which main phases are summarised above.

kNN is actively proposed in many research studies as an approach for determination of thecost-efficient sensors in WSN starting from the previous decade. Here, we discuss some of suchworks [65, 66, 67]. For instance, Winter et al [65] propose a partial infrastructure-based two-dimensional kNN algorithms namely the Geo Routing Tree (GRT) and the kNN Boundary Tree(KBT) to identify energy efficient sensors. The former has a good trade-off between energy andquery accuracy, however, it is not suitable for dynamic networks thereby it is not suitable formodern WSNs. At the same time, KBT is far better query latency and energy consumption in

Page 31: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

30

dynamic networks. Moreover, it consists of three phases which include different approaches.There are two energy efficient techniques are proposed in [65]: the single root (KBT SR) andthe perimeter tree (KBT PT) which use "TreeHeight". Unfortunately, the drawback of KBTSR is that poorly set timers can either reduce the accuracy of the kNN results or unnecessarilyincrease the query latency. Though the KBT PT attempts to balance the tree to improve queryaccuracy since the timers are set based on a fixed estimate of the height of the tree, it does notsolve an issue of a short life time and the low accuracy yet.

3DkNN algorithm [66, 68, 69] is based on data mule and implemented over three-dimensional(3D) sensor space rather than most kNN algorithms that deal with two-dimensional (2D) spaces.Further, the main difference of 3DkNN algorithm is that data mule is both the centre point forquery origination and the point-of-interest, in opposite to the algorithms described above whichuse the base station (sink) as a central point for query origination which reaches a sensor closeto the point-of-interest. The mobile data mule employs kNN to select a subset of sensor nodesaround it [66]. The cost of collecting data from this subset is minimum compared to any othersubset of nodes around the data mule. The 3DkNN’s novelty lies in the dynamical computationof k size set of cost-efficient nearest sensors around the mobile data mules using KNN-METRIC.That allows considering the metrics pointing out to sensor’s efficiency such as Signal to NoiseRatio (SNR) and distance.

KNN −METRIC = cα× SNR

β ×Distance(D)(1)

where c is constant, α and β are pre-assigned weights obtained experimentally.

The algorithm was simulated using Cooja and Contiki and evaluated considering metrics asquery latency and energy consumption. Moreover, its performance was compared with KBT

a) b)

Figure 8. a) energy consumption b) query latency comparisons of 3DkNN with KBT [66].

algorithm discussed above. According to the results in [66], the 3DkNN outperforms KBT interms of energy consumption and query latency (fig. 8).

Page 32: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

31

Y.Komai et al in their paper [67] propose two beacon-less (without broadcast messages con-taining information about the device forwarding them) methods processing kNN query in Mo-bile Ad-Hoc Networks (MANETs). It uses a three-way handshake transmission to identify thequery. First, query-issuing node broadcast a kNN query to identify the closest node to it whichbecomes its global coordinator. Second, this node gathers information about other nodes in thenetwork following two different approaches: Explosion (EXP) and Spiral (SPI). In the formerone, the coordinator broadcast query request within a particular area defined by the density ofnodes in the entire network. The receiving nodes reply to it with information about itself, that isthen transmitted to the query issuing node. The second method does not require the pre-definedregion to send a query message. However, it is assumed that the entire network area is dividedinto a set of cells. The global coordinator forwards the query in a spiral manner to the nodeslocated close to the centre of the nearest cell. These nodes are called local coordinators. Theyforwards query with collected information about the nodes within their cell further to the nextcell in the spiral. The node which eventually obtains the kNN result transfers it to the queryissuing node. The simulation experiments conducted in [67] show that the beacon-less methodsdecrease a bandwidth usage but it takes more time for query identification than in the methodsusing beacons. The authors claim that their approaches can also retain the accuracy of the queryresult while quick movements.

kNN query in the IoT context We see a perspective of using kNN query for efficient datacollection from sensing IoT devices (sensors) in order to address the OppS challenges related toresource cost. kNN query processing algorithms allow gathering data only from cost-efficientsensors. The "cost" here might depend on different indicators like distance, reliability, accu-racy, sustainability, scalability, usability, security etc. Thus, it reduces the energy consumed onattempts to connect the sensor nodes which are too far for establishing a connection, do nothave sufficient battery level to transfer data or have inappropriate data. According to the OppSprojects discussed in the previous subsection, the mobile smart devices gather data from nearbysensors. The word "nearby" there means the sensor nodes which are visible in the communi-cation radio range. However, "visible" does not mean that they are connectible (e.g in BLEsmartphone can discover the sensors which have a low signal level, however, that can not beconnected), so attempts to connect such modes are just energy and time waste. The same situ-ation is with the sensors which have a really low battery level that can lead to data loss. Also,the sensor nodes which are usually used in the modern networks are cheap and unstable thatmeans sometimes they can produce unreal data. Therefore, considering these metrics we cansave power and memory. The discussed kNN algorithms determine the physically nearest neigh-bour sensors using one or two indicators. Though, 3DkNN allows using multiple indicators it

Page 33: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

32

remained just in theory. Our idea is to use kNN query concept considering different metrics inorder to retrieve a set of the most cost-efficient sensors. Collecting data from this set can tackleresource cost in OppS systems.

2.2.3 Multiple Criteria Decision Making

The algorithm proposed in this thesis considers several indicators for determining k size queryof the most efficient sensor nodes. This is a complex process that relates to Multiple Crite-ria Decision Making (MCDM) problem. In the MCDM, decisions about choosing or rankingalternatives are made through evaluation of different criteria that is a hierarchical structure ofattributes. In this case, it is inappropriate to directly exploit the conventional methods based onweighted sum. Moreover, some of the attributes might not be numerical (e.g security). Makingdecisions involves finding trade-off among several criteria conflicting with each other. Thereare many techniques developed to solve MCDM problems like Multiple Attribute Utility The-ory (MAUT) [70] and outranking methods [71, 72].

MAUT-based approaches introduce different preferences as multiple attribute utility functions.They combine utility functions with criteria weighting functions for each criterion. After suc-cessfully assessing the utility function, it presents a problem as a single objective function whichis a privilege of using MAUT. Thereby, it ensures that the best compromise decision is achieved.

The principle of outranking approaches is to scale a dominance of one alternative over an-other, instead of identification of a single best choice. So, outranking identifies the preferenceof one solution over another through a comparison of alternatives performance for each crite-rion without user prescribed scale. Generally, such types of approaches are applied in cases ofcomplicated aggregation of criteria factors measured in incomparable units. Their implementa-tion is quite complex compared to other MCDM methods. Moreover, they often do not reach adecision [72].

Considering our MCDM problem, we give our preference to MAUT-based approach. AnalyticHierarchy Process (AHP) [73] is one of the widely used MAUT-based approaches, solving theMCDM problems. It was developed by T.L. Saaty in the 1970s then broadly investigated andimproved [74]. This tool can deal with qualitative and quantitative data as aspects of MCDMproblems. It simplifies and organises complicated problems by quantifying and relating theirelements to general goals with consideration of alternative solutions. Thus, AHP transformsa complex problem to hierarchically arranged structure [74, 72]. It uses pairwise comparisonsof the factors that allow determining the compromise among criteria. Its major advantage over

Page 34: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

33

other methods solving MCDM problems that intuitively appeals decision makers is a verifica-tion of inconsistencies in the evaluation of criteria and alternatives that decreases unfairness indecision making. There is a variety of application fields for this method in MCDM situationslike the ranking of cloud computing services [72], analysis of environmental issues [75], se-lection of websites, evaluating tools, e-business, drugs selection and others [74]. Thus, we useAHP in this thesis for ranking sensors in order to identify a set of the most cost-efficient ones.We give definition to AHP and describe processes involved to model the ranking problem in thenext chapter.

2.3 Summary

This chapter has discussed the IoT and OppS paradigms in details. It has reviewed several worksdeveloped in this domains. Due to this, we identified a gap of these systems. They do not utilizeany specific approach to collect the raw data from sensing actuators to enhance the efficiencyof their system. In the implementations, they used to collect data with mobile smart devicesfrom nearby sensors thereby applying OppS paradigm. They do not consider that these sensorsmight produce low accuracy data or even are not connectible because their signal strength istoo low. However, the introduction of an approach that identifies efficient sensors can improvethe effectiveness of this stage in the IoT systems. This idea came to us while reviewing thetechnique widely used in WSNs called kNN query that selects the k sensors from which thedata is collected. Mostly, we have inspired by 3DkNN that uses a mobile smart device to collectthe data. Moreover, we have chosen a method that helps to enable our idea of ranking the sensorsthat are available in radio range and then pick k top sensors to collect data from.

Page 35: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

34

3 CollMule Algorithm

The previous chapter provides a comprehensive literature review that investigates the currentchallenges in the Internet of Things (IoT) and opportunistic sensing (OppS) paradigms. Thus, itdefined the research problem of this thesis which is a reduction of energy consumption. More-over, Chapter 2 presents the existing approaches that can be utilized in the development of oursolution. This chapter describes our method that addresses the problem on the data collectionstage where mobile devices collect data only from the most cost-efficient sensors regarding thesystem requirements.

3.1 Introduction

In this section, we propose an algorithm named CollMule for collecting data from sensing IoTdevices situated in the surrounding environment using mobile smart devices. The former appli-ances are also called sensors here, while the latter ones are called mules or collectors. CollMulealgorithm is inspired by 3DkNN algorithm [66]. It considers three-dimensional space (see Fig-ure 9) and different metrics to select the most cost-efficient k size set of sensors. Following

Figure 9. Sensor selection in a three dimensional area.

KNN concept, our algorithm consists of three phases:

1. Discovering phase implies gathering initial information about sensing IoT devices;

Page 36: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

35

2. Ranking phase - ordering the devices considering different metrics;

3. Collecting phase - obtaining data from the k most cost-efficient devices.

During the first phase, a mule discovers surrounding IoT devices by listening for radio channelswhere they broadcast messages informing about their presence. Such packets usually containdata about the device like name, signal strength, radio power, manufacturer data, services thedevice provides etc. In our algorithm, it is assumed that they include metrics for the rankingphase that are discussed in the next section. Then, CollMule ranks the devices from the lessto the most cost-efficient ones using the metrics retrieved from these messages. The last phasedetermines a k size (number of devices) set of devices to collect data from. Further, the muleconnects and reads the sensed data from them. The optimal k size is found by experimental testsin Chapter 5.

3.2 Metrics

There are many different metrics which may play important role in the estimation of the IoTdevice performance as mule’s neighbour. For example, they can be location, distance, batterylevel, sensor accuracy, received signal strength indication (RSSI), link quality indication, packetdelivery rate, packet error rate [76], data size and etc. Here, we use only a few of them whichare described below.

• RSSI describes the wireless signal strength through measuring power of the receivedsignal. Usual unit used is decibel-milliwatts (dBm).

dBm = 10 × log(P

1mW) (2)

The signal is stronger when its RSSI value is higher. RSSI is automatically determinedby wireless receivers. As It is measured differently on various devices, it is useful forassessment of the environmental effect on a specific radio chip.

• Distance here estimates how far are IoT devices from the mule. To calculate it, we con-sider coordinates in three dimensional space and use geometrical formula:

DistanceD =√

(X2 − X1 )2 + (Y2 − Y1 )2 + (Z2 − Z1 )2 (3)

It impacts on latency (the time taken to collect data from a device) which effects itself onenergy consumption. Hence, the shorter distance, the less power is consumed to get the

Page 37: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

36

data.

• Sensor Accuracy. Modern sensors embedded into IoT devices are still unstable, as theysometimes do not work properly, return errors or zero values. Whereas, in the data col-lection it would be wasting of energy and time on connecting to and trying to obtain datafrom a sensor which currently does not provide proper measurements. Therefore, sensoraccuracy is an important metric in the computation of the efficient devices. Generally,accuracy is defined as "the amount of uncertainty in a measurement with respect to anabsolute standard" [77]. Sensor accuracy is the maximum difference between the valuemeasured by primary or good secondary standard and the output value of the sensor. Itcan be expressed in percentage or absolute value [78].

• Battery Level. It is another significant factor to consider for evaluation of the deviceperformance. Its impact can be interpreted different ways. We can assume that deviceswith the higher level should be graded as more efficient because the devices having lowpower should remain alive until recharging. On another hand, the low power can be analarm for gathering data from such device in first order, however, it must be enough forsuch action. Thus, we take a second assumption considering the minimum amount ofenergy with that the data collection is possible. As there is no standard battery levelestimation mechanism on the IoT devices we use for our testbed, we have developed itsmodel which is described next.

3.2.1 Battery Level Estimation Model

Nowadays, we have to be concerned and aware of the ecological and environmental situationon our planet. Many years people threw away used hardware polluting lands with poisonousemissions like lead, sulphuric acid, and cadmium [79]. Especially, it relates to batteries whichare power limited. Thereby, they become unusable in short time and are thrown in big amounts.Consequently, rechargeable batteries replace regular ones today. Although they must be also re-cycled, their utilization reduces the amount of waste. Therefore, we consider exploiting reusablebatteries for modelling battery consumption in this project.

Battery capacity represents a period of time during that it can provide a given current. It ismeasured in Ampere-hours (Ah). Different battery manufacturers measures their own way. It isimportant to notice that the capacity of rechargeable batteries tends to diminish every time theyare recharged. Moreover, such factors as temperature and current consumed impacts consider-ably on time it can last [80]. In this thesis, we do not consider temperature effect as it usuallydoes not exceed storage and charging temperature range of the most types of batteries in the

Page 38: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

37

buildings. Moreover, it requires a good knowledge of chemistry and complex computations.Also, we assume to use power bank of 5000mAh [81] (BatteryCapacity) with lithium polymerbattery which residual capacity (RisidualCapacity) might lose 0.1% of full capacity per monthwith discharging at 100% and recharge every 24 hours. The recharge life is approximately 300- 400 cycles at 100% of discharge [82]. We estimate the power level following this formula:

BatteryLevel =ResidualCapacity

BatteryCapacity × 0 .8× 100% (4)

where ResidualCapacity is battery capacity remained after some consumption. We also con-sider that 20% is utilised by charging/discharging process. Further, the battery consumption ismodelled assuming that energy is used on CPU, sensing and communicating processes.

Communication modelling Before modelling, we have to choose a type of communication tobe used in this thesis. Among available short range radio technologies, it is the most preferable,as e.g while using WiFi Direct on the smart mobile devices it prohibits using WiFi for Internetaccess. Another technology that can be used is ZigBee or NFC, however, the additional hard-ware needs to be deployed in the most cases, as modern smart mobile devices do not supportZigBee and the same with sensors and NFC. Therefore, in our model, a mule uses BluetoothLow Energy (BLE) to interact with IoT devices. BLE, also known as Bluetooth SMART, isan evolution of Bluetooth Classic focused on low-powered devices. [83] described a full ar-chitecture of this protocol. Here, we review the two lowest layers which allow the low-levelcommunication between devices. Physical Layer represents 40 Radio Frequency (RF) channelsin 2.4 GHz band used for broadcasting and other 37 channels for bidirectional data exchangebetween devices connected to each other. Link Layer is where the interaction occurs. There aretwo patterns of communication in BLE protocol:

1. advertisement based - when the data is broadcasted using advertising packets;

2. connection based - the bidirectional data exchange takes place after establishing a con-nection;

In the context of CollMule algorithm, we use the second pattern. A mule scans to discoversensors nearby which advertise their availability through three RF channels in series to avoidinterference. The scan period called scanInterval takes a fixed time T during which the mulelistens to advertising messages for a fixed period Ts (scanWindow). After these, the mule stopsscanning for a while. The sequence of broadcast packets is transmitted by sensors (advertisers)within the time span called advertising event (advEvent). The time period between them equals

Page 39: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

38

to the sum of advertising interval (advInterval) and advertising delay (advDelay), whereby theformer has a standard time range from 20 ms to 10.24 s which might be configured; and the laterone differs from 0 to 10 ms in uniformly distributed way implied to avoid synchronisation withother advertisers.

After the mule discovers accessible sensors, it connects to a selected sensor which is derivedusing CollMule algorithm described previously. The connection happens through sending arequest to connect (Connection Request) from the mule to sensor which is supposed to listenfor possible incoming messages. The sensor establishes a connection after receiving the requestmessage defining it. Here, the mule and sensor play roles of master and slave respectively. Thereis a wait time of 1.25 ms and then delay in master’s data packet sending (TransmitWindowSize)considered.

In our case, mule sends a data request to the sensor which replies with a message consistingthe measured data. The request is sent at the time called connection event. If there is more datato be exchanged the connection may continue. By the standard, an Inter Frame Space (IFS) timeof at least 150 µs must be guaranteed between data messages transmission. It is assumed thatsensor’s radio is turned off to save energy till the next event. Another important parameter tobe considered is the period between connection events (connInterval) ranging from 7.5 ms to 4s. Finally, the connection fails if the time period called connSupervisionTimeout is surpassedsince the last packet was received. This parameter adopts values from the span between 100ms to 32 s, and equals to or is greater than connInterval. In our scenario, the connection breakfollows as soon as sensor data is received by the mule.

Battery Residual Capacity Estimation An IoT device sends advertising packets with fre-quency fadv meanwhile it stays in receive mode waiting for a possible incoming request for aconnection. When a mule requests to connect the device, the advertisement is interrupted.

Figure 10. Illustration of periods involved in the calculation of the power consumption of our model.

Page 40: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

39

Capacity remained after some time of current consumption is computed as follows:

ResidualCapacity = BatteryCapacity − Discharge (5)

where the last is a battery consumed during the time spent in advertising and connecting (in-cludes connection, measurement reading and disconnection) modes that is estimated as:

Discharge = Qadv +Qconn (6)

where Qadv - discharge by advertisement; Qconn - discharge by connection. Both advertisingand connecting modes are described next following the same order.

Figure 11 demonstrates the processes performed during advertising mode. Considering themwe can derive a formula for the discharge estimation that is:

Figure 11. Illustration of advertising period.

Qadv = Iadv × Tadv (7)

where the last is an advertising period that is a time taken by a BLE device to advertise itsaccessibility and services; Iadv - current used during advertising period. Here, we use partiallythe current consumption model proposed in [54] to calculate the currents. We can see from thefigure above that during Tadv there are two actions which the device performs: broadcastingof advertisement message in three channels in series with waiting time to receive requests andsleeping that is a mode when the radio is off. Thus, the period and current can be derived withfollowing formulas:

Tadv = Tact + Tsleep (8)

where Tact and Tsleep are action and sleep time respectively.

Iadv =IactTact + IsleepTsleep

Tadv(9)

Page 41: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

40

where Iact and Isleep are current consumed during action and sleep time respectively.

Qconn = IconnTconn (10)

where Iconn - current used in connection DC; Tconn - connection period; From Figure 12, we

Figure 12. Illustration of connection period.

can see that the connecting mode involves many processes. Here, the sensing device playsa slave role and a mule is a master as it initiates the connection. Thus, the device receivesa Connection Request from the master which interrupts the current advertising mode at timeTadvInterr calculated following the next formula.

TadvIterr = Twu + Tpre + (N + 1

2)(Ttx + Ttx−rx) + (

N − 1

2)(Trx + Trx−tx) (11)

where Twu - radio wake-up time; Tpre - radio preparation time; Ttx - transmission time; Ttx−rx -time of switching from transmission to receive modes; Trx - time in reception mode; N - numberof advertisements in the interrupted advertising event. It is assumed that the mule might hearany of them with the same probability.

Considering current consumed during each of periods noted above we can calculate the cur-rent consumed while advertisement interruption.

IadvInterr =IwuTwu + IpreTpre + (N+1

2)(ItxTtx + Itx−rxTtx−rx) + (N−1

2)(IrxTrx + Irx−txTrx−tx)

TadvInterr(12)

Then, the link between the devices is established. This phase includes the request transmissiontime (TCReq), IFS interval (TIFS), the wait time (Twait) and a time up to Transmit Window Size(TTWS) before the first packet is sent by the mule playing master role. The following formulas

Page 42: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

41

can be used for time (Tsetup) and current (Isetup) calculation that describe these processes.

Tsetup = TIFS + TCReq + Twait + TTWS (13)

Isetup =IIFSTIFS + ICReqTCReq + IwaitTwait + ITWSTTWS

Tsetup(14)

After the connection has been established, the master and slave start to exchange data. Thesecan take a number of round trip interchanges depending on how many services and characteristicthe master needs to read. The next formulas define the processes involved here.

TRT = TMS + TSM + 2TIFS (15)

IRT =IMSTMS + ISMTSM + 2IIFSTIFS

TRT

(16)

where TRT - time of round trip exchange between the master and the slave; IRT - average currentconsumed during a round trip exchange between the master and the slave; MS and SM meandata channel packets transferred by the master to the slave and opposite way respectfully.

As soon as the data exchange ends and the link between the mule and IoT device breaks, thelatter detects that after connSupervisionTimeout (cSTO) time expiration. During this time itsradio remains active in receive mode waiting for another message from the mule. Then, there isa post-processing stage when the radio is turned off. Thus, the connection time and current arecalculated as follows:

Tconn = TadvInterr + Tsetup + TRT + Toff + Tpost + TSTO (17)

Iconn =IadvInterrTadvInterr + IsetupTsetup + IRTTRT + IoffToff + IpostTpost + IrxTSTO

Tconn(18)

So, the current consumed during connection is obtained by plugging equations 12, 14, 16 to theequation 18.

3.3 Ranking

We rank the available devices considering multiple metrics. As it has been discussed in the pre-vious chapter, we use Analytic Hierarchy Process (AHP) [84] for this purpose. That is intendedto tackle Multiple Criteria Decision Making (MCDM) problem like, in our case, selection of themost cost-efficient sensors considering several metrics.

Page 43: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

42

3.3.1 AHP definition

Basically, AHP sets priorities to different options and the criteria exploited to assess the former.In most cases, the criteria are scaled in different units like distance in meters and Received SignalStrength Index in decibel-milliwatts and even can have no unit of measurement. Obviously, thedifferently scaled criteria cannot be directly correlated. Thereby, they must be reduced to a uni-fied scale. Priorities of criteria are obtained considering their importance in terms of achievingthe goal, next alternatives priorities are obtained considering their performance on each crite-rion. Obtaining of these priorities is based on pairwise comparison of reduced criteria. Finally,overall priorities considering the contribution of each option to the goal are derived through aweighting and summation process [85].

The first step of AHP is to define problem structure in a hierarchical way. Then, ratio scaleis used to generate and synthesise priorities of alternatives. It is "a set of numbers that is in-variant under a similarity transformation (multiplication by a positive constant)." Its idea is tostandardize the weights of a whole set of objects using normalization in order to read themindependently from units of measurement [73]. The derivation of the relative ratio scale is per-formed from a matrix of pairwise comparison judgements. Such matrices are constructed foreach hierarchical level. Below, we state the main definitions in AHP taken from [74].

Definition 1. Assuming (E1, ..., Ei, ..., En) are n decision elements, the pairwise comparison

judgement matrix is denoted as Mn×n = [mij ], which satisfies:

mji =1

mij

(19)

where each element of mij represents the judgement concerning the relative importance of de-cision element Ei over Ej . The principal eigenvector of the matrix is calculated next.

Definition 2. Eigenvector of n×n pairwise comparison judgement matrix can be denoted as: ~w

= (w1, ..., wi, ..., wn)T , which is calculated as follows:

Aw̃ = λmax w̃ , λmax ≥ n (20)

where λmax is the maximum eigenvalue in the eigenvector ~w (vector of weights [86]) of matrixMn×n [74].

Some inconsistency in judgement is allowed because human does not always make consistentdecisions. The consistency can be checked by calculating consistency index (CI) derived from

Page 44: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

43

the principal eigenvalue, and consistency ratio (CR). It must be done before transforming thevector into the weights of elements. It is proved by Prof. Saaty that the maximum eigenvalueof a consistent reciprocal matrix equals to its size (λmax=n). Thus, CI and CR are formed asfollows:

CI =λmax − n

n − 1(21)

CR =CI

RI(22)

where RI is a random consistency index given in the table 2. These index values are averagerandom consistency index of 500 sample sized matrices generated by the professor using fun-damental scale values and their reciprocals upon the condition that it is about 10% or less [85].

Table 2. Random Index (RI) [86] .

n 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15RI 0 0 0.58 0.89 1.11 1.25 1.35 1.40 1.45 1.49 1.52 1.54 1.56 1.58 1.59

The result of CR must not exceed 10% to ensure acceptance of the pairwise matrix’s inconsis-tency that allows normalizing the eigenvector of the matrix as final weights of decision elements.Otherwise, the subjective judgement needs to be revised [74, 85].

3.3.2 AHP model

Problem and its hierarchical structure The problem that needs to be solved on this phase ofCollMule Algorithm is to define an order of sensing IoT devices regarding their cost-efficiencytowards a mule. We describe our problem structure from the bottom to the top as follows (seeFigure 13):

1. Top layer: goal - ranked IoT devices according to their cost-efficiency towards a mule;

2. Intermediary layer: factors - the metrics (distance, RSSI, battery level and sensor accu-racy) defined in the previous section;

3. Bottom layer: alternatives - IoT devices which are available in the BLE range.

Our model consists of three layers: the goal to obtain ranked IoT devices; the factors affectingcost-efficiency of each device; and the alternative devices that are available in communication

Page 45: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

44

Figure 13. AHP model for CollMule.

radio range. There could be more layers if we considered factors that comprise more than onemetric (e.g. capacity that can consist of CPU, memory and disk storage). We assume to use theexplicit metrics such as those discussed in the previous section.

Pairwise comparison The metrics we use are measured in different units. In order to maketheir comparison possible we need to adduce them in respect of fundamental scale [84] that in-dicates the importance or domination of one element over another. First, we classify the metricsvalues and assign a value to each level that points to its importance, see the table 3. These levelvalues match the definitions given to the corresponding intensity of importance values in thefundamental scale.

Table 3. Metrics scaling .

Scores Distance, m RSSI, dBm Sensor Accuracy Power Level, %1 > 10 < -84 errors [90;-100]3 [8; 10] [-71; -84] - [70; 90]5 [5; 8) [-61; 70] - [50; 70)

7 [2; 5) [-46; -60]one of the sensors

returns 0 value[30; 50)

9 (0;2) [-25; -45] work properly < 30

Then, each element of a comparison matrixmij is obtained from subjective judgement on whichhierarchical element effects more on a goal. As the diagonal elements of the matrix always equalto 1, we need to complete only the upper triangular matrix by comparing the alternatives fol-lowing the rules described in the piece of code shown on the Figure 13. The lower part of thematrix is filled with reciprocal values of the upper part following the Definition 1 (see the ma-trix in the tables below). It is important to note that mij > 0. The size of the matrix depends

Page 46: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

45

on the number of elements which are compared. Thus, at the intermediary layer, we have onecomparison matrix corresponding to pairwise comparisons between the metrics with respect tothe goal. At the same time, the matrices at the bottom layer are composed by comparing thealternatives with respect to the each factor. Further, we provide an example where we calculateweights and consistency ratio in order to rank sensors according to distance, RSSI, and powerlevel.

Example Assume that a mobile device have discovered sensors that have these metrics (seeTable 4):

Table 4. Example values of sensor metrics.

Sensors Distance, m RSSI, dBm Power Level, %S1 2 -50 25S2 5 -69 75S3 7 -75 85S4 9.5 -80 95

First, we assign the scores to the values according to the table 3. Then we compare them to eachother in order to compose pairwise comparison matrices following the steps described above.Thus, we have got a matrix of the second layer with size three by three and three matrices (com-parison among three factors with respect to the goal) of the third layer with size four by four(comparison among four sensors with respect to each factor). Tables 5, 6, 7, 8 demonstrate thecomposed matrices.

Table 5. Paired comparison matrix on the intermediary layer (among the factors).

Criteria Distance RSSI Power Level Priority vector, %Distance 1.00 1.00 3.00 42.857

RSSI 1.00 1.00 3.00 42.857Power Level 0.33 0.33 1.00 14.286

λmax = 3.00; CI = 0.00; CR = 0.00% < 10% (acceptable)

We obtain priority vectors known as the normalized eigenvectors following the Definition 2and largest eigenvalue λmax of the comparison matrices. The later one equals to the sum ofproducts between each element of priority vector and the sum of the corresponding columnselements of the matrix. A comprehensive explanation of the computation of eigenvector andeigenvalue can be found in [87].

Page 47: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

46

Table 6. Paired comparison matrix on the bottom layer (among alternatives with respect to the Distance).

Criteria S1 S2 S3 S4Priority Vector,

%S1 1.00 5.00 5.00 7.00 62.79S2 0.2 1.00 1.00 3.00 15.42S3 0.2 1.00 1.00 3.00 15.42S4 0.142857 0.3333 0.3333 1.00 6.37

λmax = 4.1221; CI = 0.04; CR = 4.52% < 10% (acceptable)

Table 7. Paired comparison matrix on the bottom layer (among alternatives with respect to the RSSI).

Criteria S1 S2 S3 S4Priority Vector,

%S1 1.00 1.00 5.00 5.00 41.67S2 1.00 1.00 5.00 5.00 41.67S3 0.2 0.2 1.00 1.00 8.33S4 0.2 0.2 1.00 1.00 8.33

λmax = 4.00; CI = 0.00; CR = 0.00% < 10% (acceptable)

Then, for each matrix constructed above and below we calculate CI and CR following formulas21 and 22 to check the acceptability of our subjective judgement.

Table 8. Paired comparison matrix on the bottom layer (among alternatives with respect to the powerlevel).

Criteria S1 S2 S3 S4Priority Vector,

%S1 1.00 7.00 7.00 9.00 69.46S2 0.14 1.00 1.00 3.00 12.60S3 0.14 1.00 1.00 3.00 12.60S4 0.11 0.33 0.33 1.00 5.34

λmax = 4.17; CI = 0.06; CR = 6.53% < 10% (acceptable)

After, we calculate the overall composite weights of alternative choices considering the weightof intermediary and bottom layers. For this purpose, all the priority vectors of the bottom layer(see Table 6, 7 and 8) are aggregated to a common matrix which is then multiplied to the priorityvector of the intermediary layer (see Table 5).

Weights for the given example are calculated and provided in the table 9. Then, we rank thesensors from the highest to the lowest weight value. In the given example they are alreadyordered accordingly. Finally, the first k sensors are chosen to gather data from.

Page 48: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

47

Table 9. Aggregated matrix composed of priority vectors of the bottom layer and the priority vector ofintermediary layer.

Distance RSSI Power Level Priority vector, %0.429 0.429 0.143

S1 62.79% 41.67% 69.46% 0.5469S2 15.42% 41.67% 12.60% 0.2626S3 15.42% 8.33% 12.60% 0.1197S4 6.37% 8.33% 5.34% 0.0706

3.4 CollMule Algorithm

This section presents the CollMule algorithm within a pseudo code of each algorithm’s phase.Algorithm 1 demonstrates the first phase where a mule scans radio channels for available IoTdevices. Algorithm 2 shows a process of the ranking phase using AHP where the devices areordered according to different metrics (in our case, they are distance, RSSI, power level andaccuracy). Algorithm 4 represents the last phase where the mule collects data from the number,defined there, of the most cost-efficient IoT devices. Table 10 provides description to notationsused within the pseudo codes.

Page 49: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

48

Table 10. List of Notations.

Notation Descriptiond an IoT deviceLS Set of IoT devices within the building with their

coordinatesLD Set of discovered devices with information

about themLavS List of available devices from the LS

metrType type of metric (distance, RSSI, power level, ac-curacy)

loc mule’s locationcoor coordinates of an IoT device in three dimen-

sionsdist distance from the mule to IoT device in three

dimensionsm metric valueLmetric set of metric valuesLmetrSc scores of metric valuesLaverMetr average values of different metric typesLaverSc scores of the averagesLcompMetr compared metric scoresLcompAver compared scores of averagesA comparison matrix for each list of comparisonseigV ect eigenvectors of AseigV al eigenvalues of AsCI consistency indexes of AsCR consistency ratio of AsLOrdered set of ordered devices with their weightsLkOrdered list of selected devicesLdata set of collected data

Page 50: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

49

CollMule Algorithm 1: Discovering phaseInput: List of IoT nodes with their coordinates LS .Output: LavS .

1 if true then2 scan for devices into new set LD including information from their broadcast messages3 end4 return LD;5 foreach d ∈ LD do6 if d ∈ LS then7 add d to LavS

8 end9 return LavS;

10 end

Page 51: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

50

CollMule Algorithm 2: Ranking Phase (part 1)Input: LS , LavS , metrType.Output: LmetrSc, LaverSc.

1 if true then2 foreach device in LavS do3 obtain loc;4 calculate dist from loc and coors & add to Lmetric;5 for i=0 to numMetr do6 get metric value m7 if m satisfies a certain condition then8 add m into Lmetric according to metrType9 end

10 else11 remove device d from LavS

12 end13 end14 end15 return Lmetric;16 foreach m ∈ Lmetric do17 m← appropriate importance score metrSc18 add metrSc to LmetrSc

19 end20 return LmetrSc;21 if Lmetric 6= null then22 average =

∑n=numSen0 m

23 add average to LaverMetr

24 end25 return LaverMetr;26 foreach average value av ∈ LaverMetr do27 av← appropriate importance score averSc28 add averSc to LaverSc

29 end30 return LaverSc;31 end

Page 52: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

51

CollMule Algorithm 3: Ranking Phase (part 2)Input: LmetrSc, LaverSc.Output: LOrdered.

1 if true then2 for i=0 to size of LmetrSc do3 for j=i+1 to size of LmetrSc do4 compare mi with mj

5 add to LcompMetr

6 end7 end8 return LcompMetr;9 for i=0 to size of LaverSc do

10 for j=i+1 to size of LaverSc do11 compare get(i) with get(j)12 add to LcompAver

13 end14 end15 return LcompAver;16 foreach list of comparisons do17 set new comparison matrix A = aij18 end19 return A;20 foreach A do21 compute eigVect, eigVal, CI, CR22 end23 return eigVect, CR;24 if CR ≥ 10% then25 return eigVect = null;26 end27 else28 compute overall priorities into Lpriorities

29 end30 if Lpriorities 6= null then31 rank devices in descending order into LavS regarding to priorities in Lpriorities into

LOrdered

32 end33 return LOrdered;

34 end

Page 53: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

52

CollMule Algorithm 4: Collecting phaseInput: LOrdered

Output: Ldata

1 if true then2 foreach d ∈ LOrdered do3 if priority p ≥ certain value then4 add d to LkOrdered

5 end6 end7 for each efficient sensor effSen in LkOrdered do8 Initiate connection with effSen9 if connection=true then

10 read its characteristics11 if characteristics!=null then12 return their values into new list Ldata

13 end14 end15 end16 return Ldata;17 end

As AHP is the most complex and important part of CollMule’s ranking phase, the computationalcomplexity of the entire algorithm can be estimated using the best currently known runtimeof eigenvalue computation that is O(n3 + n log2 n) [88] (an example of AHP-based methods’complexity can be found in [89]).

3.5 Summary

This chapter describes the proposed algorithm namely CollMule that is intended to collect datafrom sensors effectively. It has three main phases that involve preprocessing initial informationabout nearby sensors, ranking them and gathering data from them. It considers such metrics asdistance from a sensor to a collector, RSSI, power and accuracy levels. Moreover, it is reckonedfor being easily extended with other metrics that describe efficiency of the sensor with respectto the collector. This chapter also proposes a model estimating a power level of a sensor, as themajority of sensing appliances does not provide it. Further, the ranking method is described indetail which is the AHP chosen in the Chapter 2. Its model is defined for our algorithm whichgoal is to rank the nearby sensors considering the metrics as factors identifying the priorities ofthe alternatives. In addition, we provide a small example of its computation in order to showhow it works.

Page 54: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

53

4 CollMule Architecture

In the previous chapter, we described CollMule algorithm that allows to effectively gather datafrom the IoT devices. It computes a set of the most cost-efficient sensors with respect to themobile smart device that collects their data. This chapter proposes a system architecture thatapplies the algorithm taking into account the opportunistic sensing systems described in Chapter2. Firstly, we give an overview of entire system architecture where its layers are introducedand communication between them is discussed. Then, there is a detailed review of the layerselements that present complicated systems themselves.

4.1 System Overview

This section presents an overview of the proposed system architecture. Its aim is to provideefficient data collection from sensing IoT devices (sensors). Thereby, the system architecturehas to be composed of key elements played by different technologies.

Firstly, we define the system topology. Opportunistic sensing (OppS) paradigm implies theuse of sensing appliances that detect environmental events and mobile devices that collect thissensed data opportunistically, process and upload it to a central repository for further distribu-tion. Therefore, the topology is determined to consist of a data collectors or mules, sensors,Access Point (AP) and a central server.

Figure 14. System Topology.

Page 55: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

54

In our case, the data collector is a mobile device physically carried by a human that able tocompute, store and communicate with the world (e.g smartphone, tablet). The collector andsensing IoT devices can communicate with each other via short-range radio technology likeBluetooth Low Energy (BLE), WiFi Direct/Hotspot or ZigBee. The former one collects rowdata from the later ones using the CollMule algorithm proposed in the previous chapter. Afterthat, when it reaches the AP, consequently, the Internet access becomes available it sends thecollected data to some server for further processing and distribution across the network. Thistransfer could be accomplished via such Internet communication protocols as HTTP, MQTT orCoAP. However, it does not matter here as this thesis concerns about data collection from thesensing devices by the mule. Thereby, the main part of the system topology we are interested inis framed by a green rectangle on Figure 14.

In the thesis, we propose an architecture for the overall system that contains storing, gatheringand sensing layers (see Figure 15). It follows the principle of the MULE three-tier architecture[52] presented in the Chapter 2 that is a common architecture pattern in OppS systems.

Figure 15. CollMule System Architecture.

• Sensing layer consists of the IoT devices that sense the surrounding environment andreturns the data to the higher layer;

• Gathering layer is intermediary that contains mules providing scalable and flexible wayto collect data from the bottom layer and forward it to the top layer.

Page 56: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

55

• Storing layer represents a central repository that stores, processes and distributes datareceived from the lower layers.

We review in detail only the first two architecture layers, as, mentioned above, the latest one isout of this thesis scope. The middle and bottom layers contain numerous complex elements thathave their own architecture depending on their functions. Thereby, the following subsectionsdescribe the architectures of mule and sensing IoT device in the same order.

4.1.1 Mule Architecture

Mules represent the intermediary layer of the system architecture. Its role is played by a soft-ware application on a mobile smart device which main goal is to gather data from the bottomlayer elements. For this purpose, the mule listens to BLE radio channels, detects advertisementmessages broadcasted by available sensing devices, determines a set of the most cost efficientones, collects data from them and stores it until further instructions. Thus, its architecture pre-sented on Figure 16 consists of various components that perform its different functions. Theyare defined as follows:

Figure 16. Mule Architecture.

Page 57: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

56

• Sensors Detection Manager (SDM) discovers sensor nodes that are accessible in the com-municational range;

• Node’s Info Repository (NIR) stores an information about the nodes within a building;

• Location Tracker (LT) traces the device’s position;

• Query Manager (QM) is responsible for organizing a data collection order;

• Communication Interface (CI) is accountable for establishing a connect to the sensors andobtaining the sensed data, and sending it to the central repository when it is possible;

• Data Manager (DM) is intended to manage data storage until it is sent to the storing layerof the system architecture;

• Controller manages all processes involved in the functioning of the software.

The QM is represented by the ranking phase of CollMule algorithm that determines the orderof available sensors in terms of theirs cost-efficient towards a mule. For realising this, it usesinformation about discovered sensors and the device’s location provided by SDM, NIR, and LT.Further, the controller passes an ordered list of sensors to CI that connects to k number of themfollowing its order and retrieves their data. The obtained information is then temporarily storedin DS till the storing layer becomes accessible.

In this section, we do not define the exact devices that should act the collector role. They can beany mobile devices having radio communication hardware, though, it has been specified earlierthat they should have BLE for our implementation. Moreover, there is no specific technologiesand tools are determined for implementing the mule’s functions. This is done in the next chapterwhere the implementation is described.

4.1.2 Sensing IoT Device Architecture

The bottom layer of the system consists of sensing IoT devices. Their role in our system is tomeasure environmental phenomenon and send the acquired data to intermediary level wheneverit is requested. In our system, each of them functions as follows: advertises its accessibility bybroadcasting messages that contain information about the device (like RSSI, power level andaccuracy) and available types of measurements (combined in a service) it provides; connectsto the mule when it is requested; sends the current measures to it. A such device is a complexappliance containing two main parts: an IoT unit and sensors (see figure 17). The formercontrols accomplishing tasks. It consists of:

Page 58: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

57

Figure 17. Sensing IoT device layer Architecture.

• Communication Interface (CI) broadcasts messages about availability and realises con-nection with a mule;

• Power Level Estimator (PLE) computes consumed power;

• Sensor Data Extractor (SDE) retrieves sensed data from sensors;

• Controller processes requests and manages tasks within the IoT device.

PLE estimates the battery power level which is broadcasted with other information about thedevice by CI. After establishing a connection and receiving a request for sensed data, SDE re-trieves it from the sensors part and transfers it to Controller. That sends it to the querying endthrough CI.

The second part of the IoT device contains several different sensors that detect environmen-tal events and changes which then are returned to the IoT unit. As it is mentioned in the mainaim of this thesis the system is applied to monitor indoor air quality (IAQ). Therefore, the sensorpart comprises from a set of sensors measuring different air characteristics.

In terms of high-level architecture, there is no limitation on choice of specific hardware for thesensing IoT device and tools for its implementation. Nevertheless, the preferable radio commu-nication technology between sensor and mule is BLE. Specifically, we use the connection-basedapproach, as, the power consumption model proposed in Chapter 3 is focused on this specificcommunication technology and method.

Page 59: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

58

4.2 Summary

In this chapter, we discuss the proposed system architecture that corresponds to CollMule al-gorithm. It follows the basic OppS systems’ architecture composed of three layers. However,we consider only details of the intermediary and bottom layers that fall within the scope of thisstudy. Thereby, the elements of these layers are reviewed as separate systems which architec-tures are described here. Chapter 4 does not define specific hardware and tools for the proposedsystem as its high-level architecture is designed to be universal for different applications. In thenext chapter, we describe the implementation of the system in real life scenario and evaluate it.

Page 60: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

59

5 Implementation, Results and Evaluation

This chapter describes an implementation of the proposed system in indoor air quality (IAQ)monitoring application which architecture has been introduced in the Chapter 4. As it has al-ready been mentioned there, we deploy only the gathering and sensing layers of the architecture.This is because the thesis is mainly focused on the collection of raw data from sensors withinthe IoT paradigm using CollMule algorithm proposed in the Chapter 3. Moreover, here, wedetermine experimentally the number of sensors in a set called k size which data is collectedby a collector. There are two versions of CollMule’s last phase implementation that are col-lecting the data sequentially and simultaneously. The former collects data from a set of sensorsconnecting to and obtaining the data from them one by one. The latter accomplishes the sameprocess connecting to all the sensors in a set simultaneously. The Chapter 5 evaluates an overallperformance of the both system implementation versions regarding the performing rate, powerconsumption, and CPU usage. According to the results, the one that performs better is chosen.

5.1 Prototype Implementation

The previous chapter has defined the architecture of the system and its elements. Moreover,their basic functions have been introduced there. This section of the Chapter 5 describes animplementation of the system in real life scenario. Firstly, it introduces testbed implementationwhere we described the setup of used hardware. After, it defines the assumptions taken and toolsused for the collector and sensor prototypes implementation. Then, the communication betweenthe devices is described in details.

5.1.1 Testbed

The hardware we use for the implementation of our system comprises mobile smart deviceslike a smartphone and tablet and sensing IoT devices consisting of Raspberry Pis 2 and 3, anddifferent sensors. The sensors measure air characteristics, as the proposed system is applied toIAQ monitoring that is part of this thesis goal. The main characteristics of chosen devices canbe found in Table 11.

Our sensing IoT device is composed of a Raspberry Pi3, a Sensly Hat4, a BME280 and Sharp

3https://www.raspberrypi.org4https://store.altitude.tech/product/the-sensly-hat-for-the-raspberry-uncalibrated/

Page 61: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

60

Table 11. Information about used hardware.

Device Nameand Model

Numberof

Devices

Architecturepart

Technical characteristics

Sony XperiaM5[90]

1 Mule

OS: Android 6.0; Chipset: MediatekMT6795 Helio X10; CPU: Octa-core 2.0GHz Cortex-A53; Memory: 16 GB, 3 GBRAM; Bluetooth: v4.1, A2DP, LE, aptX

ASUS GoogleNexus 7[91]

1 Mule

OS: Android 5.1; Chipset: Nvidia Tegra 3;CPU: Quad-core 1.2 GHz Cortex-A9;

Memory: 16 GB, 1 GB RAM; Bluetooth:v4.0

Raspberry Pi 2model B[92]

2IoT unit of the

sensing IoTdevice

OS: Raspbian Jessie with pixel; CPU:900MHz quad-core ARM Cortex-A7;

RAM: 1GB.

Raspberry Pi 3model B[93]

6IoT unit of the

sensing IoTdevice

OS: Raspbian Jessie with pixel; SoC:Broadcom BCM2837 CPU: 4 ARM

Cortex-A53, 1.2GHz RAM: 1GB LPDDR2(900 MHz) Bluetooth: Bluetooth 4.1

Classic, Bluetooth Low EnergyPlexgearBluetoothAdapter

2Communication

hardwareBluetooth v4.0LE dongle for Raspberry Pi 2

Sensly Hat byAltitudeTech[94]

8Sensing partof the IoT

deviceGas sensor board for Raspberry Pi

Sharp DustSensor[95]

8Sensing partof the IoT

deviceParticulate Matter sensor

BME280sensor byAltitudeTech[96]

8Sensing partof the IoT

device

measures humidity with ±3% accuracy,barometric pressure with ±1 hPa absoluteaccuraccy, and temperature with ±1.0◦C

accuracy.

Dust Sensor. As mentioned in the table, Raspberry Pi plays role of the IoT unit and the sensingpart consists of the board, the temperature and humidity sensor and the particulate matter sensor.Also, we use a BLE dongle for the Raspberry Pi 2 as it does not contain internal BLE hardware.The Sensly Hat is used as a connecting board in our testbed implementation that allows to plugin the BME280 and Sharp Dust Sensor. The board is designed specifically for Raspberry Pi thatmakes it easy to set up. Moreover, its manufacturer provides scripts5 for its software installationthat we have downloaded and installed. In addition, it does not require complex programmingto retrieve the sensed data. The complete sets of sensing device are illustrated on the figure 18

5https://github.com/Altitude-Tech

Page 62: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

61

a and b. To realize its role in our system architecture, we developed an application prototypethat has functions defined in the previous chapter. Its implementation is described later in thissection.

a) b)

Figure 18. The sensing set with Raspberry Pi a) 3; and b) 2.

The previous chapters have defined that the role of collectors must be played by mobile smartdevices. That are able to detect nearby sensors, compute a set of the most cost-efficient of themand collect data from it. For this purpose, these devices must have sufficient processing capacityand power supply. Therefore, it has been chosen to use the smartphone Sony Xperia M5 andGoogle Nexus 7. Their detailed specification is presented in Table 11. We installed and ran ourapplication prototype on them which executes CollMule algorithm. It is described below.

5.1.2 Assumptions

We assume that sensor nodes of our system are static. Thus, their addresses and locations areknown. The sensors compute the power level of their battery using a simplified version of themodel we have proposed in the third section. Sparse sensor plan is considered because of thelimited number of sensing devices. Moreover, we assume that the mule moves with really slowvelocity and stops for a few seconds during processing the proposed algorithm.

5.1.3 Mule prototype implementation

Our application prototype is implemented in Java for Android platform using Android Studio. Itfollows mule’s architecture described in the previous chapter. It runs mainly on the backgrounddiscovering nearby sensors, computing the CollMule algorithm, connecting and collecting datafrom the selected most cost-efficient sensors.

Page 63: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

62

Earlier it has been decided to use BLE communication radio technology in our project. InChapter 3 we have explained our choice. We have implemented the part of the interaction withthe IoT devices using bluetooth and bluetooth.le packages of Android API.

The ranking part of the CollMule algorithm is implemented using a linear package of ApacheCommons Math 3.3 API.

For location tracking, we used at first tried using positioning provided by APs and GPS. How-ever, the coordinates we received were far from the real one. As GPS is not suited for indoorpositioning (reference). While, for using APs a special system has to be used like Cisco CMXIndoor Positioning6, Google Indoor Positioning7 or Ekahau Real-Time Location System8, thatrequires purchasing SDKs and additional hardware. Therefore, this prototype uses manuallycomputed coordinates within a building.

Figure 19. Flow of the app’s process.

Figure 19 illustrates a flow of processes executed by the mule. Firstly, it discovers sensorswhich are available around the mule. After CollMule running on the mule selects a k size setof ranked sensors, it tries connecting to these sensors and acquiring data from them. There aretwo ways of connection implementation: sequential and simultaneous connections. The formeris able to connect the sensors one by one following the list order. In this case, when the muleis denied to connect to one sensor it tries to connect to the next sensor in the order. The latterconnects to all of them at the same time creating multiple threads for each connection. Then,the mule waits for a certain time after which it checks for its location. If it changes its position itreturns to discovering stage. Otherwise, taking into account a made assumption that the sensors

6http://www.cisco.com/c/en/us/solutions/enterprise-networks/connected-mobile-experiences/index.html7https://www.mapspeople.com/mapsindoors8https://www.rfidsolutionsonline.com/doc/ekahau-real-time-location-system-0001

Page 64: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

63

are static it tries to collect data from the same list of sensors. We consider this in order to savepower on recomputing the list.

5.1.4 Sensing IoT device prototype

Our prototype running on the IoT devices is implemented using Golang9 using its Gatt library10

and Python. Moreover, we have updated BlueZ11 version to 5.43 on Raspberry Pis as RaspbianJessie package contains its old version. The prototype implementation corresponds to the sens-ing layer architecture described in the Chapter 4.

The battery level estimating code runs on the IoT device. It is implemented using simplifiedbattery level estimation model described in Chapter 3. We have measured the current consumedby a sensor node while advertisement and connection modes using current meter illustrated onFigure 20 and taken their average values. The table below demonstrates the obtained values.

Figure 20. The meter used for measuring current during the advertisement and connection modes of asensing IoT device.

Table 12. Current consumed by sensing sets with Raspberry Pi 2 and 3.

Sensing setAdvertisement

periodConnection

PeriodRaspberry Pi 2 0.32A 0.37ARaspberry Pi 3 0.34 0.38A

The time spent in both modes is triggered by our power estimation code running on each node.Thereby, we calculate the battery level substituting the obtained numerical values of current and

9https://golang.org10https://github.com/paypal/gatt11Bluetooth protocol stack for Linux platform (http://www.bluez.org)

Page 65: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

64

time respectfully to the formulas 7, 10 depending on the sensor’s mode. Further, it calculatesthe discharge and battery residual capacity using formulas 6, 5. We do not consider a duty cycleof the sensors as in our implementation they return the measurements on request of the mule.Finally, the calculated values are used to compute the battery level using the formula 4. Thisvalue is advertised with other metrics (RSSI and accuracy level).

Here, it is important to review the packet structure that is advertised by the IoT devices aswe include, there, non-standard data about the device like battery and accuracy levels. The ad-vertising packet is (see Figure 21). The Packet Data Unit (PDU) consists of 2 bytes header and23 bytes payload. The former includes RSSI. The latter contains an advertisement address (weuse Bluetooth MAC address) and ADV_IND (PDU type, simple broadcast messages) Payload.The address takes 6 bytes, so the rest bytes are given for:

• List of services provided by the device;

• Local name;

• Manufacturer Specific Data.

Figure 21. BLE Advertising Packet Structure.

We deployed IAQ Monitoring service that provides three characteristics: temperature, humidityand PM concentration. For their identification, we use 128bit UUIDs. The local name is usedto advertise the battery and accuracy levels. It is structured as described on Figure 22. Themanufacturer specific data is usually advertised by default (we have not made changes to this).

Page 66: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

65

Figure 22. Local Name Structure.

Note: the UUIDs have to be unique. There are many standard UUIDs for existing services.Therefore, it is important to use different ones. We have randomly generated them using OnlineUUID Generator12.

The sensor data is retrieved using Sensly API in Python. As stated above this data is providedby Raspberry Pis as IAQ Monitoring service.

5.1.5 Communication between mules and sensors

Figures 23 and 24 show the communication between mules and sensor following Bluetoothspecification [97] v4.0. Where a peripheral (here, IoT device) is discoverable until a connec-

Figure 23. Communication between mules and sensors.

tion is established. During the connection, it does not advertise itself. Therefore, it is impossiblefor multiple mules to be connected simultaneously to the same sensor. Though it possible in

12https://www.uuidgenerator.net

Page 67: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

66

Figure 24. Communication between mules and sensors during simultaneous connection.

the specification v4.1 its realisation is considerably more complicated. Moreover, there are nopractical implementation examples available on the Internet. Thus, we adhere to the former one.

According to this, we assume that the sensor can receive requests for a connection from datamules while it is in advertising mode. The sensor allows connecting only to the mule whichrequest has been received first. Thereby, another mule’s request is denied. After data exchange,the sensing device enters a sleeping mode for a short time. In sequential connection, the mulecontinues to collect data from the next sensors in its queue list (see Figure 23). While in thesimultaneous connection the mule tries to gather data from all sensors at the same time (see Fig-ure 24). After the collection is finished, it continues to execute its process described previouslyin both types of connection.

5.2 Experimental k size identification

The next stage of our research is to test the performance of CollMule algorithm and the proposedsystem. After each element of the system has been implemented that is described in the previoussection it is time for deploying the system in real life scenario. As it has been mentioned in thescenario of the Chapter 1 the system is deployed within the Luleå University of Technology13 B

13https://ltu.se

Page 68: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

67

building of Campus Skellefteå. In overall, it has four levels: three of them are above the groundand one is under. The experiments have been held primary on the second floor above the groundand on the staircase leading from the first to the second floor.

Figure 25. Experimental setup on the second floor plan.

The figure 25 demonstrates our experimental network setup on the plan of the building’s secondfloor. The stars signed with the letters are positions of the collectors from which they gather datafrom sensors that are illustrated as blue circles on the plan. Also, the dotted blue circles repre-sent the sensors situated on the staircase and the first floor. Red dotted lines show the user’s path.

A basic experimental scenario is: the mule (user with his/her smart device) follows the pathand collects the sensor data at location points that are shown on the figure 25. The sensingIoT devices advertise their availability and service they provide at the fixed positions that canbe seen on the plan. Following CollMule algorithm, mule collects the data from k number ofselected sensors that are available nearby at that moment and location.

As it has been stated in the Chapter 3, the number of sensors which data should be collectedis determined experimentally in this section. The reason for this is that the number varies de-pending on the building’s plan as mainly the walls and doors interfere data collection and causemessage losses. Therefore, firstly, we run the experimental scenario to identify the possible kvalues and define the optimal number for this plan. Here, we use only the smartphone.

The table 13 summarizes the obtained results in the different locations of the first and secondphases of the algorithm that are presented in the middle and last columns respectively. Thereby,the nearby sensors are detected by the smart device via BLE scanning (listening radio chan-nels for sensory advertisements). After that, the scan results are processed and the devices are

Page 69: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

68

Table 13. Experiments data.

LocationNumber of

nearby sensorsWeights

A 33=35.84523307157775,5=64.15476692842226

B 53=38.50165811666313,4=61.49834188333688

C 51=16.86394528725128,4=38.50859184034136,2=44.62746287240736

D 5

8=19.508221405808985,7=21.98103791922744,

6=27.782567723011187,5=30.72817295195239

E 56=46.87499999999999,7=53.12499999999999

F 5

11=14.153648004116265,8=15.921277998228547,10=28.13432192837169,

9=41.7907520692835

G 411=18.831603790409368,12=23.23225799906402,10=57.93613821052662

H 411=13.019261468663034,10=37.618626527216406,12=49.36211200412058

I 310=27.872955880414267,13=34.87304586931668,12=37.253998250269056

ranked regarding the computed weights. According to this table, the number of nearby sensorsfor different positions varies from three to five. However, not all of the visible sensors havean appropriate signal strength for connection. Therefore, such sensors are excluded from theranking. The high weights define the most cost-efficient sensors which data should be gathered.In cases when only two devices are ordered the data can be gathered from both of them as theirweights are pretty close. In other cases, we can exclude the sensors having the weight value lessthan 20%. As their distances to the collector and RSSI values are pretty low that might cause anincrease in power consumption of both devices (the collector and sensor).

Note: we consider the choice of the k size just for the case of our experimental setup. Inother cases, it might be completely another situation. For example, there could be numerousequally efficient sensors. However, it might be possible only in really dense sensor networkswhere the sensors are deployed at the same time and very accurate, which work without any

Page 70: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

69

bugs. Such system is unrealistic and related to the simulated one.

The identification of the optimal k number has been defined specifically for the experimentalsetup plan on the figure 25. That is done for demonstration of the CollMule’s last phase wherethe k most cost-efficient sensors are chosen and their data is collected. However, the algorithmperformance must be evaluated independently from the particular setup. Therefore, the nextsection evaluates it through measuring its performing speed and power consumption.

5.3 System Evaluation

In this section, we run an experiment with the different number of nearby sensors (here alsocalled sample size K) varied from two to seven within one room to test the speed of rankingcomputation. Then, we run another experiment with different k sizes of sensors sets to measurethe time taken to collect the data from them. Moreover, as mentioned in the Implementation sec-tion, there are two different connection ways: sequential and simultaneous which are comparedhere. Within this experiment, we also measure Battery Power and CPU Load of the mobileapplication prototype while scanning, ranking and gathering data. For this purpose, we use anapplication called "Trepn Profiler"14.

5.3.1 Latency

We estimate the performance of CollMule by measuring the time taken for ranking computationand collection data from the k size set of sensors. Further, the time taken for connection andreceiving the data from all IoT devices in a query is called collection latency and the time con-sumed to compute the ranking part of the algorithm is called computational latency. Note: wedo not measure the time taken for scanning because it is set up to 5000ms programmatically.

The experiments have been conducted on the Xperia M5 and Nexus 7. We have done ten ex-periments measuring the computational latency for each sample size K. The figure 26 showsaverage values of the latency for both of devices depending on k size. Here, we can observe thatfor a smartphone the time rise slightly from 0.177 to 0.249s while increasing the k size fromtwo to four sensors relatively. However, while further enlarging the number from k=5 to k=7 itdiffers considerably from 0.342 to 0.57s respectively. The tablet results follow similar tendency,however, the sharp rise in the values follows starting from k=4. Moreover, when the latency of

14https://developer.qualcomm.com/software/trepn-power-profiler

Page 71: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

70

Figure 26. Computational Latency vs k size.

a) b)

Figure 27. Collection Latency vs k size.

the Xperia M5 and Nexus is almost the same two and three sensors, it differs significantly withthe bigger number of sensors.

During the experiments, we also measured the collection latency for each size of k. Its av-erage values for sequential connection are illustrated on the figure 27a. The smartphone andtablet follow the same trend, however, the connection takes longer time for the tablet due toits relatively low capacity (see the specification in Table 11). As expected the simultaneousconnection (the figure 27b) is accomplished considerably quicker than the sequential one fork=2, 3, 4, and 5. However, for six and 7 sensors the collection latency values for both types ofconnection are really close, because, there is a delay between the start of each connection in thesimultaneous method that has to be enlarged with increasing of k size. Otherwise, there wouldbe losses in data request messages, thereby the mule could not receive any data from the sensors.

To sum up, the results show that the measurement of both computational and collection latencieson the Xperia M5 and Nexus 7 depends on the device performance on which experiments areheld. Therefore, further measurements are taken only on the device with higher capacity that

Page 72: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

71

is the smartphone. Moreover, the data collection is accomplished faster using the simultaneousway. However, the latency is really close to sequential way’s one after the k size reaches six.Thus, in terms of the latency, both methods can be used when the k size exceeds six sensors.

5.3.2 Power Consumption

The power consumption using the proposed CollMule algorithm to facilitate mobile data collec-tion is a key metric to validate the proposed approach of using query principle on the collectorof sensor data. The mobile device in this experiment discovers available sensors, computes thecost-efficient set of k sensor nodes and collects sensor data from them. The OppS frameworkspreviously discussed in the Chapter 2 do not explore the cost-efficient data collection on thestage of gathering raw data from sensors by mobile devices. As they do not estimate the powerconsumption of the mobile devices on this stage of their systems, there is nothing to comparewith the results we have obtained in this section.

Figure 28. Power Consumption of the prototype with different k size of sensor set.

Power consumption of the mule is estimated considering different k size. On the figure 28, eachgraph demonstrates power consumed during scanning, the ranking computation and sequentialconnection. According to them, the power usage differs for different k size. However, analysingthe results we can observe that the consumption during the computation increase slightly withthe rising of k size from two to five. Thus, there is a little fluctuation in the power value around600 mW (milliWatt), while for the six and 7 sensors it reaches approximately 1000 and 1250mW. The power utilisation fluctuates significantly while the connection and data collection. The

Page 73: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

72

maximum power value is consumed on the connection starting point. For k=2, 3, 4 and 7 it isaround 2000mW, and for k=5 it is 2900 mW, for k=6 is around 3600mW. In transitions from 4 to5 and 6 to 7 sensors, there is a difference in the trend of power consumptions of sequential andsimultaneous connections respectively. This can be explained by BLE duty cycle of the sensingIoT device. The smart device might simply try to connect the IoT device at the sleeping periodwhen the last is not available during a few milliseconds. Therefore, it consumed more power.

The graphs on the figure 28 illustrate trends in power consumption of simultaneous connec-tion with different k sizes. The computation of CollMule algorithm remains the same, so theconsumption does not change too. The situation has changed while the connection period. Theamount of consumed power varies for k sizes. Its maximum value increases gradually from1265mW for k=2 to about 2600mW for k=7.

5.3.3 CPU Usage

We also measured CPU utilization of the software prototype on the smartphone during runningCollMule with different connection methods for each k size (see Figure 29).

Figure 29. CPU usage of the prototype with different k size of sensor set.

The smart device shares CPU cycles among all its running processes. Therefore, it is importantto know the CPU usage of our application because it might consume the large amount, thereby,causing a decrease in the processing speed of the entire device system that hosts it. The optimalmaximum value of CPU load for an individual application is considered to be no more than 30%

Page 74: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

73

assuming a margin for the sudden spike in the load [98].

According to Figure 29, the CPU load mostly equals to 12% the during the scanning and rank-ing (in the time span from 0 to 7 seconds). Only in some of the cases it reaches 20% or evenfalls to 8%. While the situation during data collection is completely different. The CPU loadfluctuates significantly for both types of connection. The peaks vary from 25 to 37% and from12 to 30% for sequential and simultaneous connections relatively. The value equal to 48% is asingle case that might be caused by simultaneous data load from sensors on the multiple threads.The graphs show that CPU load does not depend on k size especially for simultaneous connec-tion, as for bigger k size it can be low and vice versa. It can be caused by the same reason asfor battery power in case when k=4, 5, 6, 7. Moreover, it seems that the considerable effect iscaused mostly by data flow incoming from sensors while its collection. In addition, there aresometimes failures in BLE communication that also can affect on CPU and power usage.

Summing up the above, CollMule burden CPU pretty steadily (12% in average) while its firsttwo stages. While during the last stage its load fluctuates in both types of connection. Theapproximate average value is 30 and 25% for sequential and simultaneous connections respec-tively. Thus, the latter is more efficient to use in terms of CPU load, as it remains within 30%of CPU utilization that is the limit we mentioned above.

According to the obtained results discussed in this section, we can choose to use only the simul-taneous connection, as it is more efficient in terms of all three metrics we measured: performinglatency, power consumption, and CPU utilization.

5.4 Discussion

In this section, we discuss lessons learned from our system implementation and the obtainedresults of the experiments. As it is broadly known operation systems including Android andtheir elements continuously evolve. Therefore, while implementing BLE scanning and connec-tion parts of our application for the Android platform, there were problems with discrepanciesof classes and methods in different SDK versions. For instance, the method startLeScan of theclass BluetoothAdapter is replaced by startScan in the class BluetoothLeScanner in the APIlevels 21 and upper15. So, in case there is a need to install the application on the device withAndroid version lower than 5.0, the different ways of implementation have to be deployed.Moreover, there was an issue relating to the Android permissions. In Android 6.0 (applicationswith SDK version 23 or higher) it is required to list the permissions in an application’s manifest

15https://developer.android.com/reference/android/bluetooth/BluetoothAdapter.html

Page 75: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

74

and each permission that affects the privacy and security must be requested while it is running16.

We have also faced a huge problem with the implementation of sensing IoT device. It relates tocommunication element of the IoT unit which is in our case Raspberry Pi. The deployment ofBluetooth on Raspberry Pis took quite long time, as BlueZ is still developing and has a lot ofbugs depending on releases. Also, the implementation of BLE on IoT devices can be deployedusing different ways theoretically. However, we have tried most of them, and only Gatt imple-mentation in Golang works. Rest of them do not advertise the service and its characteristics17,which we have designed for air characteristics produced by sensing part of the IoT device. Fur-thermore, they either do not have a documentation at all or they are poorly documented. Thebook that provides a good example of the Golang library is "Raspberry Pi Android Projects"by Gokhan Kurt[99]. This book gives step by step instructions to the library installation and itsusage.

According to the obtained results discussed in the previous section, we can assess our algorithmimplementation being appropriate for use on mobile devices. Even though the computationaland connection latencies can be slightly slow for using it while moving with high velocity, it isacceptable for our assumptions made in the first section of this chapter. However, we shouldtest the algorithm performance while a mule moves with different velocities and stop durations.Also, the battery power consumption and CPU utilization of the prototype on a gathering deviceare considered reasonable for all CollMule’s phases: discovering, ranking and collecting (usingsimultaneous connection). Therefore, the proposed system can attract people to participate indata gathering for their own and others benefits. As it has been mentioned in the scenario ofChapter 1 the users who need to know air quality can see the air measurements of sensors. Whilethe volunteer users can share the collected data, thereby, helping the former ones to extend thearea of known data. Moreover, the proposed algorithm is implicitly reduce the overall powerconsumption of the system through collecting data only from cost-efficient sensors.

In this chapter, we collected and described the results of experiments held within this thesis.We evaluated how quickly the ranking computation and collection are performed by CollMuleprototype on the mobile devices regarding sample size K; and how much energy and CPU areused by the mule prototype regarding to the k size. According to the obtained results, the compu-tational and collection latencies are acceptable assuming that the mule moves with considerablyslow velocity and stops for a few seconds during processing CollMule algorithm. Though, weshould test the algorithm performance while a mule moves with different velocities and stopdurations. In addition, the battery power consumption and CPU utilisation of the prototype on

16https://developer.android.com/training/permissions/requesting.html17That means they do not include their UUIDs to the broadcast messages

Page 76: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

75

a gathering device can be considered reasonable for all CollMule phases: discovering, rankingand collecting (using simultaneous connection), compare to commercial BLE connection appli-cation which consumes around 3000mW and 35% for the maximum amount of these resourcesrespectively during connection and data reading from one device (these were also measuredwith Trepn Profiler).

To the best of our knowledge, there is no OppS system within IoT that uses any particular al-gorithm for collecting data from the cost-efficient sensors, thereby, making a comparison of ouralgorithm and proposed system difficult. As CollMule is an extension of 3DkNN algorithm, itsperformance could be compared with the same approaches that were contrasted to the latest onein [66, 68, 69]. However, that approaches were assumed WSNs that are significantly larger thanour system. Comparing to a simple system where mule catches opportunistically the messagesthat sensors periodically broadcast, CollMule is more efficient in terms of number of messagesand amount of data that are advertised by IoT devices and caught by the mule. Further, it mightbe more energy efficient than the simple system due to use of connection-based BLE approachthat is demonstrated in [54].

5.5 Summary

This chapter has provided the detailed description of the proposed system implementation andits evaluation. There software prototypes running on the collectors and sensing IoT devices havebeen developed. The collector prototype collects data from sensors using two ways: sequentialand simultaneous. After testing the performance of both prototype versions, only the simultane-ous version is chosen in terms of the performing rate, power consumption and CPU usage. Theexperimental k size determination has been held in this chapter shows that the k size is mostlyindividual for an experimental setup. In our case, we have found that when there only two sen-sors are detected they are almost equally efficient, therefore, the data from both devices shouldbe collected. However, when there are 3, 4, 5 available sensors those which have the weightless than 20% have to be excluded as they are relatively inefficient in terms of distance, RSSI,battery level and accuracy. Thus, the system deployment in real life scenario should considersome weight constraint for sensors when choosing the optimal k size. Furthermore, the systemevaluation demonstrates the appropriateness of CollMule for data collection using the mobilesmart device through measuring the performance of its phases in terms of latency, battery power,and CPU consumptions.

Page 77: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

76

6 Conclusion and Future Work

Previous chapters have described the accomplished work within the thesis. In this chapter, weconclude it. Moreover, we discuss the problem it tries to tackle and its contributions. Further, theFuture Work section discusses the improvements that can be done to enhance the performanceof the proposed algorithm and system.

6.1 Conclusion

This thesis identified an issue which has not been covered by the existing OppS systems withinthe IoT paradigm reviewed in the Chapter 2. Those systems address the resource cost issueproposing different approaches to tackling it. However, they do not consider any particular ap-proach for the phase of collecting raw data from sensors by a mobile device that would preventwasting its energy and memory space for gathering and storing unreliable sensors’ data. By un-

reliable we refer to such sensors that are too far for connection or produce bugs, or the accuracyof their measurements is low and significantly far from realistic values. Any potential user ofsuch system would not like to spend a considerable amount of battery power and memory spaceof their smart devices. Therefore, the challenge addressed here is to reduce the resource costs,in particular, power consumption while collecting data from sensors by smart devices. Thereare many reasons for this. For example, it can make the IoT systems including data collectionmore sustainable, because less power consumption means less CO2 emissions that pollute theair. Also, OppS involves people participation, so it can attract more users who have a will toshare the capacity of their smart gadgets in order to support efficient data collection.

For this purpose, we developed an algorithm called CollMule. It is intended to efficiently col-lect data from sensing IoT devices using mobile smart devices. For this purpose, it selects themost cost-efficient devices to gather data from. The algorithm is held on a mobile smart deviceand performs in three phases: scanning, ranking and connecting. In the former one, it gathersinitial information about devices that are available within radio communication range. Then, itranks them regarding the metric values like distance, RSSI, battery level and accuracy that it hasobtained in the previous phase. After, it connects and collects the data from the k top sensors.It implicitly reduces the amount of overall system’s power consumption as it prevents the smartdevice from attempts to connect unreliable sensors.

Moreover, this work proposed the system where CollMule algorithm is applied to monitor IAQ.We implemented for a demonstration of its performance and also the appropriateness of using

Page 78: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

77

CollMule in real life scenario. The implemented system has been evaluated considering the timetaken by the ranking computation and data collection itself, power consumption and CPU usagewhile running the algorithm on a smart device. The overall latency of CollMule implementationmight be slow for collecting data on the move. However, for our assumption where the usermoves with significantly low velocity and stops for a few seconds, our CollMule’s implementa-tion can be considered acceptable. The results show that it utilizes a reasonable amount of thedevice’s battery power and CPU for collecting data without overloading and making the deviceto work slowly.

The energy efficiency achieved by the proposed algorithm brings benefits to all three pillarsof sustainability: economic, social and ecological. Moreover, the system’s application of IAQmonitoring can also potentially improve them. However, the system has to be improved in or-der to accomplish a proper IAQ service. Therefore, the next section discusses the future workthat can be accomplished to make complete IAQ monitoring system. Furthermore, it considersimprovements to CollMule’s implementation.

Finally, our paper [24] will be published in proceedings of of the 17th NEW2AN/ruSMARTconference.

6.2 Future work

Any system could be developed and improved more. CollMule algorithm and system have alsosome things that can be added on top in order to be considered a complete IoT system. In thissection, we discuss them.

Firstly, a central server could be introduced to the system implementation which would dis-tribute the data received from different smart devices. That would allow sharing data among thesystem’s users. There is also another way to bring distribution into the system that is using theshort range radio communication which is used for data collection. However, it would make thesystem more complicated and possibly insecure.

Secondly, the processing of the collected raw data could be added. Perhaps, for this purpose,we could use a context-aware approach in our IAQ monitoring application.

Thirdly, the software prototype could use precise technology for indoor positioning like thatwe mentioned in the Chapter 5. This would allow calculating a distance from the mule to thesensors accurately which is necessary for determination the efficiency devices within CollMule

Page 79: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

78

algorithm. Moreover, using such technology it would be interesting to test our approach onmobile sensing IoT devices. Such data collection system could be applied to some big indus-trial buildings like manufactures and storages. For example, the Amazon’s warehouse use lot ofrobots moving around that also produce data which might be collected using our approach thatcould make its system more energy efficient.

Furthermore, CollMule algorithm could be improved with adding a prediction of the mule’smovements in order to compute the next set of cost-efficient sensors in advance. This couldreduce the battery usage of the smart device on discovering devices and ranking computationall the time mule changes its location. In this case, the ranking should be based on metricsdifferent from those we used in this thesis, though a distance would also be suitable. However,some sensors might not be accessible at the moment when the mule would try to connect them,thereby increasing the power consumption of the mule.

In order to improve user’s experience using our software application, a comprehensive visu-alisation of the user interface (UI) should be developed. There are many ways to do that. It canbe a 3D plan of the building where the user could see his/her device and the sensors with theirdata. Also, it could visualize the selected sensors which data would be gathered by enclosingthem into a sphere around the device. Even augmented reality might be used to visualize it.

Page 80: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

79

REFERENCES

[1] L. Atzori, A. Iera, and G. Morabito. The internet of things: A survey. Elsevier B.V.

Computer Networks, 54:2787–2805, 2010.

[2] Gartner. Gartner says 8.4 billion connected "things" will be in use in 2017, up 31 percentfrom 2016. http://www.gartner.com/newsroom/id/3598917, 2017. Ac-cessed: 2017-05-16.

[3] C. Zhu, V. C. M. Leung, L. Shu, and E. C.-H. Ngai. Green internet of things for smartworld. IEEE Access, 3:2151–2162, 2015.

[4] GeSI team. SMARTer2030. Technical report, GeSI, 2015.

[5] R. Ganti, F. Ye, and H. Lei. Mobile crowdsensing: Current state and future challenges.IEEE Communications Magazine, 49(11):32–39, nov 2011.

[6] A. Hassani, P. D. Haghighi, and P. P. Jayaraman. Context-aware recruitment scheme foropportunistic mobile crowdsensing. In 2015 IEEE 21st International Conference on Par-

allel and Distributed Systems (ICPADS). IEEE, dec 2015.

[7] J. Amos. Polluted air causes 5.5 million deaths a year new research says. http://www.bbc.com/news/science-environment-35568249, 2016. Accessed: 2017-04-20.

[8] A. Steinemann, P. Wargocki, and B. Rismanchi. Ten questions concerning green buildingsand indoor air quality. Building and Environment, 112:351–358, feb 2017.

[9] United States Environmental Protection Agency. Indoor air quality. https://cfpub.epa.gov/roe/chapter/air/indoorair.cfm. Accessed:2017-05-17.

[10] United States Environmental Protection Agency. Criteria air pollutants. https://www.epa.gov/criteria-air-pollutants. Accessed:2017-05-17.

[11] World Health Organization. Air quality guidelines - global update 2005. http://www.euro.who.int/__data/assets/pdf_file/0005/78638/E90038.pdf,2005. Accessed:2017-05-17.

[12] United States Environmental Protection Agency. Carbon monoxide (CO) pollution inoutdoor air. https://www.epa.gov/co-pollution/. Accessed:2017-05-17.

[13] United States Environmental Protection Agency. Nitrogen dioxide (NO2) pollution.https://www.epa.gov/no2-pollution. Accessed:2017-05-17.

Page 81: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

80

[14] United States Environmental Protection Agency. Ozone pollution. https://www.

epa.gov/ozone-pollution. Accessed:2017-05-17.

[15] United States Environmental Protection Agency. Sulfur Dioxide (SO2) Pollution.https://www.epa.gov/so2-pollution. Accessed:2017-05-17.

[16] United States Environmental Protection Agency. Particulate matter (PM) pollution.https://www.epa.gov/pm-pollution. Accessed:2017-05-17.

[17] United States Environmental Protection Agency. Lead (Pb) air pollution. https://

www.epa.gov/lead-air-pollution. Accessed:2017-05-17.

[18] W. Yi, K. Lo, T. Mak, K. Leung, Y. Leung, and M. Meng. A survey of wireless sensornetwork based air pollution monitoring systems. Sensors, 15(12):31392–31427, dec 2015.

[19] H. E. Fathallah, V. Lecuire, E. Rondeau, and S. L. Calve. An IoT-based scheme for realtime indoor personal exposure assessment. In 2016 13th IEEE Annual Consumer Commu-

nications & Networking Conference (CCNC). IEEE, jan 2016.

[20] E. Fathallah, V. Lecuire, E. Rondeau, and S. Le Calve. Development of an IoT-basedsystem for real time occupational exposure monitoring. In 10th International conference

on systems and networks communications. ICSNC, November 2015.

[21] D. Lohani and D. Acharya. SmartVent: A context aware IoT system to measure indoor airquality and ventilation rate. In 2016 17th IEEE International Conference on Mobile Data

Management (MDM). IEEE, jun 2016.

[22] B. Kang, S. Park, T. Lee, and S. Park. IoT-based monitoring system using tri-level con-text making model for smart home services. In 2015 IEEE International Conference on

Consumer Electronics (ICCE). IEEE, jan 2015.

[23] A. Kotsev, S. Schade, M. Craglia, M. Gerboles, L. Spinelle, and M. Signorini. Nextgeneration air quality platform: Openness and interoperability for the internet of things.Sensors, 16(3):403, mar 2016.

[24] A. Zhalgasbekova, A. Zaslavsky, S. Saguna, K. Mitra, and P. P. Jayaraman. Op-portunistic data collection for IoT-based indoor air quality monitoring. In The 17th

NEW2AN/ruSMART, St. Petersburg, Russia, 28-30 of August 2017.

[25] K. Peffers, T. Tuunanen, M. A. Rothenberger, and S. Chatterjee. A design science researchmethodology for information systems research. Journal of Management Information Sys-

tems, 24(3):45–78, 2007.

Page 82: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

81

[26] A. Klimova, E. Rondeau, K. Andersson, J. Porras, A. Rybin, and A. Zaslavsky. An in-ternational masters program in green ICT as a contribution to sustainable development.Journal of Cleaner Production, 135:223–239, nov 2016.

[27] J. Porras, A. Seffah, E. Rondeau, K. Andersson, and A. Klimova. PERCCOM: A masterprogram in pervasive computing and communications for sustainable development. InSoftware Engineering Education and Training (CSEET), 2016 IEEE 29th International

Conference on. IEEE, 5-6 April 2016.

[28] World Commission on Environment and Development. Our Common Future. Oxford Uni-versity Press, London, 1987.

[29] L. M. Hilty and M. D. Hercheui. ICT and sustainable development. In IFIP Advances in

Information and Communication Technology, pages 227–235. Springer Berlin Heidelberg,2010.

[30] R. R. Shaker. The spatial distribution of development in europe and its underlying sustain-ability correlations. Applied Geography, 63:304–314, sep 2015.

[31] Dave Evans. The internet of things the internet of things: How the next evolution of theinternet is changing everything. Technical report, Cisco IBSG, 2011.

[32] S. Zhao S. Li, L. D. Xu. The internet of things: a survey. Springer Science, 2014.

[33] IERC Cluster SRIA 2014. Internet of Things. http://www.internet-of-

things-research.eu/about_iot.htm, 2014. Accessed: 2017-03-02.

[34] E. Borgia. The internet of things vision: Key features, applications and open issues. Else-

vier B.V. Computer Communications, 54:1–31, 2014.

[35] Natioanal Instruments. Internet of things: Science fiction or internet of things: Science fic-tion or business fact? https://hbr.org/resources/pdfs/comm/verizon/

18980_HBR_Verizon_IoT_Nov_14.pdf, 2014. Accessed: 2017-03-02.

[36] J. Gubbi, R. Buyya, S. Marusic, and M. Palaniswami. Internet of things (IoT): A vi-sion, architectural elements, and future directions. Future Generation Computer Systems,29(7):1645–1660, sep 2013.

[37] A. Al-Fuqaha, M. Guizani, M. Mohammadi, M. Aledhari, and M. Ayyash. Internet ofthings: A survey on enabling technologies, protocols, and applications. IEEE Communi-

cations Surveys & Tutorials, 17(4):2347–2376, 2015.

[38] D. T. Ngo T. D. Nguyen, J. Y. Khan. Energy harvested roadside ieee 802.15.4 wirelesssensor networks for IoT applications. Elsevier B.V. Ad Hoc Networks, 2016.

Page 83: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

82

[39] N. C. Luong, D. T. Hoang, P. Wang, D. Niyato, D. I. Kim, and Z. Han. Data collection andwireless communication in internet of things (IoT) using economic analysis and pricingmodels: A survey. IEEE Communications Surveys & Tutorials, 18(4):2546–2590, 2016.

[40] D. Miorandi, S. Sicari, F. D. Pellegrini, and I. Chlamtac. Internet of things: Vision, appli-cations and research challenges. Ad Hoc Networks, 10(7):1497–1516, sep 2012.

[41] B. Guo, D. Zhang, Z. Wang, Z. Yu, and X. Zhou. Opportunistic IoT: Exploring the har-monious interaction between human and the internet of things. Journal of Network and

Computer Applications, 36:1531–1539, 2013.

[42] L. Pelusi, A. Passarella, and M. Conti. Opportunistic networking: data forwarding indisconnected mobile ad hoc networks. IEEE Communications Magazine, 44(11):134–141,nov 2006.

[43] Z. Tang, A. Liu, and C. Huang. Social-aware data collection scheme through opportunisticcommunication in vehicular mobile networks. IEEE Access, 4:6480–6502, 2016.

[44] P. P. Jayaraman, C. Perera, D. Georgakopoulos, and A. Zaslavsky. MOSDEN: A scal-able mobile collaborative platform for opportunistic sensing applications. EAI Endorsed

Transactions on Collaborative Computing, 1(1), may 2014.

[45] J. G. P. Rodrigues, A. Aguiar, and C. Queiros. Opportunistic mobile crowdsensing forgathering mobility information: Lessons learned. In 19th International Conference on

Intelligent Transportation Systems (ITSC). IEEE, 2016.

[46] S. Song, S. Shin, Y. Jang, S. Lee, and B.-Y. Choi. Effective opportunistic crowd sensingIoT system for restoring missing objects. In IEEE International Conference on Services

Computing. IEEE, 2015.

[47] D. Roggen, A. Ferscha, G. Troster, P. Lukowicz, and H. Scholten. Context awarenessand information processing in opportunistic ubiquitous systems. In Ubicomp Opportunity

Workshop, 2010.

[48] Q. Liang, X. Cheng, S. CH Huang, and D. Chen. Opportunistic sensing in wireless sensornetworks: Theory and application. IEEE Transactions on Computers, 63(8):2002–2010,August 2014.

[49] J. Liu, H. Shen, and X. Zhang. A survey of mobile crowdsensing techniques: A criti-cal component for the internet of things. In 25th International Conference on Computer

Communication and Networks (ICCCN). IEEE, 2016.

[50] H. Ma, D. Zhao, and P. Yuan. Opportunities in mobile crowd sensing. IEEE Communica-

tions Magazine, 52(8):29–35, August 2014.

Page 84: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

83

[51] A. Ahmed, K. Yasumoto, Y. Yamauchi, and M. Ito. Distance and time based node selectionfor probabilistic coverage in people-centric sensing. In 8th Anual IEEE Communications

Society Conference on Sensor, Mesh and Ad Hoc Communications and Networks. IEEE,2011.

[52] R. C. Shah, S. Roy, S. Jain, and W. Brunette. Data MULEs: Modeling a three-tier archi-tecture for sparse sensor networks. Intel Research, 2003.

[53] G. Anastasi, M. Conti, M. D. Francesco, and A. Passarella. Energy conservation in wirelesssensor networks: A survey. Ad Hoc Networks, 7(3):537–568, may 2009.

[54] S. Aguilar, R. Vidal, and C. Gomez. Opportunistic sensor data collection with bluetoothlow energy. Sensors, 17(159), 2017.

[55] Y. Ma, S. Zhang, C. Lin, and L. Li. A data collection method based on the region divisionin opportunistic networks. ACES Journal, 32:43–49, 2017.

[56] J. G. P. Rodrigues, A. Aguiar, F. Vieira, J. Barros, and J. P. S. Cunha. A mobile sens-ing architecture for massive urban scanning. In 14th International IEEE Conference on

Intelligent Transportation Systems. IEEE, 2011.

[57] G. Aloi, G. Caliciuri, G. Fortino, R. Gravina, P. Pace, W. Russo, and C. Savaglio. EnablingIoT interoperability through opportunistic smartphone-based mobile gateways. Journal of

Network and Computer Applications, 81:74–84, 2017.

[58] G. Aloi, G. Caliciuri, G. Fortino, R. Gravina, P. Pace, W. Russo, and C. Savaglio. A mobilemulti-technology gateway to enable IoT interoperability. In 2016 IEEE First International

Conference on Internet-of-Things Design and Implementation (IoTDI). IEEE, apr 2016.

[59] C. Pereira, J. Rodrigues, A. Pinto, P. Rocha, F. Santiago, J. Sousa, and A. Aguiar. Smart-phones as M2M gateways in smart cities IoT applications. In 23rd International Confer-

ence on Telecommunications (ICT). IEEE, 2016.

[60] Y. Han, K. Park, J. Hong, N. Ulamin, and Y.-K. Lee. Distance-constraint k-nearest neigh-bor searching in mobile sensor networks. Sensors, 15(8):18209–18228, jul 2015.

[61] T. Cover and P. Hart. Nearest neighbor pattern classification. IEEE Transactions on Infor-

mation Theory, 13(1):21–27, jan 1967.

[62] T. Seidi and H.-P. Kriegel. Optimal multi-step k-nearest neighbor search. ACM SIGMOD,1998.

[63] T.-Y. Fu, W.-C. Peng, and W.-C. Lee. Parallelizing itinerary-based knn query processingin wireless sensor networks. IEEE Transactions on Knowledge and Data Engineering,22(5):711–729, May 2010.

Page 85: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

84

[64] Y. Han, J. Tang, Z. B. Zhou, M. Xiao, L. Sun, and Q. Wang. Novel itinerary-based KNNquery algorithm leveraging grid division routing in wireless sensor networks of skewnessdistribution. Personal and Ubiquitous Computing, 18(8):1989–2001, aug 2014.

[65] J. Winter, Y. Xu, and W.-C. Lee. Energy efficient processing of k nearest neighbor queriesin location-aware sensor networks. In The Second Annual International Conference on

Mobile and Ubiquitous Systems: Networking and Services, 2005. MobiQuitous 2005.

IEEE, 2005.

[66] P.P. Jayaraman, A. Zaslavsky, and J. Delsing. Intelligent mobile data mules for costeffi-cient sensor data collection. The International Journal of Artificial Intelligence, Neural

Networks, and Complex Problem-Solving Technologies, 6096:225–234, 2010.

[67] Y. Komai, Y. Sasaki, T. Hara, and S. Nishio. KNN query processing methods in mobile adhoc networks. IEEE Transactions on Mobile Computing, 13(5):1090–1103, May 2014.

[68] P.P. Jayaraman, A. Zaslavsky, and J. Delsing. Cost efficient data collection approach usingK-nearest neighbours in a 3D sensor network. In In Proceedings of the 2010 Eleventh

International Conference on Mobile Data Management (MDM 2010), pages 183–188,Kansas City, Missouri, USA, May 23 - 26 2010.

[69] P.P. Jayaraman, A. Zaslavsky, and J. Delsing. Intelligent processing of K-nearest neigh-bours queries using mobile data collectors in a location aware 3D wireless sensor network.In The Twenty Third International Conference on Industrial, Engineering & Other Appli-

cations of Applied Intelligent Systems (IEA-AIE 2010), Cordoba, Spain, 2010.

[70] J. S. Dyer. MAUT - multiattribute utility theory. In Multicriteria decision making analysis:

state of the arts surveys, pages 265–292. Springer Verlag, 2005.

[71] J. Figueira, S. Greco, and M. Ehrogott. Multiple Criteria Decision Analysis: State of the

Art Surveys. Springer New York, 2005.

[72] S. K. Garg, S. Versteeg, and R. Buyya. A framework for ranking of cloud computingservices. Future Generation Computer Systems, 29(4):1012–1023, jun 2013.

[73] T. L. Saaty and L. G. Vargas. Models, Methods, Concepts & Applications of the Analytic

Hierarchy Process. Springer US, 2001.

[74] Y. Deng. Fuzzy analytical hierarchy process based on canonical representation on fuzzynumbers. JOURNAL OF COMPUTATIONAL ANALYSIS AND APPLICATIONS, 22:201–228, February 2017.

Page 86: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

85

[75] K. Mathiyazhagan, A. Diabat, A. Al-Refaie, and L. Xu. Application of analytical hierarchyprocess to evaluate pressures to implement green supply chain management. Journal of

Cleaner Production, 107:229–236, nov 2015.

[76] W.S. Jang and W.M. Healy. Wireless sensor network performance metrics for buildingapplications. Energy and Buildings, 42(6):862–868, jun 2010.

[77] Accuracy, precision, resolution & sensitivity. http://kb.mccdaq.com/

KnowledgebaseArticle50043.aspx. Accessed: 2017-04-16.

[78] Natioanal Instruments. Sensor terminology. http://www.ni.com/white-paper/14860/en/, 2013. Accessed: 2017-04-16.

[79] BU-703: Health concerns with batteries. http://batteryuniversity.com/

learn/article/health_concerns, 2016. Accessed: 2017-04-12.

[80] Lithium rechargeable batteries. http://www.electronic-products-design.com/geek-area/electronics/batteries/lithium-rechargeable-

batteries. Accessed: 2017-03-02.

[81] Bubble Bang. Bubble Bang 5000mAh Power Bank. Manual.

[82] M. Sabatini. Lithium ion vs. lithium polymer - what’s the difference? http:

//www.androidauthority.com/lithium-ion-vs-lithium-polymer-

whats-the-difference-27608/, October 2011. Accessed:2017-04-08.

[83] J. Nieminen, C. Gomez, M. Isomaki, T. S., B. Patil, Z. Shelby, M. Xi, and J. Oller. Net-working solutions for connecting bluetooth low energy enabled machines to the internet ofthings. IEEE Network, 28(6):83–90, nov 2014.

[84] T. L. Saaty. Decision making with the analytic hierarchy process. International Journal of

Services Sciences, 1(1):83, 2008.

[85] K. Teknomo. Analytic hierarchy process (ahp) tutorial. http://people.revoledu.com/kardi/tutorial/AHP/, 2006. Accessed: 2017-04-27.

[86] T. L. Saaty. The analytic hierarchy and analytic network measurement processes: Ap-plications to decisions under risk. EUROPEAN JOURNAL OF PURE AND APPLIED

MATHEMATICS, 1(1):122–196, 2007.

[87] K. Teknomo. Linear algebra tutorial. http://people.revoledu.com/kardi/

tutorial/LinearAlgebra/, 2011. Accessed: 2017-04-29.

Page 87: CollMule: An Opportunistic Data Collection System for IoT ...1136294/FULLTEXT01.pdf · CollMule: An Opportunistic Data Collection System for IoT-based Indoor Air Quality Monitoring

86

[88] V. Y. Pan and Z. Q. Chen. The complexity of the matrix eigenproblem. In STOC ’99:

Proceedings of the 31st annual ACM symposium on Theory of computing. ACM, May1999.

[89] Y. A. Tung. Time complexity and consistency issues in using the ahp for making groupdecisions. Journal of Multi-Criteria Decision Analysis, 7:144–154, 1998.

[90] Sony Xperia M5. http://www.gsmarena.com/sony_xperia_m5-7464.php.Accessed: 2017-05-20.

[91] Asus Google Nexus 7. http://www.gsmarena.com/asus_google_nexus_7-4850.php. Accessed: 2017-05-20.

[92] Raspberry Pi 2 Model B. https://www.raspberrypi.org/products/

raspberry-pi-2-model-b/. Accessed: 2017-05-20.

[93] Raspberry Pi 3 Model B. https://www.raspberrypi.org/products/

raspberry-pi-3-model-b/. Accessed: 2017-05-20.

[94] The Sensly HAT: Gas sensor for the raspberry pi. development board.urlhttps://store.altitude.tech/product/the-sensly-hat-for-the-raspberry-uncalibrated/.Accessed:2017-05-20.

[95] Sharp. GP2Y1010AU0F – compact optical dust sensor. https://www.sparkfun.

com/datasheets/Sensors/gp2y1010au_e.pdf. Accessed: 2017-05-20.

[96] BME280 humidity + barometric pressure + temperature sensor. https:

//learn.adafruit.com/adafruit-bme280-humidity-barometric-

pressure-temperature-sensor-breakout/overview. Accessed:2017-05-20.

[97] Bluetooth core specification. https://www.bluetooth.com/

specifications/bluetooth-core-specification. Accessed: 2017-05-07.

[98] K. Subramanian. 4 things you need to know about CPU utilization of your Java appli-cation. http://karunsubramanian.com/java/4-things-you-need-to-

know-about-cpu-utilization-of-your-java-application/, 2014.Accessed: 2017-05-05.

[99] G. Kurt. Raspberry Pi Android Projects. Pakt Publishing Ltd., 2015.