scieee AI-readable full text Open interactive document viewer

Computing Aggregate Quantities in Large-Scale and Dense Sensor Networks

Maryam Vahabi

Full text

FACULDADE DE ENGENHARIA DA UNIVERSIDADE DO PORTO Computing Aggregate Quantities in Large-Scale and Dense Sensor Networks Maryam Vahabi DISSERTATION Doctoral Program in Electrical and Computer Engineering Supervisor: Eduardo Manuel de Médicis Tovar January 19, 2016 c Maryam Vahabi, 2016 Computing Aggregate Quantities in Large-Scale and Dense Sensor Networks Maryam Vahabi Doctoral Program in Electrical and Computer Engineering Approved by: President: Prof. José Alfredo Ribeiro da Silva Matos External Referee: Prof. Nicolas Navet External Referee: Prof. Leandro Buss Becker FEUP Referee: Prof. Manuel Alberto Pereira Ricardo FEUP Referee: Prof. Paulo José Lopes Machado Portugal Supervisor: Prof. Eduardo Manuel Médicis Tovar January 19, 2016 Abstract Although the information technology transformation of the 20th century appeared revolutionary, a bigger change is on the horizon. The term cyber-physical system (CPS) has come to describe the research and technological efforts that will ultimately allow the interlinking of the real-world physical objects and the cyber-space efficiently. Technological advances in hardware design enable the emergence of low-cost single embedded computer equipped with sensing, processing and communication capabilities. This makes it economically feasible to densely deploy networks with very large quantities of such nodes. Accordingly, it is possible to take a very large number of sensor readings from the physical world, compute quantities and take decisions out of them. Very dense networks offer a better resolution of the physical world and therefore a better capability of detecting the occurrence of an event; this is of paramount importance for a number of foreseeable applications. Environmental monitoring and structural health monitoring (SHM) are two examples of such applications. In this Thesis, we consider densely instrumented CPS applications. Considering the typical limited capabilities of sensor nodes (in terms of communication and processing), computing an estimate of the state of the physical world is challenging. In general, the main challenge of dense sensing networks is categorized into two distinct classes: data transmission and data aggregation. Assume a large-scale dense networked sensor system, whose nodes have a common sensing goal: to measure a physical phenomenon and also to compute different features from the distribution of sensor readings in order to trigger a set of control commands for the actuators in a timely manner. Based on the aforementioned challenges, we formulate the Thesis hypothesis as follows: we believe that it is possible to extract certain features of a physical phenomenon in a dense sensor network, in a reliable and timely way, and with a time complexity that is essentially independent of the number of sensor nodes. Therefore, the primary objective of this Thesis is to devise technologies and methodologies that enable extracting certain features of a physical phenomenon monitored by a dense sensing network in a timely and reliable manner. To reach this primary objective, a set of scientific and technical objectives have been identified. The first objective is to devise an error recovery scheme for the slotted WiDOM protocol in a noisy wireless channel. This scheme should enable reliable data transmission in harsh environments where sensor nodes are more prone to interference. The second objective is to devise an aggregation mechanism that captures the dynamics of the physical quantities and self adapts according to the physical changes. This mechanism allows obtaining an accurate interpolation for a dynamic physical quantity. The third objective is to devise algorithms to identify various features in a distribution of a physical phenomenon. Feature extraction i ii algorithms enable identifying the location and the boundaries of events in dense sensing applications. Resumo Embora a transformação tecnológica da informação no século 20 pareceu revolucionária, uma mudança ainda maior está no horizonte. O termo cyber-physical system (CPS) chegou para descrever a investigação e os esforços tecnológicos que permitirão a interligação dos objetos físicos do mundo real ao ciber-espaço de forma eficiente. Os avanços tecnológicos no design de hardware permitiram o surgimento de computadores embebidos únicos de baixo custo, equipado com capacidades de detecção, processamento e comunicação. Isto torna economicamente viável implantações densas de redes com grandes quantidades de tais nós. Deste modo, é possível fazer grande número de leituras dos sensores do mundo físico, calcular quantidades e tomar decisões locais. Redes muito densas oferecem uma melhor resolução do mundo físico e, portanto, uma melhor capacidade de detectar a ocorrência de um evento; isso é de suma importância para um número de aplicações previstas. Monitoramento ambiental e monitoramento de integridade estrutural (SHM) são dois exemplos de tais aplicações. Nesta Tese, consideramos aplicações CPS densamente instrumentadas. Considerando as capacidades limitadas típicas de nós sensores (em termos de comunicação e processamento), o cálculo de uma estimativa do estado do mundo físico é um desafio. Em geral, o principal desafio das redes densas de sensoriamento é dividida em duas classes distintas: transmissão de dados e de agregação de dados. Suponha que um sistema de rede de sensores densa e de grande escala, cujos nós têm objetivo comum de sensoriamento: medir um fenômeno físico e calcular diferentes características da distribuição das leituras dos sensores, a fim de desencadear um conjunto de comandos de controle para atuadores de forma temporal. Com base nos desafios acima mencionados, formulamos a hipótese de Tese como se segue: acreditamos que é possível extrair certas características de um fenómeno físico de uma rede de sensores densa, de uma maneira fiável e atempada, e com uma complexidade de tempo que é essencialmente independente do número de nodos de sensores. Portanto, o objetivo principal deste trabalho é desenvolver tecnologias e metodologias que permitam a extração de certas características de um fenômeno físico monitorado por uma rede densa de de sensores de forma temporal e confiável. Para alcançar este objectivo primordial, um conjunto de objectivos científicos e técnicos foram identificados. O primeiro objectivo é conceber um sistema de recuperação de erro para o protocolo WiDOM em um canal sem fio ruidoso. Este regime deve permitir a transmissão de dados confiável em ambientes ruidosos onde nós sensores estao mais propensos à interferência. O segundo objectivo é conceber um mecanismo de agregação que captura a dinâmica das quantidades físicas, que se auto adapta de acordo com as mudanças físicas. Este mecanismo permite a obtenção de uma interpolação rigorosa para a quantidade física dinâmica. iii iv O terceiro objectivo é conceber algoritmos para identificar várias características em uma distribuição de um fenômeno físico. Algoritmos de extração de características permitem identificar a localização e os limites de eventos em aplicações de sensoriamento densas. Acknowledgements First and foremost, I would like to thank my supervisor, Eduardo Tovar for his continuous support during my PhD. His guidance helped me in all the time of research, during paper submissions and writing the Thesis. Despite his busy schedule as the director of CISTER/INESC-TEC, he was always very helpful. I feel fortunate for having had the opportunity to conduct research in such a supportive place. I also like to thank Björn Andersson for his guidance during the first two years of my PhD when he was at CISTER/INESC-TEC. I enjoyed his immense knowledge and enthusiasm that inspired and motivated me. I should express my gratitude to Stefano Tennina, who was always available with patience to discuss and find solutions. I think he is one of the most patient, respected mentors I have ever met. It was really a pleasant experience to work with him as he has deep knowledge in the sensor network area and real-world experiments. Several contributions in this Thesis resulted from collaborations with other researchers in our lab. Vikram Gupta was always coming to meetings with nice ideas, and we were discussing on many interesting research problems. Michele Albano and Raghu Rangarajan were also very helpful in consolidating those ideas. Their deep knowledge helped me to provide efficient algorithms. I also thank Patrick Meumeu Yomsi, Artem Burmyakov and João Loureiro for the stimulating discussions and the rest of my fellow students to make the lab environment at CISTER more alive and cheerful. I wish to acknowledge all who contributed in administrative and everyday bureaucracy: Sandra, Inês and Cristiana. Finally, I would like to thank my beloved mother for always inspiring me to excel in academics. My father for encouraging me in my childhood and taught me to remain curious. He is not with us anymore, but I hope that I have made him proud. My father- and mother-in-law were always encouraging me to pursue my studies. I sincerely hope that I continue to meet their expectations. Finally, and most importantly, I would like to thank my dear husband and best friend, Hossein Fotouhi, for his support, encouragement, patience and unwavering love. He made these years the best years of my life. This work was supported by FCT (Portuguese Foundation for Science and Technology), under PhD grant SFRH/BD/67096/2009. v xii LIST OF FIGURES 6.20 Aβversus Aδ, dash lines show the boundaries provided by Aδ, and solid lines refer to active regions detected by Aβ; (a) β=30, γ=0.3; (b) β=30, γ=0.2; with β=10 for Aβ. ...................119 6.21 Aγversus Aδ, dash lines show the boundaries provided by Aδand solid lines refer to that given by Aγ(a) β=30, γ=0.3; (b) β=30, γ=0.2; with ε=15◦for Aγ. ............................120 6.22 Execution time of different augmenting functions in an MBD network with different communication ranges for cluster-based approach {C(14,7), C(40,20)} and ripple-based approach {R(14), R(40)}: (a) considering scenarios depicted in (Figure 6.21-a) and (b) considering scenarios depicted in (Figure 6.21-b). . . . . . . . . . . . . . . . . . . . . . . . . . . 120 6.23 The computation time of various feature extraction techniques (Aβ,Aγ and Aδ) for scenario sc2 with πs=20%, ε=15◦,γ=1, θ=π/4. . . . . 120 6.24 The impact of density on the performance of each technique for scenario sc2. .....................................121 List of Tables 2.1 WiDOMparameters. ............................ 23 4.1 Different cases of WCRT computation. lp(i) /hp(i) corresponds to the set of message streams with priority lower / higher than message stream mi. . 48 4.2 List of symbols used in the computation of WCRT of a set of message streams.................................... 49 4.3 Tasks’configuration. ............................ 56 4.4 Timeout values experimentally measured on MicaZ platform. . . . . . . . 58 4.5 ResponsetimeinHNC............................ 64 4.6 ResponsetimeinLNC............................ 65 4.7 Response time in SPNC. . . . . . . . . . . . . . . . . . . . . . . . . . . 66 4.8 Response time for original WiDOM in non-lossy environment. . . . . . . 66 6.1 Summary of the symbols and notations used in this chapter. . . . . . . . . 93 6.2 Computation time of the MIN value in the cluster-based and the ripplebasedapproaches ..............................110 xiii xiv LIST OF TABLES List of Algorithms 1 Basic Interpolation Algorithm . . . . . . . . . . . . . . . . . . . . . . . . 35 2 Differential Interpolation Algorithm . . . . . . . . . . . . . . . . . . . . . 37 3 Faulty Node Tolerant Algorithm . . . . . . . . . . . . . . . . . . . . . . . 38 4 Send-Task................................... 53 5 Receive-Task................................. 54 6 Management-Task .............................. 55 7Learning functionality ............................ 79 8Assessment functionality........................... 82 9Distance augmenting function (Aβ) executed on each sensor node ni. . . 96 10 Vector augmenting function Aγ, executed on each sensor node ni...... 98 11 Cluster-based approach ...........................102 12 Function timeslot-assignment(Gi), executed on the leader node . . 104 13 Ripple-based approach, executed on each sensor node ni..........105 xv xvi LIST OF ALGORITHMS Abbreviations BB Black Bursts BIA Basic Interpolation Algorithm CAN Controller Area Network COTS Commercial-Off-The-Shelf CPS Cyber-Physical System CSMA Carrier Sense Multiple Access DB-MAC Delay Bounded Medium Access Control DIA Differential Interpolation Algorithm DSME Deterministic and Synchronous Multi-channel Extension EDF Earliest Deadline First GTS Guaranteed Time Slots HIPERLAN High Performance Local Area Network HNC High Noisy Channel ISM Industrial, Scientific and Medical LNC Low Noisy Channel MAC Medium Access Control MBD Multiple Broadcast Domains MCU Micro-Controller Unit MVDS Minimum Virtual Dominating Set PCF Point Coordination Function PIFS PCF Inter-Frame Space QoS Quality-of-Service RAM Random-Access Memory RF Radio Frequency RIG Register Interfering Graph RTOS Real-Time Operating System SBD Single Broadcast Domain SHM Structural Health Monitoring SPNC Sporadic Noisy Channel TDMA Time Division Multiple Access TFSS Time For Signal Sensing TTSMNG Time To Start Managin TTSRCV Time To Start Receiving WAI Weighted-Average Interpolation WCRT Worst Case Response Time WIA-PA Wireless network for Industrial Automation - Process Automation xvii xviii Abbreviations WiDOM Wireless Dominance WirelessHART Wireless Highway Addressable Remote Transducer WLAN Wireless Local Area Networks WSN Wireless Sensor Network Chapter 1 Introduction Although the information technology transformation of the 20th century appeared revolutionary, a bigger change is on the horizon. The term cyber-physical system (CPS) has come to describe the research and technological efforts that will ultimately allow the interlinking of the real-world physical objects and the cyber-space efficiently [ECPS02, SLMR05]. The integration of physical processes and computing is not new. Embedded systems have been in place over the last few decades and these systems often combine physical processes with computing. The revolution is coming from the massively deploying networked embedded computing devices, allowing instrumenting the physical world with pervasive networks of sensor-rich embedded computation [SLMR05]. 1.1 Research and Application Context Technological advances in hardware design enable the emergence of low-cost single embedded computer equipped with sensing, processing and communication capabilities. This makes it economically feasible to densely deploy networks with very large quantities of such nodes. Accordingly, it is possible to take a very large number of sensor readings from the physical world, compute quantities and take decisions out of them. Very dense networks offer a better resolution of the physical world and therefore a better capability of detecting the occurrence of an event; this is of paramount importance for a number 1 2Introduction of foreseeable applications. Environmental monitoring and structural health monitoring (SHM) are two examples of such applications. In this Thesis, we consider densely instrumented CPS applications. In [LDB+09], the authors report a densely deployment of sensor nodes for environmental monitoring with high data resolution and fidelity. Such a high resolution sensing enables a more precise understanding of the variability and the dynamics of the environmental parameters. High spatial resolution is also used in structural health monitoring to accurately identify structural damages by analyzing the measured data through mathematical modeling [SCMSJ11]. SHM is relevant in aircraft, civil infrastructure (e.g. bridges and building) and laboratory specimens (e.g. beams and composite plates) [CGJ+04], just to provide a few examples. In addition to detect the structural damage in a physical infrastructure, the aircraft industry is also considering the benefit of using dense sensing (and actuation), to minimize the carbon footprint. Active flow control [DM10, TPB+12] is one such technological developments that allows significant reduction of drag and therefore, related fuel consumption and pollution emissions [R+04]. One approach to achieve the flow control is to perform local adjustments of the skin surfaces using a very dense deployment of sensor, controller, and actuator nodes (smart skin patches) embedded in the aircraft wings and fuselage [DOBY14]. Many research projects (e.g. [LSBP02, LBP03, VLVS+03]) have considered dense deployment of sensing devices using substrate surface as a platform for power supply and communication bus. The Pushpin project [LSBP02] is a system with identical dense sensing devices, where sensor nodes have the form factor of pushpins. Employing these small sensor devices with such density is envisioned as an enabler for an electric skin. The Tribble (Tactile Reactive Interface Built By Linked Elements) project [LBP03] is a dense sensing system consisting of 20 hexagonal and 12 pentagonal tiles connected as a sphere resembling a soccer ball. The tiles communicate neighbor to neighbor. Tribble was designed as a test-bed for dense sensing to investigate applications involving multi-modal electronic skins. 1.2 Research Challenges and Problem Statement 3 Pin & Play [VLVS+03] are networking objects that are used on surfaces such as walls and boards. The purpose of Pin & Play is to network objects in everyday environments by literally pinning them to a networked surface. The following section will address possible classes of applications which can benefit from dense sensing. 1.2 Research Challenges and Problem Statement The scale of densely instrumented CPS poses huge challenges in terms of inter-connectivity and timely data processing. In this Thesis, we will look at efficient, scalable data acquisition methods for such dense CPS applications. CPS systems with high spatial resolution sensing must typically fulfill the following aggregation requirements (R1 to R5): R1. Computation (for estimating the state of the physical world) must be based on sensor readings from many sensor nodes, potentially all sensor nodes. The rationale for this requirement is that if the computation is based only on sensor readings from a single sensor node or a small subset of sensor nodes, we derive no benefit from the large and densely deployed number of sensor nodes available. R2. Sensor nodes must be able to communicate. The rationale for R2 follows from R1. R3. Broadcast media (such as a shared wired bus or a wireless channel) must be used for communication. The rationale for R3 follows from the fact that a point-to-point communication network is too expensive as the number of sensor nodes becomes large. R4. The computation (for estimating the state of the physical world) must be performed within low and bounded delay. Note that the communication process is a part of this computation. The rationale for R4 follows from the fact that control algorithms must obtain an estimate of the physical world that is not too old. R5. The computation (for estimating the state of the physical world) must be scalable. The rationale for R5 follows from the fact that unscalable computation leads to an outdated estimation of the physical world. Considering the communication cost, 10 Introduction broadcast domain. We compared these two approaches and showed their performance in various scenarios. The code for this implementation is also available on-line [Vah15]. 1.6 Structure of the Thesis The remainder of this Thesis is organized as follows. In Chapter 2 we provide the necessary background on dominance-based MAC protocols. Timeliness aspects are discussed and other real-time MAC protocols, and characteristics are briefly surveyed. In Chapter 3 we review previous relevant work that exploits dominance-based MAC protocols to efficiently compute aggregate quantities. We discuss relevant aggregate quantities such as MIN (the basic building block used in all algorithms aiming for computation other aggregation quantities) and the more complex one (that includes positioning information) and main focus of our work: complex feature extraction. Chapters 4, 5 and 6 describe the main contributions attained in this research work. In Chapter 4, we detail a novel proposal to improve the reliability of slotted WiDOM under noisy channel conditions. Besides describing the implementation of the error detection mechanism, we propose a novel response-time formulation that enables computing the upper-bound on message transmission delay for slotted WiDOM. In Chapter 5, we present and discuss the results on a novel sophisticated adaptive method to compute approximate interpolation in densely-deployed sensor systems. In this method we present an add-on functionality that computes the change pattern metric of the physical signal in order to provide more accurate approximate representation of the physical signal. In Chapter 6 we propose a set of algorithms that identify the main features of a sensor reading distribution and extend the proposed functionality to a large multi-hop dense network in a fully distributed manner by leveraging the inherent properties of the dominance-based MAC protocols. Finally, in Chapter 7, we conclude this Thesis by providing a summary of the research contributions and an outline of potential research challenges that build on the current results. Chapter 2 Background and Related Work — Binary/Countdown MAC Protocols In this chapter, we provide relevant background information regarding the family of medium access control protocols used as a basis throughout the research work described in this Thesis. First, a brief introduction to binary/countdown MAC protocol is provided. Then, the adaptation of that MAC protocol to the wireless case, dubbed WiDOM (wireless dominance), is described and important related research efforts surveyed. 2.1 Introduction Real-time computing systems are those systems in which correctness of the system depends not only on the logical result of computation but also on the time at which the results are produced [SSH99]. This implies that, unlike more traditional information and communication systems, where there is a separation between correctness and performance, in real-time computing systems correctness and performance are tightly interrelated. Only a few decades ago, real-time computing systems were an important but narrow niche of computer systems, consisting mainly of military systems, air traffic control and embedded systems for manufacturing and process control. This association caused that real-time systems problems did not attract widespread interest from the computer community. 11 12 Background and Related Work — Binary/Countdown MAC Protocols Meanwhile, the emergence of large-scale distributed systems, enabled by advances in networking technology, has broaden real-time concerns into a mainstream enterprise, with clients in a wide variety of industries and academic disciplines. Terms such as “Cooperating-Objects” [MM09], “Cyber-Physical Systems” or “Internet of Things” [AIM10, Kop11, SGLW09, COM09] have come to describe the research and technological efforts that will ultimately efficiently allow interlinking the real world physical objects and cyberspace. The integration of physical processes and computing is however nothing dramatically new: embedded systems have been in place since a long time to denote systems that combine physical processes with computing. The revolution is coming from extensively networking embedded computing devices, in a blend that involves sensing, actuation, computation, networking, pervasiveness and physical processes. And interaction with the physical world always implies timeliness as a main concern in the design process. This tendency has been establishing real-time technology as a priority for commercial strategy and academic research for the foreseeable future and also for a wider number of applications. Collecting data from high-density networks can make use of specific properties of the communication medium to collect aggregates in a fast and energy-efficient manner. WiDOM [PAT07] is such a medium access control protocol that can be employed to efficiently compute aggregates in a timely manner with significantly lesser message exchanges, as shown in [PAT07, ETPA11]. With that approach, the number of messages exchanged and time to gather an aggregate are not dependent on the number of nodes in a given broadcast domain, thus facilitating dense networks without correspondingly high-energy and temporal costs. Acquiring the representation of the physical world must be done with a low (and bounded) delay. Due to the large number of devices, which potentially offers high spatial resolution, communication becomes challenging, and obtaining a representation of the physical world with a low (and bounded) delay can be a major obstacle. So, the desire for high spatial resolution may come at the cost of precluding high temporal resolution. In [SAL+03] the authors outline various challenges in real-time communication in 2.2 Binary/Countdown MAC Protocols 13 sensor networks. Quality-of-Service oriented approaches, like those described in [FLE06], provide probabilistic timing and reliability guarantees based on the application requirements. Such provisions are necessary in systems with real-time requirements, and especially in critical systems employed in for example, aeronautical applications. Reducing the radio power can help not only to achieve energy-savings, but can also limit the radiocoverage in dense networks, thereby reducing packet collisions. Low-power radio designs [SAL+03, FLE06] have been proposed that can help on achieving the above goals. Another approach to reduce the delay induced by wireless communication is the adoption of decentralized computation. The analysis of sensor data within a small cluster of nodes or locally on single nodes with the objective of extracting data features relevant for the application will contribute to the reduction of the communication traffic. However, it must be ensured that the energy and time saved on the communication is not lost with the additional processing. The computation capabilities of the node must be then adapted accordingly, using for example reconfigurable computing [HZG09]. 2.2 Binary/Countdown MAC Protocols Many emerging embedded applications are designed to respond to stimuli from the environment. Typically, these events are triggered sporadically; that is, the exact time of a transmission request is unknown but a lower bound on the time between two consecutive transmission requests from the same message stream is known. Such traffic is called sporadic message streams. While many scheduling algorithms and analysis techniques for wireless communications are available for periodic messages, the case of sporadic messages is less studied. Most of the current wireless protocols cannot be analyzed to offer pre-run-time guarantees that sporadic messages meet deadlines, and the protocols that do offer such guarantees rely on polling, which is inefficient when the deadline is short and the minimum time between two consecutive requests is long. In wired networks, sporadic messages can be efficiently scheduled using the controller area network (CAN) bus [Bos91], and this has already proven to be useful in 14 Background and Related Work — Binary/Countdown MAC Protocols 6WDUWRIWKHWRXUQDPHQW (QGRIWKHWRXUQDPHQW Figure 2.1: Arbitration in dominance/binary-countdown protocols. industry, as witnessed by the pervasive use of the CAN bus. It has a medium access control (MAC) protocol which is collision-free and prioritized, and hence it is possible to schedule the bus such that if message characteristics (minimum inter-arrival times, transmission times, jitter, etc.) are known, then it is possible to compute upper-bounds on message delays [BLDB06, THW94]. This MAC protocol belongs to a family called dominance or binary countdown protocols [MW79]. In such protocols, messages are assigned unique priorities, and before nodes try to transmit, they perform a contention resolution phase named arbitration such that the node trying to transmit the highest-priority message succeeds. During the arbitration (depicted in Figure 2.1), each node sends the message priority, bit-by-bit, starting with the most significant one, while simultaneously monitoring the medium. The medium must be devised in such a way that nodes will only detect a “1” value if no other node is transmitting a “0”. Otherwise, every node detects a “0” value regardless of what the node itself is sending. For this reason, a “0” is said to be a dominant bit, while a “1” is said to be a recessive bit. Therefore, low numbers in the priority field of a message represent high priorities. If a node contends with a recessive bit but hears a dominant bit, then it will refrain 2.2 Binary/Countdown MAC Protocols 15 from transmitting any further bits, and will proceed only monitoring the medium. Finally, exactly one node reaches the end of the arbitration phase, and this node (the winning node) proceeds with transmitting the data part of the message. As a result of the contention for the medium, all participating nodes will have knowledge of the winner’s priority. Besides its ability to handle efficiently sporadic message streams, binary/countdown MAC protocols can also be efficiently exploited to compute aggregate quantities. The following example illustrates this. The problem of obtaining aggregated quantities (e.g., MIN) in a single broadcast domain can be solved with a naive algorithm: every node broadcasts its sensor reading sequentially. Hence, all nodes know all sensor readings and then they can obtain the aggregated quantity. This has the drawback that in a broadcast domain with mnodes, at least mbroadcasts are required to be performed. Considering a network designed for m≥100, the naive approach can be inefficient; it causes a large delay. Let us consider the simple application scenario as depicted in Figure 2.2 (a), where a node (node N1) needs to know the minimum (MIN) temperature reading among its neighbors. Let us assume that no other node attempts to access the medium before this node. A naive approach would imply that N1broadcasts a request to all its neighbors and then N1would wait for the corresponding replies from all of them. As a simplification, assume that nodes orderly access the medium in a time division multiple access (TDMA) fashion, and that the initiator node knows the number of neighbor nodes. Then, N1can derive a waiting timeout for replies based on this knowledge. Clearly, with this approach, the execution time depends on the number of neighbor nodes (m). Figure 2.2 (c) depicts another naive approach, but using a CAN-like MAC protocol. Assume, in that case, that the priorities the nodes use to access the medium are ordered according to the nodes’ ID, and are statically defined prior to runtime. Note that in order to send a message, nodes have to perform arbitration before accessing the medium. When a node wins, it sends its response and stops trying to access the medium. It is clear that using a naive approach with CAN brings no timing advantages as compared to the previous naive solution (Figure 2.2 (a)). 16 Background and Related Work — Binary/Countdown MAC Protocols IPP-HURRAY TECHNICAL REPORT (HURRAY-TR-061102) 6 (a) CAN arbitration (b) Na¨ ıve algorithm (TDMA-like MAC) (c) Na¨ ıve algorithm (CAN-like MAC) (d) Novel algorithm (CAN-like MAC) Fig. 2. Dominance/Binary-Countdown Arbitration Motivating Examples. (a) Example of bitwise arbitration; (b) example application where N1needs to know the minimum (MIN) temperature reading among its neighbors (N2to N6); (c) possible solution for the example application using a CAN-like MAC, using fixed priorities for the messages; (d) possible solution for the example application exploiting the properties of a CAN-like MAC, where priorities are assigned at runtime according to the sensed values. with this approach, the execution time depends on the number of neighbor nodes (m). Figure 2c depicts another na¨ ıve approach, but using a CAN-like MAC protocol. Assume in that case that the priorities the nodes use to access the medium are ordered according to the nodes’ ID, and are statically defined prior to runtime. Note that in order to send a message, nodes have to perform arbitration before accessing the medium. When a node wins it sends its response and stops trying to access the medium. It is clear that using a na¨ ıve approach with CAN brings no timing advantages as compared to the other na¨ ıve solution (Figure 2b). Consider now that instead of using their priorities to access the medium, nodes use the value of its sensor reading as priority. Assume that the range of the analog to digital converters (ADC) on the nodes is known, and that the MAC protocol can, at least, represent as many priority levels This assumption typically holds since ADC tend to have a data width of 8,10,12 or 16-bit while the CAN bus offers up to 29 priority bits. This alternative would allow an approach as depicted in Figure 2(d). With such an approach, to obtain the minimum temperature among IPP-HURRAY TECHNICAL REPORT (HURRAY-TR-061102) 6 (a) CAN arbitration (b) Na¨ ıve algorithm (TDMA-like MAC) (c) Na¨ ıve algorithm (CAN-like MAC) (d) Novel algorithm (CAN-like MAC) Fig. 2. Dominance/Binary-Countdown Arbitration Motivating Examples. (a) Example of bitwise arbitration; (b) example application where N1needs to know the minimum (MIN) temperature reading among its neighbors (N2to N6); (c) possible solution for the example application using a CAN-like MAC, using fixed priorities for the messages; (d) possible solution for the example application exploiting the properties of a CAN-like MAC, where priorities are assigned at runtime according to the sensed values. with this approach, the execution time depends on the number of neighbor nodes (m). Figure 2c depicts another na¨ ıve approach, but using a CAN-like MAC protocol. Assume in that case that the priorities the nodes use to access the medium are ordered according to the nodes’ ID, and are statically defined prior to runtime. Note that in order to send a message, nodes have to perform arbitration before accessing the medium. When a node wins it sends its response and stops trying to access the medium. It is clear that using a na¨ ıve approach with CAN brings no timing advantages as compared to the other na¨ ıve solution (Figure 2b). Consider now that instead of using their priorities to access the medium, nodes use the value of its sensor reading as priority. Assume that the range of the analog to digital converters (ADC) on the nodes is known, and that the MAC protocol can, at least, represent as many priority levels This assumption typically holds since ADC tend to have a data width of 8,10,12 or 16-bit while the CAN bus offers up to 29 priority bits. This alternative would allow an approach as depicted in Figure 2(d). With such an approach, to obtain the minimum temperature among (a) Naïve algorithm (TDMA-like MAC) (b) Novel algorithm (CAN-like MAC) IPP-HURRAY TECHNICAL REPORT (HURRAY-TR-061102) 6 (a) CAN arbitration (b) Na¨ ıve algorithm (TDMA-like MAC) (c) Na¨ ıve algorithm (CAN-like MAC) (d) Novel algorithm (CAN-like MAC) Fig. 2. Dominance/Binary-Countdown Arbitration Motivating Examples. (a) Example of bitwise arbitration; (b) example application where N1needs to know the minimum (MIN) temperature reading among its neighbors (N2to N6); (c) possible solution for the example application using a CAN-like MAC, using fixed priorities for the messages; (d) possible solution for the example application exploiting the properties of a CAN-like MAC, where priorities are assigned at runtime according to the sensed values. with this approach, the execution time depends on the number of neighbor nodes (m). Figure 2c depicts another na¨ ıve approach, but using a CAN-like MAC protocol. Assume in that case that the priorities the nodes use to access the medium are ordered according to the nodes’ ID, and are statically defined prior to runtime. Note that in order to send a message, nodes have to perform arbitration before accessing the medium. When a node wins it sends its response and stops trying to access the medium. It is clear that using a na¨ ıve approach with CAN brings no timing advantages as compared to the other na¨ ıve solution (Figure 2b). Consider now that instead of using their priorities to access the medium, nodes use the value of its sensor reading as priority. Assume that the range of the analog to digital converters (ADC) on the nodes is known, and that the MAC protocol can, at least, represent as many priority levels This assumption typically holds since ADC tend to have a data width of 8,10,12 or 16-bit while the CAN bus offers up to 29 priority bits. This alternative would allow an approach as depicted in Figure 2(d). With such an approach, to obtain the minimum temperature among (c) Naïve algorithm (CAN-like MAC) Figure 2.2: Dominance/Binary-countdown arbitration motivating examples. (a) Example application with TDMA-like MAC; (b) possible solution by exploiting the properties of a CAN-like MAC, where priorities are assigned at runtime according to the sensed values; (c) possible solution using a CAN-like MAC with fixed priorities for the messages. With such an approach, to obtain the minimum temperature among its neighbors, node N1needs to perform a broadcast request that will trigger all its neighbors to contend for the medium using the prioritized MAC protocol. If neighbors access the medium using the value of their temperature reading as the priority, the priority winning the contention for the medium will be the minimum temperature reading. With this scheme, more than one node can win the contention for the medium. But, considering that at the end of the arbitration the priority of the winner is known to all nodes, no more information needs to be transmitted by the winning node. In this scenario, the time to obtain the minimum temperature reading only depends on the time to perform 2.3 Binary/Countdown MAC Protocols in Wireless 17 the contention for the medium, not on m. If, for example, one wishes that the winning node transmits information (such as its location) in the data packet, then one can code the priority of the nodes by adding a unique number (for example, the node ID) in the least significant bits, such that priorities will be unique. Such use, results in a time complexity of log m. A similar approach can be used to obtain the maximum (MAX) temperature reading. In that case, instead of directly coding the priority with the temperature reading, nodes will use the bitwise negation of the temperature reading as the priority. Upon completion of the medium access contention, given the winning priority, nodes perform bitwise negation again to know the maximum temperature value. MIN and MAX are just two simple and pretty much obvious examples of how aggregate quantities can be obtained with a minimum message complexity (and therefore time complexity) by exploiting binary/countdown MAC protocols, provided that message priorities are dynamically assigned at runtime upon the values of the sensed quantity. 2.3 Binary/Countdown MAC Protocols in Wireless WiDOM was proposed [PAT07] to solve the problem of sporadic messages scheduled on a wireless channel, and it relies on adapting dominance/binary countdown protocols to the wireless channel. This adaptation is non-trivial due to the following reasons: (i) implementations of dominance protocols for a wired medium are based on a wired-AND behavior of the bus, where the dominant signal overwrites the recessive signal; (ii) these implementations require that nodes are able to monitor the medium while transmitting—clearly this does not easily extend to the case of wireless channels— and (iii) due to non-idealistic of the used transceivers and nature of the wireless medium. In the following we explain the way WiDOM overcomes all the mentioned issues. WiDOM is composed of three phases: synchronization;contention resolution or tournament; and data exchange —see Figure 2.3. In all dominance/binary countdown protocols, nodes need to agree on a common time before starting the contention resolution 18 Background and Related Work — Binary/Countdown MAC Protocols … F E H G H H G ETG Tx/Rx (npriobit) Synchronization phase Tournament phase Data exchange phase Time Ci” Ci Ci’ Figure 2.3: Timing order of the WiDOM protocol. phase. This phase is of paramount importance since a small time drift in transmitting the priority bits may lead to an erroneous result. Hence, the synchronization is needed to provide a common reference point in time so that all nodes can start the competition at the same time and it should happen right before the tournament phase. In the initial version of WiDOM, at the start of synchronization, nodes should wait for a long period of idle time “F” —see Figure 2.3, such that no node disrupts an ongoing tournament. Then nodes with a pending message wait for another time span “E” to compensate for the potential clock drift and also ensuring that all nodes have enough time to listen for “F” time units. Afterwards, nodes start sending a carrier pulse for a duration of “H” time units that signals the start of a tournament and establishes a common time reference. To do so, they have to switch from receive mode to send mode, which takes “SWX” units of time. By sending this signal, all nodes restart their timers and synchronization ends. In the tournament phase, nodes transmit the priority of the message contending for the medium bit-by-bit. If a node loses the contention of a bit (i.e. it transmits a recessive bit and receives a dominant bit), it does not continue further bits and only proceed listening to the medium to find out the priority of the winner. If a node does not lose the contention during the current bit, it will proceed with the contention for the next bit. The nodes that have a dominant bit, start transmitting a pulse of carrier for the duration of “H” units of time, while nodes with a recessive bit perform carrier sensing for the same time span. Also, note that the fact that wireless transceivers are not able to send and receive simultaneously poses no problem to WiDOM since when a node has a dominant 2.4 Slotted WiDOM 19 bit, there is no need for reception and when a node has a recessive bit, it sends nothing; it performs carrier sensing. There is also a guarding time interval “G” to separate pulses of carrier waves. This guarding time interval makes the protocol robust against clock inaccuracies, and takes into account that signals need a non-zero time to propagate from one node to another. At the end of the tournament, the node that does not receive a pulse wins the competition and waits for “ETG” time units before starting data transmission. 2.4 Slotted WiDOM The original implementation of WiDOM, explained in the previous section, is based on commercial off-the-shelf (COTS) wireless sensor network (WSN) platforms. That version of WiDOM implies a significant additional overhead. Part of that overhead is due to technological limitations, importantly the switching time between transmission and reception mode, that can be alleviated by carefully chosen hardware. Another part of that overhead is caused by the required synchronization in which nodes should wait for a long period of silence before any data transmission. Slotted WiDOM is a more recent version of WiDOM aimed at reducing the overhead. To do so, the authors have developed an add-on platform (called WiFLEX [PGAT09, Gom08]) to perform the tournament phase more efficiently (lower overhead) and with lower energy consumption. A novel synchronization mechanism that exploits an out-of- band signaling technique was introduced in the design. Most WSN platforms use the Chipcon CC2420 radio [T. 07], which does not offer the desirable characteristics needed for the WiDOM implementation. In terms of hardware, the WiFLEX approach consists of two small boards: the WiFLEX-main board (simply main board), illustrated in Figure 2.4-(a), and the WiFLEX-daughter board (daughter board), illustrated in Figure 2.4-(b). This platform can be plugged into common WSN platforms such as the MicaZ [I. 04] or FireFly [MRR07]—see Figure 2.4. The main board sends and receives pulses during the tournament, while the daughter board, which is also known as WiFLEX-rxsync, is only responsible for receiving syn- 26 Background and Related Work — Binary/Countdown MAC Protocols problem. Several industrial standards such as WirelessHART [wir10], ISA-100.11a [ISA09] and WIA-PA [WIA11] leverage IEEE 802.15.4 physical layer with a low rate of maximum 250 kbps and a low implementation complexity for resource-constrained devices. They mainly utilize TDMA approaches to provide guaranteed access to the wireless medium. An adaptive scheduling algorithm can effectively improve the timeliness support by means of delay optimization or mitigation [TLB12, LRY+12]. The standards also adopt packet-level channel hopping to improve the reliability of individual wireless links by combating external interference and multi-path fading. ISA-100.11a, WirelessHART and WIA-PA provide a limited service differentiation in MAC schemes. They support four traffic categories. High-priority packets are allowed to access the medium prior to low-priority packets. Hence, all data flows should be allocated into one of these four classes of traffic flow and then a polling-based mechanism resolves the competition among these traffic levels. Another work called GinMAC [SBR10] is proposed to deliver data in a timely manner. This protocol encompasses three procedures: off-line network dimensioning, an exclusive TDMA schedule and delay conform reliability control to support timeliness requirements. In the implementation of GinMAC the traffic patterns and channel characteristics are known a-priori and all complex calculations including slot allocation is done offline. Due to off-line dimensioning, the protocol has a more predictable performance. Although GinMAC can support mission-critical data delivery, it has some limitations. For example, the protocol is tailored for a control loop setting in which sensor data must be forwarded to the sink, resulting in a convergecast traffic pattern. Some mission-critical applications, such as battlefield tracking, may create different traffic patterns and thus cannot be supported by GinMAC. Furthermore, as GinMAC is a TDMA-based protocol with exclusive slot usage, it is suitable for a dense albeit relatively small network. In order to remove this scalability restriction, additional work is required. In [WUT05], a MAC protocol based on a binary countdown was proposed. However, the binary countdown arbitration was employed such that collisions can cause deadline misses. 2.6 Summary 27 2.6 Summary This chapter provided background material on medium access control protocols relevant to the proposed research work. We briefly introduced the binary/countdown MAC protocol. The main advantages of this MAC design were defined in terms of (i) timeliness support for event-triggered messages and (ii) simultaneous non-destructive transmission of information in a single broadcast domain. These will be shown to be important characteristics to be exploited for efficient distributed computations in densely deployed sensor networks. Both wired (CAN bus) and wireless (WiDOM) versions of this MAC design were described, including an add-on hardware to eliminate the shortcoming of the original WiDOM implementation: slotted WiDOM. While the CAN bus implements error recovery schemes, no such mechanism have been devised for the WiDOM protocol. That would be relevant given the error prone nature of wireless channels. We will address this challenge in Chapter 4 and propose a novel solution to the problem. 28 Background and Related Work — Binary/Countdown MAC Protocols Chapter 3 Background and Related Work – In-network Data Aggregation One of the key purposes of sensor network deployments is to collect data from the physical environment in order to obtain the desired information about the status of the phenomena of interest. Data aggregation is defined as the process of aggregating data from multiple sensor nodes to eliminate the redundant transmission and therefore to prolong network lifetime. In this chapter, we survey various techniques of data aggregation in sensor networks. A special focus is then given to the use of dominance-based technologies for computing aggregate quantities. 3.1 Data Aggregation Techniques Data aggregation is used either to fuse data from different sensors to eliminate redundant transmissions [KEW02, WFS08] or to fuse data and apply signal processing for computing some properties such as MIN (MAX), AVERAGE or SUM [MSFC02]. Data aggregation techniques are tightly coupled with how data is gathered at the sensor nodes (data-centric) as well as how packets are routed through the network (routingcentric) [FRWZ07]. There are two well-known categories for packet forwarding in the network: tree-based and cluster-based approaches. 29 30 Background and Related Work – In-network Data Aggregation According to the tree-based approach [IGE+03, LRS02, XHE01], first there is the need to construct a spanning tree that is rooted at the sink node. Upon receiving a request from the sink, nodes start performing in-network aggregation along the aggregation tree by proceeding level by level from their leaves to their root. So, if two or more messages arrive to a given node, their aggregate can be easily computed. The main drawback of this approach is that due to channel impairments, it is possible to lose an aggregated data. In fact, a single message at a given level of the tree may aggregate the data coming from the whole related sub-tree. When a packet is lost at a given level of the tree, the data coming from the related sub-tree will be lost as well. The cluster-based approaches [Hei00, MR04, YG02, ZNLF04] are also based on a hierarchical organization of the network. Initially, nodes are subdivided into clusters and a special node, called cluster-head, is selected in each cluster. The cluster-head nodes are elected in order to aggregate data locally and transmit the result of such an aggregation to the sink. If the sink node loses the packet coming from a cluster-head, it will lose all the information about the underlying cluster. Several studies have been done on real-time data aggregation. Most of these studies couple the aggregation mechanism with the underlying routing or MAC approaches. Zhang et al. [ZJX10] investigated the problem of maximizing information collection under a delay bound constraint for CSMA/CA-based MAC protocols in sensor networks. They proposed an optimal algorithm and a distributed heuristic algorithm to allocate the maximal allowable transmission delay at each sensor node. Although, their approach does not guarantee the reception of all measurements; they have achieved the information collection ratio of 95% in the best case. A different approach to route packets by performing data aggregation is presented in [DBMC04], where the routing and the MAC protocols are jointly designed. The primary objective of the Delay Bounded Medium Access Control (DB-MAC) [DBMC04] scheme is to minimize the latency for delay bounded applications while taking advantage of data aggregation mechanisms for increased energy efficiency. However, considering a dense network, all the aforementioned protocols suffer from poor timeliness. The time complexity of finding a simple aggregate quantity (e.g. MIN) 3.2 Boundary Detection Techniques 31 depends on either the number of nodes in the same broadcast domain, if a TDMA MAC approach is used, or on the number of allowable retransmissions and some none deterministic factors, if a contention-based MAC protocol is used. 3.2 Boundary Detection Techniques Boundary detection in sensor networks often aimed in various applications. There are different approaches to address the problem of boundary detection and determining the extent of an event in sensor networks [CG03, NM03, WGM06, SBP04, ATS14]. Chintalapudi and Govindan presented localized edge detection techniques based on statistics, image processing, and classification [CG03]. Nowak and Mitra described a method for hierarchical boundary estimation using recursive dyadic partitioning [NM03]. They developed an inverse proportionality relation between energy consumption and the mean-square error in boundary detection and showed that their method is near-optimal with respect to this fundamental trade-off. Another hierarchical boundary estimation is proposed in [ATS14], where a contiguous two-dimentional shape of an event is found with a threshold-based boundary detection. Other schemes represent the boundary of an event or the signal landscape of a sensor network compactly using in-network aggregation [BGHS06, GSW09, HHMS03, DRK11, HR10]. Gandhi et al. studied the problem of monitoring the events of sensor networks using sparse sampling [GSW09]. However, their algorithm requires the prior knowledge of the event geometry (e.g. circle, ellipse, or rectangle) for computational efficiency. Similar method has been explored in [DRK11], which utilized a regression-based spatial estimation technique to determine discrete points on the boundary. Ham et al. present a distributed boundary detection based on in-network aggregation in which only sensor nodes that identify a boundary transmit their observation to the remote station [HR10]. To that end, they first applied a Delaunay triangulation to determine the neighbors of each node and then generate boundary segments between neighboring sensors. However, this algorithm cannot be known as a fully decentralized approach since the two steps mentioned above should be done centrally through a remote station. 32 Background and Related Work – In-network Data Aggregation There are also contour-based methods for deciding the type of an event [XLCL06, LL10]. In these works, the authors consider energy-efficient techniques to construct and incrementally update a number of two-dimentional contour maps in a sensor network. Another field of research involving detecting holes and topological features in a sensor network is presented in [Fun05, KFPF06]. In these approaches, local connectivity graphs are used to infer static features of an event but these approaches require the involvement of all the nodes in the network. 3.3 Scalablity Issues Most of the techniques mentioned in Sections 3.1 and 3.2 exploit the opportunities for parallel transmission and of en-route aggregation of data. However, in densely instrumented systems where even a very small area may contain several hundreds of sensor nodes, the performance of the common data aggregation techniques is limited by the fact that nodes in the same broadcast domain cannot transmit in parallel. Thus, the time-complexity of those approaches also heavily depends on the number of sensor nodes. This results in long delays for collecting the information of all nodes and obtaining the required set of measurements. In this context, dominance-based protocols have emerged as an enabler protocol for efficient aggregation techniques offering a much lower time complexity. The following subsections describe in detail techniques that exploit dominance-based MAC protocols to efficiently compute aggregate qualities with a time complexity that is independent of the number of nodes in a broadcast domain. Basic aggregate quantities such as MIN will be addressed, as well more complex ones such as approximate interpolation, which builds on the MIN “primitive”. 3.4 Computing Aggregate Quantities by Exploiting Dominance 33 3.4 Computing Aggregate Quantities by Exploiting Dominance It is possible to devise algorithms for sensor data processing such that its time-complexity is independent of the number of nodes. In fact, if each node uses the value of its sensor reading instead of an arbitrary priority, the node winning the contention for the medium will be the one with the minimum (MIN) of the sensed values [APE+08, ETPA11, PGAT09]. It is straight forward for the case where all measured values are non-negative. However, for the case where negative values are involved, sensor nodes should add an offset to their measurements before starting the arbitration, in order to be sure that all values are nonnegative. In [APE+08], it is demonstrated that CAN-enabled platforms can be used to compute various aggregate quantities. In [PGAT09] the authors show the same, but using slotted WiDOM. In order to understand how a dominance-based MAC protocol can be used to efficiently compute an aggregate quantity, consider a simple example of how to compute the minimum of all sensor readings. One naïve approach as shown in Figure 2.2 (a) would be to use a time-division multiple-access (TDMA) scheme and assign one timeslot to each sensor node and let a sensor node transmit its sensor reading in its slot. After one TDMA cycle, a node knows all sensor readings and the MIN value can be computed but, unfortunately, the time-complexity is O(m), where mis the number of sensor nodes. The same type of naïve scheme can be implemented with a prioritized MAC protocol. Figure 2.2 (c) shows this. Nodes contend with each other and each time the winner sends its measured value to the sink and similarly the MIN value is computed. Now consider a prioritized MAC protocol where a sensor node uses its sensed data as its priority. The MAC protocol will grant medium access to the sensor node with the minimum sensor reading —see Figure 2.2 (b). Since a dominance-based prioritized MAC protocol makes all sensor nodes know the priority of the sensor node which was granted the medium, it holds that all sensor nodes will know the minimum of the sensor reading. This makes it possible to compute MIN. The importance of the above method is that its time-complexity is independent of 34 Background and Related Work – In-network Data Aggregation the number of nodes in the broadcast domain. Similarly, the maximum value (MAX) can be obtained by this method. The only difference is that for computing the MAX value nodes use the bitwise negation of their sensed values as their priorities and compete for channel. The computation time of this method has a time complexity of O(npriobits), where npriobits is the number of bits used to represent the data (priority). Other aggregate quantities (even if approximations) such as COUNT,AVERAGE, and SUM can be computed using same building block as explained in computing MIN and MAX [APT09]. It is also possible to track how a physical quantity varies over an area observed by a dense network with the time-complexity that does not depend on the number of sensor nodes. In our work we are particularly interested in how to perform sensing in a densely deployed sensor network. Approximate interpolation is an approach we will exploit. 3.5 The Basic Interpolation Algorithm Each node is assumed to be able to take sensor readings and to know its location. All nodes use the same function to interpolate the sensor data. Nodes start with the interpolation function being a flat surface. Then, at each round, one node, which is called control point, will be selected and broadcast its measured value together with its location. Upon receiving the message, other nodes re-compute the interpolation function and this procedure iterates for a predefined number of iterations (k). Since at each iteration one control point is selected, kalso represents the number of control points used to obtain an interpolation. In order to find the most effective subset of control points, the technique described previously for finding the MIN value is used. In the Basic Interpolation Algorithm (BIA) [APE+08], the node with the highest interpolation error has the highest priority to send its value. For a node ni, the interpolation error eiis defined as the absolute difference of its sensor value, vi, and its interpolated value, f(xi,yi): ei=|vi−f(xi,yi)|(3.1) 3.5 The Basic Interpolation Algorithm 35 where xiand yiare space coordinates and the function f(x,y)approximates the sensor readings throughout the area of interest. The next step is to provide an interpolation function which is represented by a set of control points S. Each control point pi∈Shas three attributes: xi,yiand vi. The value of the approximate interpolation at the location (xi,yi)is given by vi. In each iteration, the node with the highest interpolation error is found and is added to the set of control points, S. The interpolation function f(x,y) —also called weighted-average interpolation (WAI) function [SS04, She, TOMO05]— is mathematically defined as follows: f(x,y) =              0 if S=/0 vi∃Pi∈S:xi=x∧yi=y Σi∈svi·wi(x,y) Σi∈swi(x,y)otherwise (3.2) where wi(x,y)is a weight that is inversely proportional to the distance between the ith control point and the point in the location (x,y), and is given by: wi(x,y) = 1 (xi−x)2+(yi−y)2(3.3) Algorithm 1 shows the pseudo code corresponding to BIA. It must be mentioned that this procedure is executed by all nodes so that all of them have the same approximation of the interpolation. This algorithm is valid for the case where we deal with a smooth physical signal that exhibits comparably (to the time the computation takes) slow variations over time. It is also assumed that there are no faulty sensors in the network. Algorithm 1: Basic Interpolation Algorithm input : Number of iteration (k) output: Approximate interpolation of sensor readings 1S←/0 2for i=1 : kdo 3re-compute the interpolation value according to Equation 3.2 4calculate ei 5select the sensor node niwith maximum ei 6add the node nito the set of control points S 7end 42 Improving the Reliability of Slotted WiDOM R2 The overhead related to the arbitration of the prioritized MAC protocol should scale (grow slowly) with the number of priority levels; R3 A schedulability analysis should exist for the prioritized MAC protocol; R4 The schedulablity analysis should take into consideration the case where corrupted messages in a noisy channel impose the need for retransmission. Finally, in order to obtain an efficient system, the following requirement should also be satisfied: R5 The overhead related to the arbitration of the prioritized MAC protocol should be low. Unfortunately, the current state of the art cannot fulfill all these requirements. The Controller Area Network (CAN) [Bos91], which is devised for a wired channel, offers many priority levels (hence fulfilling R2). For the wireless version of CAN, dubbed WiDOM [PAT07, AT06], there exists a corresponding schedulability analysis as well (hence fulfilling R1, R2 and R3), but the existing analysis is based on the assumption that no errors can happen during the message transmission (missing R4). Another problem with this protocol is that it imposes a large overhead (missing R5). On this account, the slotted WiDOM [13], already mentioned in Chapter 2, offers low overhead (hence fulfilling R1, R2 and R5) but no schedulability analysis is available for it. The development of a schedulability analysis for slotted WiDOM — with the capability of analyzing the responsiveness of message streams that suffer from release jitter and also experience noise on the channel — would, however, offer us the missing piece in fulfilling the five requirements listed above. In this chapter, we also introduce a technique for error recovery in the slotted WiDOM such that the protocol is made more reliable under poor channel conditions. We develop a novel schedulability analysis for slotted WiDOM taking into account the erroneous transmissions of messages which may happen under noisy conditions. Previous work [PAT07] has already provided the schedulability analysis of WiDOM, but that analysis is only applicable to the basic implementation, not to the slotted version. It also considers that all messages are transmitted over an error-free channel. 4.2 Ack-Enabled Slotted WiDOM 43 In the following sections, we first explain the error recovery mechanism proposed for the slotted WiDOM and then we present a new schedulability analysis that takes into account the erroneous transmissions of message. 4.2 Ack-Enabled Slotted WiDOM Besides physical aspects related to signal propagation, in a wireless channel a communication error may result from the interference due to various transmitters sharing the same frequency band, like Wi-Fi, Bluetooth and other sensor networks. It may also come from the presence, in the vicinity, of electromagnetic sources such as electric motors or microwave ovens. To minimize the impact of external interferers on the reliability of the system, we implement an error recovery scheme based on acknowledgment (Ack) packet transmission after receiving any data packet. Through this scheme, if the sender does not receive back an Ack packet from the receiver during a predefined period of time, it will re-issue the data transmission. In other words, the sender retries to send the same packet in the next tournament and retransmit the data until it receives the Ack from the intended receiver. It should be mentioned that the retransmission of the corrupted packet may not happen immediately after the erroneous transmission, since a higher priority message may be enqueued while the sender is waiting for the Ack of the previous transmission. Note that the error recovery method that we use for WiDOM is not exactly similar to the one that is used in the CAN bus. Unlike CAN, we do not need to globalize a detected error because in this version of WiDOM we are dealing with unicast transmissions, not multicast. To save more resources, we do not assign an individual timeslot for sending the Ack packet, since the Ack packet size is comparatively smaller than the data packet size and can be transmitted at the end of data transmission within the same timeslot. Figure 4.1 shows the “superframe” of the slotted WiDOM protocol. The ACK box in the figure is considered to accommodate the switching time (from send mode to the receive mode) and also the time duration a node needs to wait to receive the Ack message from the receiver. Accordingly, the periodicity of PSshould be chosen in a way that a message with the 44 Improving the Reliability of Slotted WiDOM … TFSS A* B* H G H G H G H G ETG Tx/Rx ACK TFSS Preamble (npriobit)x2 Synchronization phase Tournament phase Data exchange phase Start of receiving synch signal Time A*: (Prio_Tra); Transferring priority from WSN host platform to WiFLEX. B*: (Win_Prio); Transferring winner priority from WiFLEX to WSN host platform. ACK: Acknowledge packet transmission for error recovery scheme (optional). Ci” Ci Ps Figure 4.1: Timing of slotted WiDOM with a master node including three phases of synchronization, tournament and data-exchange (time intervals are not drawn to scale). longest transmission time (Ci) could be able to finish its transmission and receive its Ack packet before the start of the next synch signal. This constraint is formulated as follows: Ps≥TFSS+Prio_Tra+2×(H+G)×(npriobits+1) +ETG+Win_Prio+max(Ci)+SWX+ACK (4.1) SWX is the time needed by the radio to switch from receive to transmit mode and vice versa. TFSS is the time needed to recognize the synch signal— see Table 2.1. Prio_Tra and Win_Prio are time spans needed for WiFLEX and host WSN platform communications. Gis the guard time to let discrimination between two H-length priority bits. ETG is a gap at the end of the tournament to let nodes set their radio according to the result of the tournament, and ACK is the time for transmitting an acknowledgement packet. A random noise burst can cause a transmission error on either a data or an Ack packet. If such a transmission error occurs, packet retransmission is required, leading to an increase in the message transmission time. We estimate the time overhead imposed by such transmission errors. Let δdenote the duration of a noise burst. The number of slots affected by a δduration noise burst is at most 1 +dδ Pse. Then the new message transmission time is 4.2 Ack-Enabled Slotted WiDOM 45 TFSS Time Tournament Tx/Rx ACK TFSS Tx/Rx ACK PsPs Noise burst Noise burst Tournament Figure 4.2: Error caused by a noise burst with length of one timeslot. delayed by (D(δ)), computed as follows: D(δ) = Ps×1+δ Ps.(4.2) Figure 4.2 shows an example of a noise burst with duration of one timeslot (δ=Ps) that can add a delay of up to 2Pson the message transmission time. Given F(∆t), an error function modeling the interference in a wireless channel during an interval ∆t, the maximum incremental delay due to the error recovery scheme is: E(∆t) = D(δ)×F(∆t).(4.3) Similarly to the technique proposed by the authors in [BVN+11], we consider two different types of noise sources: (i) a periodic noise burst with the period of Tpand the burst duration of δp; and (ii) a sporadic noise burst with a minimum inter-arrival time of Ts and a burst duration of δs. The sporadic noise models the interference caused by packetbased radios (e.g., Wi-Fi, Bluetooth) while the periodic noise models the interference induced by other electromagnetic noise sources. So, being Kthe number of periodic noise sources and Jthe sporadic ones, the overall delay within the interval ∆tdue to the error recovery process is given by [BVN+11]: E(∆t) = K ∑ n=1 ∆t (Tp)n×D((δp)n)+ J ∑ n=1 ∆t (Ts)n×D((δs)n).(4.4) The choice of using the deterministic noise patterns allows deriving the response time analysis of message streams in a closed form. This is obviously in some cases a simplification, but it also reproduces some realistic noise conditions as described in [BVN+11]. 46 Improving the Reliability of Slotted WiDOM In this Thesis, we validate our findings with a real experimental testbed. Certainly, some other realistic scenarios would require the consideration of non-deterministic noise models. Although not in the scope of this work, the consideration of those non-deterministic noise models would require adapting our response time analytical framework using stochastic approaches, such as those described in [MCG13]. 4.3 Calculating Response Time for Ack-Enabled WiDOM The schedulability analysis presented in this section borrows the ideas from previously published CAN analysis [DBBL07]. It provides feasibility tests based on Worst Case Response Time (WCRT) computation. However, our analysis is non-trivial and slightly different from [DBBL07] since it deals with: – the slotted nature of the protocol; – the error detection approach, by including acknowledgment (Ack)-based mechanism and packet retransmissions, rather than redundancy through the repetition of (six) consecutive identical symbols [DBBL07], i.e., assuming more realistic wireless channel models; and – the release jitter that generally occurs when messages are being queued. The WCRT of a message stream (mi) is known to be the longest response time among all message instances qthat enter the ready queue for a period of time called level-i busy period. A level-ibusy period is a time interval [t0,t1)such that both t0and t1are beginning of a non-faulty superframe (i.e., superframes where all the three phases perform normally without any error occurrence). For each superframe in [t0,t1)it holds that either (i) all transmitted packets have higher priority than mi, or (ii) at most one transmitted packet with lower priority than miis transmitted in the first superframe (started at t0). Figure 4.3 shows an example of a level-ibusy period. The preliminary WiDOM analysis, presented in [PAT07], is simplistic in the following aspects: 4.3 Calculating Response Time for Ack-Enabled WiDOM 47 Time Stream 1 Stream 2 Stream mi Stream mi+1 t0t1 Tx Tx Tx Tx PsPsPsPs Figure 4.3: level-ibusy period; lower index shows higher priority. The upward arrow indicates the release time of the message. – It assumes that no transmission error can happen. It is not realistic to ignore the transmission errors, especially for error-prone wireless channels, when providing pre-run-time guarantees for mission-critical applications. – It does not consider the release jitter that generally occurs while messages are being queued. Consequently, following the analysis in [DBBL07], we observe that the WCRT of an instance qof a message stream mican be divided into four components as follows. 1. The queuing delay wi,q, which corresponds to the longest time interval from the start of the busy period until when the instance qstarts a successful transmission (see Figure 4.4). In general, wi,qcomprises two elements: (i) blocking imposed by the messages of lower priority set lp(i)and (ii) interference caused by set of higher priority messages hp(i). 2. The transmission time C00 i, as the time span needed to finish a transmission, which includes the tournament duration and the time needed to detect the synch signal —see Figure 4.1. 3. The release jitter (or queuing jitter [PGAT09]) Ji, which is defined as the largest difference between the initiating time of an event and the time at which the message, triggered by the event, has been enqueued. 4. The error overheads Ei, including the time for receiving Ack packets, the retransmission time and the duration of a noise burst, which is provoked by an interference source. 48 Improving the Reliability of Slotted WiDOM Time Stream m1 Stream m2 q1,0 q2,0 q1,1 q2,1 ... q2,Q2−1 Level-i busy period Tx Tx Tx Tx Tx w2,1 Figure 4.4: An example of queuing delay wi,q; lower index shows higher priority and upward arrows indicate the release time of the message. To compute the response time of a message stream miin slotted WiDOM, we consider a busy period [t0,t1). According to the definition, there should be a packet transmission in all non-faulty timeslots during the [t0,t1)interval. We observe that, according to the release time of messages in high or low priority sets, eight distinct cases can occur, as summarized in Table 4.1. In order to reduce the level of pessimism in the computation we investigate each case individually and then derive the appropriate response time equations for each of them. Finally, the maximum of the response times over all these cases will correspond to the upper-bound on the WCRT for a set of message streams. Table 4.2 summarizes all the symbols used in the following analysis. Case 1. There is no message released in the [t0−Ps,t0)interval, which is the last superframe immediately before the level-ibusy period begins. This is the simplest case where there is neither blocking from the lp(i)set nor further interference from the hp(i)set. We can Table 4.1: Different cases of WCRT computation. lp(i) /hp(i) corresponds to the set of message streams with priority lower / higher than message stream mi. Message in lp(i) Message miMessage in hp(i) Cases arrived in arrived in arrived in [t0−Ps,t0)? [t0−Ps,t0)?[t0−Ps,t0)? Case 1 7 7 7 Case 2 7 7 X Case 3 7X7 Case 4 7X X Case 5 X7 7 Case 6 X7X Case 7 X X 7 Case 8 X X X 4.3 Calculating Response Time for Ack-Enabled WiDOM 49 Table 4.2: List of symbols used in the computation of WCRT of a set of message streams. Symbol Description RiWCRT for message stream i LiThe length of level-ibusy period QiNumber of instances in message stream ithat become ready for transmission during Liperiod Wi,qTime span from start of busy period until instance qstart transmission JiRelease jitter of message stream i C00 iTime needed to finish the transmission of a message in message stream i TiThe periodicity of message stream i PsThe periodicity of synchronization signal P(Le)The penalty of an Le-length error occurring Ei(∆t)Extra time overhead imposed by the error recovery mechanism during a time interval ∆t compute the WCRT for the message stream mias follows: RCase 1 i=max q=0,...,QCase 1 i−1wCase 1 i,q+Ji+C00i−q×Ti(4.5) whereC00 iis the time span needed to finish the transmission and can be obtained as follows: C00 i=TFSS+Prio_Tra+2(H+G)(npriobits+1) +ETG+Win_Prio+Ci(4.6) In Equation (4.5), wi,qrepresents the longest time from the beginning of the busy period until when the instance qof the message stream mibegins a successful transmission. Ti is the periodicity of message stream mi. It is obvious that the erroneous transmission can lead to a longer delay. Therefore, the overhead of an error recovery mechanism must be considered and is formulated by the following recursive equation: wCase 1 i,q= q+∑ j∈hp(i)&wCase 1 i,q+Jj+Qbit Tj'!×Ps+EiwCase 1 i,q+C00i(4.7) Ei(∆t)is the maximum time required for the error signaling and recovery scheme in any time interval of length ∆t—see Equation (4.4). Qbit is the time granularity (Qbit = 50 Improving the Reliability of Slotted WiDOM 4/250000 =16µs) [PAT07]. The number of message requests Qiof the message stream mithat become ready for transmission before the end of the busy period is given by: Qi=LCase 1 i+Ji Ti+1 (4.8) where Liis the length of the longest level-ibusy period and can be computed recursively by: LCase 1 i=∑ j∈hp(i)∪iLCase 1 i+Jj Tj×Ps+EiLCase 1 i.(4.9) To investigate the remaining cases, we follow the same reasoning as above and adapt the analytical formulations as needed. Note that in each case we should replace the appropriate superscript in the response time equations. Case 2. There is an instance of the hp(i)message stream released in the [t0−Ps,t0)interval. This case is rather similar to Case 1 except that we need to consider more interference imposed by the hp(i)message stream. Therefore, Riand Qican be calculated similarly as Case 1 (Equation (4.5) and Equation (4.8)), but we must consider the following changes in the computation of wi,qand Li: wCase 2 i,q=(q+∑ j∈hp(i)dwCase 2 i,q+Ps+Jj+Qbit Tje)×Ps+Ei(wCase 2 i,q+C00 i)(4.10) LCase 2 i=∑ j∈hp(i)∪iLCase 2 i+Ps+Jj Tj×Ps+EiLCase 2 i.(4.11) Case 3. In this case, neither hp(i)nor lp(i)messages occur in the [t0−Ps,t0)interval, but an instance qof the message stream miis released in [t0−Ps,t0)slightly after the synch 4.3 Calculating Response Time for Ack-Enabled WiDOM 51 signal’s broadcast. As described in Chapter 2, only nodes with non-empty ready queue wait to receive the synch signal. Thus, the instance qmisses participating in the current tournament phase and should wait for the next superframe. As a consequence, this case is similar to Case 1, but the duration of an extra superframe must be added into Equation (4.5), resulting in: RCase 3 i=Ps+max q=0,...,QCase 3 i−1wCase 3 i,q+Ji+C00i−q×Ti.(4.12) Case 4. There is no lp(i)message released in the [t0−Ps,t0)interval, but both hp(i)and an instance qof the message stream miare released during such interval. With the same reasoning stated in Case 2, Equation (4.7) and Equation (4.9) are rewritten as follows: wCase 4 i,q= q+∑ j∈hp(i)&wCase 4 i,q+Ps+Jj+Qbit Tj'!×Ps+EiwCase 4 i,q+C00i(4.13) LCase 4 i=∑ j∈hp(i)∪iLCase 4 i+Ps+Jj Tj×Ps+EiLCase 4 i.(4.14) Then Riis expressed as follows: RCase 4 i=Ps+max q=0,...,QCase 4 i−1wCase 4 i,q+Ji+C00i−q×Ti.(4.15) Case 5. There is an instance of lp(i)released in the [t0−Ps,t0)interval but no other messages, neither minor hp(i)are released in the same period. Following the same reasoning as in Case 1, we should revise the computation of wi,qand Liwith a blocking term, obtaining: 58 Improving the Reliability of Slotted WiDOM Table 4.4: Timeout values experimentally measured on MicaZ platform. Parameter Value H+G110 µs TFSS 300 µs Prio_Tra 238 µs Win_Prio 449 µs ET G 555 µs SWX 35 µs considering the maximum data rate over the wireless medium (250 Kb/s in the ISM band of 2.4 GHz [T. 07]), the time needed to transmit a data packet is: ∀i∈{1,...,n}:Ci=128×8×1 250000 =4096 µs(4.20) In the same way, the time needed to transmit an Ack packet is 554 µs. Applying Equation (4.6), we have: ∀i∈{1,...,n}:C00 i=9158 µs(4.21) This value is computed with the timeouts as given in Table 4.4, experimentally measured from the real platform. Considering npriobits=15 and all the mentioned timeout values and the constraint in Equation (4.1), the periodicity of the synch signal Psshould be larger than 9747 µs. We choose Ps=15 ms, i.e., the master node sends a 300 µs-long synch signal every 15 ms. We relaxed this choice to allocate to the gateway some time to accomplish the data extraction from the received packet and to format the customized Ack packet. Consequently, the nodes were configured with different transmission rates, ranging from 190 bps to 14 kbps. Interestingly, these choices give analytical system utilization values ranging from 39% up to 61%. 4.4.2 Interference Pattern We create two types of interference to test the WiDOM protocol: (i) periodic interference and (ii) sporadic interference. The periodic interference is usually spatially localized and follows a regular duty cycle pattern. The best example of this category is the interference produced by microwave ovens. To create this noise pattern, we utilize the Jamlab 4.4 Implementation and Practical Aspects 59 -50 -55 -60 -65 -70 -75 -80 -85 -90 -95 -100 -105 -110 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 Amplitude [dBm] Zi g bee channels (a) Periodic interferer with duty cycle of 70 ms -50 -55 -60 -65 -70 -75 -80 -85 -90 -95 -100 -105 -110 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 Amplitude [dBm] Zigbee channels (b) Periodic interferer with duty cycle of 200 ms. -50 -55 -60 -65 -70 -75 -80 -85 -90 -95 -100 -105 -110 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 Amplitude [dBm] Zigbee channels (c) Sporadic interferer with minimum inter-arrival time of 70 ms. Figure 4.6: Spectrum occupancy in presence of interference. The spectrum analyzer also shows the effect of nearby IEEE 802.11 wireless routers. 60 Improving the Reliability of Slotted WiDOM THNC= 70 ms ≈ PS HNC Time TLNC= 200 ms ≈ PS LNC Time Interference burst Interference free Tx Tx Re-Tx Re-Tx Tx Re-Tx Tx Re-Tx Tx Re-Tx Tx Tx Re-Tx Re-Tx Tx Transmit request Retransmit request Stream mi Stream mi Figure 4.7: Example of data transmission under HNC and LNC interference. tool [BVN+11] running on an extra MicaZ node (“interferer” node in Figure 4.5). We set the interferer’s duty cycle to 70 ms and 200 ms to compare the performance of the WiDOM protocol under different noise densities. We refer to the environment with higher noise burst rate as the High Noisy Channel (HNC) scenario —see Figure 4.6 (a), and the one with with lower noise burst rate as the Low Noisy Channel (LNC) scenario —see Figure 4.6 (b). Both periodic interferers send three packets with length of 128 bytes in burst to occupy the channel for the duration of one slot, Ps=15 ms —considering data rate of 250 Kb/s. Figure 4.7 aims at clarifying, with an example, how the HNC and LNC channel conditions impact on the message stream transmissions. The message streams have the same data rate in both scenarios, i.e., the transmit requests generation time is the same. Clearly, the HNC scenario leads to more collisions than the LNC one, thus more frequent retransmissions. The sporadic noise model emulates in a fully controlled way the interference generated by heavily loaded Wi-Fi access points. To generate this type of interference traffic, we used a simple model, inspired by the Markov model presented in [BVT+10], consisting of two states: “clear channel” and “interference”. Differently from the Jamlab tool [BVT+10], in our model, instead of considering fully random and irregular interference pattern, we generate a fixed duration of “interference” to keep the burst length equal to one Psperiod. In this state, the interferer broadcasts unmodulated signals. The duration of the “clear channel” state is defined through a constant slot 5 ms duration multiplied by 4.4 Implementation and Practical Aspects 61 a random variable R, uniformly distributed over the interval [14,200]ms. Hence, the time duration of staying on the clear channel state will be a random time period from 70 ms up to 1 s. In other words, the minimum inter-arrival time between two consecutive noise bursts is set to 70 ms. We refer to this scenario as the Sporadic Noisy Channel (SPNC) scenario —see Figure 4.6 (c). All interferers generate noise in the Channel 15 of the IEEE 802.15.4 spectrum. In all scenarios, interferers are generating packets and transmitting them with the highest power level (0 dBm). As it is shown by the spectrum analyzer (Figure 4.6), the radiation power in all situations is the same, but the density of noise bursts is quite high in the Figure 4.6 (a) as compared to that in Figure 4.6 (b). It can be also observed that in the presence of a sporadic noise source, the channel spends more time in clear channel state as compared to the periodic noise source with duty cycle of 70 ms. Note that the spectrum analyzer visualizes the status of the entire ZigBee bandwidth, including the noise coming from WiFi/IEEE 802.11 wireless routers on the adjacent channels. 4.4.3 Evaluation We utilize different interference patterns to evaluate the reliability and the robustness of the WiDOM protocol against noise, while having a predictable response time for message streams. Our evaluation focuses on five network performance indices as indicated next. Packet loss ratio: the ratio of the data (measurements) missed in the gateway over total number of the generated data by sender nodes. Deadline miss ratio: the ratio of messages that missed their deadlines over the total number of generated messages. In all scenarios, the deadline is considered to be implicit which is equal to the message periodicity. WCRT miss ratio: the ratio of messages that have been sent after their calculated WCRT over the total number of generated messages. 62 Improving the Reliability of Slotted WiDOM Average response time: the average of all received messages response time in the gateway from any sender. Energy consumption: the average energy consumption of each node, expressed as a function of the number of packets sent and received. We run the experiment for both the original and the Ack-enabled versions of WiDOM in different noisy environments. All experiments were run for about 40 minutes, which corresponds to more than 40000 message transmission requests. 4.4.3.1 Packet Loss Ratio Figure 4.8 depicts the packet loss ratio for both versions of the WiDOM protocol, under different noise conditions. According to the results, two observations can be made. First, the packet loss ratio for the Ack-enabled WiDOM is much smaller than that of the original version of the WiDOM protocol in all scenarios. This is due to the implementation of Ack packets, which provide a legitimate feedback on transmission status for the sender nodes, giving them a chance for retransmitting the lost packets. Second, the high noisy channel (HNC) jeopardizes the network performance much more than the low noisy channel or the SPNC case. As it is illustrated in Figure 4.8, SPNC is less destructive, since the packet loss ratio under SPNC is lower than the one under HNC for both WiDOM versions. Two reasons contribute to this: (i) in heavy noisy channels there is a higher risk of collision for both data and Ack packets; and (ii) a higher collision rate inherently leads to more retransmission requests in the case of Ack-enabled WiDOM, which increases the traffic load. Moreover, in each scenario the packet loss ratio is almost flat against the data rate. One could think that for higher transmission rates there ought to be higher amounts of packet loss. Indeed, this happens in absolute terms, but in terms of packet loss ratio (i.e., percentage), the effect is minimal. 4.4 Implementation and Practical Aspects 63 0 0.5 1 1,5 3 4,5 6 7,5 9 10,5 12 13,5 1 5 0 2 4 6 8 10 12 14 Data Rate [kb/s] Packet Loss Ratio [%] Ack−Enabled WiDOM in HNC Ack−Enabled WiDOM in LNC Ack−Enabled WiDOM in SPNC Original WiDOM in HNC Original WiDOM in LNC Original WiDOM in SPNC Figure 4.8: Packet loss ratio of Ack-enabled WiDOM and original WiDOM. 4.4.3.2 Timing Behavior Tables 4.5- 4.7 show the response times achieved by the experimental setup of Ackenabled WiDOM under HNC, LNC and SPNC interference environments, respectively. In particular, three distinct metrics are investigated in the time domain. The first metric is the deadline miss ratio, which corresponds to the number of generated packets that did not have the chance to be transmitted. It has been observed that for all scenarios there is no deadline miss for any message stream – the two variables Gnt_N and Txed_N were always equal. The WCRT miss ratio is the second time metric considered. It indicates the number of messages that have been sent with a response time higher than their analytically computed WCRT. It has been computed by applying the response time analysis to calculate the upper-bound of response time for each message stream according to the analytical formulation detailed in the Section 4.3. We have used the timeouts as given in Table 4.4 and the upper-bound for the jitter has been estimated as 1 ms. We remind that Nano-RK uses a policy of scheduling the tasks and interrupts with a one-shot timer whose accuracy is 1 ms. So, all tasks might experience a jitter of around 1 ms for any execution. Figure 4.9, illustrates the results given in Tables 4.5- 4.7, The analytically computed response time is shown by Calc.Riand the maximum and average values of response time observed in the tests for each message stream are given by Exp.Max.Riand Exp.Avg.Ri, respectively. These notation is used in tables and figures as well. 64 Improving the Reliability of Slotted WiDOM Table 4.5: Response time in HNC. i12345 Protocol Ackenabled WiDOM Original WiDOM Ackenabled WiDOM Original WiDOM Ackenabled WiDOM Original WiDOM Ackenabled WiDOM Original WiDOM Ackenabled WiDOM Original WiDOM Ti(µs)70000 180000 350000 700000 1200000 Datarate(bps)14629 5689 2926 1463 853 Calc.Ri(µs)55158 25158 70158 40158 130158 55158 145158 70158 265158 100158 Exp.Avg.Ri(µs)21389 14370 19729 16648 27887 18675 27835 20269 38450 24067 Exp.Max.Ri(µs)53289 23163 56228 33835 91558 46490 109865 59157 169607 82223 i6 7 8 9 10 Ti(µs)1900000 3700000 5400000 5400000 5400000 Datarate(bps)539 277 190 190 190 Calc.Ri(µs)280158 115158 340158 130158 355158 145158 490158 175158 565158 205158 Exp.Avg.Ri(µs)35849 30499 39827 29554 54920 40113 52907 41039 58839 41063 Exp.Max.Ri(µs)202986 94846 236513 108986 262178 76108 290555 77645 308128 149384 4.4 Implementation and Practical Aspects 65 Table 4.6: Response time in LNC. i12345 Protocol Ackenabled WiDOM Original WiDOM Ackenabled WiDOM Original WiDOM Ackenabled WiDOM Original WiDOM Ackenabled WiDOM Original WiDOM Ackenabled WiDOM Original WiDOM Ti(µs)70000 180000 350000 700000 1200000 Datarate(bps)14629 5689 2926 1463 853 Calc.Ri(µs)55158 25158 70158 40158 100158 55158 115158 70158 130158 100158 Exp.Avg.Ri(µs)17769 13932 20020 16061 19342 18994 26118 20187 33916 22956 Exp.Max.Ri(µs)53122 23159 59232 33809 80596 44296 94604 55271 108183 73483 i6 7 8 9 10 Ti(µs)1900000 3700000 5400000 5400000 5400000 Datarate(bps)539 277 190 190 190 Calc.Ri(µs)145158 115158 175158 130158 205158 145158 265158 175158 280158 205158 Exp.Avg.Ri(µs)35303 29103 38711 29801 37509 37001 40080 40127 45397 40741 Exp.Max.Ri(µs)118599 94601 142268 104367 163848 96682 168064 105221 184175 82168 66 Improving the Reliability of Slotted WiDOM Table 4.7: Response time in SPNC. i12345 Protocol Ackenabled WiDOM Original WiDOM Ackenabled WiDOM Original WiDOM Ackenabled WiDOM Original WiDOM Ackenabled WiDOM Original WiDOM Ackenabled WiDOM Original WiDOM Ti(µs)70000 180000 350000 700000 1200000 Datarate(bps)14629 5689 2926 1463 853 Calc.Ri(µs)55158 25158 70158 40158 130158 55158 145158 70158 265158 100158 Exp.Avg.Ri(µs)19218 14122 19627 16201 19703 16962 26012 19961 35627 23108 Exp.Max.Ri(µs)52942 23240 60124 35556 98219 44215 91240 56294 122419 73947 i6 7 8 9 10 Ti(µs)1900000 3700000 5400000 5400000 5400000 Datarate(bps)539 277 190 190 190 Calc.Ri(µs)280158 115158 340158 130158 355158 145158 490158 175158 565158 205158 Exp.Avg.Ri(µs)35604 29014 38868 29462 42191 39218 46713 40793 47508 41921 Exp.Max.Ri(µs)132047 93261 153510 102286 185420 82490 181506 83912 181241 85122 Table 4.8: Response time for original WiDOM in non-lossy environment. i1234 5 Ps(µs)10000 15000 10000 15000 10000 15000 10000 15000 10000 15000 Ti(µs)30000 70000 70000 180000 120000 350000 300000 700000 900000 1200000 Datarate(bps)34133 14629 14629 5689 8533 2926 3413 1463 1138 853 Calc.Ri(µs)20158 25158 30158 40158 50158 55158 60158 70158 90158 100158 Exp.Avg.Ri(µs)10936 14035 13417 16025 14512 18731 16204 19970 18301 23281 Exp.Max.Ri(µs)17316 22901 27305 33914 36827 44260 50113 54218 54961 79540 i678910 Ti(µs)1900000 3700000 5400000 5400000 5400000 Datarate(bps)539 539 277 277 190 190 190 190 190 190 Calc.Ri(µs)110158 115158 120158 130158 170158 145158 180158 175158 200158 205158 Exp.Avg.Ri(µs)21743 26916 25047 29427 32184 36849 33927 39085 36265 40110 Exp.Max.Ri(µs)61227 89301 75203 102546 69416 98113 76439 86343 80116 109754 4.4 Implementation and Practical Aspects 67 0 100 200 300 400 500 600 12345678910 Response time (ms) Node ID Calc. Ri Exp. Avg. Ri Exp. Max. Ri (a) Ack-enabled WiDOM in HNC environment. 0 50 100 150 200 250 12345678910 Response time (ms) Node ID Calc. Ri Exp. Avg. Ri Exp. Max. Ri (b) Original WiDOM in HNC environment. 0 50 100 150 200 250 300 12345678910 Response time (ms) Node ID Calc. Ri Exp. Avg. Ri Exp. Max. Ri (c) Ack-enabled WiDOM in LNC environment. 0 50 100 150 200 250 12345678910 Response time (ms) Node ID Calc. Ri Exp. Avg. Ri Exp. Max. Ri (d) Original WiDOM in LNC environment. 0 100 200 300 400 500 600 12345678910 Response time (ms) Node ID Calc. Ri Exp. Avg. Ri Exp. Max. Ri (e) Ack-enabled WiDOM in SPNC environment. 0 50 100 150 200 250 12345678910 Response time (ms) Node ID Calc. Ri Exp. Avg. Ri Exp. Max. Ri (f) Original WiDOM in SPNC environment. Figure 4.9: Response time comparison of Ack-enabled WiDOM and original WiDOM under different noise conditions. Figure 4.9, clearly shows that no message experiences a response time higher than the calculated WCRT in all the considered scenarios, which substantiates the fact that the analytical model for the WCRT provides a fairly good upper-bound to the expected response time. The average value of response time, Exp.Avg.Ri, is the third and last metric considered in the timing category. It clearly shows how the Ack-enabled mechanism slightly increases the response time for all the message streams. As expected, this is what the system pays to achieve the good results in terms of packet 74 Improving the Reliability of Slotted WiDOM picked the maximum upper-bound among all the possible cases. To validate our calculated upper-bounds, we conducted a set of experiments under different noisy channel conditions. The experimental results have shown that implementing the Ack-enabled WiDOM reduces remarkably the packet loss rate to less than 2% even under high noisy channel as compared to the original WiDOM protocol. The experimental results also confirmed our analytical findings that the theoretical analysis offer valid upper-bound for each message streams. Chapter 5 Self-Adaptive Approximate Interpolation scheme In this chapter, we will propose a more efficient scalable data acquisition method for densely instrumented cyber-physical systems (CPS). Previous research works have proposed approaches for obtaining an approximate interpolation of sensor readings that are based on dominance protocols. Considering the dominance-based protocol, we design a new approach that offers a more accurate approximate interpolation by integrating the dynamics of the monitored signals into the computational process. We show that through a self-assessment functionality the algorithm detects sudden changes in the physical model and adapts itself accordingly. 5.1 Motivation Recent advances in technology make it feasible to mass produce small sensor devices with sensing, computation and communication capabilities. These low-power wireless devices can also be powered by the energy scavenged from ambient radio waves [TRNA14]. These capabilities have enabled the integration of physical processes and computing, and spurred a new direction of research that envisioned massive deployments of networked embedded computing devices. 75 76 Self-Adaptive Approximate Interpolation scheme Dense networks offer a better resolution of the physical world and therefore a better capability of detecting the occurrence of an event; this is of paramount importance for a number of industrial applications. However, the scale of such systems poses huge challenges in terms of interconnectivity and timely data processing. In this chapter, we focus on efficient and scalable data acquisition methods for such densely instrumented cyber-physical systems. As we discussed in Chapter 3, previous research works from our research group, have proposed approaches for obtaining an interpolation of sensor readings from different sensor nodes [APE+08, ETPA11, APT08]. Those approaches are based on dominance protocols, presenting therefore excellent scalability properties for densely instrumented systems. In fact, in Chapter 3, we discussed the role of dominance-based MAC protocols for computing relevant aggregate quantities. We mentioned that the basic interpolation algorithm (BIA) [APE+08] offers an efficient approach to obtain an approximate interpolation of a physical phenomenon. However, the inability of the BIA algorithm in accommodating the dynamics of the monitored signals is identified as one of the main drawbacks of this approach. This is an important issue, specially when the speed of change of the monitored signal is much faster than the speed of the execution of the interpolation algorithm. Recall from Section 3.5, where Sis defined as a set of control points that incorporates in building the approximate interpolation. In a highly dynamic environment, the initial points that are taken into the set Sbecome “outdated” fast, and as a result the approximate interpolation becomes inaccurate. This problem is more acute when the monitored signal is more complex (the one shown in Figure 3.1 is relatively simple) and therefore requiring more control points to be added to the set S. A solution to this problem was attempted in [ETPA11]. In that work, the authors proposed a differential interpolation algorithm (DIA) that embeds a model of the dynamics of the physical signal into the algorithm. The DIA algorithm is summarized as follows: after selecting a new control point, all previously selected control points in the set Supdate their three attributes ((x,y)coordinates and vvalue) according to the defined change model. However, the approach has some limitations, as listed next. 5.2 Novel Approximate Interpolation Scheme 77 1. There is no provision on how to obtain the physical model parameters to be incorporated into the algorithm (potentially without having any prior knowledge about the signal behavior). 2. There is no provision on any feedback control of the quality of the approximate interpolation, thus enabling the periodic re-computation of the physical model parameters that are embedded in the approximate interpolation algorithm. In this correspondence, we consider a new physical change pattern monitoring technique that is added to DIA algorithm to enable that the approximate interpolation algorithm self adapts according to the dynamics of the physical signal. Doing so, our algorithm requires no a-priori knowledge of the parameters related to the temporal change model matrix, those elements of the matrix are estimated during the execution of the interpolation algorithm. Therefore, this chapter offers an important advancement to the state-of-the-art. Our novel approach not only incorporates a physical model to enable more accurate approximate interpolations, but also detects and self-adapts to changes in the physical model. In the remainder of this chapter, we first present the general overview and detailed information of the proposed solution followed by evaluating the new approach. 5.2 Novel Approximate Interpolation Scheme The novel algorithm to compute approximate interpolation functionality incorporates compensation in the control points to accommodate the dynamics of the physical signal. The proposed algorithm also includes Learning capabilities. Learning is performed at the beginning of the algorithm and every time that there is a need for re-computing the physical model parameters. These time instants are determined by a third functionality that is called Assessment. Figure 5.1 shows each of the mentioned functionalities, and the sequence of their executions. For simplicity, we use the term “sample” to denote an approximate interpolation. Learning is needed at the beginning of the algorithm to determine the current dynamics of the physical signal. In this way, the first approximate interpolation is computed 78 Self-Adaptive Approximate Interpolation scheme for do end for No No com p ute transform matrix compute one sample Yes Yes need re-compute Tmatrix? assessment time? perform assessment Yes No wait for TS Learning Interpolation Assessment sampling time? Begin Figure 5.1: The proposed self-adaptive algorithm with Learning and Assessment functionalities. 5.2 Novel Approximate Interpolation Scheme 79 T=t0 T=t1 (x,y,v)t0 (x,y,v)t1 T=tm-1 (x,y,v)tm-1 ... time T=tm (x,y,v)tm α α Figure 5.2: Signal translation during the execution of interpolation algorithm. and then re-computed after a time interval TS. In fact the time between two consecutive samples is denoted by TSand the value of TSis set by the application designer based on the application requirements. The Assessment phase is performed to investigate the correctness of the change pattern model given by the Learning functionality. 5.2.1 The Learning Phase As mentioned earlier, during Learning, a matrix that models the change pattern of the physical signal is computed; we call this matrix the transformation matrix (Tmatrix). To define the matrix parameters, Ti,j, the trend of the signal change is observed and a system of equations based on this observation is solved. To do so, we define a time window during which the tracking is performed. The term “round” represents the time it takes to execute an iteration in the approximate interpolation algorithm. As explained in Chapter 3, one round of interpolation involves the process of taking one control point and re-computing f(x,y). The node with the highest error eican be found and added to the set Sduring one round. Algorithm 7: Learning functionality 1for j=1:5 do 2S←/0 3calculate the interpolation function f(xi,yi)based on S(as in Equation 3.2) 4calculate ej 5select a sensor node Nkwith the maximum ekthat is ek=e 6save the location (x,y)and the sensor reading (v)of the control point and form a system of equations 7end 8solve the system of equations to define parameters of Tmatrix,Ti,j 80 Self-Adaptive Approximate Interpolation scheme Algorithm 7 summarizes the Learning functionality. It is assumed that there is a monotonous change in a physical quantity, which implies that the overall shape of the signal is preserved during the observation time. With this assumption, it can be claimed that by nullifying the set S(Line 2 in Algorithm 7) at the beginning of each iteration, it is possible to determine the location of the node with the highest error, which will correspond to the peak in the observed physical signal. Figure 5.2 shows an example of a dynamic signal that is translating with the rate of αin a specific direction. We found that tracking the location of a specific point on the physical signal for five consecutive rounds provides sufficient information to solve a system of equations through which the Tmatrix is computed. We will justify this claim later, after explaining the procedure of updating set S. 5.2.2 The Interpolation Phase While performing the Interpolation, our algorithm uses the Tmatrix to update the data collected in the previous iteration. In particular, the algorithm selects a new control point at each round, and before computing the approximate interpolation f(x,y), all the previously selected points in set Supdate their three attributes (x,y,v)by applying the affine transformation expressed by the Tmatrix (see Equation 5.1). xnewi,ynewiand vnewiare the new (updated) versions of the xcoordinate, the ycoordinate and the value of the control point piin the current round.              xnewi←T1,1×xi+T1,2×yi+T1,3×vi+T1,4 ynewi←T2,1×xi+T2,2×yi+T2,3×vi+T2,4 vnewi←T3,1×xi+T3,2×yi+T3,3×vi+T3,4 (5.1) 5.2.3 Defining The Parameters of Tmatrix One approach to define the model parameters, Ti,j:{i∈{1,2,3},j∈{1,2,3,4}}in Equation 5.1, is to observe the trend of signal dynamics and then solve a system of equations based on that observation. To this end, as shown in Algorithm 7, we need to run the interpolation algorithm consecutively five times just for one round. The reason is that 5.2 Novel Approximate Interpolation Scheme 81 the system equation given in Equation 5.1 includes 15 unknowns/variables (twelve Ti,j variables and three new variables (xnewi,ynewi,vnewi)), therefore, we need to resolve 15 equations to define Ti,js. We know that within one round of interpolation the information of the node with the highest error (winner node) is found. This information includes values for the xand ycoordinates and the value, v, of the winner node. Hence, with five times collecting the information of the winner node, we would be able to construct 15 distinct equations and finally define all parameters of the Tmatrix. Accordingly, the model parameters Ti,jare computed by solving the following equations:         x1y1v11 x2y2v21 x3y3v31 x4y4v41         ×         T1,1 T1,2 T1,3 T1,4         =         x2 x3 x4 x5         (5.2)         x1y1v11 x2y2v21 x3y3v31 x4y4v41         ×         T2,1 T2,2 T2,3 T2,4         =         y2 y3 y4 y5         (5.3)         x1y1v11 x2y2v21 x3y3v31 x4y4v41         ×         T3,1 T3,2 T3,3 T3,4         =         v2 v3 v4 v5         (5.4) where (x1,y1,v1)corresponds to the first set of information given by the winner node and (x2,y2,v2)corresponds to the second set of information, and so forth. Each node should perform this computation individually. This computation imposes more complexity to our algorithm. However, this additional computational cost promotes the new algorithm to be more generic as compared to the simple DIA algorithm. We show that by applying this self-adaptive mechanism to the interpolation algorithm, it provides a smaller average error as compared to the existing algorithms. 82 Self-Adaptive Approximate Interpolation scheme 5.2.4 The Assessment Phase It is important to keep the model parameters up-to-date after computing the elements of Tmatrix. The algorithm needs to be able to detect the occurrence of a sudden change in the dynamics of the signal and adjust itself with the new change pattern. Applying feedback from the sensor field is helpful. To do so, we use a subset of the control points, let’s say the first ξnumbers taken into the previous sample, and broadcast their observed error value as a feedback message to assess the quality of the Tmatrix. The observed error of a control point is the difference between the measured value and the value of the interpolated signal in its location. Therefore, the observed error computed during Assessment is used to indicate the need for re-computing the transformation matrix. If the average observed error is larger than a threshold value ε, the currently used parameters of Tmatrix are deemed as not valid anymore, and Learning will execute. Algorithm 8 illustrates the Assessment functionality. Algorithm 8: Assessment functionality 1Requirements: 2(i) all nodes are aware of the start of the Assessment; 3(ii) latest set Sis preserved: S=q1,q2,. . . ,qk; 4for j=1 : ξdo 5if id == qi.id then 6compute the error and broadcast it 7else 8wait to receive a packet and store the observed error value 9end 10 end 11 re-compute_Tmatrix ←FALSE 12 if average observed error > εthen 13 re-compute_Tmatrix ←TRUE 14 end During Assessment, in order to collect feedback messages, we assume a TDMA-based communication. The first requirement listed in Algorithm 8 is satisfied by utilizing the same synchronization technique applied to the prioritized MAC protocol [Bos91, PAT07, PGAT09], since all nodes agree on a common reference time to start either a round of interpolation or a TDMA-slot. 5.3 Algorithm Evaluation 83 The Assessment functionality is performed with a periodicity TAthat is a multiple of TS. The exact value of the self-assessment periodicity is defined by the application designer according to the required accuracy level. Intuitively, the smaller the Assessment frequency, the more accurate representation of the signal will be achieved. 5.3 Algorithm Evaluation To evaluate the self-adaptive interpolation scheme, we developed several simulations in MATLAB, first to assess the efficiency of the transformation matrix, Tmatrix, in computing only one sample of the physical signal and compare it against the basic approach. Then we examined the execution of the self-adaptive approach in an application simulated by MATLAB, where we aim at performing a continuous monitoring of a signal with a given pattern change. 5.3.1 The Efficiency of Tmatrix As discussed in Chapter 3, the approximate representation of the physical signal can be obtained by executing the interpolation algorithm for a number of rounds (defined by kin Algorithm 1). Through extensive simulations, we studied the average error of a sample of a physical signal computed by the basic interpolation approach and the new self-adaptive approach. We consider a dense network with 2500 nodes, deployed in a square grid fashion. We also consider having an input physical signal that can be modeled by a single peak middle shape signal (similar to the one given in Figure 3.1(a)) with the following Gaussian function: p(x,y) = e−7((x−0.5)2+(y−0.5)2)+0.1 (5.5) Three types of linear signal changes are considered : (i) scaling, (ii) increment and (iii) translation. Figure 5.3 compares the average error of a sample computed by the BIA and the self-adaptive algorithm as a function of the number of considered interpolation rounds. Simulation results show a remarkable improvement in the average error of a sample computed by the novel self-adaptive approach independently of the considered 90 Feature Extraction in Densely Sensed Environments the application requirements, it might be important to extract these features by performing in-network processing. While feature extraction may not be an issue for a small density network (for example, tens of sensor nodes), it is still a challenging problem for a high density network. In applications where measurement constraints are required to have a high spatial granularity, covering even a small area (e.g., one square meter), may require hundreds to thousands of sensor nodes. Some examples of densely deployed sensing applications where features of physical quantity need to be monitored frequently are sleep monitoring for health [LXH+13], smart-surfaces for space and aviation [PLB04] and food industry [CO05]. In this chapter, we tackle the problem of feature extraction in applications that require such dense deployments. 6.2 Motivation Figure 6.1 presents an example of the distribution of a physical quantity (e.g., temperature or pressure values) known as a field. In this example, the distribution has three regions of activity that require detection and evaluation. A dense sensor network for measuring such a physical quantity would involve deploying sensor nodes to measure each data point in the distribution. The regions of activity, called active regions, are defined as the regions, where the deployed sensor nodes sense some values of interest. One way to define these active regions is by estimating the boundaries of these regions. A naive approach to obtain this information would be to collect readings from all sensor nodes and process them centrally. This is usually inefficient, since typical channel access techniques do not scale with an increase in number of nodes. Therefore, it becomes advantageous to devise techniques that perform feature extraction irrespective of the density of the network. Computing even simple aggregate quantities such as extrema (minimum or maximum) is not trivial for a dense network as it may require collecting data, in the worst case, from all nodes [PGAT09] (even if some sort of spatial sub-sampling is employed [NM03]). Dominance-based or binary-countdown MAC protocols, as discussed in Chapter 2, help in finding the minimum value in constant time [MW79, Bos91, PAT07]. Furthermore, 6.3 System Model 91 020 40 60 80 100 0 20 40 60 80 100 0 1 2 3 4 x−axis y−axis Sensed value X X X Boundaries of events Local Maxima Figure 6.1: An example of a 2-D physical quantity field with 10,000 sensor nodes. Each data point corresponds to a value sensed by an individual node. finding peaks and their boundaries in a distributed network, where each data point is measured by individual sensor nodes, is computationally expensive, time consuming and typically does not linearly scale with an increase in network size. In this chapter, we first establish that finding the local extrema is a challenge even after the global maximum is known. Once the global maximum is identified in constant time, we propose a few transforms that nodes employ on local data, which helps in identifying other peaks (local maxima) and their boundaries in the spread of the physical quantity being measured. Our proposed transforms, referred to as augmenting functions, allow the identification of local extrema in constant time. Moreover, instead of collecting all data as in the naive case, these augmenting functions result in fewer number of measurements being collected. 6.3 System Model We consider a sensor network where each sensor node has a unique identifier,i, and measures a particular physical quantity, si, using a sensing unit. Each sensor node knows its 2-D coordinates (x,y) in the plane of deployment. We assume that the feature extraction mechanism can either be carried out periodically, as a part of a sense-process-actuate control-loop, or sporadically initiated by an external controller, like a data sink or a master node. 92 Feature Extraction in Densely Sensed Environments As stated earlier in this chapter, the collection of all sensor values across the total sensed area is referred to as a field (shown in Figure 6.1). Each data point in the field corresponds to a true (or non-faulty) sensor reading value, sensed by an individual sensor node at its physical location. The spatial granularity and the size of the field is directly correlated to the distribution of the nodes and their spread. We also define active region as a physical area populated by sensor nodes that sense some activity. The overarching goal of our technique is to find location, boundaries and shape of an active region, which we referred to as features, in the physical environment. To illustrate and evaluate our approach, we generate various sample fields by a summation of 2-D Gaussian functions. Function M(vi)represents the process of finding the MIN over values vipublished by independent sensor nodes in a broadcast medium, where i∈ {1,2,...N}and Nis the number of sensor nodes in a broadcast domain. In fact, M(vi)represents one execution of interpolation round, as discussed in Chapter 5, for an SBD domain (later on, in Section 6.5.2 we will discuss the details of function Mfor MBD, where several number of rounds need to be run). We exploit the property of simultaneous transmissions in dominance-based protocols to devise this function. viis the scaled value that each sensor node computes based on its measured value siand the global maximum smax measured in the field. After each round, all the other sensor nodes know the identifier and the location of the sensor node with the MIN value. This sensor node is known as the winner of the round. We use ˆ ito denote the identifier of the winner. Hence, the function Mcan be formally represented as: {ˆv,ˆ i,ˆx,ˆy}=M(vi)∀i∈{1,2,...N} where ˆxand ˆyare the xand ycoordinates of the sensor node with the global minimum value ˆv. The choice of the vivalues used by an ith sensor node in the application of function Mdepends on the requirements of the application. It should be noted that a sensor node can only use its local information (such as identifier, sensor value and physical location) and other global data available from the previous iterations of M. For our goal of identifying various features, we augment (or transform) these input values such that the 6.4 Feature Extraction Using Augmenting Functions 93 Table 6.1: Summary of the symbols and notations used in this chapter. Symbol Description sisensor value measured by sensor node i smax maximum value collected by sensor nodes νi=1+si smax scaled sensor value with respect to the maximum value over all sensor nodes Aβ,Aγ,Aδaugmenting functions used for different feature extraction techniques M(vi)finding the MIN over all vivalues M(−vi)finding the MAX over all vivalues φ(νi,xi,yi)function computed by sensor nodes πstermination condition global minimum returned by Mcorresponds to one of the local minima or an edge of an active region. The function Mcan be applied to the value computed by φi, which is a function of the sensor values and their location. The codomain of the function φidenotes a set of values it can take. We assume that the cardinality of the codomain of φiis large enough that the probability of computing the same φiby two sensor nodes is negligible and thus an unique sensor node ˆ iis chosen. The time-complexity of Mis proportional to the number of bits used to encode φi, and hence, it is proportional to the logarithm of the cardinality of the codomain. However, as all sensor nodes transmit simultaneously in a dominance-based MAC protocol, the time required for the application of Mover a network is independent of the number of sensor nodes. Table 6.1 summarizes the notations and symbols that we use in the following sections, where we define a set of functions to extract different features of the field. 6.4 Feature Extraction Using Augmenting Functions In this section, we describe in detail a set of augmenting functions that can extract an approximate but faithful representation of various features in the field by applying simple transforms on the sensor values. We show that this process can be done with a limited number of broadcast messages or floodings in the cases of SBD or MBD, respectively. 94 Feature Extraction in Densely Sensed Environments −10 −8 −6 −4 −2 0 2 4 6 8 10 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 x−axis Signal Level Actual signal Augmented with β=0.11 β ≥ 0.2 Global maximum Local maximum Global minimum of the augmented signal Local minimum Figure 6.2: An example of augmented function Aβof the normalized input signal with various βin the range of [0.11, 0.5) in 1-D domain. 6.4.1 AβDistance Augmenting Function As described earlier, a global maximum value in a sensor field can be easily found by applying function M. However, finding the spread or boundaries of this peak (local maximum) is not trivial. If we modify the MAC protocol such that the sensor node with the global maximum does not participate in the next round, there is still a high chance that one of the adjacent sensor nodes to the peak will become the next local maximum. On the other hand, we might have to predefine a neighborhood range around the peak that should be excluded in the next cycle to make sure that another local maximum be the new global maximum. In this case, choosing the size and shape of the neighborhood is also a challenge. We demonstrate the process of finding an adjacent local minimum with a simple 1-D Gaussian field example, shown in Figure 6.2. Using this example we show that, by utilizing the augmenting function over the input signal, the adjacent local minimum becomes the global minimum. In this example, the field consists of three peaks and the highest peak (the global maximum) lies in the center. Finding the spread of the peak with the global maximum is 6.4 Feature Extraction Using Augmenting Functions 95 not trivial as the global minimum point can be one of those sensor nodes near the borders of the field. It is important to suitably modify the process of identifying the extrema such that a local minimum adjacent to a peak (adjacent valley) can be found. For this purpose, we observe that an adjacent valley should have a low value and its distance from the peak should also be small. Hence, each value in the field is transformed (multiplied) with the distance from the peak. With this transformation, the points located farther from the peak are associated with higher values (compared with its sensed value) and only points with the lowest sensed value and the smallest distance from the peak can become the global minimum in the augmented field. It is possible that this global minimum is a point in an adjacent valley. The boundary of this peak is found with just two rounds of executing Mfunction: (i) finding the global maximum in the original field; and (ii) identifying the global minimum in the augmented field. For 2-D Gaussian fields, the 1-D approach described above can be directly applied. Different active regions of the field are found by excluding the sensor nodes lying inside the identified active region from participating in the next rounds. The process of finding active regions is shown in Algorithm 9. Initially, function Mis used to find the global maximum (smax), then a circular area around the identified peak is filtered out. The radius of this filtering circle is set as the distance of an adjacent valley from the peak. The value and the location of the adjacent valley (Sad j−valley and dad j−valley) are found by one application of Mfunction (line 9 in Algorithm 9). Each sensor node uses a function φβas an input to M. The function φβtakes into account two properties of the field: (i) sensed value s; and (ii) sensor’s proximity to the peak d. That function is defined as follows: φβ=ν×Aβ(d)(6.1) νis the scaled value and is defined as: ν=1+s 1+smax (6.2) and smax is the value of the global maximum, found at the beginning of the algorithm. 96 Feature Extraction in Densely Sensed Environments Algorithm 9: Distance augmenting function (Aβ) executed on each sensor node ni 1begin 2Silent ←0 3smax ←M(−φs)// find global MAX 4πs←a fraction of smax // termination condition setting 5while snew−peak >πsdo 6if Silent 6=1then // if the node is not filtered out 7snew−peak ←M(−φs)// find the new peak 8compute φbased on Equation 6.1 9<sad j−valley,dad j−valley >←M(φβ) 10 Rf←dad j−valley 11 di←distance between new-peak and node ni 12 if di<Rfthen 13 Silent ←1 14 end 15 end 16 end 17 end Aβ(d)is the augmenting function, which is formulated as follows: Aβ(d) = eβ(d dmax )2(6.3) where dmax is the diameter of the monitored area, and it is used to normalize the distance from the peak. βis a parameter to control the impact of distance on the augmented field with respect to the scaled value ν. To ensure that the winning sensor node is located at the adjacent local minimum of the field, the priority function φβis computed so that the distance is exponentially penalized. Finally, by finding the global minimum over φβvalues at all the sensor nodes, we are able to find a point that lies in the adjacent valley with a high probability. The distance between the adjacent valley point and the peak determines the filtering radius, Rf(line 10 in Algorithm 9). Sensor nodes that are located within the filtering circle refrain from participating in the next iterations. Repeating this procedure conducts to finding all the peaks in the region. The algorithm stops when the value of the new peak (snew−peak) is lower than a certain user defined threshold πs, which is a fraction of the global maximum. By finding the peaks and their spread, this approach helps in identifying the location and the number of circular active regions in a field. 6.4 Feature Extraction Using Augmenting Functions 97 6.4.2 AγVector Augmenting Function Our second augmenting function is used for cases where we are interested in finding a boundary around all active regions. This approach can be used for a range of applications such as crowd monitoring for smart cities or sleep monitoring for health-care. In this approach, if we assign larger values of φto sensor nodes that lie on the boundary of an active region, then the result of applying the Mfunction over the negation of the φvalue corresponds to the boundary of active regions. This is implemented by augmenting the sensor values with a function that grows in a particular direction. The vector augmenting function Aγis designed to work with binary fields, where the input signal is not smoothly distributed, and two neighboring sensor nodes may have very close or very different measurements. By applying Aγ, each sensor node multiplies its measurement with a vector ~u. The rationale behind using a direction is to find the sensor nodes that sense a high value and are located as far as possible in the direction given by ~u, which corresponds to the edge of an active region in that direction. To compute the function φ, sensor nodes transform their locations with a direction as follows: φγ=vp×Aγ(x,y,θ)(6.4) where vpis a participation value, which is either 0 or 1, depending on the sensed value being below or above a threshold. Sensor nodes with vp=1 are part of the active region. The augmenting function is defined as follows: Aγ(x,y,θ) = eγ(x.cos(θ)+y.sin(θ)) (6.5) xand yare the coordinates of the sensor location and θis the direction given by vector~u. By using Aγ, the value is “projected” in a direction given by the vector~u. The sensor node that has the largest value has a high probability of being located on the border of an active region in the direction of~u. The way this approach works is outlined in Algorithm 10. The algorithm explores the region by choosing random directions defined in a set {¯vθ}. We assume that the seed for generating this pseudo-random directions is generated by the initiator of the boundary 98 Feature Extraction in Densely Sensed Environments Algorithm 10: Vector augmenting function Aγ, executed on each sensor node ni 1begin 2smax ←M(−φs)// find global MAX 3πs←a fraction of smax // termination condition setting 4{fθ}←∅// the set of filtered directions 5if s<πsthen 6vp←1 7else 8vp←0 9end 10 {¯vθ}← a set of θdirections 11 foreach θ∈{ ¯vθ}do 12 if θ/∈{fθ}then 13 compute φγbased on Equation 6.4 14 <sedge,(x,y)edge,θedge >←M(−φγ) 15 if (x,y)edge was found with other direction θxthen 16 {fθ}←{fθ}∪θxθ+2ε 17 end 18 end 19 end 20 end detection process. Thus, all the sensor nodes will use the same {¯vθ}in each iteration. Repeating this procedure in different directions makes it possible to find the boundary of an active region by computing the convex hull of the collected locations. If two angles lead to a same point, it means that any angle over the arc confined by these two angles would result in that point. Thus, this arc can be filtered out from further investigation. Figure 6.3 shows an example where two angles of θ1=31◦and θ2=89◦lead to find the same location P2. In this case, there is no need to examine more directions in the region of 31◦≤θ≤89◦. We also use marginal extension εto limit further the redundant directions in the arc denoted by θi±ε. We discuss the impact of ε in Section 6.6. More iterations of the algorithm leads to more accurate boundaries, but at the cost of more resource consumption. We show in Section 6.6 that with the above filtering strategy, we are able to reduce the number of dominance rounds, while still building a valid description of the active region. The worst case for our algorithm happens when the event boundary looks like a perfect circle where each new direction will give a new point (assume having a very dense deployment of sensors and consider a marginal extension of 6.4 Feature Extraction Using Augmenting Functions 99 ɽ=89° 15 10 5 0 -5 0 5 10 15 P P x-axis y-axis 2 1 ɽ=31° Figure 6.3: An example of boundary detection for a hexagonal-shape event. ε=1◦; in this case, up to 359 individual readings will be collected). However, the results show that the number of readings is usually much less in practice. 6.4.3 AδJoint Augmenting Function As described earlier, the distance augmenting function Aβidentifies circular active regions. For complex fields,Aβmay need several circular active regions to cover a noncircular shape. On the other hand, vector augmenting function Aγonly provides a convex hull of all the active regions. So, a field with several isolated active regions is identified as one large shape, which may not provide enough insights regarding the structure of the active regions. x−axis y−axis 0 20 40 60 80 100 0 20 40 60 80 100 Figure 6.4: An example of boundary detection around the peaks with a non-uniform distribution. 106 Feature Extraction in Densely Sensed Environments Global MIN Initiative Figure 6.7: An example of the worst case scenario to determine the required number of tournament (N). Assuming D=12√2 and Rco =2√2, the number of tournaments will be N=2×d D Rco e=12, i.e. two times the number of circles depicted in this figure. It takes six tournaments to activate the node with MIN and another six tournaments to receive back the global MIN by the initiative sensor node. tournament. Since nodes that are located in the border of the communication range of the initiator are not reachable by each other, border sensor nodes find different MIN values according to their location. Figure 6.8-b shows the result of finding MIN after execution of the first tournament. The two local MIN values (1 and 2) are propagated in the first tournament. In the next iteration, all activated nodes perform the tournament and update their MIN values (see Figure 6.8-c). Finally, after five tournaments, the global MIN is known throughout the network. However, the multi-hop protocol described above can suffer from the hidden terminal problem. As dominance-based protocols allow nodes to listen to MIN value even from simultaneous receptions, hidden terminals in this case can cause a device in the middle, to learn a spurious MIN value. To elaborate, consider three sensor nodes N1,N2and N3(with measured values 1, 2 and 3, respectively) as depicted in Figure 6.9. According to dominance-based protocols, during the tournament a sensor node transmits its measured value bit-by-bit. Upon knowing the existence of other nodes with a smaller measured value, it stops sending the rest of the bits. Now consider the scenario given in Figure 6.9-b. Node N3loses the tourna- 6.5 Computing Global Extrema in MBD Networks 107 4 3 2 1 0 1 3 5 6 1 1 2 2 2 2 2 4 4 3 3 3 4 2 5 3 Initiator 4 3 1 1 0 1 1 5 6 1 1 2 2 2 1 1 1 2 1 2 2 4 1 5 2 1 1 5 5 1 1 1 1 1 1 1 1 1 0 0 0 0 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 (a) (b) (c) 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 1 0 1 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 (d) (e) (f) Figure 6.8: Compute MIN in the MBD network. The evolution of determining the MIN value is shown in (a)-(f). The network diameter D=5 and communication range Rco =2. Pale numbers show inactive sensor nodes; dotted circles show the communication range in an SBD; the effective sensor nodes are shown in bold. N1 N3 N2 R2 R1 N1 N3 N2 V=011 V=010 V=001 bit3 bit2 bit1 0 0 0 0 1 0 Node N3 Perception 0 1 0 1 Lost 0 Time Tournament N1 N3 N2 V=011 V=010 V=001 bit3 bit2 bit1 0 0 0 0 1 0 Node N3 Perception 0 1 1 Lost Time Tournament TX slot RTX slot TX slot RTX slot 0 Hears smaller number Lost Lost TX slot RTX slot Lost 1 (a) (b) (c) Figure 6.9: Example of hidden terminal problem during a tournament execution (we assume three priority bits) (a) network topology, (b) execution of tournament that leads to an error in node N3, and (c) execution of tournament, including an extra time slot for bit retransmission. 108 Feature Extraction in Densely Sensed Environments ment after receiving the smallest value from node N1. Since node N1and N2are not able to communicate directly, node N2proceeds sending its last bit, which is 0, and node N3 mistakenly perceives MIN in the network as being 0. To avoid this problem, we consider two slots for each bit transmission as proposed in [PATR07]. The first slot is dedicated to the bit transmission itself and the second slot is dedicated to the retransmission of the bit detected during the first slot. If the current bit of a sensor node is dominant, there is no need to retransmit this bit for the second time, but if the bit is recessive and the sensor node detects a dominant bit during the transmission slot, it retransmits a dominant bit in the following retransmission slot (see Figure 6.9-c). This bit-level redundancy solves the problem and leads to the correct perception of MIN in the network. Obviously, it will increase the tournament duration. 6.6 Evaluation We evaluated our proposed approaches in different simulated scenarios by considering the following three metrics: Number of Rounds. A sensor node gets channel-access permit to broadcast a message in one round of execution of the Mfunction if its value is the global minimum. Hence, the number of rounds corresponds to the number of message broadcast or flooding. Accuracy. It represents the fraction of sensor nodes that declare themselves to be located in the active region(s) Ndet to the number of sensor nodes that truly lie in the active region(s) Ntrue: Accuracy =Ndet Ntrue ×100(%).(6.7) In cases where the detected area is larger than the actual active region, (Ndet >Ntrue), accuracy is more than 100%, which signifies the overestimation of the active region. Execution Time. It is the time needed to extract the various features according to the proposed augmenting functions and is computed as follows: 6.6 Evaluation 109 Execution Time =Number of Rounds×TM(6.8) where, TMis the execution time of the Mfunction. In SBD networks, TMis equal to one tournament duration. However, in MBD networks, TMdepends on the approach used for computing the global extrema (as discussed in Section 6.5). We first show the process of computing TMin MBD networks, and then evaluate the feature extraction techniques for various exemplifying scenarios. 6.6.1 Computing the Execution Time of MFunction, TM As stated earlier, the application of Mfunction results in identifying the global MIN over values of sensor nodes in a shared medium. We consider a network of size 100×100 sensor nodes in a shared medium. We change the communication range of sensor nodes Rco to study the performance of the new ripplebased and the classical cluster-based approaches in scenarios where the communication range of the sensor nodes would divide the network into multiple broadcast domains. For the cluster-based approach, where clusters are built based on a virtual range, we set the range of virtual communication r, to be always half of the actual communication range (Rco) of the sensor nodes. To have a precise computation of a tournament round, we consider the timeouts as given in Section 4.4.1, Table 4.4. As illustrated in Figure 6.9 to solve the hidden terminal problem in the ripple-based approach, it is needed to send each bit twice during the tournament. Considering 110µsas the length of one bit exchange, the tournament takes 110×nprio +ηµsfor the cluster-based approach and 2×110×nprio +ηµsfor the ripplebased approach where, nprio is the number of priority bits and ηis the time overhead imposed by the MAC protocol during the tournament. This extra time overhead is mainly due to synchronization and hardware shortcomings. For nprio =15, the value of extra time overhead is η=3099µs. Accordingly, the tournament takes 4749µsand 6399µsfor the cluster-based and the ripple-based approaches, respectively. 110 Feature Extraction in Densely Sensed Environments Table 6.2: Computation time of the MIN value in the cluster-based and the ripple-based approaches Communication Cluster-based Ripple-based (Rco,r) (Rco) range TnmtaTime(µs) TnmtaTime(µs) Rco =14, r=7 12 159388 8 96248 Rco =20, r=10 10 137602 5 64763 Rco =28, r=14 10 141698 4 50172 Rco =34, r=17 11 150543 3 39677 Rco =40, r=20 10 137602 3 35581 aNumber of referenced tournaments. Table 6.2 shows the number of referenced tournaments along with the time needed to find the global extremum in an MBD network. In this computation we took into account the time needed to aggregate data in the case of the cluster-based approach, as well as the time required for flooding the local information of the winner in the ripple-based approach. However, in both cases we assume the best case scenario. For data aggregation through the black-node tree, we first compute the maximum degree dof the cluster interfering graph (see Figure 6.5-a). To prevent any collision, it is considered that we need to have at least dtime-slots to collect data in the leader node. The duration of the time-slot is considered to be the time needed to transmit a 128 byte-size packet. Assuming the IEEE 802.15.4-compliant MICAz’s radio [CRO04] with data rate of 250 Kb/s, the time-slot duration (Ts) is then 4096µs. For the ripple-based approach, we compute the flooding time according to the theoretical lower latency bound given in [FZTS11]. In that work, the authors simplify that given that nodes transmit concurrently, the theoretical lower latency bound in a network with size hhops is h.(Ts+Td). The number of hops is computed as h=dD Rco e, where Dis the network diameter and Rco is the communication range of sensor nodes. Tdis the radio processing delay, which is in the order of a few microseconds and is determined by the radio; for simplicity, we ignore Tdin our computation. As expected, increasing the communication range results in a faster computation of MIN with the ripple-based approach. Also, this method needs a smaller number of tournaments as compared to the cluster-based approach. However, in the cluster-based approach, 6.6 Evaluation 111 we do not observe the same continuous descending trend in the number of referenced tournaments. The reason is that the placement of the clusters plays an important role in the construction of the black-node tree and the cluster interfering graph that affects the d value. It should be mentioned that the given time for both approaches is slightly optimistic. In the cluster-based approach, we do not consider the extra overhead imposed by the setup phase for cluster formation and similarly in the ripple-based approach we have used the lower bound of the flooding delay as in [FZTS11]. Note that in the cluster-based approach, not all sensor nodes become aware of MIN, while, in the ripple-based approach, which is a fully distributed algorithm, all nodes would know MIN. 6.6.2 Identifying the Active Regions We consider the same network settings as described in the previous subsection, with the size of 100×100 sensor nodes. First, we show the performance of distance augmenting function to identify circular active regions. For evaluating our approach, we generate various scenarios with several active regions. The active regions may or may not overlap resulting in complex fields. The details of the scenarios are provided in Figure 6.10. In each round of execution, after finding the global maximum, all the sensor nodes compute local values of φβaccording to Equation 6.1. Figure 6.11 illustrates the number of circular active regions with different termination rules for scenario sc1. Increasing the threshold level helps the algorithm to converge faster in smaller number of rounds, but at the cost of reduced accuracy. Figure 6.12 shows the number of rounds and the corresponding obtained accuracy for different threshold values. We believe that the property of the field plays an important role on the number of required rounds and on the accuracy of the detection. In some scenarios, increasing the termination threshold reduces the number of rounds as well as the overestimated area. This happens for scenarios sc1,sc3 and sc6, where the active regions can overlap. However, for scenarios sc2,sc4 and sc5, where either few active regions exist or active regions are far apart, the number of rounds and the accuracy remains almost the same for all termination conditions. The existence of isolated peaks in the field 112 Feature Extraction in Densely Sensed Environments x−axis y−axis 0 20 40 60 80 100 0 20 40 60 80 100 x−axis y−axis 0 20 40 60 80 100 0 20 40 60 80 100 (sc1) (sc2) x−axis y−axis 0 20 40 60 80 100 0 20 40 60 80 100 x−axis y−axis 0 20 40 60 80 100 0 20 40 60 80 100 (sc3) (sc4) x−axis y−axis 0 20 40 60 80 100 0 20 40 60 80 100 x−axis y−axis 0 20 40 60 80 100 0 20 40 60 80 100 (sc5) (sc6) Figure 6.10: Six scenarios with different active regions; each sensor node sets the value of β=10 to compute its priority —see Equation (6.1-6.3). Each circle represents one filtering zone that is computed by two readings from the sensor network and excludes sensor nodes located inside the circle from participation in the future iteration(s) of the algorithm. πsis set to 10% of the global maximum value. 6.6 Evaluation 113 x−axis y−axis 0 20 40 60 80 100 0 20 40 60 80 100 x−axis y−axis 0 20 40 60 80 100 0 20 40 60 80 100 (a) (b) Figure 6.11: The effect of termination threshold, πson the detection of active regions. The algorithm terminates when a new detected peak is (a) 20% and (b) 30% of the global maximum value. sc1 sc2 sc3 sc4 sc5 sc6 0 10 20 30 40 50 Scenarios Number of rounds [bar chart] 30% 20% 10% 0 50 100 150 200 250 Accuracy (%) [line chart] 10% 20% 30% 30% 10% Figure 6.12: The number of rounds and the accuracy of active region estimation under the different scenarios for various πs={10%,20%,30%}of the global maximum. sc2 sc4 sc5 0 50 100 150 200 Scenarios Accuracy (%) β = 13 β = 15 β = 20 β = 40 β = 50 β = 60 Figure 6.13: The effect of βon the accuracy. 114 Feature Extraction in Densely Sensed Environments sc1 sc2 sc3 sc4 sc5 sc6 0 1000 2000 3000 4000 5000 Execution Time (ms) Scenarios C(14,7) C(40,20) R(14) R(40) Figure 6.14: Execution time of Aβ(β=10, πs=20%) in an MBD network with different communication ranges for the cluster-based approach: {C(14,7), C(40,20)} and the ripple-based approach: {R(14), R(40)}. results in identifying all active regions by a fixed number of circular sections. The high value of overestimation in sc4 and sc5 is due to the steepness of the peak in the field. This steepness causes an overestimation in the filtering radius which in turn leads to a much larger (squared) overestimation of the circle’s area. We found that the choice of the exponential coefficient βin our given heuristic (Equation 6.3) affects the overestimation of active regions. In fact, the coefficient βimpacts the relative weight of distance from the peak with respect to the value of the field at a given point. Choosing an optimal value of βis not possible without the prior knowledge of the field, but the order of βcan be chosen based on the size of the field such that a proper trade-off between the sensor value at a given sensor node and its distance from the peak is maintained. Particularly, βshould be chosen such that the impact of distance can be pronounced as compared to the distance normalization (dmax in Equation 6.3). For an area of 100×100, we found that suitable values of βare in the order of 10. Specific results on the accuracy for the scenarios sc2,sc4 and sc5 are shown in Figure 6.13. The main goal of this experiment is to investigate the level of overestimation given by Aβ. It is observed that for scenarios with isolated peaks, higher values of βimprove the coverage estimation accuracy (β=40 for scenario sc4 and β=60 for scenario sc5). But for scenarios where the spread of peaks overlap, the effect of changing βis less pronounced, as in the case of scenario sc2. Figure 6.14 shows the time it takes to detect the location of active regions by Aβ. 6.6 Evaluation 115 We examined the performance of the cluster-based and the ripple-based approaches for different communication ranges Rco ={14,40}, which are the extreme ranges (shortest and longest) in Table 6.2 . Interestingly, the execution time of Aβunder the ripple-based approach is at least 58% faster than that for the cluster-based approach. Increasing the communication range from Rco =14 to Rco =40 leads the algorithm to be 63% faster under the ripple-based approach while it improves the cluster-based approach only by 34%. 6.6.3 Convex-hull Around Active Regions For evaluating the convex-hull approach described in Section 6.4.2, we convert the field to a binary field by thresholding, such that a sensor node’s value is 1 if the sensed value is greater than 10% of the maximum value, and 0 otherwise. The details of the scenarios are provided in Figure 6.15. We set the marginal extension angle to ε=1◦and γ=1. We compared our technique with a TDMA approach, where a fixed number of randomly chosen sensor nodes send their measurements. For the random approach, the number of readings was set to 150. Figure 6.16 shows the accuracy of our second technique in terms of average percentage of coverage area by running the simulation over 100 iterations. As shown, our technique covers more than 97% of the area in all the scenarios through transmitting 26 to 33 broadcast messages compared to 36% to 72% coverage by 150 randomly chosen packets. Hence, we acquire a more accurate boundary estimation with 77% less broadcast messages. Increasing the marginal extension angle, ε, still provides a satisfactory coverage area estimation, while reducing the number of messages. We tested the performance of our proposed algorithm with different marginal extension angles in all the mentioned scenarios. As shown in Figure 6.17, by increasing ε, the number of rounds decreases, since by enlarging the angle, more search space is filtered out and consequently less packets are needed to be broadcast. However, increasing εmight diminish the performance of the algorithm in terms of estimated coverage area. Figure 6.18 shows the performance degradation by increasing 122 Feature Extraction in Densely Sensed Environments of such mechanisms that build their data collection or dissemination capabilities based on the Glossy protocol [FZTS11]. Since we aim at obtaining an efficient and scalable algorithm with low time-complexity, we compare the performance of different flooding approaches based on execution time and scalability. Chaos outperforms LWB in terms of completion time [LFZ13]. In fact Chaos is able to collect small amounts of data, such as a 1-byte payload, from a 100-node network within less than 100 ms. We believe that there are two main advantages of our proposed ripple-based approach over Chaos. Firstly it provides a faster execution time; considering the tournament duration 6399 µs(see Section 6.6.1), in the ripple-based approach, all nodes will know MIN in at most 52 ms within a seven-hop network deployment. Secondly, it offers better scalability; in fact while in Chaos the number of nodes is limited to 856 in a SBD (unless some data compression mechanism is applied), our ripple-based approach does not limit the number of involved devices. 6.7 Concluding Remarks Low-power wireless sensor networks enable many emerging applications that need thousands of sensor nodes for control and monitoring. In this chapter, we presented a set of techniques that identify various features in the distribution of sensed physical quantities over a dense deployment of sensor nodes. With such simple yet effective modifications, we can obtain the location and shape of active regions with a number of messages proportional to the properties of the field. Our feature extraction techniques are efficient in the sense that they collect data from just the sensors that have more effective information for revealing the status of the monitored area. We proposed a fully distributed approach to make our feature extraction scale with large dense networks, where sensor nodes lie in a multiple broadcast area. Chapter 7 Conclusions, Perspective and Future Directions This chapter reviews the research objectives of the Thesis and summaries its major results, highlighting how the research contributions fulfilled the original research objectives. Some guidelines for future research work in the area are also provided. 7.1 Summary of the Work In this work we aimed at designing large-scale dense networked sensor systems where the sensing is performed at a very fine granularity, both in space and time. Previous research work [APE+08, ETPA11, PGAT09] has proposed algorithms for obtaining an interpolation of sensor readings from different sensor nodes, and these algorithms are based on dominance protocols, presenting therefore excellent scalability properties for densely instrumented CPS. We believe however that it was possible to improve the performance of those algorithms not only by taking advantage of knowledge of often-occurring spatial correlation of sensor readings but also by embedding the dynamics of the physical phenomenon in the algorithms. We further proposed efficient novel mechanism able to extract meaningful features from the high spatial resolution of sensor readings utilizing the same building block as used for obtaining the interpolation: MIN. 123 124 Conclusions, Perspective and Future Directions 7.1.1 Review of Research Objectives To address the problem of reliable and timely data transmission and data aggregation in dense sensing networks, we defined the following three theoretical objectives: 1. Devising an error recovery scheme for WiDOM protocol in a noisy wireless channel. 2. Devising a mechanism that captures the dynamics of the physical quantities and self adapts according to the physical changes. 3. Devising a set of algorithms to identify various features in a distribution of a physical quantity. 7.1.2 Main Research Contributions Next we briefly summarize the main research contributions. Improving the reliability of the wireless communication infrastructure. Sensor nodes must communicate using a shared broadcast medium (such as a shared bus or a wireless channel), as it would be unfeasible (due to the number of nodes) to deploy dedicated communication channels for each sensor/actuator node. The WiDOM protocol is known as a MAC protocol suitable to be exploited to allow computation of aggregate quantities in wireless. In order to reduce the large overhead of the WiDOM protocol, the slotted WiDOM was proposed. However, none of these designs were considered to tolerate errors that may occur in data transmissions. One of the main contributions of this research work is the introduction of an error recovery scheme able to significantly improve the reliability of the WiDOM protocol and as such to increase the utility of the approach for computing complex aggregate quantities. We develop this scheme over slotted WiDOM since it offers lower overhead as compared to the original WiDOM design. Developing scalable and efficient aggregate quantities that consider the physical dynamics. Previous works tackling densely deployed networked sensor systems have proposed algorithms that allow computing an approximate interpolation of sensor readings by exploiting dominance-based protocols. The second main contribution in this Thesis is a novel approach for computing approximate interpolations, where the algorithm is 7.2 Future Directions 125 self-adaptable to incorporate the physical dynamics and the trade-offs between accuracy and timeliness. Extracting various features from the distribution of the physical quantity being monitored. Many CPS applications need to detect regions with specific level of activities immediately after the occurrence of an event. While computing the interpolation together with a centralized signal processing technique might be considered as an option, we devised a set of fully distributed algorithms that provide meaningful information from the distribution of the physical quantity without the need of having the interpolated image. We showed that similarly to the case of interpolation algorithm, the time complexity of the novel algorithms depends only on the property of the distribution of the physical quantity. Extending the feature extraction algorithm to multi-hop networked infrastructures. To extend the devised algorithm to work in a multi-hop network, we devised a distributed approach that takes advantage of dominance-based protocol. We further examined the functionality of the proposed multi-hop approach against the traditional cluster-based approach and revealed that our novel approach outperforms the traditional approaches. 7.1.3 Validation of the Hypothesis We have shown through extensive evaluations that it is possible to extract certain features of a physical phenomenon in a dense sensing network with a time complexity that is independent of the number of sensor nodes. 7.2 Future Directions There are several opportunities that can be identified for further research: –Devising distributed algorithms for extracting other features or computing different aggregate quantities over a distribution of a physical quantity (related to Chapter 6). It is shown that the efficient computation of MIN through exploiting dominance-based protocol can serve as the basic building block for extracting 126 Conclusions, Perspective and Future Directions different features from a physical signal. Leveraging MIN computation would eventually be considered to further develop other aggregation algorithms. –Implementing the feature extraction algorithms on a real dense sensor platform using WiDOM protocol (related to Chapter 6). An experiment is required, using a test bed, to implement a dense sensor network to observe a phenomena and verify the results discussed in Chapter 6. Along this line, improvements to the proposed feature extraction algorithm would be required, by developing a proper synchronization algorithm for the MBD network, in order to increase its reliability. Furthermore, the limitations imposed by communication medium may also have to be considered. The current platform that exists for slotted WiDOM is a prototype developed from components commercially available at the time [PGAT09]. The development and research of better radios for the execution of slotted WiDOM and hardware miniaturization are two topics that would enable practical implementation of the proposed algorithm in a wireless domain. –Development of an adaptive interpolation algorithm for accommodating nonlinear change patterns in an dynamic signal (related to Chapter 5). Proposed interpolation algorithms consider fixed change rates of the signal [ETPA11]. In this Thesis we solve the problem of dynamic change pattern for linear change model. One interesting future work is to develop this scheme for non-linear change patterns. –Investigation of a more realistic noise pattern for wireless channel (related to Chapter 4). To provide the RMA for hard real-time support in the slotted WiDOM under noisy channel environment, the considered noise model was based on the technique proposed in [BVT+10]. There is a need to have a better noise model for real-time data traffic over wireless channel. –Developement of a probabilistic end-to-end delay guarantee for the case that no valid noise patterns exist (related to Chapter 4). In some scenarios, the RMA deemed to be hardly applicable to wireless networks due to high error probability 7.2 Future Directions 127 associated with such networks. However, it must be mentioned that this is a technological problem. The reliability of wireless networks has evolved noticeably over the last few years and hence, it is safe to assume that this evolution will continue. Nonetheless, computing a probabilistic delay guarantee can also be considered as a way to mitigate the constraint of hard real-time system and makes the protocol applicable in the context of soft real-time QoS guarantee. 128 Conclusions, Perspective and Future Directions Author’s List of Publications The following publications have been derived from work directly related to this dissertation: Journals •M. Vahabi, V. Gupta, M. Albano, R. Rangarajan and E. Tovar. Feature Extraction in Densely Sensed Environments: Extensions to Multiple Broadcast Domains. International Journal of Distributed Sensor Networks (2015). (Accepted.) •M. Vahabi, S. Tennina, E. Tovar and B. Andersson. Extended version of: Response Time Analysis of Slotted WiDOM in Noisy Wireless Channels. (Under submission.) •M. Vahabi, E. Tovar. and M. Albano. Extended version of: A Self-Adaptive Approximate Interpolation Scheme for Dense Sensing. (Under submission.) Conferences and Workshops •M. Vahabi, E. Tovar. and M. Albano. A Self-Adaptive Approximate Interpolation Scheme for Dense Sensing. In 8th IEEE International Symposium on Industrial Embedded Systems (SIES 2013), pages 105–109, June 2013, Porto, Portugal. doi: 10.1109/SIES.2013.6601481. •M. Vahabi, V. Gupta, M. Albano and E. Tovar. Feature Extraction in Densely Sensed Environments. In 27th IEEE International Conference on Distributed Computing in Sensor Systems (DCOSS 2014), pages 143-151, May 2014, Marina Del Rey, U.S.A.. doi:10.1109/DCOSS.2014.29. 129 130 Conclusions, Perspective and Future Directions •M. Vahabi, S. Tennina, E. Tovar and B. Andersson. Response Time Analysis of Slotted WiDOM in Noisy Wireless Channels. Accepted to be presented in 20th IEEE International Conference on Emerging Technologies and Factory Automation (ETFA 2015), September 2015, Luxembourg. Posters and Demos •M. Vahabi, B. Andersson. New Schedulability Analysis for WiDom. Work-In- Progress Session in conjunction with the 22nd EUROMICRO Conference on Real- Time Systems (ECRTS 2010), 6, July, 2010. Brussels, Belgium. •J. Loureiro, N. Pereira, E. Tovar, F. Pacheco, M. Vahabi. The SmartSkin Project: Densely Instrumented Physical Infrastructures. In 1st Industrial Workshop on Real- Time and Embedded Systems (CiWork 2013), Porto, Portugal. •J. Loureiro, N. Pereira, E. Tovar, F. Pacheco, M. Vahabi. Reducing Aircraft Fuel Consumption with WSAN-based Active Flow Control. In 1st Industrial Workshop on Real-Time and Embedded Systems (CiWork 2013), Porto, Portugal. Bibliography [80206] IEEE Standard for local and metropolitan area networks - part 15.4: Low-Rate Wireless Personal Area Networks (LR-WPANs), IEEE Std 802.15.4-2011 (Revision of IEEE Std 802.15.4-2006). http://standards.ieee.org/getieee802/802.15.html, 2006. [80212] IEEE Standard for Local and Metropolitan Area Networks–Part 15.4: Low- Rate Wireless Personal Area Networks (LR-WPANs)–Amendment 1: MAC Sublayer. https://standards.ieee.org/findstds/standard/802.15.4e-2012.html, 2012. [AC01] Imad Aad and Claude Castelluccia. Differentiation Mechanisms for IEEE 802.11. In 20th Annual Joint Conference of the IEEE Computer and Communications Societies (INFOCOM), volume 1, pages 209–218, 2001. [AIM10] Luigi Atzori, Antonio Iera, and Giacomo Morabito. The Internet of Things: A Survey. Computer networks, 54(15):2787–2805, 2010. [APE+08] Björn Andersson, Nuno Pereira, Wilfried Elmenreich, Eduardo Tovar, Filipe Pacheco, and Nuno Cruz. A Scalable and Efficient Approach for Obtaining Measurements in CAN-Based Control Systems. IEEE Transactions on Industrial Informatics (TII), 4(2):80–91, 2008. [APT07] Björn Andersson, Nuno Pereira, and Eduardo Tovar. Exploiting a Prioritized MAC Protocol to Efficiently Compute Min and Max in Multihop Networks. In 5th Workshop on Intelligent Solutions in Embedded Systems, pages 239–249. IEEE, 2007. 131