<<

University of Tennessee, Knoxville TRACE: Tennessee Research and Creative Exchange

Masters Theses Graduate School

12-2004

The Design of (MAC) Protocols for Energy Efficient and QoS oPr vision in Wireless Sensor Networks

Yang Liu University of Tennessee, Knoxville

Follow this and additional works at: ://trace.tennessee.edu/utk_gradthes

Part of the Electrical and Electronics Commons

Recommended Citation Liu, Yang, "The Design of Medium Access Control (MAC) Protocols for Energy Efficient and QoS oPr vision in Wireless Sensor Networks. " Master's Thesis, University of Tennessee, 2004. https://trace.tennessee.edu/utk_gradthes/4701

This Thesis is brought to you for free and open access by the Graduate School at TRACE: Tennessee Research and Creative Exchange. It has been accepted for inclusion in Masters Theses by an authorized administrator of TRACE: Tennessee Research and Creative Exchange. For more information, please contact [email protected]. To the Graduate Council:

I am submitting herewith a thesis written by Yang Liu entitled "The Design of Medium Access Control (MAC) Protocols for Energy Efficient and QoS oPr vision in Wireless Sensor Networks." I have examined the final electronic copy of this thesis for form and content and recommend that it be accepted in partial fulfillment of the equirr ements for the degree of Master of Science, with a major in Electrical Engineering.

Hairong Qi, Major Professor

We have read this thesis and recommend its acceptance:

Itamar Elhanany, Gregory Peterson

Accepted for the Council: Carolyn R. Hodges

Vice Provost and Dean of the Graduate School

(Original signatures are on file with official studentecor r ds.) To the Graduate Council:

I am submitting herewith a thesis written by Yang Liu entitled "The Design of Medium Access Control (MAC) Protocols for Energy Efficient and QoS Provision in Wireless Sensor Networks". I have examined the final paper copy of this thesis for form and content and recommend that it be accepted in partial fulfillment of the requirements for the degree of Master of Science, with a major in Electrical Engineering.

We have read this thesis and recommend its acceptance:

Vice Chancellor an Dean of Graduate S"""·.,...·��/ The Design of Medium Access Control (MAC) Protocols for Energy Efficient and QoS Provision in Wireless Sensor Networks

A Thesis Presented forthe Master of Science Degree The Universityof Tennessee, Knoxville

YangLiu

December 2004 Acknowledgments

I extend my sincere gratitude and appreciation to many people who made this thesis pos­ sible. My deepest gratitude goes to my adviser Professor Hairong Qi. Had it not been for her valuable advice, direction, patience, encouragement and steadfast support, this work would not have been possible. I am highly indebted to Professor ltamar Elhanany for many valuable discussions and insightful suggestions. I also would like to acknowledge Professor Gregory Peterson for serving as my committee member and spending timeon reviewing my thesis.

Many thanksare to my peers, formeror currentAICIPers,Ymgyue Xu, Hongtao Du, Xiaol­ ing Wang, Lidan Miao, Sankar Venkatraman, Balasubramanian Lakshminarayanan, Olawoye Oyeyele, Phani Teja SastryKuruganti, andGaurav Baone, for your friendshipand support.

This thesis is dedicated to my family, and especially my wifeQing. Your support, love and enthusiasm makeeverything possible and meaningful.

ii Abstract

This thesis work focuses on innovative designof media access control (MAC) protocols in wireless sensor networks (WNSs). The characteristics of the WSN inquire that the network ser­ vice design considers both energy efficiency and the associated application requirement. How­ ever, most existing protocols address only the issue of energy efficiency. In this thesis, a MAC protocol has been proposed (referred to as Q-MAC) that not only minimizes the energy consumption in multi-hop WSNs, but also provides (QoS) by differentiating network services based on priority levels prescribed by differentappli­ cations. The priority levels reflect the state of system resources including residual energy and queue occupancies. Q-MAC contains both intra- and inter- node arbitration mechanisms. The intra-node packet scheduling employs a multiple queuing architecture, andapplies a scheduling scheme consisting of packet classification and weighted arbitration. We introduce the Power Conservation MACAW (PC-MACAW), a power-aware scheduling mechanism which, together with the Loosely Prioritized Random Access (LPRA) algorithm, govern the inter-node schedul­ ing. Performance evaluation are conducted between Q-MAC and S-MAC with respect to two performance metrics: energy consumption and average latency. Simulation results indicate Q­ MAC achieves comparable performanceto that of S-MAC in non-prioritized trafficscenarios. When packets with different priorities are introduced, Q-MAC yields noticeable average la­ tency differentiationbetween the classes of service, while preserving the same degree of energy conswnptionas that ofS-MAC. Since the high density nature of WSN may introduce heavy traffic load and thus con­ sume large amount of energy for communication, another MAC protocol, referred to as the Deployment-oriented MAC (D-MAC) has been furtherproposed. D-MAC minimizes both sens­ ing and communication redundancy by putting majority of redundant nodes into the sleep state. The idea is to establish a sensing and communicationbackbone covering the whole sensing field with the least sensing and communication redundancy. In specific, we use equal-size rectangu­ lar cells to partition the sensingfield and chose the size of each cell in a way such that regardless of the actual location within the cell, a node can always sense the whole cell and communicate with all the nodes in neighboring cells. Once the sensing fieldhas been partitioned using these cells, a localized Location-aware Selection Algorithm (LSA) is carried out to pick up only one node within each cell to be active fora fixedamount of period. This selection is energy-oriented, only nodes with maximum energy will be on and therest ofnodes will be put into thesleep state once the selection process is over. To balance the energy consumption, the selection algorithm is periodically conducted until all the nodes are out of power. Simulation results indicated that D-MAC saves around 80% energy compared to that of S-MAC and Q-MAC, while maintaining 99% coverage. D-MAC is also superior to S-MAC and Q-MAC in terms of average latency. However, the use of GPS in D-MAC in identifyingthe nodes within the same cell, would cause extra cost and complexity forthe design of sensor nodes.

iii Contents

1 Introduction 1 1.1 Wireless Sensor Networks ...... 1 1.1.1 System and Communication Architectures . 1 1.1.2 Technical Challenges . 4 1.2 Motivations andObjectives . 5 1.3 Thesis Outline ...... 6

2 Wireless Medium Access Control : An Overview 8 2.1 Wireless Medium Access Control . . . 9 2.1.1 Scheduling-Based Mechanisms 9 2.1.2 Contention-Based Mechanisms 10 2.1.3 Arbitration-Based Mechanisms 11 2.1.4 Hybrid Scheduling and Contention Schemes 13 2.2 MAC Design for Wireless Sensor Networks . . .. . 13 2.2.1 Important Issues for Sensor Network MAC Design 14 2.2.2 State of The Art...... 15 2.3 Energy Efficient MAC Designin WSN .. . 15 2.3.1 Energy Consumption and Wastage . 16 2.3.2 Scheduling-Based Energy Saving . 17 2.3.3 Contention-Based Energy Saving . 20 2.3.4 Polling and Preamble SamplingMechanisms 22 2.3 .5 Other Mechanisms ...... 23 2.3.6 DesignGuidelines forEnergy-Efficient MAC Design. 23

3 Quality of Services (QoS) in WSN 25 3.1 Necessity of QoS in WSN ...... 25 3.2 QoS Metrics for Wireless Sensor Networks 26 3 .3 QoS Provision and Realization ...... 28 3.4 Case Study on Service Differentiation forQ-MAC . 32 3.4.1 The Metricfor Intro-node Packet Scheduling 32 3.4.2 The Metric for Inter-node Packet Scheduling 33

iv 4 The Q-MAC Protocol 34 4.1 The Queuing Architecture ...... 34 4.2 Intra-Node Scheduling ...... 36 4.2.1 MAX-MIN FairnessMechanism . 36 4.2.2 Packetized Generalized Processor Sharing (POPS) 36 4.3 Inter-Node Scheduling ...... 37 4.3.1 Power Conservation MACAW (PC-MACAW). 37 4.3.2 Loosely Prioritized Random Access (LPRA) 38 4.4 Collision Recovery Scheme . 41 4.5 Simulation and Analysis ...... 41

5 The D-MAC Protocol 46 .15 Modeling of Sensor Deployment Strategies ...... 64 5 .1.1 A Deployment Model with Coverage Constraints ...... 47 .1.25 A Deployment Model with Coverage and Network Lifetime Constraints 49 5.2 D-MAC Protocol ...... 50 5.2.1 Location-aware Selection Algorithm (LSA) . 51 5.2.2 ModifiedQ-MAC Random Access (MQRA) 53 5.3 Simulation andAnalysis ...... 53

6 Conclusions and Future Work 55

Bibliography 57

Appendix 63

A SENSIM: SEnsor NetworkSIMulator 64 A.l Simulator Architecture 64 A.2 Implementation Tools . 65 A.3 SENSIM Overview . . 66

Vita 69

V List of Tables

2.1 State-of-Art of MAC protocols in wireless sensor networks...... 16

vi List of Figures

1.1 Typical sensor node system architecture ...... 2 1.2 Trends forsensor node design [11, 10] (a) WeC: small micro-controller(1999) (b) Rene: experimental design (2000) (c) Dot: scale demonstration (2001) (d) MICA: relatively industrial platform with a couple of sensors, operating on TinyOS [10] sensor network operating system (2002) (e) Speck: concept de- sign for "Mote on a single chip" (2003) (d) Telos: robust low power design (2004) ...... 2 1.3 Communication architectures ...... 3 1.4 Layered architecture of sensor networks 6

2.1 Hidden and exposed terminals in wireless networks 8 2.2 Classification of wireless MAC protocols . . . . . 10 2.3 802.11 with DCF with DIFS denotes DCF inter framespace, SIFS denotes Short Inter Frame Space, and NAC denotes Network Allocation Vector which indi- cates the amount of time the medium is to be reserved ...... 12 2.4 Illustration of hybrid scheduling and contention schemes (a) Basic structure (b) Special case forIEEE 802.11 PCF ...... 13 2.5 Comparison of energy consumption of different devices of the general sensor node [24] ...... 17 2.6 Duty-cycle of S-MAC and T-MAC; the blue rectangular represents the trans- mitted or received packets and TA denotes the activity time-out period 22

3 .1 The general QoS model forsensor networks ...... 26 3 .2 Architecture for QoS service provision [21] ...... 29 3.3 QoS realization schemes (a) Scheduling based scheme in which the channel bandwidth (time, code, or frequency) is reserved based on different require­ ments of flows. (b) Contention based scheme with priority support in which higher prioritypackets select smaller contention time while lower packet pick up larger contention time. ( c) Contention based scheme with priority support where differentpriority level packets choose the contention time fromdifferent region. (d) Reservation based scheme where channel can be reserved based on the packet priority ...... 31

vii 4.1 The multi-queue queuing architectureemployed by each of the QoS-aware sen- sor node ...... 35 4.2 The frame structure of a sensor node ...... 38 4.3 The prioritized contention period with each priority level (PL) following the truncated, increasing geometricdistribution ...... 40 4.4 (a) Probability distributionfor the contention slot number (b) Probability of no collision occurrence ...... 40 4.5 (a) Scenario One: constant rate traffic with packets of the same criticality (b) Scenario Two: packets with different criticality, constant rate or bursty traffic . 43 4.6 Scenario 1 with periodic trafficand no equal criticality (a) Average energy con­ sumption vs. Load (b) Average latency vs. Load ...... 44 4.7 Scenario 2 with periodic traffic and different packet criticality (a) Average en- ergy consumption vs. Load (b) Average latency vs. Load ...... 45 4.8 Scenario 2 withbursty trafficand differentpacket criticality (a) Average energy consumption vs. Load (b)Average latency vs. Load 45 5.1 Sensing fieldand the equal size rectangularpartition 47 5 .2 Coverage probability and deployed node under a 10 by 10 cell partition 48 5.3 Selection the size of partitioning cell ...... 49 5 .4 (a) Coverage under network lifetimeconstraints (b) Experiment with2000 nodes 51 5.5 (a) Average energy consumption (b) Average latency 54 A. I Architecture of SENSIM ...... 65 A.2 Class hierarchy of network stack. DE represents Down Enable and UE repre­ sents Up Enable. The direction of arrow identifythe inheritance direction of the class declaration ...... 67 A.3 Snapshot of SEN SIM with 10 x 10 gird topology ...... 68

viii Chapter 1

Introduction

Recent advances in micro-electro-mechanical system (MEMS) and radio frequency (RF) tech­ nology have led to the development of small sensor devices equipped with an embedded mi­ croprocessor, several sensing modalities, a low-power radio and a battery. The low per-node cost allows hundreds of such devices densely deployed into the field and interconnected with each other to form a wireless sensor network (WSN) (25, 36], which provides us an attractive solution for large area sensing, monitoring and tracking tasks. This new-emerging computing paradigm holds great promises in many applications like home automation and security, smart office spaces, industrial control and management, agriculture and environmental monitoring, disaster detection and recovery, building monitoring and asset tracking, battlefield surveillance and reconnaissance, or even medical sensing and micro-surgery [23, 14]. The opportunitiesfor such class of networks are ubiquitous. However, before all these exciting applications come to reality, a number of formidable challenges must be solved. To date, despite the factthat numer­ ous research efforts have been directed toward optimizing hardware, algorithms and protocols for these networks, it remains largely unexplored how these innovations can be tied together to provide a reliable, robust, and quick-responsible sensing, computing, and communication system.

1.1 Wireless Sensor Networks

1.1.1 System and Communication Architectures Populating the world with networked sensors requires a fundamental understanding of the sys­ tem architecture of individual nodes and the communication architecture to organize and man­ age these nodes in scalable and resource-efficient ways. In general, as shown in Fig. 1.1, a typ­ ical sensor node is composed of six components: processor, storage unit, memory unit, power supply, sensors/actuators, and communication systems. Like UC Berkeley's Sensor Mote [11], seen in Fig. 1.2, it consists of an 8bit 4MHz Atmel Atmega 128L processor with 128K bytes program flash memory, 512K bytes measurement flash, and 4K bytes configuration EEPROM. It is capable of supporting maximal data transmissionrate of 38.4K bps within the outdoor range Processor :.,.__.._.: :� ..... L .. Radio Module : :

j \ .... -���P_t!�i?�.�-��� 1-� ..... Sensing Module !

Figure 1.1: Typical sensor node system architecture

(a) (b) (c)

(d) (e) (f)

Figure 1.2: Trends for sensor node design [11, 10] (a) WeC: small micro-controller (1999) (b) Rene: experimental design (2000) ( c) Dot: scale demonstration (2001) ( d) MICA: relatively industrial platformwith a couple of sensors, operating on TinyOS [10] sensor network operating system (2002) (e) Speck: concept design for "Mote on a single chip" (2003) (d) Telos: robust low power design (2004)

2 0 0 0 \ , \ �_v-;; 0 o ;;) 0 0 o\ o\, o 0 0 \ ' 0 ,,o 0 0 0 \ 0 ·a-..... _____.,, 0 0 :·--·:· 0 0 / 0 \'ZQ_ ,.... 0 0 I , ···,,_ ____�-- ...... -----�----···· a 0 0 0 0 O 0

(a) Dim:tTmnomilllion (b)FlltAdHoc

0 0 �: o 0

�� 0 J 0 0 0 0 0

(c)Clllllcring • s.,,.,, Sink • Chi-Hmd (b)MobilcA.,.,..

0 s.,,.,.Node

Figure 1.3: Communication architectures

of 1000 feet. The integrated sensing modalities include the lighting, temperature, acoustic, and magnetic sensors and the node is powered by two AA batteries. These nodes has been applied to a real-world habitat monitoring application conducted on Great Duck Island offthe coast of Maine [ 46] to measure humidity, pressure, temperature, infraredradiation, total solar radiation, and photo-synthetically active radiation. For these networks, sensing measurements obtained from multiple sensors of different modalities at the distributed locations need to be transmitted to the processing center or the net­ work gateway, the so-called sink node. With respect to the communicationmechanism adopted, four basic communication architectures exist: direct transmission, flat ad hoc, clustering, and mobile agents, as shown in Fig. 1.3. Becausethe number of sensor nodes is usually large and the transmit range of sensor nodes are limited (According to Rappoport et. al. [57], signal propagation followsthe exponential law with the exponent being exponent 2 to 4 depending on the transmission media), hence, in gen­ eral it is cost inefficient and, in many cases, implausiblefor each node to directly communicate with the sink node. To be cost-efficient, short-range, multi-hop data transmissions are highly preferred. In the flat ad hoc multi-hop communication architecture, as shown in Fig. l .3(b ), sensor nodes send or relay data packets to the sink node given routing capabilities. Although this mode is flexible and energy efficient, scalabilityis still a problem. The nodes closer to the sink node will be primarily used to route data packets from other nodes to the sink node. If the network size is large, these nodes will relay a large number of data and their energy can be exhausted very fast, resulting finally in disconnection of the network. The clustering [30] archi-

3 tecture, illustrated in Fig. 1.3(c ), attempts to address this issue by partitioning the network into clusters. A special type of node called cluster-headhas been elected to supervisethe data trans­ mission within each cluster. Once thecluster-head obtains the sensing measurements, it directly communicates with sink node in case of one-level clustering, or communicate with high-level cluster-headin a hierarchical clustering schemes and repeat the same process until reaching the sink node. The main disadvantage of this mode of operation is that the communication relies highly on the cluster-head, thus placing a burden on thehigher level cluster heads. Moreover, the energy depletion of cluster heads is faster than that of other nodes. In the mobile agents based architecture [53], instead of letting each sensor node send data to the sink node, a series of mobile agents are launched by the sensor sink which can move to differentsensor nodes for data collection. Since the data processing is conducted locally at the sensor nodes through the processing codes carried by the agents, it can solve the above mentioned scalability problem. However, how to derive the migration routes, recover from agent failure, apply the complex agent techniques to light-weight sensor nodes like Motes are still challenging problems.

1.1.2 Technical Challenges As the impactof new technologies are always two-folded, the benefits always come along with the design challenges. The design of wireless sensor networks is no exception. The unique challenges it faces can be summarized as follows.

• The Stringent Resource Challenge. Sensor nodes are normally battery-powered. Once deployed, the battery can not be recharged or replaced. Thus, the lifetime of the sensor node is mainly determinedby the battery life. As a result, the scarce energy resource must be wisely managed in order to extend the lifetimeof thenetwork. In addition, constraints on storage and computation capacity also limit theapplication of complex scheduling and signal processing algorithms.

• The Self-Organization and Scalability Challenge. Self-organization reflectsthe ability of sensor networks to formglobal level structuresor function through interactions among the low-level components. In other words, sensor nodes independently coordinate with each other in order to accomplish particular tasks without any external management and con­ figuration. Meanwhile, since the proliferation of low cost sensors enables large amount sensor deployment, as more sensors are put into the field, more data is captured which can enhance decision making. The risk is, however, large data transfer and information overloading.

• The Redundancy Challenge. Sensor networks have high node densities. At a specific time, many sensor nodes can sense the same phenomena and produce similar sensing results, thus introducing high redundancy. On one hand, the sensing redundancy can maintain coverage and therefore reduce the damage caused by node failure; however, on the other hand, it can also introduce high designcomplexity and high collision probability when accessing the channel.

4 • The Network Dynamics Challenge. Since sensors are usually rapidly deployed in large amount, it is very difficult, if not possible, to maintain a pre-designed network struc­ ture. Therefore,the new sensor deployment and node failuremay introducehigh network dynamics. All these dynamic features indicate that sensor networks tend to be infra­ structureless and require the underlying network services and applications to be adaptive.

• The Reliability Challenge. Sensors communicate through low-bandwidth and unreliable wireless links compared to wired communication. An individual sensor may sufferinter­ mittent connectivity due to high bit error rate (BER) of the wireless link, and it can further deteriorated by environmental hazard. The challenge is to provide reliable information based on potentially unreliable wireless communication networks and unreliable sensor nodes.

1.2 Motivations and Objectives

All the above mentioned challenges put forwardthe new directions forsensor network design. Considering that thousands of simple, unattended and resource-constrained sensor nodes are deployed in order to accomplish sensing, data processing, monitoring, and tracking tasks, how to develop the proper protocols which can organize these nodes to form an efficient commu­ nication network becomes one of the most important design issues. The traditional OSI seven layer model is apparently too heavy and not tuned forthese new emerging networks. Instead, a four-layerarchitecture shown in Fig. 1.4 is more admissible. Notice that MAC is a sub-layer of data used to schedule and coordinate data transmission among multiple nodes sharing the common channel. MAC layer is essential to the successful operation ofthe shared-medium network especially for wireless sensor networks. In addition, in our architecture, we do not include the because the end-to-end delivery assurance may cause large energy consumption. Instead, it is better to verify the hop-by-hop correctness of data delivery at the MAC layer, which further strengthen its importance. The MAC design is a key technology as it schedules the transmission of wireless nodes in the network to avoid collisions. However, the unique features of WSN make it difficult to apply the traditional MAC protocols. For instance, in sensor networks, the stringent energy limitation imposes constraints on the MAC protocol design since the nodes in such networks are generally assumed to be powerfuland rechargeable. In addition, sensor network, compared with traditional , may include much higher node density. On one hand, the high node density results in large sensing redundancy. By transmitting these redundant data, energy could be wasted. On the other hand, the high density topology will make the central­ ized scheduling extremely difficult which arises the need for highly localized and distributed design. Furthermore, a sensor node may several sensing modalities including temperature, acoustic, seismic, and even imaging capabilities. For a given application, the collected sensing information may have different priority levels and, through in-network processing, these mea­ surements may be aggregatedand condensed to a decision, which is extremely important. The transmission of this type of data needs to be both accurate and timely. Consequently, there is a

5 Application SpecifyApplications like sensing Monitoring, or Tracking

Network Routing and Flow Control

Multiplexing andDe-rnultiplexin! Data Link - Error Control ······························· ...... MAC Multiple Access Control

Physical :. and Channel Coding

Layers Functionalities

Figure 1.4: Layered architecture of sensor networks clear need for support of quality-of-service(QoS). Therefore, instead of maximizing throughput and channel utilization like traditional net­ works, new issues, like energy efficiency, scalability, redundancy, QoS provision, and multi­ hop fairness, become the top concerns and need to be highlighted during the design process. We describe the design objectives for the new MAC protocols from three perspectives. First of all, the new MAC protocol should be inherently energy-efficient to ensure a node lifetime of one or several years on a single battery; Secondly, we expect these networks to prioritize data packets and provide different services in accordance with different application specifics. Finally, all those sensor nodes should self-organize and cooperate with each other for the suc­ cessful data transmission. In summary, energy efficiency, QoS-aware network management, and self-organization are the key issues in sensor network MAC designto ensure efficientusage of sensor resources as well as efficientaccess to gathered measurements.

1.3 Thesis Outline

The thesis is organized as follows. Chapter 1 introduces the emerging technology, the wireless sensor networks (WSN). The system architecture of individual sensor node and the communication architecture of the whole network has been discussed, followed by a description of the design challenges. In addition, it also discusses the motivation of MAC protocol design in sensor networks and the objectives of the research. Chapter 2 briefly surveys the medium access techniques of wireless network witha focuson the energy efficient MAC design for wireless sensor network. Sources of energy consumption are analyzed and existed solutions are discussed and classified. At the end of the chapter, the designguidelines on how to achieve energy efficiencyin wireless sensor networks are provided. Chapter 3 discusses another importantfeature of the MAC design,Quality-of-Service (QoS). The necessity on service provision for WSN is justified and the QoS metrics from application

6 and network prospectives are defined. It also describes the possible realizations according to different MAC design strategies and gives a case study on QoS provision on our proposed pro­ tocol, Q-MAC. Chapter 4 describes in detail the energy-efficient, QoS aware MAC solution (Q-MAC). In brief, a multi-queue based queuing architecture has been applied. Within each sensor node, the intro-node scheduling is used to select the next transmitted node. After that, the node needs to contend with its neighbors for channel access by using LPRA protocols. Simulation and analysis are given at the end of this chapter. Chapter 5 presents the D-MAC, a deployment-oriented MAC protocol, aiming at minimiz­ ing the sensing and communication redundancy, and thus achieving both energy-efficiency and lower latency compared to that of S-MAC and Q-MAC. The summary and future research directionsare given in chapter 6. The motivation, design strategy, and implementation of self-developed wireless sensor network simulator, SENSIM are explained in the Appendix. The software architecture of this tool and the current development status are given.

7 Chapter 2

Wireless Mediuni Access Control : An Overview

The Medium Access Control (MAC) techniques are responsible for coordinating and schedul­ ing data transmissions among multiple nodes sharing the same channel so that no transmission is interfered with at the receiver by a concurrent second transmission from some other nodes, resulting in packet loss. In wireless network, since the sender has no means of knowing about whether there exists any interference at the receiver end, hence, hidden and exposed terminal problems have been identified [38]. In Fig. 2.1, let the letters A, B, C, D represent the commu­ nication terminals, which can send data packets within their communication range represented by a circle surroundingit and can receive the data packets if they are within the range of sending transmitter. Two terminals who are in each other's circle can communicate with each other. An example of the hidden terminalproblem is that both A and C unknowingly send a packet at the same time to B, there would be a collision at B resulting in data loss. Another case is that if B wishes to transmitto A while C wishes to transmit to D, there is technically no problem if they transmit at the same time because A and D cannot overhear each other's data transmission. However, the exposed terminalproblem occurs if B senses the transmission of C and waits until the medium is free before transmitting.

Figure 2.1: Hidden and exposed terminalsin wirelessnetworks

8 While the hidden terminal problem results in data loss, the exposed terminalproblem simply affects efficiency. To solve these problems, explicit information exchange between transmitter and receiver is necessary. In this chapter, we briefly review the MAC protocols proposed for wireless networks. With a focuson the discussion of medium access control designfor wireless sensor networks, we also investigate the benefitsand disadvantages of existing solutions.

2.1 Wireless Medium Access Control

The Medium access control (MAC) problems have been studied for years, and many designs targeted at different applications and optimization goals have been proposed. They can gener­ ally be classifiedinto two categories: the scheduling-based, with the access point or cluster head performing the access control;and the contention-based,with each node contend forthe channel access. In contention-based MAC protocols, nodes compete foraccess to the channel randomly. When only one node makes a transmission attempt, the packet is received successfully in the absence of errors caused by channel noise. When multiple nodes transmit simultaneously, a collision may occur and a contention resolution algorithm is needed to resolve the conflict. This resolution process does consume bandwidth resources, but in a bursty traffic environment, the cost is usually worthwhile when compared to scheduling-based MAC protocols. Moreover, in most scheduling-based protocols, each node only consume a portion a channel resources and theiraccess time is scheduled thus achieving collision free. However, the idle nodes do consume a portion of channel resources and this portion may become significantwhen the number of po­ tential users in the system grows. In contention-based schemes, idle users do not transmitand thus do not consume any bandwidth resource. Among themost popular contention-based MAC protocols are ALOHA [12] and several variants of CSMA such as MACA [37] and MACAW [17]. Scheduling-based MAC protocols ensure that a transmission, whenever made, will not be impaired by another transmission in the system. These conflict-free transmissions can be achieved by allocating the channel to the user either statically or dynamically. So far, both cat­ egories include a bunch of protocols with different design directions. In Fig. 2.2, we show the simple classificationof these wireless MAC protocols.

2.1.1 Scheduling-Based Mechanisms

For scheduling-based techniques, the is divided into sub-channels such that multiple nodes can simultaneously perform data transmission without collision. Based on the different domains in which the channel resource is divided, scheduling-based techniques can be furtherdivided into Frequency Division Multiple Access (FDMA), Time Division Multi­ ple Access (TOMA), Code Division Multiple Access (CDMA), and more recently, Orthogonal Frequency Division Multiple Access (OFDM). The scheduling-based schemes are in general collision free. However, a centralizedchannel allocation is needed.

9 Channel AllocationMechanisms Schdeduling-Based FDMA CDMA TOMA OFDM Mechanisms HybridTDMA/PDMA McdiumAcceu

CSMA Contention-Based Mechanisms CSMA/CA Wireless MACA MACAW IEEE 802.11 MAC Mechanisms Polling Mechanisms Arbitration Mechanisms Token Passing

Hybrid Hybrid Scheduling/Contention Schemes Schemes

Figure 2.2: Classificationof wireless MAC protocols

2.1.2 Contention-Based Mechanisms The first contention-based Medium Access Control approach can be traced back to ALOHA [12], in which each communication terminaltransmits packets immediately afterthey are gen­ erated. If collision occurs, the packet will be retransmitted. Later on, the modified so-called slotted ALOHA [58] has been proposed to achieve better performance by scheduling the trans­ mission process at the beginning of each time slot, thus reducing the chance of transmission collision. These techniques are classic and can be considered as the simplest and best decen­ tralizedaccess policy.

Carrier Sense Multiple Access (CSMA) The centralidea of CSMA is listening beforetransmitting. The purpose of listening is to detect the occupation status of the channel. However, based on strategy to reduce collision, it can be classifiedinto two categories: non-persistent CSMA and p-persistent CSMA. In non-persistent CSMA, if a node detects the idle channel,it transmitsimmediately. Otherwise, it waits a random period before starting to sense channelagain. In p-persistent CSMA, if thechannel is busy, the node will continue to listen until the channelbecomes idle. If the channel is free,it will transmit with probability p and delay for one time unit with probability 1 - p. In the case of delay for one time unit (one time unit equals to the length of propagation delay), the node will continue to sense the channel after that delay and repeat the same process until the packet has been transmitted. The so-called ] -persistent CSMA is the particular case of p-persistent CSMA in case that probability p equal to 1. In ]-persistent CSMA, since the node is extremely selfish,it may introduce higher collisions. In general, CSMA is a pure decentralized protocol. Because

10 of no message exchanging between transmitterand receiver, the mentioned hidden and exposed problemsstill exist.

CSMA with Collision Avoidance (CSMA/CA) As indicated by its name, CSMA/CAbased mechanisms, like MACA [37] and MACAW [17], try to solve the hidden and exposed terminal problems by establishing a handshaking between the transmitter and the receiver. In MACA, a node with packets waiting to be sent transmits a short Request-to-Send control packet to the intended receiver. The receiver immediately re­ sponses with a Clear-to-Send (CTS) packet. After receiving the CTS, the actual data transmis­ sion can be launched. Since a node that could interfere with a transmission can at least hear CTS from the receiver of the message and remain silent, the hidden terminal problem can be solved. Moreover, by allowing the node, which overhears an RTS packet but not the corre­ sponding CTS packet, transmit its data packet, the expose terminal problem can also be solved. MACAW presents several additions to MACA, including use of an acknowledge (ACK) packet after successful reception, allowing rapid link-layer recovery from transmission error and the use of CSMA when sending CTS packets. Thus, the transmission message exchange sequence between a sender and a receiver now becomes RTS-CTS-DATA-ACK.

The IEEE 802.11 Standard The IEEE 802.11 standard [32] supportsseveral differentMAC techniques, as shown in Fig. 2.3, one of the so-called distributed function (DCF) mode is based on CSMA/CA protocols. Sim­ ilar to MACAW mentioned above, it also uses the RTS-CTS-DATA-ACK sequence. Several improvement over MACAW are introduced including virtual carrier sense, binary exponential back-off, and fragmentationsupport. The designis based on the assumption of a single cell sce­ nario, with mobile nodes always in range of at least one Access Point (AP). As a result, there is no multi-hop scenario. The ad hoc aspect of the protocol assumes peer-to-peer communications. The main energy saving is achieved by turningoff the radio when the node is not the intended to transmit or receive. Since the Network Allocation Vector (NAV) records the data packet trans­ mission time, the idle listeningnode knowsexactly how long the radio can be turnedoff. There is also another mode forthis standard, the optional point coordination function (PCF), which is a centralized, contention-free channel access, based on the poll-and-response mechanism.

2.1.3 Arbitration-Based Mechanisms The arbitration-based mechanism usually introduces token or polling message [41] to arbitrate the channel access, and can provide certain QoS (like latency, service rate) for particular ser­ vice. However, due to the fact that the traveling time of token or polling messages increases with the network size, its application has been limited especially for large-scale, high-density communication networks. Furthermore, the round-trip delay of the token or polling messages also makes this mechanism unsuitable for real time applications.

11 DIFS SJFS TXNode I has] i I DATA : SJFS : SIFS j

RXNode � NAV� 'AO{! Neighbors NAV(RTS)

Figure 2.3: 802.11 with DCF with DIFS denotes DCF inter frame space, SIFS denotes Short Inter Frame Space, and NAC denotes Network Allocation Vector which indicates the amount of time the medium is to be reserved

Token Passing Schemes Inspired by the most well-known Token-Ring protocols developed for traditional wired net­ works with a ring topology, the wireless token passing schemes apply a so-called "token" to specifythe right to access medium. Once a node receives a token, it can access the channel and transmit data at that time. Afterthe data transmission is accomplished, the token is continuously moved to other communicationnodes. Through this way, all the nodes within the network can transmit their data in the order which follows the trace of passing token. To avoid a situation that a node occupies the channel for a very long time, the limitation for individual transmis­ sion should be defined, which can be done by limiting the maximal transmitting time foronce token passing. Token passing techniques are promising in the context of single hop wireless communication where each node can reach all other nodes. Normally the token passing can be arbitrated either by network Access Point (AP), or pre-determined routine. Nevertheless, in the context of multi-hop communication, the round-trip time for the token messages can be very large, thus, its application can be greatly constrainedor even unrealistic, especially fornetworks with high density node populations.

PollingSchemes As opposed to the token-passing protocol, the polling requires a master node acting as the centralizedcontroller. The master node sends out the "polling messages" to each of the nodes in a round-robinfashion. Once receiving the polling message, the node can transmit data for a pre-determined transmission period. In case of no packets to be sent, the node can send sort of acknowledgment message to notify the central controller so that the master node can continue to poll thetraffic from other nodes. This procedurerepeats in a cyclic manner. The most attractive featureof this scheme lies in the factthat the collision has been totally eliminated while avoiding the empty slots inherited in contention based protocols. However, the problem comes with polling delay, which also limits its application in the multi-hop context. Several well-known Medium Access Control (MAC) standards have integrated this scheme, like [28] and IEEE 802.11 PCF [32].

12 .i :�-·1-- : I F-= I (a)

Frame Period coe1_1:1.1�?!1�.���F)···························· ..c:��-�-��.P.C?n ....

NodeI RTS

Node2 SIFS -== ---, &aco r::-Polu +D.aa _ ACK

(b)

Figure 2.4: Illustration of hybrid scheduling and contention schemes (a) Basic structure (b) Special case for IEEE 802.11 PCF

2.1.4 Hybrid Scheduling and Contention Schemes

The inspiration of hybrid schemes comes fromthe needs of such network, in which the traffic with or without QoS requirements both exist. As we know, the QoS guarantees can be realized by polling or some centralized scheduling. However, in case of high density and relatively lower traffic rate, these schemes are not efficient at all. For contention based scheme, it is on the contrary. The hybrid schemes try to solve this problem by combining the features of these two schemes to provide an elegant solution for both random and dedicated access. For realization, a TDMA based method has been applied to partition the time axis into "frame". Each frame includes two phases, a contention-free phase and a contention phase, shown in Fig. 2.4(a). During the contention-free phase, the traffic with certain QoS require­ ments can be served by polling process, which is repeated in every frame. Other traffic without QoS requirements can be served during the contention process. The typical protocol using this scheme includes IEEE 802.11 combining with DCF and PCF, as shown in Fig. 2.4(b).

2.2 MAC Design for Wireless Sensor Networks

As we indicated before, the MAC design strategy in sensor networks is very different from that of the traditional wireless network. The nature of energy efficiency, high density node distribution, ad hoc network topology, infonnationand communication redundancy, and special node-to-sink communication pattern highlight this difference. In this section, we first briefly discuss several important attributes and trade-offs of MAC design. After that, the state-of-the­ art on current progress is presented. More than 20 different schemes are included and classified.

13 2.2.1 Important Issues for Sensor Network MAC Design In [65], Ye et.al. identifieda couple of MAC attributesand trade-offswhich may influence the sensor network MAC design. They are collision avoidance, energy efficiency, scalability and adaptivity, channel utilization, latency, throughput, andfaimess. The authors also emphasize that collision avoidance, energyefficiency and scalability and adaptivity to densities and num­ ber of nodes are top concerns. We argue that, for many sensor network applications, latency is actually an extremely important attributeneeded to be more considered. For instance, suppose that a sensor network is performing a monitoring and tracking task within a particular envi­ ronment. The time attached to the sensing event is critical since it can provide very important information like when the target appears and what the speed of the target is, etc. In addition, the long latency can normally render the collected information useless. On EnergyEfficiency and Latency. In our opinion, sensor network may have two types of energy efficiency, the individual energy efficiency and the network energy efficiency. For indi­ vidual energy efficiency strategy, each individual tries to minimize its own energy consumption and thus gain efficiency. While for network energy efficiency strategy, it tries to optimize the energy consumption of each other in order to maximize the network lifetime. Here the term of network lifetime is mainly measured by the degree of sensing and communication cover­ age. For instance, if the degree of sensing and communication coverage is lower than certain pre-defined threshold, there may exist some isolated sensing or communication field. In this case, the sensor network may lose certain importantinformation which may greatly degrade the successful deployment of a given application. Therefore, we can claim that network efficiency is generally more important compared to individual efficiency. The intuitive way to achieve this goal is to balance the energy consumed at each node. However, since the dominant traffic pattern in sensor networks is nodes-to-sink transmission, as a result, the closer a sensor is to the sink node, the higher the trafficburden is imposed, and thus the more energy is consumed. As we argued above, latency is another important design issue. Nevertheless, we also realize that there may exist many time-insensitive sensing data. Hence, the problem becomes how to minimize the latency of high time-sensitive data at the expanse of increasing the time delay of time-insensitive data. In addition, as a common way, many sensor network MAC protocols [22, 66] trade offlonger latency forachieving higher energy efficiency. However, to the best of our knowledge, there hasn't exited any clear cut what the best trade-offis. On Collision Avoidance. As indicated before, there are two types of strategies to reduce or eliminate collisions, centralize scheduling and contention. Centralized scheduling methods can totally remove collision at the expense of high complex allocation. If the network topology is high-density, the network performance based on this strategy may be very poor. For con­ tention based schemes, although they are simple and distributed, the collision can not be totally eliminated. Thus, the collision recovery mechanisms need to be applied. In general, the expo­ nential back-offscheme is widely used forthis goal. So far, several experiments [42, 29] have been conducted to evaluate the performance of some proposed sensor network MAC protocols. However, with the very small scale of node deployment, the results cannot provide us enough informationwhich can be taken as the designdirections. On Organization, Scalability, and Adaptivity. These are closely related issues on how to

14 organize communications in wireless sensor networks and how to adapt with the change of network topology, which may greatly reflect the MAC protocol design. In general, there exist two different realistic architectures, centralized or distributed. In the centralized architectures, due to the multi-hop nature, two or more layers of clustering hierarchy are required. Through this way, a series of central or local communication controllers (also called the cluster-head) are selected to schedule and coordinate the communications. In the distributed fashion, the sensor nodes coordinate locally with their neighbors for data transmission. However, since sensor nodes may fail because of multiple reasons like battery power depletion, carried away by some animals, crash due to hardware malfunctioning or software bugs, or even destroyed by the nature disasters, a good MAC design should accommodate such changes gracefully. Organization, scalability, and adaptivity are important attributes and have great influence on MAC design, because sensor networks are deployed in an ad hoc manner and often operate in uncertain environments. On Fairness among Multi-hop Communication. Due to the short-range communication characteristic of sensor networks, in order to organize such network, multi-hop based commu­ nication is a must. Generally speaking, two types of data traffic flowin and out of each node. They are self-generated or relayed packets fromother nodes. Therefore, how to decide when to send the self-generated and when to send the relayed traffic needs some arbitration strategies. Ideally, the goal is to provide a fairservice partition according to differentusers, nodes or appli­ cations requirements. Here, fairness does not mean treating each service requirement equally. Instead, since each flowmay have different service requirement, some are time-sensitive, others are not, some optimization needs to be achieved based on their performance in an application as a whole, thus arising another designtrade-off.

2.2.2 State of The Art Up to now, based on the different approaches and strategies, many research work [66, 22, 63, 44, 49, 30, 52, 33, 35, 64] has been proposed to address the MAC design problems for wireless sensor networks. Ye presented a brief overview of sensor networks MAC design in [65]. where several early proposed solutions were discussed and classified. Langendoen [42] also reviewed several typical mechanisms and provided the in-depth performance evaluation and analysis on S-MAC, T-MAC and L-MAC, Low Power Listening (LPL) techniques and IEEE 802.11 through simulation. Here, we provide a comprehensive review on MAC designin WSNs. In Table. 2.1, we classify most of the proposed protocols based on their design directions and the applied methods. Similar designs are listed together with some brief descriptions about their features, similarity, and differences.

2.3 Energy Efficient MAC Design in WSN

Thus far, most of the proposed research in MAC design of WSN has been dedicated to achieve energy efficiency from different perspectives. In the section, we focus on the discussion of energy-efficient MAC design in wireless sensor networks. We first investigate the sources of

15 Table 2.1: State-of-Art of MAC protocolsin wireless sensor networks.

classes I Types I Protocols I Features TOMA EMACs (62] three operation modes of a sensor node, localized transmission time slots selection LMAC (61, 63] localized TOMA Scheduling TRAMA (56] distributed packet scheduling, transmission reservation ODS [49] Schedule long-lived, end-to-end and periodic fbwa ER-MAC [54] balance energy consumption Kulkarni [40] General rule based TOMA for broadcast, coveragecast and local gossiping Arisha [15] provide a solution to allocate time slots to multi-hop sensor nodes based breath-flrst or depth-flrst search CDMA CSMAC [44] combine OS-CDMA and frequencydiversity in channel allocation; location aware to turnoff the redundantaodes CDMA/fDMA LEACH [30] dynamical clustering and cluster-headrotating CSMA/CA S-MAC [66] Periodic listen and sleep with fl xed duty-cycle Contention CSMA/CA T-MAC[22] traffic adaptive duty-cycle CSMA Sift[35] carefullyselected contention length to reduce collision in highly dense node population polling WiseMAC [31] synchronized preamble sampling Arbitration polling B-MAC [52] Reconflguration of MAC parameters to meet the changing of application polling IEEE 802.15.4 [33] star architecture, hybrid scheduling and contention schemes with QoS support Wakeup Radio PicoRadio [27] CDMA based multiple access with wakeup radio Others system STEM [59] periodically listen the wakeup channel in low duty cycle Miller [48] periodically listen the main radio and bufferingpackets I energy conswnptionfor sensor nodes, and then analyze the potential energy waste. Afterthat, we classify the existing protocols based on their strategies for energy saving, followedby the discussion of their design challenges. About fifty papers have been reviewed and most of the existed research work has been covered. Finally, we give some general guidelines on how to designenergy-efficient MAC protocols in sensor networks.

2.3.1 Energy Consumption and Wastage According to [55], the energy of a single sensor node is mainly conswned for three purposes: sensing, computation, communication. Among all these factors, since data transmission has been identified as the dominant source to consume energy, shown in Fig. 2.5, our discussion here focuses on the energy expenditure on data communications. In [65], Ye identified four types of energy wastes during the transmission and reception of sensor network communication systems. They are Idle listening, Collisions, Communication overhead, and Overhearing. Idle listening. It happens when the radio is listeningto the channel to receive possible data. The cost is especially high in many sensor network applications where there is no data to send

16 20 i ...... g 15 +------1 10 ------­ [a s ;------,-- J Sensors CPU TX RX IDLE SLEEP Radro···--···············--····" 0'""'"''" Devices ( working modes)

Figure 2.5: Comparison of energy consumptionof different devices of the general sensor node [24] during the period when nothing is sensed. Many MAC protocols always listen to the channel when active, assuming that the complete device would be powered offby the user if there is no data to send. Collisions. It happens when two nodes transmit simultaneously and interfere with each others' transmission. In this case, packetsare corruptedand must be discarded. Hence, the time and energy used during transmission and reception are wasted. Communication overhead. Most protocols require control packets to be exchanged. Since these packets contain no application data, we consider the transmission and reception as over­ head. Overhearing. Since the channel is a shared medium, a node may receive packets that are not destined forit, causing the overhearing overhead. A MAC protocol achieves energy saving by controllingthe radio to avoid or reduce energy waste from the above sources. A simple and effective strategy to save energy is to turn offthe radio when it is not intended to transmit or receive packets. However, putting radio into the sleep mode corresponds to low power consumption as well as reduced operation capacity, in­ creased latency and slow system response. Thus it is actually a design trade-offand needsto be evaluated beforeapplied into sensor network communication and networking design. In addi­ tion, a complete energy management scheme must consider all sources of energy consumption, not justthe radio.

2.3.2 Scheduling-Based Energy Saving The most attractive featuresof schedule-based mechanisms lies in the factsthat they are inher­ ently collision freeand the sensor nodes can be turned offwhen they are in the idle state, thus energy expenditure can be saved due to data retransmission and idle overhearing. However, drawbacks exist in channel allocation schemes due to the nature of network dynamics and high­ density network topology. The multi-hop based communication also increases the complexity of the channel allocation mechanism. Depending on different domains the channel is parti­ tioned, different difficulties might be faced. When using TOMA, the transmission time needs

17 to be highly synchronized, and the ad hoc, multi-hop, and network dynamics also increase the complexity of the allocation algorithms. For FDMA, due to the expensive hardware require­ ment, the limited bandwidth and the large number of sensor nodes, it is not realistic to assign unique frequency band for each individual node. Similar case happens when using CDMA, since each node must encode its data bits with unique orthogonal codes and the code space is also limited.

Proposed Solutions

• Infrastructure-BasedScheduling In order to organize the short-range multi-hop based sensor network communications, clustering-based approach has been proposed. In this approach, sensor nodes are parti­ tioned into clusters and for each cluster a cluster-head is selected to supervise the com­ munication within its cluster and transmit the collected sensing or aggregating data to the base station. This techniquescan be combined with scheduling-based MAC protocols to solve the centralized channel allocation problems caused by high dense network topol­ ogy because it off-loadthe scheduling and allocation tasks fromthe one-layer architecture controlled by the centralbased station to the two-layer or multiple-layer architecturecon­ trolled by both multiple cluster-heads and the base station. A couple of protocols have been presented. LEACH [30] organizes the nodes into cluster hierarchies, and apply TOMA within each cluster. The cluster-head is dynamically rotated among the cluster members depending on their residual energy. Nodes in the cluster can only talk to the cluster-head through single communication hop, which then talk to base station through long-rangeradio using FDMNCDMA. However, LEACH assumes all sensor nodes can reach the base station which might not be true for most of sensor network applications. Arisha et. al. [15] also formeda clustered infrastructure. Instead of including a dynam­ ically cluster-head selection phase, this approach uses multiple fixedgateways acting as cluster-heads. Normally these gateways are in small amount compared with a huge num­ ber of sensor nodes and can be assumed powerfulnodes. Within each cluster, the gateway, throughbreadth-first-search (BFS) or width-first-search(WFS), can allocate transmission time slots to their clustered nodes in the context of multi-hop communications. The merit of this scheme is to provide us a way to assign the transmission time slots to the nodes with multiple hops away from the communication controller.

• Decentralized-Based Scheduling The TRAMA protocol [56] uses collision-free packet scheduling for energy efficiency. Nodes periodically wake up to exchange broadcasting messages and learntheir two-hop neighborhoods. Based on this knowledge, nodes periodically reserve future slots for backlogged traffic. A hash-based priority scheme is then used so that onlyone node in a two-hop neighborhood will transmit in a given slot. ODS [49] also tries to schedule the sensor trafficflow into non-interfering slots. Differentfrom TRAMA scheduling recently received packets on hop-by-hop basis, ODS attempts to schedule long-lived, end-to-end,

18 periodic flows in a much simple way without maintaining the two-hop neighborhood information. However, since ODS is conservative in scheduling flows, it may greatly degrade network performance when the trafficis bursty. The TOMA-based EMACs [61, 63] and LMAC [62] protocols are proposed for Euro­ pean research project EYES[l]. The most attractive advantage of these protocol is to provide an solution to allocate the limited transmission time slots under the context of densely deployed sensor networks. Meanwhile, the channel allocation process is decen­ tralized without any arbitration nodes like cluster-head or sensor sink. In other words, sensor nodes autonomously select the unoccupied transmission time slot and claim the ownership by local broadcasting. In EMACs, each TDMA frame is partitioned into three phases, the Communication Request (CR) phase, the Traffic Control (TC) phase, and the Data Section. Three operation modes of a node are defined, the active mode which means a node can control or claim a transmission time slot, the passive mode in which a node cannot own a time slot but can rely on an active node for channel access, and the dormant mode in which a node has been put into sleep for an agreed amount of time. In brief, the passive nodes can access the channel by placing a request during the CR phase of a particular time slot. Then the owner of that slot transmits a message in the TC phase to notify the collected information on local topology and routing, time slots occupation, and the potential receiver. Therefore,the transmission can be launched either by the requested passivenodes or the owner of thattime slot and the owner can suppress the requested transmission from passive nodes for its own benefit or let the multiple re­ quests contend for the channel utilization. The real data transmission happens during the data section. LAMC further simplified the process by partitioning a transmission time slot into two parts instead of three applied in EMACs, in which for each slot, it consists of a control message and a data unit. The informationbroadcasted in the control section includes a collected occupied time slot information. Once the newly joined node listens fora complete frameof all controls message, it can find out all the unassignedtime slots and randomly select and claim one of them. UnlikeEMACs, every nodes in LMAC will be assigned a unique time slot, thus it may introduce longer frame size. Also, collision in slot selection does occur sometime, and it can be solved by notification by neighbors and random back-offfor re-selection. Another featureof LMAC is that the receiver does not acknowledge the correct reception of the data and leave the reliability issues to the upper layer protocols. The drawbacks of these protocols lie in the following. First, every node must listen to the control sections of all slots in a frameresulting in the unnecessary energy wastes. Secondly, in LMAC, each node has been assigned a unique time slot, which may introduce an extremely long latency in such a high-density sensor networks. The channel utilization is also very poor.

• General Rule Based Scheduling In this category, there is no need for any centralized scheduling or distributed, negotiated based scheduling algorithm. The method to allocate the transmission slots to sensor nodes is based on some general rules. In [39, 40], Kulkarni et. al. presented a self-stabilizing

19 TDMA mechanism, in which a fixedschedule was used throughout the network lifetime. The partition ruleswhich is used forscheduling can be described as follows. The protocol assumes a rectangular or hexagonal grids and two range, communication range and inter­ ference ranges. The left-top position in the grid can be taken as the initialization point. Suppose the communication range is 1 and interferencerange is y. Since the initialization point is the left-top grid point, a node can only receives a message either from the west neighbor or fromnorth neighbor, the allocating rule is that if the message is fromthe west neighbor, the assigned slot should be theprevious slot decreased by one; If the message is from the north neighbor, the assigned slot should be the previous slot decreased by (y + 1). Through this way, all the neighbors within a node's interference range can be ensured with the uniquely assigned transmission time slots. In [ 40], the author further made some improvements such that the protocol would be adaptive to other communica­ tion patterns like coveragecast and local gossip by increasing the interval between slots assigned to a sensor and length of slots during each access. They show that such static schedules can result in acceptable performance for typical communication patterns, but their constraints on the location of the nodes renders it impractical in many deployment scenarios.

• Other Approaches Beside the above mentioned protocols, there also exist some other interesting solutions. ER-MAC [54] is a TOMA-based approach aiming at balancing the energy consumption and thus increasing the network lifetime. The applied evaluation rule is based on the node's energy criticality. A distributed algorithm is used to find sets of winner or loser, who are then assigned appropriate slots in the TD MA-based MAC protocol. However, the authors assumethat each node has been pre-assign two time slots and leave out the portion of how to allocate the transmission time slots among sensor nodes, which, in our view, is actually extremelyimportant for TDMA-based MAC design. Liu et. al. [45] proposed a CDMA sensor MAC denoted as CSMAC protocol which reduces the channel interference and consequently message latency by combining the DS-CDMA and frequencydiversity techniques. This protocol assumes the location awareness of each sensor node, therefore, network redundancy can be reduced by turning offthe redundant nodes and selecting minimum neighbors. However, during their simulationsand analysis, the extent of energy expenditure introduced by coding and decoding electronics employed in CDMA has not been investigated.

2.3.3 Contention-Based Energy Saving The most appealing feature of contention-based MAC protocols is that the shared channel is allocated on-demand and in a distributed way. A contention scheme needs to be employed to decide at a specifictime which node can access the channel. The type of protocols have some benefits over the scheduling based protocols. First, they are scalable and easily adaptive to the change of topologies. Secondly, these types of protocols do not assume any infrastructure to organize the network, they are more flexiblefor supporting upper layer protocols. Finally, they

20 do not acquire the strict time synchronization like that of scheduling based protocols. However, these protocols are not inherently energy efficient. First, each node has to listen to the channel all the time since it has no knowledge of the exact time of data transmission. Second, collisions do happened no matter what scheme we apply which causes re-transmission and energy waste. Finally, the widely used collision avoidance scheme like RTS-CTS message exchange intro­ duces the communication overhead. So far, several protocols [66, 22] have been proposed to solve the above mentioned problems. Since sensor network are generally assumed as low networks, the key idea for these protocols is to let sensor nodes operate under the periodically active and sleep mode.

Proposed Solutions

• S-MAC S-MAC [66] is a decentralized strategy, by letting each node coordinate with their local neighbors, a periodic listen and sleep schedule can be derived. With thisschedule, sensor node can turnoff the radio when they are not the intended transmitter or receiver at a par­ ticular time, thus saving energy by avoiding idle listening and overhearing. S-MAC starts with fixed on-sleep duty cycle, attempts to reduce the energy wastage by making sensor node periodically listen and sleep. It uses RTS/CTS/DATA/ACK message exchange for collision avoidance. However, with the fixed on/sleep duty cycle scheme, the network performance can be degraded in case of bursty traffic. In addition, the existed multiple on/sleep schedules on edge nodes could result in unbalanced energy consumption and thus lose communication coverage. To solve this problem, Li et. al. [43] developed a global schedule algorithm (GSA) and fastpath algorithm (FPA) to contr<;>l and exploit the presence of multiple schedules and thus reduce energy consumptionand latency. GSA tries to make a large network converge to a single global schedule, and FPA provides fast data forwarding paths by adding additional wake-up periods on the nodes along paths thus reducing the multi-hop data transmission latency.

• T-MAC T-MAC [22] is another contention-based low duty cycle MAC protocol. It demonstrates similar behaviors to S-MAC with the exception an adaptive active/sleep duty cycle to han­ dle the load variations in time and locations. The key idea is to let the node dynamically end the active part when there is no trafficin the channel fora certain pre-determinedtime. However, the early sleeping problem can be introduced and the authors propose several solutions, including future-RTS (FRTS). Their algorithms reduce the latency incurred by a scheduled MAC, but approaches such as FRTS are limited to the 3-hop neighborhood of the originator. The illustration of S-MAC and T-MAC can be found in Fig. 2.6. Ac­ cording to the figure, S-MAC always keep the same active-sleep schedule. While for T-MAC, if the node cannot detect any signal from the channel for a certain time which is represented by TA in the graph, the node will automatically turnoff its radio until the next On cycle. The early sleeping problem happens, as observed in the third active cycle,

21 NORMAL 0 0 D TimeAxia

Active S-MAC

Sleep Active T-MAC Sleep ·� � Figure 2.6: Duty-cycle of S-MAC and T-MAC; the blue rectangular represents the transmitted or received packets and TA denotes the activity time-out period

when transmission starts just after the time-out and still within the active period. As we mentioned above, this problem can be solved by FRTS message exchange.

• Other Approaches Woo and Culler [64] proposed a CSMA-based MAC protocol, designed especially to support the periodic and highly correlated traffic of some sensor network applications. They proposed an adaptive transmission rate control (ARC) scheme, whose main goal is to achieve media access fairnessby balancing the rates of originating and route-through traffic. Because it is CSMA-based, this approach may suffer from control overheads and hidden terminal problems. Instead of using a time-varying contention window from which a node randomly picks up a transmissionslot, Sift[35] uses a fixed-sizecontention window with a carefully-chosen pseudo random number generation strategy, which is based on a near optimal non-uniformprobability distribution to reduce the collision.

2.3.4 Polling and Preamble Sampling Mechanisms As indicated in [56], the goal of preamble sampling techniques is to let the receiver sleep most of the time when the channel is idle. It consists of transmitting a preamble of certain transmission length (Tp) in front of each packet. A receiver wakes up periodically every Tp seconds and checks foractivity on the channel. If the channel is foundidle, the receiver goes back to sleep. If a preamble is detected, the receiver stays on and continues to listen until the packet is received.

Proposed solutions • WiseMACand B-MAC There is another type of low duty cycle MAC protocols using the preamble sampling techniques to alleviate the energy cost during idle listening. Receivers periodically wake up fora very short duration and sample the medium for activities. With the knowledge of each neighbor's independent sampling schedule information, WiseMAC [31] can further reduce the wakeup preamble and energy cost. WiseMAC saves energy from eliminat­ ing synchronization for different schedules, but since nodes are not coordinated, a sleep

22 delay is introduced at each hop which could be as large as the duration of a sampling period. B-MAC [52] is a similar work using this technique of preamble sampling. The main contribution of B-MAC is to provide an interface forreconfiguring the MAC layer parameters to meet the application's new and dynamically changing demand.

• The IEEE 802.15.4 Standard The IEEE 802.15.4 ZigBee [33] network includes a centralcoordinator, called the access point, assuming it is connected to the fixednetwork and supplied with an unconstrained amount of energy. A power save scheme has been specifiedin the IEEE 802.15.4 standard to save energy at the cost of a larger delay. The access point buffersincoming trafficad­ dressed to sensor nodes. A beacon is periodically transmitted with period. This standard is preferred in the WSN industry, however, the single-hop requirement and the needs for many access points or Full Function Device (FFD) make them less attractive in random deployment applications.

2.3.5 Other Mechanisms The PicoRado [27] design uses a separate low-power radio to wakeup the neighbor when the data needs to be sent. The main radio which is actually used for data transmission is always turned offif the node is not the intended transmitter or receiver. The applied CDMA scheme will increase both hardware complexity and total energy expenditure, which have not been considered by the authors. STEM [ 59] is another two-radio architecture. More energy saving is achieved by letting the wakeup radio periodically listen using a low duty cycle. Miller et.al. [48] make furtherimprovement on energy saving by periodically listening the primary channel and buffering packets.

2.3.6 Design Guidelines for Energy-Efficient MAC Design Based on the above discussion on the energy efficient sensor network MAC design, some gen­ eral guidelines can be used as the direction forenergy saving, which is described as follows. • Collision should be avoided whenever is possible since the followingretransmission may lead to extraenergy consumptionand possible unbounded delays. • The potential MAC design needs to be simple with the possible minimal communica­ tion overhead. When the packet size is very small, the long overhead of complex MAC protocolsmay dominate on energy consumptionwhich is noi desirable. • Reduce the informationand network redundancy. By reducing the unnecessary data trans­ mission, energy can be saved, meanwhile trafficload and transmission delay can also be reduced. • Turnoff the transmitter when possible. Sensor networks are assumedto be low trafficrate networks. Most of the time has been wasted by idle listening or overhearing thus arising the need to periodically put the sensor into sleep mode in order to save energy.

23 • Be scalable and adaptive to the network dynamics. Normally the change of network topology can consume a lotof energy. If the proposed MAC is inherently adaptive to the node failure, traffic change, or even mobility of sensor node, it can avoid unnecessary overhead.

24 Chapter 3

Quality of Services (QoS) in WSN

Quality of Service (QoS) is an overloaded term with various meanings and perspectives. There is little consensus on the precise definition of QoS. My focus here is to study the QoS for networking services, especially forwireless sensor networks, therefore, it can be viewed from two aspects, the capacity of network services and the requirements of specified applications. In other words, from the application point of view, the sensing delay, sensing accuracy, or the decision accuracy are the top concerns,while from the networking point of view, network connectivity, throughput, reliable and low latency data transmission may be critical. Thus, QoS control is usually located between the and the actingas the tuner to control and tunethe network parameters to satisfythe requirements fromgiven applications. This model is shown in Fig. 3 .1. The traditional QoS research in multimedia networks provide QoS services to applications in terms of ensured end-to-end rates and latencies. The widely used parameters to evaluate the quality of include: latency which identifies the delay of packets travelingacross the network; jitter which represents actual delay deviating from the average; reliabilitywhich refers to missing packets or the corruptedpackets resulting in incorrect packet transmission; and throughput. However, several questions arise when we talk about QoS in sensor networks. "Do we really need to provide QoS for Wireless Sensor Networks?", "What kind of QoS does a sensor network require?", and "If QoS is needed for WSN, how can we provide it in such low bandwidth and resource constrainednetworks?". The discussion of the followingsection are related to these questions.

3.1 Necessityof QoS in WSN Numerous applications of sensor networks have been identified in diverse fields including in­ dustry,defense, national security, and space. These applications are generally critical and time­ sensitive, such as fire monitoring, warehouse management, and battle field surveillance and reconnaissance. The loss or delayed data transmission may produce serious consequence like outliers in decision making and misleading information. Thus, in order to satisfy such ap­ plication requirement, the data transmission in sensor network needs to be reliable, robust and timely, whichactually triggers the need forQoS supports. Intuitively, these requirements can be

25 Figure 3.1: The general QoS model for sensor networks

achieved through high-speed, high-quality communicationchannel. However, since these net­ works are characterized by the nodes with little computing power, small memory, and limited energy reserves, meanwhile the communication channel is low-rate and error-prone. In such resource constrained environment, providing QoS for proper allocation of resources is critical to meet the demands of the application. In addition, a sensor node may be equipped with differenttypes of sensors like temperature, acoustic, seismic, or even imaging sensors. For a given application, these sensing modalities may have differentcontributions, thus it is reasonable to assign different network services when collecting these sensing information. Due to the high density deployment of sensor nodes, the redundancy in sensor networks is very high and through in-network processing ( data compres­ sion, processing and fusion),these raw measurement may be aggregatedand condensed to form a decision. Consequently, it is extremelyimportant to provide high priority network services for those formeddecisions since they are the top concernfrom the application point of view. There­ fore, the existence of different importance level data packets poses the clear need for support of certain service differentiation. In other words, we expect these networks to prioritize data packets and provide different services in accordance with differentapplication specification. In summary, the Quality of Service (QoS) provision is an important consideration and a holis­ tic approach to the design, analysis and management of sensor network systems comprising a number of interconnected sensor nodes is necessary in order to efficiently achieve predictable and robust end-to-end performanceto meet the stringent requirements of end users and specific applications.

3.2 QoS Metrics for Wireless Sensor Networks

Unlike transitional multimedia networks, the guaranteed end-to-end QoS provision for WSN is extremely difficult or even unrealistic due to the low-capacity, error-prone and time-varying

26 wireless channel, the network dynamics and the ad hoc nature. As a result, applications, on one hand, must adapt to time-varying QoS parametersoffered by the network; on the otherhand, the link and network layers need to provide the best effort QoS support. Meanwhile, QoS should be adaptive to the channel condition, network topology and reconfiguration of theapplications. A negotiation is also needed for QoS such that the high priority application data can obtain better QoS by sacrificing the QoS of less important data, like aggregated and normal sensing data. In order to provide best quality of service according to the requirement of applications, we firstneed to identify what the quality of service is and how to evaluate the quality of services. The traditionally used metrics, according to [60] areFideli ty, Loss, Corruption,Security, Delay, Jitter, Synchronization, Set-up time, and Tear-down time, which can be classified into quality and timing categories. Many of these metrics are not applicable for wireless sensor networks, therefore, according to the simple QoS model seen in Fig. 3.1 and considering the characteris­ tics, we present two sets of important QoS metrics fromthe application and network points of view [13]. From the application perspective, the quality of service is mainly referred as the quality achieved for the purpose of special task. And the corresponding metrics can be classified as follows.

• Cost. From the user point of view, the most important concern is the cost estimation to deploy a sensor network for a particular application. This metric can actually be used to decide the total number of sensor nodes deployed into the field. • Sensing Time. For a particularapplication, the user usually has the expectation on how long it takes forthe sensor nodes to sense or monitor the field. This parameter is decided by the conducted applications. • Sensing or Detection Accuracy. It represents the extent of accuracy reported by sensor networks compared with the ground truth. • Sensing Latency. It measures the delay from the time when the event happens to the time when the sensing or detection reach the controlcenter.

Related to the application QoS expectations, the internal network metrics can be described as follows.

• Energy Efficiency. Conserving energy is an extremely important goal in the design of protocols for WSNs. Thus energy efficiency can be taken as the fundamentalQoS metric which may have great influenceon other metrics. Generally speaking, it can be measured by the average energy consumption of transmitted message unit. • Coverage. Coverage is another important metric and within the context of sensor net­ works, it mainly includes sensingcoverage and communicationcoverage. Once the cov­ erage has been lost, it may have some isolated area that cannot be sensed or communicate. It may greatly degrade the network performance and may miss some importantinforma­ tion.

27 • Density. Density can be used to measure thenetwork redundancy and sensing redundancy. As the general rule, the more data collected, the more accurate the decision. However, it also leads to more power and bandwidth consumption and possibly introduces longer delay.

• longevity. We use longevity to represent network life time, which is a confusing termin wireless sensor networks. So far, there exists several different definitions. It can be mea­ sured by the time when the first node depletes its power, or by the time certain amount of sensor nodes are dead, or by the time the sensor network loses its sensing or commu­ nication coverage, or even by the time all the sensor nodes are dead. This metric is used to identifyhow balance the energy is consumed by each sensor node, therefore, it is clear that the more balanced the energy has been used among all the sensor nodes, the longer the system can survive.

• Transmission Accuracy. Transmission accuracy may be affected by several factors, such as channel bit-error-rate (BER), collision, or node failure.

• Latency. In many cases, the information collected from the sensing field is time critical, which should be delivered in a timely manner. We use the metric latency to measure the average message transmission delay.

Although all the metrics are important to reflect the QoS provision, it is impossible to achieve all of these objectives at the same time since some of the metrics conflict with each other. How to select suitable QoS metrics highly depends on the imposed applications. Often, the network may offer the application several performance curves that identify different quality of service, e.g. some approximate rate-delay trade-offcurve derived from the capabilities of MAC protocols. Giventhese kinds of curves, the application layer then can decide the opera­ tion point on that curve to achieve optimal results. Energy constraints also introduce another set of trade-offs related to network performance versus longevity. These trade-off curves will typically be multidimensional to incorporaterate, latency, transmission accuracy, longevity, and so on.

3.3 QoS Provision and Realization In order to provide QoS, there generally exist two models: Integrated Services (IntServ) model [20], the flow-based reservation, and the Differentiated Services (DiffServ) model [19], the class-based differentiation. The IntServ model gives special treatment to packets from a given flow. Here the flowmainly refersto the stream of packets with the same source address, destina­ tion address and portnumber. Each is required to maintain the state informationon each flow and the router can determine which flow can obtain what services based on the available capacity. The most challenging issue with this model is the scalability problem since it may include too many flows within a network. Instead of maintaining individual flows on all the routers, in the DiffServmodel, the flowsare aggregated into an aggregateflow according to the

28 Application Profile

ServiceModel

I CAD=- I R=•= Alloution I =- I . . . T I ������= -�J .. Figure 3.2: Architecture forQoS serviceprovision [21]

identified service classes. Packets are marked as belonging to a particular service and routers in path will determine the service based on these class information. In general, the DiffServ model provides service on a per-aggregate basis whereas the lntServ provides service on a per­ flow basis. These two models are proposed fortraditional wired network, in which the channel quality can be assumed to be perfect. Once the packet is transmitted,it will successfullyreach the next hop. In addition, energy is not a big concern either, which has posed extra challenges for service provision in wireless sensor networks. As indicated in [18], the concept of flow has two interpretations. One can be data-centric treating each type of sensing data as a unique flow, the other can be host-centric treating the streamsof packets flowing from the a source to the sink nodeas unique flow. In order to make it realistic for sensor networks, the total numberof flows should be limited, therefore, the host-centric interpretation might be infeasible. The IntServ model might be possible when the number of sensor types is small, and the successful exam­ ple can be referred to as the Directed Diffusion [34]. The DiffServ model holds great promise for supporting QoS in sensor networks. The key idea is to let each sensor node differentiate the service provision into several levels with different priorities for services. Each incoming packet needs to be classified into one of the categories based on its importance level to obtain the corresponding services. The Q-MAC protocol developed in this thesis is also based on this model. QoS provision and realization can be achieved through the admission control and resource reservation [21]. The typical implementation system is illustrated in Fig. 3.2. It includes an application profile, which is mapped to the service model by using different forms of traffic specifications. The service model describes a set of offered services by the network, such as guaranteed service, best efforts service, and so on. To achieve appropriate QoS for different service classes, a network should use different strategies to allocate its networking resources

29 to different classes according to their profile. The applied schemes are called the admission control and the resource reservation. Furthermore, since the transmission in sensor networks is generally multi-hop, the network resource allocation scheme should be partitioned globally. In addition, since wireless network is a highly dynamic system, to maintain a specified QoS level, a wireless system has to adapt to varying conditions when the wireless link fluctuates or degrades. By using the rate adaptive features, the resource allocation scheme can be adaptive to the network conditions. As we indicated before,the end-to-end QoS guarantee is extremelydifficult to achieve and it generally involves complex global scheduling for resources allocation, which might present big challenge in the context of high density network topology. The introduction of image and video sensors has also posed the need forcertain end-to-end assurance. The transmissionof image and video data requires the optimal use of energy, bandwidth, and the number of transmissionnodes. In this case, scheduling based MAC protocols are preferred and the IntServ model is needed. For most of applications in WSN, there is no need to provide the end-to-end service guarantee. Instead of tryingto bound the delays, the feasible way is to provide best-effort services. As for the MAC strategy, the contention-based mechanism can be applied. Once obtaining the QoS requirement for specific applications, the following step is to con­ trol or tune the sensor networks to match such requirement. In other words, the network re­ source needs to be allocated properly. Based on the different lower layer design strategy, it can have several different implementation methods, which is shown in Fig. 3.3. In scheduling based MAC scheme, the servicesdifferentiation can be realized by allocating the channel based on time, frequency, or code domain, as observed in Fig. 3.3(a). The actually assigned service rate can be determined by the priority levels of given packets. The problems associated with these schemes are mainly caused by the network dynamics and high density topology. And as a result, the limited resource capacity may not satisfy the needs of all the nodes. There exist two schemes for contention-based random medium access. The first scheme, motivated by [26], in which services with higher priority level have a higher access probability, and can assign different contention windows to different services, in accordance to the priority level. For instance, as shown in Fig. 3.3(b), the higher priority level packet (e.g. priority 1) are as­ signed a smaller contention window size which is frac1N for packets with a priority level of N. Thus, the change to access the channel_ of priority 1 level packet is N times greater than the priority N level packets since the less the access contention time, the higher probability to access the channel. However, in this case, we cannot guarantee that the higher priority packet can always access the channel over the lower priority packets, whereas, this can be ensured in the Fig. 3.3(c). In this scheme, each priority level packer can be assigned a contention win­ dow in a certain range and between these ranges there are no overlaps. However, this scheme will introduce longer latency for low priority packets but we think it is worthwhile in sensor networks considering the existence of high redundancy data. Meanwhile, for these contention based schemes, collision is possible between services with the same priority level. As opposed to the contention MAC protocols, realization of the priority in the arbitration protocols is a lot easier. An example is shown in 3.3(c), where the control center can poll the traffic from the sensor nodes and assign corresponding transmission time slot. Since the higher priority class

30 i+I .: i+2 :. i+3:.

T1_·me_lF_r,_eq_u_en_cy�code ,....__?+-:�;-��-- �-,:-:_ .:·..... · ---.1-, .....,--'- ______

(a) time •

<:,vi:: ::: ���::j CWN J ...... (b) J time •

CW! CW2 CW3 CWN I. .I. .I. .I (c)

i+l i+2 i+3 time i R! T i Rl T i RI T i Ri T •

(c)

Figure 3.3: QoS realization schemes (a) Scheduling based scheme in which the channel band­ width (time, code, or frequency)is reservedbased on different requirements of flows. (b) Con­ tention based scheme with priority support in which higher priority packets select smaller con­ tention time while lower packet pick up larger contention time. ( c) Contention based scheme with priority support where different priority level packets choose the contention time fromdif­ ferentregion. ( d) Reservation based scheme where channel can be reservedbased on the packet priority

31 can be polled more frequently than the lower priority traffic class, services differentiation can be achieved.

3.4 Case Study on Service Differentiationfor Q-MAC Differentiating network services for different packets is the key issue to QoS protocol design. In Q-MAC, two QoS metrics are defined for the purpose of intra-node and inter-node packet scheduling fromthe perspectives of application layer abstraction, MAC layer abstraction, and the information on available system resources of sensor nodes including the residual energy and the queue's proportional load. In brief, the metric forintra-node packet scheduling is deter­ mined by the application layer and MAC layer abstraction, and the metric forinter-node packet scheduling is derived from all three factors mentioned above. In this section, we explain the rationale of these metrics.

3.4.1 The Metric forIntro-node Packet Scheduling The trafficfor each sensor node involves both relayed and self-generated packets. To be stored into the corresponding queue with specified priority level, these packets need to be classified based on the factorsderived from the application and MAC layer abstraction.

• Application Layer Abstraction. From the viewpoint of the application layer, we classify the packets according to their content importance. On one hand, a sensor node may host several different sensing modalities which capture data from different perspectives. According to the specificapplication, the sensor readout of differenttypes of sensors may play a different role in information provisioning and decision making, and consequently possess different importance levels. On the other hand, different types of applications also imply different degrees of content importance. For example, applications like data compression, aggregation, and fusionare widely used in WSNs, whose aggregateddata or decision are extremelyimportant and thus have precedence over datacollected from, for example, network maintenance applications and environment monitoring applications. In order to reflect the different importance levels of different applications, in Q-MAC, we attach five extra bits of information to every message generated. We use two bits to identify the different types of applications and three bits for different types of sensing data. In practice, the selection of number of bits can be justified according to specific network constructions.

• MAC Layer Abstraction. The packets within a sensor node consist of both self-produced and relayed packets. Meanwhile, the number of transmitted hops can also be different among the relayed packets. Thus, the key problems are to provide fair, efficient network service between self-generated and relayed packets and among the relayed packets with different transmitted hops. In general, packets that have gone through more hops have a higher priority than those that have gone through less. As a result, forthe current imple­ mentation of Q-MAC, we consider the originating packets as the 1-hop packet and, for

32 other relayed packets, their hop number is calculated by increasing the actual transmitted hops by one. After normalized by the maximal permitted hops, the factor of MAC layer abstraction can be determined.

Once we derive these two factors from both application abstraction and MAC abstraction, we can classifyeach packet through simple normalization and thresholding and store it into the correspondingqueue.

3.4.2 The Metric for Inter-node Packet Scheduling After selecting the next transmitted packet, the inter-node packet scheduling is launched to determine which node can access the channel. The metric used for this purpose relies not only on the intra-node scheduling metric but also the information of the available resources of the sensor nodes. In sensor networks, the energy consumption of all sensor nodes are expected to be balanced in order to minimize the probability of losing communicationcoverage and thus to maximize the network lifetime. Thus, if all other conditions are the same, the nodes with higher residual energy will surely have precedence over others to access the channel. In addition, the queues' proportionalload is also an very importantfactor which may affectthe service provision among neighboring nodes. If the queuing system of a sensor node is highly occupied, it raises the need for more network services to avoid the potential overflow of the queue system and the large latency imposed by the traffic congestion.

33 Chapter 4

The Q-MAC Protocol

Q-MAC takes energy efficiency and QoS provisioning as the two key issues for wireless sen­ sor network MAC protocol design. It consists of two levels of scheduling tasks, the intra-node scheduling and the inter-node scheduling. The intra-node scheduling scheme adopts a multi­ queue based queuing architecture to classify data packets according to their application and MAC layer abstraction. The MAX-MINfairness algorithm and the packetized GPS algorithm are used to determine the next packet to be served fromthe multi-queue mechanism within each node. The inter-node scheduling employs the power conservation MACAWprotocol and the loosely prioritized random access protocolfor multiple access of the channel among neighbor­ ing sensor nodes. The followingsubsections describe the Q-MAC protocolin detail.

4.1 The Queuing Architecture

In Q-MAC, multiple first-in-first-out (FIFO) queuing systems are employed as illustrated in Fig. 4.1. The use of multiple queues results in improved performance, with respect to a single FIFO system, by avoiding the complexity of in-queue searching algorithms. When a packet is received, it is classifiedbased on its criticality and then stored into the appropriate queue. It is obvious that the number of queues will determine the number of network service levels offered. However, how to choose a proper number of queues and how to establish the size of each queue remain challenging tasksand, in many cases, translate to trade-offsbetween node resources and the expected QoS provisioning. In Q-MAC, we assign fivequeues to each of the sensor nodes. One of the queues is regarded as an instant queue, or deterministic queue, meaning that if any packet are stored in thisqueue they will be instantly served. A justification for such a queue lies in the fact that we want to leave a trapdoor for centralizednetwork management traffic (e.g. network synchronization, reorganization, or even reconfiguration) and to offer extremely urgent traffic a path for rapid service. For all other queues, we simply use the MAX-MIN fairness algorithm[l6] and the packetized GPS algorithm[50] to determine the next serviced packet for each of the sensor nodes.

34 FIFO Weighted rbitration

I Sensor

FIFO Weighted rbitration

I I Sensor Intra-nodePacket Scheduling ! Inter-nodePacket Sch�duling

Figure 4.1: The multi-queue queuing architecture employed by each of the QoS-aware sensor node

35 Calculateat the starting the rate time of each of a queuenew frame using the MAX-MINfairness algorithm with weights; if the size of instant queue 0 then ifI > then next packet = the firstpacket in the instant queue;

else p Calculate F of the firstpacket in each queuep except the instant queue using PGPS; I next packet is the packet with smallest F ; end endnew packet received or generated if then Quantizethe size the boundedcriticality size and of classi the specifiedfyinto a queueparticular queue; if < then I store the packet at the end of queue; elseI drop thepacket; end end Algorithm l: The intra-node scheduling in Q-MAC.

4.2 Intra-Node Scheduling

4.2.1 MAX-MINFairness Mechanism

Each queue within a sensor node is dynamically assigned a weight for resolving network ser­ vice contention. To fairlyallocate network services to each flow, the classical MAX-MIN fair allocation algorithm is employed. A rate allocation is said to be MAX-MIN fairif one cannot increase a rate of one flow without decreasing an already smaller rate. Therefore, the flow with the smallest rate request will always be satisfied if this rate is less than the total available rate divided by the number of flows.

4.2.2 Packetized Generalized Processor Sharing (PGPS)

With the rates obtained from MAX-MIN Fairness Mechanism, the PGPS is used to select the p next transmittingpacket. The idea is to defineF as the time at whicha packet would complete service under GPS. Then, a good approximation of GPS can be achieved by serving packets p with the earliest F first. It has been shown that the latter scheme results in bounded packet delay, as would be required for strict QoS support. The complete intra-node packet scheduling algorithm is shown in Algorithm 1.

36 4.3 Inter-Node Scheduling

4.3.1 Power Conservation MACAW (PC-MACAW) The MAC layer is responsible for coordinating and scheduling data transmissions among mul­ tiple nodes sharing the same channel. In wireless sensor networks, sensor nodes use radio frequency (RF) to communicate with each other. The communication range of a sensor node is predominantly determined by transmission power and fadingeffects in different environments. Two nodes are said to be neighbors if and only if they are within each other's communication range. Due to the nature of radio waves, within a particular communication range, only one data transmission can be carried out at any given time without collisions occurring. In consid­ eration of the high cost of retransmission, inspired by MACAW (17], we introduce the Power Conservation MACAWprotocol as means of scheduling data transmissions in wireless sensor networks. The basic idea of MACAW is to employ an RTS-CTS-DATA-ACK message exchange for­ mat for each packet. Such a protocol structure is known for solving the hidden terminal and exposure problems and greatly reducing the occurrence of collisions. However, since energy efficiency is a fundamentalrequirement for wireless sensor network protocol design, in order to make this protocol power efficient, some modifications to the MACAW scheme are required. It has been shown that communication is the dominating factorin energy consumption. Moreover, idle listening, collision, communication overhead and overhearing contribute most to energy wastage. Hence, our task here is to develop a simple and distributed protocol which minimizes collision and idle listening. Before we describe the power conservation MACAW in detail, let us study another MAC layer protocol, popularly cited in the world of energy-efficient MAC protocol design, the S­ MAC protocol. In general, the S-MAC [66] protocol is built on top of the MACAW protocol. It achieves energy efficiencyby letting sensor nodes periodically turnoff their transceivers. How­ ever, it has several limitations. First, synchronizing the sleep/active schedule involves signifi­ cant communication overhead. Second, the same duty-cycle of sleep/active may have different sleep/active schedules due to a different starting time. Third, we notice that since it is possible for different communication cells to apply different sleep/active schedules and for edge nodes to stay active when either communication cell stays active, the edge nodes normally consume more energy than normal nodes, resulting in potential loss of network coverage. In addition, there typically exist two trafficpatterns in wirelesssensor networks, periodically generated traf­ fic and bursty traffic. For the bursty traffic pattern, S-MAC will perform poorly and introduce substantial latency along with a high probability packet loss. Inspired by the MACAW and S-MAC protocols,we present the Power Conservation MACAW protocol (PC-MACAW) to address the key problems mentioned above. In PC-MACAW, we re­ define the term "frame" to represent one RTS-CTS-DATA-ACK message exchange. The start­ ing time of the first framecan be initiated by a sensor sink throughnetwork-wide broadcasting. A frame space (FS) exists between any two consecutive frames. Each frame consists of two parts, the contention period (CP) and the packet transmission period (TP). A short space (SS) is introduced between the contention period and the transmissionperiod. During the contention

37 A Frame---•1 � 1t 22TS • CP SS TP Figure 4.2: The frame structure of a sensor node

period, a node needsto send out RTS and wait for CTS to access the channel. Aftersuccessfully accessing the channel, the source node can start transmitting a data packet within the designated packet transmission period. Noticing that ACK is used to acknowledge successful data packet transmissions. Here, we use time slots as the minimal interval to partition the time axis of each sensor node. Time slots (TS) are in the order of microsecond. The frame structure is shown in Fig. 4.2. Since each node contends for the channel at an identical starting time, framing yields, ensures the fairness of data transmission among neighboringnodes. Such fairnessforms the foundationof the proposed Loosely Prioritized Random Access protocols, in which we use contention time of each node to regulate the order by which nodes access the channel. Another byproduct of framing, is that it assists potential receiver nodes to hear RTS/CTS correspon­ dences. Meanwhile, the high priority nodes continuously contend for channel, which in turn increases the probability of a successful data transmissionduring a frame interval. Finally, this mechanism is simple to implement and has a good scalability attributes, the key forlarge scale wireless sensor networks. Since each node can hear RTS/CTS messages originating from its neighboring nodes, it knows which node is a sender and which a receiver during any given frames. Therefore, to reduce the energy cost of idle listening and overhearing, it can turn off its radio when it is neither the sender nor the receiver.

4.3.2 Loosely Prioritized Random Access (LPRA) As indicated above, different types of sensors may have different importance in accordance with a particular application. Existing data compression and fusion techniques will further increase this variability. As a result, sensor nodes may have different service requirements. Here, we present a Loosely Prioritized Random Access (LPRA) protocol, which coordinates data communication between sensor nodes by reflecting on the urgency of the packets waiting to be transmitted. Let µ denote the transmission urgency of a node that contains packets waiting to be sent. Correspondingly, four key factorsdirectly impact the urgency metrics: packet criticality, trans­ mission hops, the residual energy, and the queues proportional load. Packetcriticality reflects the importance of the packet fromthe perspective of application layer. Transmission hops iden­ tifieshow many hops a packet has been transmitted. The more hops, the higher the cost involved for retransmission. In addition, it makes sense that the packet with more hops has a higher ur-

38 gency to be transmitted than the packet with less hops. The residual energyis another important factor. Since sensor networks have high data redundancy, by allowing the node with higher energy to transmit packets first, it helps balance energy consumption within the entire network. To avoid queue overflow,the queues' proportionalload should be considered as well. Suppose each node maintains n queues, each of which is associated with a dynamic service weight. Let th Wi denote the service weight of the i queue, Qi denote its maximal load, Qc(i) denote the instant load, and A represent the proportional load. Then A can be defined in Eq. 4.1 based on the overall occupancy of all the queues and the occupancy of the most occupied queue. Here ½ is used as a normalizing factor. If the proportional load is high, the node is expected to trans­ mit packets with high urgency even at the expense of droppinglower-priority packets, in cases where the queues are overflowed.

1 (E?=t WiQc(i) Qc(k) A= x + ( )) (4.1) 2 E?=t WiQ(i) maxk=l...n Q(k) The urgency of a node can thus be calculated as follows:

I Ee · Cc He µ= - X (--+A+--+--) (4.2) 4 Emax Cmax Hmax where Ee , He, and Cc represent the residual energy, the transmitted hops and the criticality of a packet, respectively. Correspondingly, Emax, Hmax, and Cmax refer to the initial energy, maximum permitted hops, and the maximum criticality level that a packet can have. Noticing that the criticality of a packet is derived from the application layer and a ¼ normalizing factor is applied. Once we have established the urgency level of each node, we can quantize it into several prioritylevels used to classifythe criticality of each sensor node. Given that N priority levels are supported and that p represents the priority of a sensor node, we write

p = min(l(l - µ) x NJ,N -1) (4.3) in order to allow lower priority levels represent higher urgency of a node. The operator La J is to round a down to the biggest integer that is smaller than a. As a result, p ranges from O to N - l with N priority levels in total. Once we calculate the priority level for each node, we can use Eq. 4.4 to calculate the contention time for each node before sending out an RTS control packet. Let tcr represent the contention time of a node with priority level p and a contention window size of CW for each priority level, tcr = p x CW + rand( CW) (4.4) where the rand( CW) functionis used to generate a random waitingtime between 1 and CW. In this way, we can ensure that the node of high priority level will always access the channel when competing with the node of low priority level. However, since we partition the con­ tention period into N levels and CW becomes relatively small, it will increase the possibility of collision occurrence when several neighboring nodes of the same priority level competing

39 Figure 4.3: The prioritized contention period with each priority level (PL) following the trun­ cated, increasing geometricdistribution

...... -- --(••C'J.7') --...... aplin9(a•O.I) ...,.,..,...,fa:•0.1) L I ,...

.._., __ 30 .. (a) (b) Figure 4.4: (a) Probability distribution for the contention slot number (b) Probability of no collision occurrence the channel with each other. We firstdefine the probability of collision from

n-l CW-1 CW ) Pr(without collision) = � n x p(i) ( � (j) (4.5) , / where CW is the contention window size measured in time slots, n is the number of neighboring th nodes, and p( i) is the probability to pick up transmission time at the i time slot. Consequently, uniformly random picking up a transmission slot between 1 and CW will definitely introduce high collision probability. Jamiesonet.al. [35] investigate this problem and propose a near optimal probability mass function which minimizes the random access collision occurrences using the truncated, increasing geometricdistribution, . (1- o oow ( ) X ' ... , ' ) = Q -i I ar'l. . = I CW (4.6) p 'l, 1 - aCW where O < a < 1 is the distribution parameter. By using simple mathematical induction method, we can infer that p(i) must be increasing to maximize the probability of no colli­ sion happening. This distributionis illustrated in Fig. 4.3. We test the probability of no colli­ sion based on the uniformdistribution, linear distribution,and near optimal distribution witha equals to 0. 7, 0.8, 0.9. As shown in Fig. 4.4, the linear distribution can achieve high probability

40 when the number of neighboring nodes is less than 10 and the near optimal distribution with a = 0. 7 performs better when the neighboring nodes is in very large value. Since the involved calculation forlinear distribution is simpler than that forthe near optimal distribution, when the neighboring nodes is less than 20, the linear distribution (which is an arithmetic progression sequence with initial value of 0 at contention time 0) is an efficient substitute especially when CW is dynamically changed in the case of collision recovery. Once we select the non-uniform probability distribution, combined with the pseudo random number generator, we can easily obtain the contention time. The LPRA algorithm is described in detail in Algorithm 2.

4.4 Collision Recovery Scheme

Q-MAC is inherently contention based, therefore, collisions may occur from time to time. We apply two schemes for collision recovery. First, for high-priority packets, we reduce the value of the current contention window (CW) by half in order to increase the chance forsuch packets to access the channel in the next frame. This is done so that minimal degradation of service is experienced by the extremely urgent packets. A low bound and a high bound are set for the possible values of CW. The reason formaintaining a CW is that we want to allow fora certain element of randomness in order to avoid collision. Low priority data packets will probably originate fromperiodic readings, therefore we can defertheir transmission as it is possible that other nodes have already transmitted similar sensor measurements. By doubling the CW size during the next frame, collision rate is reduced. Secondly, according to the characteristics of the application, we further set a threshold for dropping packets. If the difference between the sensing time and the current time is beyond this predefined threshold, packets are immediately dropped.

4.5 Simulation and Analysis

In this section, we evaluate the performance between Q-MAC and S-MAC protocols based on a self-development java-based wireless sensor network simulator, the SENSIM. Some physical layer parameters are taken fromthe Berkeley Mica2 sensor Motes [11] configurations, includ­ ing a 4Mhz, 8bit Atmel microprocessor and RFM Chipcom CCIO00 radios running at 19.2 Kbits/second over a single shared channel. The energy consumption calculation in SENSIM is based on the datasheet [4] from the Chipcom CCl000 radio, i.e., 0.2 µA while powering off, 7.4 mA while receiving and 10.4 mA while transmitting with 0dBm at frequency 433Mhz. We implement both the S-MAC protocol and the Q-MAC protocol in SENSIM. To simplifythe simulation process, we pre-determine the routing table foreach node. In other words, each node contains the exact routes to other sensor nodes. More specifically, since all the generated pack­ ets are destined to the senor sink. Therefore, in our simulation, each node contains the routing table destining to the sensor sink. Two scenarios are developed with sensor sink at the center of the sensing field and the rest of sensor nodes randomly distributed in the field. The topologies

41 if at the beginningof a frame then Select next transmitting packet; if next transmitting packet is not null then state = contention; else state = non­ contention; Calculate the priority p and the contention time ( tcT ); while cu"ent time < the end of transmissionperiod (C P) of this frame do if (the state is contention) then Listen to the channel for tcT amount of time; if no packet received during tcT then I transmit RTS and listen to the channel; else if receive RTS fromthe potential sender then transmit CTS and wait for data transmission; if receive RTS or CTS for other nodes then state = SLEEP; sleep until the end of frame; if hears collision then recalculate tcT; end end if receive CTSfrom potential receiver then I state = data-transmission; break; else I sleep until the end of frame; end end while cu"ent time < the end of frame do if state = data-transmission then I transmitDATA; state = WAIT-FOR-ACK; end if receive ACK then I state = RECEIVE-ACK; transmission succeed; sleep until the end of frame; end end if (state ! = RECEIVE-ACK) && (state ! = SLEEP) then I data collision happened; end end Algorithm2: The loosely prioritized random access algorithm.

42 � ... �...... � ... .. !fiillNIIDII.YINPIIUltdon�!:!8'1 ,· i!J.i•'..·,:-..J�i�L. £\·.�·:� ,;�··e. EJ �#1

,i\

�')_·�.

(a) (b) Figure 4.5: (a) Scenario One: constant rate traffic with packetsof the same criticality (b) Sce­ nario Two: packets with different criticality, constant rate or bursty traffic are shown in Fig. 4.5. For these scenarios, we compare the effectsof different packet generation models andthe existence of packet criticality on the network latency and energy conswnption. The first scenario consists of 15 sensor nodes with a maximum of 3 hops from the sensor sink. The communication range for each node is represented by a circle centered at the sensor node. In this scenario, we apply the constant rate trafficgeneration model andtake the generated packets of all nodes with the same criticality, which is by default level 3. The frames and messages are of equal length at 100 bytes. The variable trafficrate can be achieved by changing the message inter-arrival time. Similar to S-MAC, the contention period (CP) forQ-MAC is also 115ms and it has been partitionedinto six divisions, fiveequal length CW s, each of which is 15 ms plus a 40 ms period forRTS/CTS control packet exchange. In Q-MAC, differentduty cycles can be achieved by varying the length of Transmission Period (TP). Through network-wide broadcasting, sensor sink can notify new framesize and the starting time. The purpose of this experiment is to compare the performance of S-MAC and Q-MAC without specifyingcriticality for each generated packet and we expect Q-MAC to have at least comparable performance as S-MAC. The simulation has been repeated for 10 times. Each time every node generates in total 100 messages. According to the simulation result shown in Fig. 4.6, Q-MAC and S­ MAC achieve similar energy saving but Q-MAC displays lower latency because of the shorter contention time and synchronization data transmission. In the second scenario, twenty five nodes are generated to test the event based sensor net­ work applications. In this scenario, a sensing event occurs at the location close to node 12 represented by a solid rectangular. We use the distance between the node and the sensing event as a criteria to emulate the application layer abstraction and create different criticality of gen­ erated packets at each node as the closer the node to the event, the more accurate the data. We

43 A-agoCurer< Energy ConlllJmjldon

-

I,l L I 5 j J 3 r f' 2 r 0.5 � 0 15 25 30 35 40 15 � 25 30 35 40 A-Loed(� A-Loed� 1 (a) (b) Figure 4.6: Scenario 1 with periodic traffic and no equal criticality (a) Average energy con­ sumption vs. Load (b) Average latency vs. Load

observe in Fig. 4.5(b) that four circles are plotted surrounding the event indicating the different sensitivity levels of the sensor node fall within each circle. For instance, packets generated by node 12 have the highest criticality, followedby node 20 and node 23 with the second highest criticalitylevel. Node 15 generates packets with the third highest criticality level and the next is node 5 and node 21. For the rest of sensor nodes which are out of the sensingrange, no packets have been generated. We evaluate the effectof two differenttraffic models, the periodically gen­ erated traffic and the bursty traffic. First, we let the nodes within the sensing range periodically generate prioritized traffic based on their distance from the sensing event and then forward the packets to the sensor sink. The simulationresults are shown in Fig. 4. 7. Generally Q-MAC can achieve better energy saving compared to S-MAC because of the shorter contention window size and better collision recovery scheme for RTS/CTS packets. For instance, when operating at 50% dutycycle, Q-MAC can achieve around10% more energy saving than S-MAC when the average load is small. This advantage degradesas the load get heavier. According to the results of average packet latency, Q-MAC performs as expected and it successfully differentiates net­ work services based on packet priorities. The higher priority packets are always accompanied with lower latency. The second test is conducted under the same scenario with a bursty trafficgeneration model. When a node detects an event, it continuously generates packets with an average bursty rate of fourpackets. The different average load can be achieved by adjusting the inter-arrival time of the packets. The simulation results are similar to that of periodical traffic generation except it introduces longer delay. However, according to the results shown in Fig. 4.8, the latency introduced by burstytraffic are mainly limited to the lower priority packets and leave the higher priority packets with little change.

44 10r------,--, -;:_-::__-::______-:..., Q-MAC(SO%d

- -

o.s - - -

10 30 3S 40 10 30 3S 40 (a) (b) Figure 4.7: Scenario 2 with periodic traffic and different packet criticality (a) Average energy consumption vs. Load (b) Average latency vs. Load

20r------,...-.,..-�-..,.,-=-..,..- .,..-,,...-.,,.,-----r--, + 0-MAC(plorllyl) ..,.. 0-MAC(plorlly2) 3.S -+- 0-MAC(plorlly 3 ) - a-MAC(plorlly4) S-MAC 18 + f 31L _ __,,__....._.___..__.-- i': L l

,,�s:=s:=F=+=��=-==�0.S

30 35 40 10 30 35 40 (a) (b) Figure 4.8: Scenario 2 with bursty traffic and different packet criticality (a) Average energy consumption vs. Load (b) Average latency vs. Load

45 Chapter 5

The D-MAC Protocol

The fundamental idea of S-MAC and our proposed Q-MAC is to introduce the active-sleep schedule for every node to avoid unnecessary energy waste, thus achieving efficiency. The question comes with "Is it really necessary that we need all the node to be active?" We realize that reducing redundancy is an very efficient way to minimize both energy consumption and latency within wireless sensor networks. Hence, the Deployment-oriented Medium Access Control(D-MAC) protocol is proposed aiming at reducing the redundancyand in the meanwhile minimizing energy consumption, delay and maximizing the network lifetime.

5.1 Modeling of Sensor Deployment Strategies We assume that sensor nodes remain static once they are deployed. The network dynamics are introduced mainly by sensor failure and the later add-in nodes. So far, most of research has assumedthat sensor nodes have been uniformlyrandom deployed into a specifiedsensing field, probably by an airplane. We furtherassumes that this sensing region are two-dimensional and can be partitionedby some equal size rectangular cells. Actually it is common that the interested sensing field may have a irregular shape. In this case, the sensingfield can still be partitioned by equal size rectangular cells with small extensions of sensing area. Normally sensor nodes are deployed forsensing, monitoring or even trackingpurposes, theideal case is that all sensing events or the sensor fieldcan be 100% measured by the deployed sensor nodes and all the sens­ ing information can be 100% transmitted to the sink node. However, accordingto the random deployment strategy, we cannot provide such a perfect case. As a result, certain area of sensing fieldcannot be sensed or monitored and there may exist a couple of sensor nodes which cannot find a path to transmit their data to the sink node. These problems are the so-called coverage problems [47]. Since we cannot guarantee 100% sensing and communicationcoverage no mat­ ter how many nodes are deployed into the field based on the random deployment strategy, the problem has been transfered to, depending on the totalnumber of deployed sensor nodes, what percentage of sensing and communicationcoverage we can achieve, or under certain coverage expectation degree, how many nodes are needed to be deployed into the field. In the following sections, we derive some probability model to solve these problems.

46 a ......

0

'.)

"

,;:_)

Figure 5.1: Sensing fieldand the equal size rectangular partition

S.1.1 A Deployment Model with Coverage Constraints As shown in Fig. 5.1, we partitionthe sensing fieldusing equal size rectangular cells. Currently we assume this partition can ensure 100% sensing and communication coverage if there exist one sensor node within each rectangular cell. Later we will show how to determine the cell size to achieve this perfect coverage. The deployment strategy is random deployment, in which each sensor node is uniformly and independently distributed into the sensing field. An typical example of this deployment is the application of battle fieldsurveillance, in which sensor nodes are randomly deployed from an airplane into the battlefield. Suppose the width and height of the field are a and b respectively. The size of the partitioning cell is d. As a result, there are in total ¥}- cells in the sensing fields. Based on our assumption, if there is a sensor node in each cell, the sensing and communi­ cation coverage can be ensured. Suppose the total number of sensor nodes deployed into the field is N, the number of cells is m, and the expectation of coverage is p%. Then the problem can be re-formulated into the problem that given the expectation p%, how to calculate the total number of N. The probability of at least one node in a particular cell xgiven the total N nodes deployed can be computed from Eq. 5.1. Notice that for the cell x, the probability of a sensor node to be deployed in this cell is ¾ due to the nature of random deployment.

N Prob(at least one node in cell x) = L Prob(exact i nodes in cell x) i=l N (5.1) = LdN X (_!_)im X (1- _!_)(N-i) m i=l Since this probability of at least one node in the cell x can be used to represent the prob­ ability of coverage in the cell xand the cell xis randomly selected from all the cells used to

47 0.1 ......

10.7 r·I:: ...... _ .... 0. ·J·····!···.. · .. ··!···· .. ···1 ...... ,...... , ...... 1 ! 3 o.2r······,..,......

0.1t- ......

�00 200 300 400 !!00 800700 900 1000 TheTolal-dd"'*"9dS---

Figure5.2: Coverage probability and deployed node under a 10 by 10 cell partition partition the field and for each cell the probability of the coverage is the same, we can derive the probability of coverage of the whole sensing field, by Eq. 5.2.

m Prob( sensor network coverage) = ITProb( cell i coverage) i=l N (5.2) )

N 1 {Nx.l.)i Prob(sensor network coverage)= (L e<-Nx m> ., m (5.3) z. r i=l Hence, once we know the user expectation of sensor network coverage p%, we can use the above probability model to estimate how many nodes are needed to be deployed. The simplest way to make this estimation is to draw map illustrating the relationship between the coverage probability and the number of deployed sensor nodes. By identifying the intersection point in that map associated with certain coverage probability, we can derive the total number of node. An example is given using a 10 by 10 cell partition of the sensing field, and the map forcoverage vs. deployed node is shown in Fig. 5 .2. According to this deployment strategy, if there exists one node in a partition cell, we can say the sensing and communication coverage for that cell is assured. In order to guarantee

48 vL � I Sens //� ��� �nin T\c llll\lJtiC tion �R. ge J 1/ � r l lj "'f / I ' �t>' "'� \\ l � ly / \ �� ---�I/ �-� v ___ V

Figure 5.3: Selection the size of partitioningcell this feature, we need to carefully select the partition cell size given the value of sensing and communication range. According to Fig. 5.3, it is obvious that the communication range should be at least two times of the diagonal length of a cell if any of the nodes in cell p can be assured to talk to any nodes in cell q. Meanwhile, we expect that one node can sense all the events from position within that cell it belongs to. Hence the cell size selection actually reflects the trade­ offbetween sensing range and communication range of a single node. Here we assume that both the sensing and communication of a sensor node are omni-directional. The sensing and communication range can be determined by calculating the distance that maintains the minimal acceptable signal-to-noise ratio. We propose a solution on how to select the suitable size of the cell. If the sensing range is twice less than the communication range, we take sensing range as the reference to calculate the cell size. Otherwise, we take the communication range as the reference. The reason to make such choice is that we want to ensure the sensing range of a sensor node can cover the whole cell and the communication range of a sensor node can cover all the neighboring cells. The method used to calculate the cell size is formulated in Eq. 5.4. Here, we use d to represent the cell size, s for the sensing range and c for the communication range.

X S if S < 2c d = { � (5.4) 272x c otherwise

5.1.2 A Deployment Model with Coverage and Network Lifetime Constraints The energy depletion time for single sensor node is very short compared with the user expecta­ tion sensor network functiontime, which is usually granted forone or several years. In order to match these requirements, there exist two solutions. One is to tryto design sensor networks in

49 an energy efficientways. The other is to deploy more sensors. Clearly, providing efficient sens­ ing, processing, and communication protocols or algorithms is far from enough, which arises the need for"swarm" deployment. A large amount of sensor nodes are distributed into the field. By introducing sensing and communication redundancy, the expected network lifetime can be achieved. Given the extremely low price for each sensor node, the promise that this method holds can be strengthened. However, the more sensors deployed into the field could produce more sensing traffic, more nodes contending for the channel access, and thus cause more en­ ergy consumption. As a result, extra attention needs to be paid on reducing these introduced sensing and communicationredundancy. Furthermore, as indicated in the previous section, we still needs a mathematical model to deal with such cases. Specifically, we need to finda optimal sensor deployment strategy to ensure both cost-effectiveand sensing, communicationcoverage underconstraints of the network lifetime. For a single node, we can roughly estimate the bat­ tery functiontime undercertain sensing sampling rate and communicationrate. Thus, with the requirement of network lifetime, we can estimate the number of sensors within a partitioncell dividing the network lifetime by the single battery function time and production with a factor. This factor is mainly used to compensate for some extra cost of communication overhead or sleep-active scheduling. These parameters estimation should be derived from the physical mea­ surement on the real sensor node, which is out of the scope of this thesis. Intuitively it makes senses since the communicationcost is the dominantenergy consumption source and is propor­ tional to the transmitted bits. Therefore, we can use the number ofnodes within one partitioning cell to reflectthe network lifetimeconstraints. In this case, if every partitioningcell has at east r nodes, the network lifetimeand coverage can be assured. Again, r is derived fromexperiments. Similarly, the model can be derived in Eq. 5.5

m Prob(coverage with required lifetime)= IJProb(cell i coverage) i=l (5.5) N x <�)i x (1 - �/N-i>r = (LcnN m m i=r. Also it can be simplified to Eq. 5.6 based on the Poisson theorem.

(-Nx-:,) (N m Prob(coverage with required lifetime)= cf e �I¾;)') (5.6) . :, i. i=r The coverage vs the total number of deployed sensor nodes map is shown in Fig. 5.4.

5.2 D-MAC Protocol The D-MAC protocol is intensively deployment-oriented MAC protocol, with the design fo­ cusing on reducing sensor network redundancy, minimizing energy, maximizing sensing and communication coverage time and network lifetime. This protocol is based on Q-MAC, with

50 ---

(a) (b) Figure 5.4: (a) Coverage under network lifetime constraints (b) Experiment with 2000 nodes

extra considerations on reducing the sensor network redundancy while maintaining sensing and communication redundancy. For this protocol, a GPS system is assumed to be equipped with each sensor node and the sensor network deployment is based on the strategy proposed in the last section with both coverage and network lifetime constraints. D-MAC is mainly composed of two parts:_ The Location-aware Selection Algorithm (LSA) and the Modified Q-MAC Ran­ dom Access (MQRA), which is discussed in details as follows.

5.2.1 Location-aware Selection Algorithm (LSA) Location-aware Selection Algorithm (LSA) is used to select certain amount of active sensor nodes within a partition cell based on the expectation of information redundancy the user in­ tends to maintain. The criteria for sensor selection is mainly based on the residual energy. For instance, suppose the degree of the redundancy within one partition cell is 1. In other words, only one sensor node can be selected at one time that remain active in this cell until its energy is below a certain threshold. In that case, the selection algorithm will restart and new sensor node can be selected. Generally the selected node should have the maximal residual energy compared with all other sensor nodes within that cell. The actual algorithm can be refereed to Algorithm. 3. According to this algorithm, once the nodes are deployed into the field, it will launch the selection process which is truly distributed. Firstly, the node randomly picks up a number between 1 and a predetermined constant, called the Contention Window (CW). For a single sensor node, it may contain several such constants determined by its residual energy level. In other words, a node with the highest residual energy level will select a contention time in a small range, indicating that the pre-loaded constantparameter should be smaller compared with that of the lower residual energy level. Through this way, the node with higher residual energy level can access the channel earlier than those with lower energy and thus reducing the communication overhead. Before sensor networks are deployed, we threshold the energy into several levels. The initial energy is at the highest level and when sensor nodes runout of power, it may reach the lowest level. Afterthat, sensor nodes will listen to the channel for a period spec-

51 Obtain the current residual energy level; calculate a contention time (tcw) listen to the channelfor t cw;

if recv a select msg from other node in the same cell then obtain the value for residual energy level Ez; if Ez > my residual energylevel then I turnoff the radio; put itself into sleep state; lend I drop the message and continue to listen the channel; end send out a selection message with its residual energy level, identification(id) and location; listen to the channel forpre-predefined period of time; if recv selection msg with higher energythen I send out a cfm msg; put itself into sleep state; else I remain active for a period of time forsensing and data trans; end Algorithm3: Location-aware Selection Algorithm (LSA) ified by the selected contention time. If it receives any selection message during the period and the energy level in that message is higher than its own energy level and the location of message sender is within the same cell, the sensor node then turnsoff its radio immediately and changes into a sleep state until the next selection process. Otherwise, it ignoresthe received message and continues listening to the channel. When the contention time is expired andit receives no mes­ sages containinghigh energy level, the node locallybroadcasts a selection message with its own ID, residual energy level and location information and waits for another fixed, per-determined period of time. All the nodes within the communication range can hear this selection message and determine whether to turn offthe radio and stay in the sleep state. As we indicate above, since the communication range is larger than the cell size, it is still possible that nodes within one cell can receive the selection messages from other cells. In this case, those messages are simply discarded. If the node receive the selection message whose energy level is lower than its own, it will challenge the potential candidate by sending out a challenging message, in which it declares itself as the winner. Once the potential candidate receives this challenging message, it will turn offthe radio. Through this way, the node with the highest residual energy level can always be selected as the active node in one cell. Normally the selection message is very small and only contain several bytes, therefore,the probabilityof occurrenceof collision is very small. Even if the selection messages do meet collision, our collision recovery mechanism can still help the collided nodes to select a random waiting time for back-offand retry the process later. Notice that this protocol is location aware, which means each sensor node is aware of

52 its position in the sensing field, which could introduce more hardware cost (like GPS cost) and complexity for a single sensor node. We argue that it is still realistic since for many applica­ tions like monitoring and tracking,it is very difficultor impossible to carry out tasks without the positioning systems. Since transmission of the real position information could consume much more overhead, to solve thisproblem, the cell ID is used instead. One of the QoS proprieties we want to achieve is the balanced energy consumption. As a result, after a fixed period of time, the re-selection process can be launched that provides a chance for other more powerful nodes to be active. This strategy can be confirmed according to the "relaxation" phenomenon (51], in which battery can recover the capacity lost at high discharge rate.

5.2.2 Modified Q-MAC Random Access (MQRA) Generally speaking, D-MAC is built based on the Q-MAC protocol, with similar multiple­ queue based architecture, intra-node and inter-node scheduling mechanisms, which we have detailed in the previous chapter. What makes the D-MAC different is that it further reduces the redundancy. According to our deployment strategy, in the case of sensing range is similar to the communication range, since we take communication as the reference to decide the cell size, it is possible that the neighbors cell will have similar sensing results. Therefore, it may introduce higher sensing redundancy. In order to avoid thiscase, we can further modifyQ-MAC protocol by adding a fieldin the RTS control packet including sensing time and cell ID. So when neighbor nodes hear this message, if their sensing data is also detected at the close time period, they can ignorethose messages. Through this way, we can further reduce the redundant sensing informationand improve the network efficiency.

5.3 Simulation and Analysis D-MAC is tested using the SENSIM simulator. In our experimental simulation we have 200 nodes distributed in the sensing field. We partition the sensing field using the deployment strategy we discussed above and the sensing field is divided into 5 x 5 cubic cell. In this case, the network coverage is 99% and we don't consider the network lifetime constraints. In this simulation, we also assume that the sensing range is equal to the communication range which is 2\1'2 times cell size. The energy consumption is the same as the simulation in the Q-MAC protocol which is obtained from the datasheet of chipcon cc1000 radio. Since our focus is to investigate the energy consumption and latency based on the differenttraffic load, the simulation is designed mainly for homogeneous trafficin which every generated packet is treated equally. For the Q-MAC protocol, we simply set the priority for all packets to the priority level 3. In this simulation, we also assume that sensor sink is located at the center of the sensing field and sensing events periodically occur within each cell and can be detected by the node within that cell. In addition, the traffic load is changed through adjusting the inter-happening time of each sensing event. Specifically, the re-selection time for D-MAC is 1000 s, and we run the simulation for 10000 s. The size of each time slot in our simulation is set to lms. As far, the frame size for all the protocol is set to 230ms. The duty cycle for all the protocols

53 fut"·' f :r-----...... :;:::=s=-----... f .. Ju I .. I .. , f f •2 ----0.3 0.4 0.S _..__0.3 0.4 (a) (b) Figure 5.5: (a) Average energy consumption (b) Average latency are set to 10%. We define the average energy consumption as the totoal current energy cost divided by the number of nodes and the elapsed time and average latency as the total time of the successfully transmitted packets divided by the summation of the number of successfully transmitted packets. The simulation results are shown in Fig. 5.5, in which we compare the performance of S-MAC, Q-MAC, and D-MAC. The simulation is repeated forten times and the graph shows the mean values of these conducted test. Accordingto our simulation result, we can see that D-MAC achieves dramaticenergy saving and low latency comparedwith S-MAC and Q-MAC. Roughly D-MAC can achieve 80% energy saving compared with S-MAC and Q-MAC. And the latency forD-MAC is around seven times lower than S-MAC and five times lower than D-MAC. In this case, although the many more nodes deployed in one cell can help improve sensing accuracy, D-MAC also ensures sensing coverage based on the deployment strategy and thus also can achieve high sensing accuracy. The benefit for D-MAC is that it eliminates most of unnecessary sensing data transmission, decreases the number of active nodes and thus reduces the number of contender for channel accessing; and as a result, a much better performance can be achieved. We can imagine that with more sensor nodes deployed into the field, in both S-MAC and Q-MAC, since all the nodes can detect the sensing event, generate the data packets, and transmit them the sink nodes, the network performance will become worse with the increase of deployed nodes. During the simulation, we also notice that the higher redundancy will cause the system only to operate on the lower traffic load in order to keep the network stable. Therefore, we believe reducing redundancy at MAC layer is a fair method to achieve greater energy saving and better system performance.

54 Chapter 6

Conclusions and Future Work

In this thesis, we present Q-MAC and D-MAC, the novel energy-efficient, QoS-aware MAC protocols for wireless sensor networks. The Q-MAC involves two layers of scheduling, an intra-node layer and an inter-node layer, to provide differentiated services while retaining low energy conswnptioncharacteristics. Simulation results indicate that when compared to S-MAC, Q-MAC offers almost the same degree of power efficiency while allowing for flexible differ­ entiation between different classes of services. The latter is fundamental in sensor networks, which are strongly application-oriented. The reason of similar energy saving achieved by Q­ MAC and S-MAC protocols is that they both apply similar active-sleep duty cycle mechanism which determines the total energy saving. We also notice that in order to match the coverage requirement and network lifetime requirement, sensor networks normally contain hundreds of sensor nodes deployed in a sensing field, thus introducing extremely high communication and sensing redundancy. In such case, if we still apply S-MAC or Q-MAC protocols, the network performance may be greatly degraded with the increasing of deployed sensor nodes. Based on this observation, we propose a Deployment-oriented Medium Access (D-MAC) protocol with the design focuson organizing sensor networks with the least redundant sensor nodes. To achieve this purpose, we designa sensor network deployment strategy, which can estimate the total deployed sensor nodes based on the coverage and network lifetimeconstraints. Ourstrat­ egy is based on the random deployment. In order to reduce both sensing and communication redundancy, we use rectangular cells with carefully chosen size to partition the sensing field and through the Location-aware Selection Algorithm (LSA), we can determine the least redun­ dancy and coverage ensured active sensor set. Simulation shows the dramatic energy saving and latency reduction. The results match our expectation that the redundancy reduction can greatly improve the network performance. In this thesis, we also present a self-developed sen­ sor network simulator, called SENSIM. It is developed based on the JAVA technology with the support of M ysql database. In the future, we would like to propose "traffic adaptive scheduling" scheme for sensor network MAC protocol design. Currently the applied duty cycle in S-MAC, Q-MAC, and D­ MAC are fixed. As a result, the change of traffic load may introduce larger redundancy or even make the system unstable if the trafficarrival rate is bigger than the service rate. In order to avoid

55 that problem, we need to poll the traffic information and control the service rate accordingly. Two possible solutions need to be investigated. One is centralized management, in which the current and previous information are sent to the sink node and services then can be assigned to each node. In this case of contention based protocol, the service rate can be measured by the duty cycle of active-sleep. However, this centralized feedback control mechanism may introduce more communication overhead and it may not be applicable when the change of traffic is frequently. Furthermore,in the case that the message size is very small, it could greatly degradethe network performance. Another method is "region based scheduling", motivated by the fact that the change of traffic load occurs in a small region and only has localized effect. Thus we hope to figure out some ways which can let the nodes within that region determine their own duty cycle. The challenges come with the existence of multiple duty cycle and how to coordinate the data transmission among nodes with different duty cycles. Another direction is to evaluate effects caused by the QoS metrics like energy, node density, fairness and so on. For instance, we can observe that high node density could cause the system to be unstable with even a very low traffic arrival rate. So for a typical application in sensor networks, what is the trafficarrival rate and how the density can affectthe network performance. All these interesting and valuable topics are needed to be worked out. Our simulator development also need to be greatly improved. Currently the simulation speed is comparably slow, and in the future, we expect to parallelize the simulator so that it can run on multiple machines. Currently our simulator is a time-driven based simulator, in which we have a variable recording the current time, which is incremented in fixedsteps. After each increment we will check to see whether an event occurs and records the system change accordingly. The drawback of this method is the slow simulation time. In the future, we would like to move to the event-driven based simulation, in which we only check the occurrence of discrete events and update the system information.

56 Bibliography

57 Bibliography

[ 1] http://ey es.eu.org/. [2] http://nesl.ee.ucla.edu/projects/sensorsim/. [3] http://pcl.cs.ucla.edu/projects/ glomosim/. [ 4] http:/ /www.chipcon.com/files/cc1 000 _data..sheet...2...2. pdf. [ 5] http://www.cs.berkeley.edu/ pal/research/tossirn.html. [ 6] http://www.isi.edu/nsnam/ns/. [7] http://www.j-sirn.org/. [8] http://www.osti.gov/opennet/. [9] http://www.ssfuet.org/homepage.html. [10] http://www.tinyos.net/. [ 11] http://www.xbow.com/ products/wireless..sensor..networks.htm.

[12] N. Abramson. The aloha system - antoher alternative for computer communications. in AFIPS ConferenceProceedings, 36:295-298, 1970. [13] S. Adlakha, S. Ganeriwal, C. Schurgers, and M. Srivastava. Density, accuracy, delay and lifetime tradeoffs in wireless sensor networks. In Conference on Embedded Networked Sensor Systems (SenSys), 2003. [14] I. F. Akyildiz, W. Su, Y. Sankarasubramaniam, and E. Cayirci. Wireless sensor networks: A survey. Computer Networks(Elsevier) Journal, 38(4):393-422, March 2002. [15] K.A. Arisha, M.A. Youssef, and M.F. Younis. Energy-aware tdma-based mac for sensor networks. InlMPACCT, 2002. [16] D. Bertsekas and R. Gallager. Data Networks. Prentice Hall, 1987. [17] V. Bharghavan, A. Demers, S. Shenker, and L. Zhang. Macaw: A media access protocol forwireless lans. Proc. ACM SIGCOMM, 24(4), 1994.

58 [18] S. Bhatnagar, B. Deb, and B. Nath. Service differentiation in sensor networks. In The Fourth International Symposium on Wireless Personal Multimedia Communications, 2001.

[19] S. Blake, D. Black, M. Carlson, E. Davies, Z. Wang, and W. Weiss. An architecture for differentiated services. In RFC 2475, IETF, 1998. [20] R. Braden, L. Zhang, S. Berson, S. Herzog, and S. Jamin. Resource reservation protocol (rsvp) versionl, functional specification. In RFC 2205, IETF, 1997.

[21] H. Chen, L. Huang, S. Kumar, and C.C.J. Kuo. Radio Resource Management for Multi­ media QoS Support in Wireless Networks. Kluwer Academic Publishers, 2004.

[22] T.V. Dam and K. Langendoen. An adaptive energy-efficient mac protocol for wireless sensor networks. ACM SenSys, 2003.

[23] D. Dewasurendra and A. Mishra. Design Challenges in Energy-Efficient Medium Ac­ cess Control for Wireless Sensor Networks. Book chapter in Handbook of Sensor Net­ works: Compact Wireless and Wired Sensing Systems, M. Ilyas and I. Mahgoub(eds.), CRC Press, 2004.

[24] D. Estrin, A.Sayeed, and Srivastava. Tutorial on wireless sensor networks. In Mobicom, 2002.

[25] Deborah Estrin, Ramesh Govindan, John Heidemann, and Satis Kumar. Next century challenges: Scalable coordination in sensor networks. In MOB/COM, 1999.

[26] J.F. Frigon and V.C.M. Leung. A pseudo-bayesian aloha algorithm with mixed priorities. In Wireless Networks, 2001.

[27] C. Guo, L.C. Zhong, and J.M.Rabaey. Low-power distributed mac forad hoc sensor radio networks. In Proceedings of IEEE GlobeCom, 2001.

[28] J. Haartsen. The bluetooth radio system. IEEEPersonal Communications, 2003.

[29] G. Raikes, T.V. Dam, and K. Langendoen. Comparing energy-saving mac protocols for wireless sensor networks. In Accepted for publication in Kluwer s MONET Special Issue on WLANOptimization at the MAC and Network Levels, 2004.

[30] W.R. Heizelman, A. Chandrakasan,and H. Balakrishnan. Energy-efficientcommunication protocolsfor wireless microsensor networks. In Proceedings of the Hawalli International Conference on System Science, 2000.

[31] A.E. Hoiydi and J.D. Decotignie. Wisemac: An ultra low power mac protocol for multi­ hop wireless sensor networks. In In Proceedings of the First International Workshop on Algorithmic Aspects of Wireless Sensor Networks (ALGOSENSORS), 2004.

59 [32] IEEE. Wireless Ian medium access control (mac) and physical layer () specification. IEEE 802.11, ISOIIEC 8802-11:1999, 1999.

[33] IEEE. Wireless medium access control (mac) and physical layer (phy) specification for low rate wireless personal area networks (lr-wpans). IEEE 802.15.4-2003, 2003.

[34] C. Intanagonwiwat, R. Govindan, and D. Estrin. Directed diffusion: A scalable and robust communication paradigm for sensor networks. In MOB/COM, 2000. [35] K. Jamieson, H. Balakrishnan, and Y Tay. Sift: A mac protocol for event-driven wireless sensor networks. MIT Laboratoryfor Computer Science, Tech. Rep. 894, 2003. [36] J. M. Kahn, R. H. Katz, and K. S. J. Pister. Next century challenges: Mobile networking for "smartdust". In MOB/COM, 1999. [37] P. Kam. Maca: A new for packet radio. ARRLICRRL Amatuer Radio 9th Computer Networking Conf, 1990. [38] L. Kleinrock and F. A. Tobagi. in radio channels: Part ii - the hidden terminalproblem in carriersense multiple-access modes and the busy-tone solution. IEEE Trans. Commun., COM-23(12):1417-1433, 1975. [39] S.S. Kulkarni and M. Arumugam. Collision-free communicationin sensor networks. In In Proceedings of the Sixth Symposiumon Self-StabilizingSystems (SSS), 2003. [40] S.S. Kulkarni and M. Arumugam. Tdma service for sensor networks. In Intl. Workshop on Assurance in Distributed Systems and Networks(ADSN),2004. [41] J. Kurose and K.W. Ross. Computer Networking: A Top-Down Approach Featuring the . Addision Wesley, 2004. [42] K. Langendoen and G. Halkes. Energy-EfficientMedium Access Control. Book chapter in the Embedded Systems Handbook, CRC Press, to appear. [43] Y Li, W. Ye, and J. Heidemann. Energy and latency control in low duty cycle mac proto­ cols. In Technical Report ISI-TR-595, USC InformationSciences Institure, 2004. [44] B.H. Liu, N. Bulusu, H. Pham, and S. Jha. Csmac: A novel ds-cdma based mac protocol for wireless sensor networks. In GLOBECOM, 2004. [45] F. Liu, K. Xing, X. Cheng, and S. Rotenstreich. Energy-Efficient MAC LayerProtocols in Ad Hoc Networks. Book chapter in Resource Management in Wireless Networking, M. Cardei and I. Cardei and D.Z. Du(eds.), Kluwer Academic Publisher, To appear, 2004. [46] A. Mainwaring, J. Polastre, R. Szewczyk, and D. Culler. Wireless sensor network for habitat monitoring. ACM international Workshop on Wireless Sensor Networks and Ap­ plications, 2002.

60 [47] S. Meguerdichian, F. Koushanfar, M. Potkonjak, and M.B. Srivastava. Coverage problems in wireless ad-hoc sensor networks. In INFORCOM, 2001. [48] M.J. Miller and N.H. Vaidya. Minimizing energy consumption in sensor networks using a wakeup radio. In WCNC, 2004. [49] M.J. Miller and N.H. Vaidya. On-demand tdma scheduling for energy con- servation in sensor networks. In Technical Report, UIUC, available at http://www.crhc.uiuc. edu/wireless/grouPubs. html, 2004. [50] A.K. Parekh and R.G. Gallager. A generalized processor sharing approach to flowcontrol in integrated services networks: The single-node case. Proc. IEEE /NFORCOM, 1992. [51] S. Park, A. Savvides, and M.B. Srivastava. Battery capacity measurement and analysis using lithium coin cell battery. In In the Proceedings of International Symposium on Low Power Electronics and Design, 2001. [52] J. Polastre, J. Hill, and D. Culler. Versatile low power media access for wireless sensor networks. To appear in the Second ACM Conference on Embedded Networked Sensor Systems (SenSys), 2004. [53] H. Qi, Y. Xu, and X. Wang. Mobile-agent-based collabortive signal and informationpro­ cessing in sensor networks. Proceedings of the IEEE, 2003. [54] S.S. Iyengar R. Kannan, R. Kalidindi and V. Kumar. Energy and rate based mac protocol for wireless sensor networks. In SIGMODRecord, 2003. [55] V. Raghunathan, C. Schurgers, S. Park, and M.B. Srivastava. Energy-aware wireless mi­ crosensor networks. In IEEE Signal Processing Magzine, 2000. [56] V. Rajendran, K. Obraczka, and J.J Garcia-Lina-Aceves. Energy-efficient, collision-free medium access control for wireless sensor networks. In Proc. ACM SIGMOBILE Intl. Conj. Embedded Network Sensor Systems (Sensys), 2003. [57] T.S. Rappaport. Wireless Communications: principles and practice. Prentice Hall PTR, 2002.

[58] L. G. Roberts. Aloha packet system with and without slots and capture. ACM SIGCOMM Computer Communication Review, page 2842, 1972. [59] C. Schurgers and M.B. Srivastava. Stem: Topology management for energy efficientsen­ sor networks. In IEEE Aerospace Conference, 2002. [60] K.J. Turner, E.H. Magill, and D.J. Marples. Service Provision: Technologies for Next Generation Communications. John Wiley & Sons Ltd, 2004. [61] L.F.W van Hoese!, S. Chatterjea, and P.J.M. Havinga. An energy-efficient medium access protocol for wireless sensor networks. In ProRisc, 2003.

61 [62] L.F.W van Hoesel and P.J.M. Havinga. A lightweight medium access protocol (lmac) for wireless sensor networks: Reducing preamble transmissions and transceiver state switches. In INNS, 2004. [63] L.F.W van Hoesel, T. Nieberg, H.J. Kip, and P.J.M. Havinga. Advantages ofa tdma based, energy-efficient, self-organizingmac protocol for wsns. In IEEE VTC, 2004. [64] A. Woo and D. Culler. A transmission control scheme for media access in sensor net­ works. Proceedings of the ACM/IEEE International Conference on Mobile Computing and Networking, 2001. [65] W. Ye and J. Heidemann. Medium Access Control in Wireless Sensor Networks. Book chapter in the Wireless Sensor Networks, T. Znati, K.M. Sivalingam and C.Raghavendra(eds.), Kluwer Academice Publishers, 2004. [66] W. Ye, J. Heidemann, and D. Estrin. An energy-efficientmac protocol for wireless sensor networks. In INFORCOM, 2002.

62 Appendix

63 Appendix A

SENSIM: SEnsor Network SIMulator

The challenges of developing, debugging, and evacuating complex sensor networks demands a new set of tools. Simulation provides timely and inexpensive study of the existing and future sensor network protocols and methods under various conditions. Currently, the most popular simulators include ns-2 [6], TOSSIM [5], JavaSim [7], GloMoSim [3], SSFNet [9], SensorSim [2], and OPNET [8], providing varying degrees of scalability, realism, and detail for under­ standing the behavior of sensor networks. However, most of them have been built upon the wired network model and only take wireless as an extension to their layered architecture. In fact, wireless networks are inherently different due to the extremecomplexity of signalinterfer­ ence, attenuation of radio wave and the local broadcasting nature, which makes communication patterndistinctive from the equivalent wired network. Under this context, Glomosim is a good choice as it is a standalone wireless simulator and is designedfor large scale ad hoc and sensor networks simulation. Nevertheless, the lack of modules to evaluate the energy consumption, the most important metric in sensor network simulations, has greatly limited its usage. The only acceptable tool left is SensorSim, which has been integrated into ns2. It provides additional features for modeling sensor networks including a power model, a battery model, a radio prop­ agation model and a sensor channel model. It also supports hybrid simulation, which allows the real-time interaction between the real and simulated nodes. However, the pre-release status and in-comprehensive documentation make it difficult to use. Therefore, a standalone sensor network simulator is highly desirable.

A.1 Simulator Architecture

The goal of SENSIM is to provide a convenient tool which can be used to evaluate the per­ formance of newly developed protocols for wireless sensor networks. SENSIM is designed as a networked simulator, accessible through the public Internet, with the motivation to inte­ gratemost classical protocolspro�sed forwireless sensor networks. We expect SENSIM to be a parallel simulator and emulator for sensor networks design, although the first release of the simulator only contains a standalone version. In general, SENS IM consistsof four modules, the configuration module which generates the network topology, initializes parameters for sensor

64 • 11 • • • Topology Application network • • • config • I Sensor Node I I Simulation • • • • • • • Configuration • • 0 "' Senor Net SiEi" sm s network OQ co 01 1 info ' 1ro� Simulation I Sim : copfig RoutingTable sim infonnation Queuing System DBMS - sim rn infonnation Model

MYSOL ANALYZE Link Layer Model TOOL Physical Layer Model

Figure A. I: Architecture of SENSIM nodes, specifies the application, and configuresthe simulation parameters; the sensor network module which maintains the network topology, generates the neighborhood information, and the state of the node (dead or alive); the sensor node abstraction module, which is further di­ vided into the energy sub-module and the network stack sub-module. The energy sub-module is based on the parameters of Mote's chipcon CCIO00 radio and the network stack sub-module has several protocols implemented. The simulation core is based on the time-driven simulation in which the simulation clock is moved forwardat the fixedcycle, with all the possible actions carried out, and at the end of that cycle, the updated informationis collected; the storage module stores the temporary simulation information into the remote database such that the simulation can continued at a later time if needed. Meanwhile, it saves the simulation informationand uses tools like MATLAB to analyze the data. The architecture of SENSIM is illustrated in Fig. A. I.

A.2 Implementation Tools SENSIM is developed using the JAVA technology. We describe in the following basic tools used in SENSIM.

• J2SE 5.0. It provides an integrated JAVA application development environment including java compiler, virtual machine, user interface toolkits, and so on. Since JAVA is a cross­ platform development tool,SENSIM can run on different systems like Windows, Linux,

65 Solaris. • Apache Ant. It is a java-based build tool. Once provided with an XML-based makefile, it can automatically locate all the source files, compile them, and package the class files into the executable file. • CORBA. It is used to bridge the client with the module residing on the server side which is written in C++ forhigher execution efficiency. • MySQL Connector/J. It is used to coverts JDBC calls into network protocols used by the MySQL database. Therefore, it enables interaction with MySQL and connects all corporatedata. • MySQL. It is used as our database server to store all thesimulation, emulation, and ani­ mation data. • Java Network Launching Protocol (JNLP). It is usually defined as server-resident appli­ cation over a network and across firewalls, and latching it on a client. In our case, we apply it to latch SENSIM with a single click from a web browser without going through complicated installation procedures.

A.3 SENSIM Overview The current implementation can be generally divided into two parts: simulation and visualiza­ tion. We try to keep these two modules as independent as possible. For the simulation part, we design several classes, SimCore, Network, Node, BasicApp, BasicRoute, BasicMAC, Ba­ sicPhys, and BasicEnergy. During the initialization, the Network and SimCore have been con­ structed by the visualization tool or the configuration information obtained from the database. After initialization, the simulator core walks through simulation time by calling specific meth­ ods of each node. A simulation clock is broken into the following operations:

• cyclestart. This signifies a new clock phase. Any cycle-by-cycle statistical information should be adjusted. • cycleexecute. In this phase, all the nodes determine what exactly they are going to do in this cycle and carry out these actions. Informationabout what other nodes have decides to do is withheld so that two nodes can simultaneously decide to transmit to each other. • cycleupdate. Any post-cycle statistical information like energy consumptionand latency are updated or computed during this phase.

Each node object must implement each of these methods for simulation. In addition we declare these methods into the class of Node, BasicApp, BasicRoute, BasicMAC, and Basic­ . If a user wants to definehis/her own sensor network protocols, what needs to done is to extend the basic class definition for application layer, network layer, MAC layer, or Physical

66 CBR

BasicApp Bursty

DE UE Moving Targets

BasicRoute 1----1- Flooding

DE UE S-MAC

BasicMAC 802.11 DCF

Q-MAC DE UE D-MAC

BasicPhys MOTE

Figure A.2: Class hierarchy of network stack. DE represents Down Enable and UE represents Up Enable. The direction of arrow identifythe inheritance direction of the class declaration

layer and overload all these simulation cycle methods. In addition, the simulation is launched or stopped by the control of SimCore. Fig. A.2 shows the current implementation of network stack protocols. In the application layer, we have implemented Constant (CBR), bursty traffic,and moving targets as the application model; In the network layer, we simply implement floodingas the routing protocol; In the MAC layer, we have implemented S-MAC, 802.11 DCF, Q-MAC, and D-MAC protocols; And in the physical layer, we have mainly used Berkeley Mote as the referenceand implemented Mote as our applicable physical layer. Notice that at the cur­ rent stage we have not implemented the wireless channel fading. Instead, we simply specified the communication range for each sensor node, but we do introduce the Bit Error Rate (BER) which can be specifiedfrom our visualization tool. The simulation examples can be referredin the Q-MAC and D-MAC simulations. Visualization is another importantfeature of SENSIM, it includes the following functional­ ities.

• Topology Visualization. We need to display the network topology fora generated sensor network. The graphic user interface forthis purposeneeds to be interactive, which means the user can obtain all the related information of sensor nodes by simply clicking the position of the node. In addition, we also provide a series of toolkitsfor users to modify the configurationof the network, like adding or removing sensor nodes, re-specifyingthe parameters like the width or height of sensing field.

67 Figure A.3: Snapshot of SEN SIM with 10 x 10 gird topology

• Viewing tools. We provide the viewing tools such as zooming, selection of a particular sensing area, drag and drop, and multi-layer display.

• Reports. We implement a chart library dealing with XY plots, time series charts, and his­ tograms. This library can be used for reporting purpose, including plotting the topology distributionsand simulation results.

A snapshot of SENSIM simulator is shown in Fig. A.3 with a 10 x 10 grid topology. The SEN SIM is an ongoing project and still needs a lot of work to make it a comprehensivesimu­ lation tool. We plan to release this simulator by the end of this yearand publish on our group's website.

68 Vita

Yang Liu was born in Guiyang, P.R. China in 1974. His major interests and research ar­ eas are in the area of embedded system, networking and digital system design. In 1993, he attended Zhejiang University, P. R. China, where he received a Bachelor of Science degree with the major in the Optical & Scientific Instrument Engineering in 1997, and a Master of Science degree with honor in 2001 with the major in the Biomedical Engineering & Instrumentation. He also minored in Computer Science during his undergraduate study. For his undergradu­ ate thesis, he improved the control system of LRZ-1 Raman Spectroscopy, which is designed and implemented by Optical & Scientific Instrument department, Zhejiang University. During his graduate study, he was one of key members of a high-profile national project, "Virtual In­ ,, strument Oriented Graphical Development Platform . His contribution included proposing an execution scheduling algorithm for the data flow language, object oriented analysis of software architecture, GUI design, component library implementation, VXI bus interface design using Delphi and Visual C++. He has published two papers related to this project. In the fall of 2002, he came to the University of Tennessee at Knoxville as a graduatestudent in Electrical and Com­ puter Engineering Department and joined the Advanced Imaging & Collaborative Information Processing lab as a graduate research assistant where he has been working on several projects related to network and security protocols design for wireless sensor networks. In his research on Medium Access Control (MAC) of WSN, he proposed two new energy-efficient and QoS­ aware MAC protocols, Q-MAC and D-MAC, whichcan achieves better performance compared with a popular solution, S-MAC. One paper has been submited to a journal. In this project, he also developed a time-driven based wireless sensor network simulator, called SENSIM, in which several networking protocols of WSN has been integrated.

69 59017i1 �30('J 14/16/85 tll3 '