Design and implementation of a QoS-aware MAC protocol for Wireless Multimedia Sensor Networks

17
Design and Implementation of a QoS-Aware MAC Protocol for Wireless Multimedia Sensor Networks M. Aykut Yigitel, Ozlem Durmaz Incel, Cem Ersoy Computer Networks Research Laboratory, Netlab Department of Computer Engineering Bogazici University, Bebek, 34342, Istanbul/Turkey Abstract Wireless Multimedia Sensor Networks (WMSNs) have entered the Wireless Sensor Networks (WSNs) family to meet the multimedia requirements of new emerging applications, such as surveillance and telepresence. Combining the traditional scalar sensors used in WSN nodes with tiny cameras and microphones, WMSNs commonly carry heterogeneous traffic with different quality of service (QoS) requirements. In order to deliver heterogeneous traffic with different requirements in highly resource constrained sensor networks, QoS provisioning and service differentiation become unavoidable. In this paper first we discuss the QoS- provisioning in sensor networks and evaluate the efficiency of existing QoS-aware MAC protocols. As a result of this evaluation, next we design and implement a QoS-aware MAC protocol for WMSNs, Diff-MAC, which utilizes methods introduced by many previous studies in the literature and provides a fair all-in-one QoS-aware MAC protocol. Diff-MAC aims to increase the utilization of the channel with effective service differentiation mechanisms while providing fair and fast delivery of the data. Performance evaluation results of Diff-MAC, obtained through extensive simulations, show significant improvements, in terms of latency, data delivery and energy efficiency, compared to two other existing protocols. Implementation of Diff-MAC on Imote2 platform also reveals that the protocol with moderate complexity can be easily implemented on the resource constrained motes. Keywords: QoS-aware MAC protocols, Service Differentiation, Prioritization, Wireless Sensor Networks, MAC Protocols. 1. Introduction The availability of low-cost hardware and rapid development of tiny cameras and microphones have enabled a new class of Wireless Sensor Networks (WSNs): multimedia or visual wireless sensor net- works [1, 2] and this new class has contributed to new potential WSN applications, such as surveil- lance, target tracking and telepresence. Composed of embedded cameras and microphones besides tra- ditional scalar sensors, nodes in a wireless multime- dia sensor network (WMSN) usually carry hetero- geneous and Quality of Service (QoS)-constrained Email addresses: [email protected] (M. Aykut Yigitel), [email protected] (Ozlem Durmaz Incel), [email protected] (Cem Ersoy) traffic, such as video, voice and periodic scalar data. Especially real-time multimedia and mission- critical applications bring forward QoS as a require- ment since delay-bounded and reliable data delivery becomes a necessity. The term QoS, in fact, refers to control mech- anisms that orchestrate the resource reservation rather than the provided service quality itself. In- ternational Telecommunication Union (ITU) [3] has defined QoS as: “Totality of characteristics of a telecommunications service that bear on its ability to satisfy stated and implied needs of the user of the service”. Simply, QoS brings the ability of giving different priorities to varied users, applica- tions, data flows, frames or packets by controlling the resource sharing, hence achieving service dif- ferentiation among classes to provide better per- Preprint submitted to Elsevier February 26, 2011

Transcript of Design and implementation of a QoS-aware MAC protocol for Wireless Multimedia Sensor Networks

Design and Implementation of a QoS-Aware MAC Protocol for WirelessMultimedia Sensor Networks

M. Aykut Yigitel, Ozlem Durmaz Incel, Cem Ersoy

Computer Networks Research Laboratory, NetlabDepartment of Computer EngineeringBogazici University, Bebek, 34342,

Istanbul/Turkey

Abstract

Wireless Multimedia Sensor Networks (WMSNs) have entered the Wireless Sensor Networks (WSNs) familyto meet the multimedia requirements of new emerging applications, such as surveillance and telepresence.Combining the traditional scalar sensors used in WSN nodes with tiny cameras and microphones, WMSNscommonly carry heterogeneous traffic with different quality of service (QoS) requirements. In order todeliver heterogeneous traffic with different requirements in highly resource constrained sensor networks,QoS provisioning and service differentiation become unavoidable. In this paper first we discuss the QoS-provisioning in sensor networks and evaluate the efficiency of existing QoS-aware MAC protocols. As aresult of this evaluation, next we design and implement a QoS-aware MAC protocol for WMSNs, Diff-MAC,which utilizes methods introduced by many previous studies in the literature and provides a fair all-in-oneQoS-aware MAC protocol. Diff-MAC aims to increase the utilization of the channel with effective servicedifferentiation mechanisms while providing fair and fast delivery of the data. Performance evaluation resultsof Diff-MAC, obtained through extensive simulations, show significant improvements, in terms of latency,data delivery and energy efficiency, compared to two other existing protocols. Implementation of Diff-MACon Imote2 platform also reveals that the protocol with moderate complexity can be easily implemented onthe resource constrained motes.

Keywords: QoS-aware MAC protocols, Service Differentiation, Prioritization, Wireless Sensor Networks,MAC Protocols.

1. Introduction

The availability of low-cost hardware and rapiddevelopment of tiny cameras and microphones haveenabled a new class of Wireless Sensor Networks(WSNs): multimedia or visual wireless sensor net-works [1, 2] and this new class has contributed tonew potential WSN applications, such as surveil-lance, target tracking and telepresence. Composedof embedded cameras and microphones besides tra-ditional scalar sensors, nodes in a wireless multime-dia sensor network (WMSN) usually carry hetero-geneous and Quality of Service (QoS)-constrained

Email addresses: [email protected] (M.Aykut Yigitel), [email protected] (OzlemDurmaz Incel), [email protected] (Cem Ersoy)

traffic, such as video, voice and periodic scalardata. Especially real-time multimedia and mission-critical applications bring forward QoS as a require-ment since delay-bounded and reliable data deliverybecomes a necessity.

The term QoS, in fact, refers to control mech-anisms that orchestrate the resource reservationrather than the provided service quality itself. In-ternational Telecommunication Union (ITU) [3] hasdefined QoS as: “Totality of characteristics of atelecommunications service that bear on its abilityto satisfy stated and implied needs of the user ofthe service”. Simply, QoS brings the ability ofgiving different priorities to varied users, applica-tions, data flows, frames or packets by controllingthe resource sharing, hence achieving service dif-ferentiation among classes to provide better per-

Preprint submitted to Elsevier February 26, 2011

formance over others according to their require-ments [4]. Thus, service differentiation constitutesthe substantial part of QoS support.In case of WMSNs that deliver various types of

traffic like video, voice, event-driven, periodic orbest effort, QoS support mechanisms are utilizedto prioritize and manage the resource sharing ac-cording to the requirements of each traffic class.Since Medium Access Control (MAC) layer rulesthe sharing of the medium and all other upper-layer protocols are bound to that, it has the abil-ity to severely affect the overall performance of theWMSNs. Therefore, MAC layer becomes a properchoice to implement QoS support.In this work, we first give a detailed background

on the QoS requirements and challenges of WSNstogether with the comparisons of existing work onservice differentiation and QoS-aware MAC proto-cols for WSNs. With these comparisons, we iden-tify the missing properties in the existing work forQoS provisioning in WMSNs and introduce the de-sign and implementation of a new QoS-aware andpriority-based MAC protocol for WMSNs, “Diff-MAC”. Diff-MAC is designed with key features tosupport service differentiation and QoS provision-ing to deliver heterogeneous traffic. These featuresinclude: i) fragmentation & message passing, ii)adaptive contention window adjustment, iii) adap-tive duty cycling, iv) intra-node & intra-queue pri-oritization. Although some of these key compo-nents have been integrated in previous MAC pro-tocols for WMSNs [5–9], Diff-MAC is the first all-in-one QoS-aware MAC protocol proposed for WM-SNs that dynamically adapts the use of its resourcesto meet the requirements of different traffic classes.We evaluate the performance of Diff-MAC with ex-tensive simulations for three different classes of traf-fic co-existing in the network: real-time (RT) multi-media traffic, non real-time (NRT) traffic and besteffort (BE) traffic, and compare its performancewith SMAC [10] and another QoS-aware MAC pro-tocol proposed for WMSNs [8]. The key contribu-tions of this work and highlights of Diff-MAC arelisted as follows:

• We give a detailed background information onservice differentiation and QoS-aware protocolsfor wired networks and traditional wireless net-works, and investigate the details of existingQoS-aware MAC protocols for WSNs togetherwith their comparisons.

• The built-in fragmentation and message pass-

ing feature of Diff-MAC fragments the longvideo frames into smaller video packets and re-serves the medium to send these packets as aburst which in turn reduces the retransmissioncost of long messages in case of MAC failures.

• Diff-MAC can adjust its contention window(CW) size according to the dynamic traffic re-quirements to reduce the number of collisionsand keep the packet latencies as small as pos-sible.

• Diff-MAC adapts its duty cycle (DC) accordingto the dominating traffic class in the networkand balances both energy consumption and de-lay. For instance, due to the stringent delay re-quirements of real-time multimedia traffic, sen-sor nodes adapt a higher duty cycle whereas ifthe flowing traffic has a best-effort character-istic, sensors adjust their duty cycles to lowerlevels to conserve energy.

• Intra-queue and intra-node prioritization fea-ture of Diff-MAC provides fair delivery of thedata among all sensor nodes and among alltraffic classes respectively to avoid intolerableperformances.

• Diff-MAC exhibits better performance in termsof delay and delivery rate for RT and NRT traf-fic while it keeps the energy consumption at anacceptable level, and it exhibits better energyefficiency in terms of BE traffic while it keepsthe delay at lower levels compared with SMACand the MAC protocol proposed in [8].

• Simulation results using a realistic link layermodel show that Diff-MAC provides efficientservice differentiation and manages to be fairamong all sensor nodes even under lossy chan-nel conditions.

• We implemented Diff-MAC on the Imote2 sen-sor mote platform [11] and evaluated its perfor-mance in terms of different metrics, such as la-tency and packet failure rate. Our experimentsreveal that resource requirements of the pro-tocol in terms of memory and processing caneasily be met on a typical resource-constrainedsensor hardware and show the efficiency of Diff-MAC over the default, non-adaptive MAC pro-tocol that is available on sensor devices.

2

The remainder of the paper is organized as fol-lows: In Section 2, first detailed background infor-mation on QoS provisioning and service differentia-tion in traditional networks are presented, next theservice differentiation mechanisms at MAC layer forWSNs and WMSNs are explained and finally QoS-aware MAC protocols are evaluated together withtheir comparisons and the missing properties in theexisting work for QoS provisioning in WMSNs areidentified which drive the design of Diff-MAC. De-tails of the system model and key features of Diff-MAC are explained in Section 3. An example ap-plication scenario, details of the system/simulationparameters, and comparative performance analy-sis of Diff-MAC are presented in Section 4. Sec-tion 5 presents the implementation of Diff-MAC onImote2 sensor platform and the experimental eval-uations of the protocol. Finally, Section 6 drawsthe conclusions and provides possible directions forfuture research.

2. Related Work

In this section, first we give background informa-tion on QoS provisioning and service differentiationin traditional networks and next discuss the servicedifferentiation methods at the MAC layer for WM-SNs which is the main topic of this paper.

2.1. QoS Provisioning and Service Differentiationin Traditional Networks

QoS support is a well-studied problem for wirednetworks and general wireless networks carrying in-ternet traffic and it is shortly defined as the abil-ity of a network to satisfy the certain require-ments of the user or application. Service differ-entiation is the widely adopted scheme in bothwired and wireless networks to provide QoS guaran-tees. There are two service differentiation modelsproposed for conventional computer networks, In-tegrated services (IntServ) [12] and DifferentiatedServices (Diff-Serv) [13]. Aim of the both differenti-ation models are to prioritize flows or packets, maptheir priorities into service qualities and provide re-quired service quality by sharing limited resourcesamong them.IntServ model maintains service on a per-flow

basis and can be considered as reservation-basedapproach. It specifies a fine grained QoS systemand follows the hard QoS approach [14]. However,IntServ model has a number of disadvantages which

makes it inappropriate for WSNs. Firstly, it is hardto provide guaranteed service quality due to timevarying channel capacity on the wireless medium.Second, maintenance of the per-flow states of thesensor nodes and scalability for dense networks is areal challenge. Third, IntServ model requires a re-liable in-band or out-of-band QoS signaling withinthe sensor network for resource reservation which isvery hard to assure in WSNs.

DiffServ model maintains service on a per-packetbasis and can be considered as a reservation-lessapproach. Major drawback of DiffServ model is itscostly memory requirement since every network en-tity will behave as a source and an intermediatehop. However, lightweight and easy-to-implementDiffServ model can easily be adapted to WSNs andthis model operates in a multi-hop manner [15].Each packet will have a degree of importance andthis will be apparent for every entity of the network.In this way, each layer of the communication proto-col stack can treat the packet by the way its priorityimposes. As we elaborate in Section 2.3, DiffServModel is the service differentiation approach in allthe QoS-aware MAC protocols designed for WSNs.

In the literature, there are many protocols pro-posed for wireless networks to provide QoS sup-port mechanisms [16, 17]. Although WSNs inheritmost of the well-known QoS challenges from tradi-tional wireless networks, such as time varying chan-nels and unreliable links [16], typical characteristicsof WSNs, such as severe resource constraints andharsh environmental conditions, high node densityand scalability pose additional unique challengesfor QoS-Support. Therefore, there is a growing de-mand to develop resource efficient service differen-tiation methods and QoS-aware protocols to enableWMSNs to operate more efficiently with heteroge-neous traffic.

2.2. Service Differentiation Mechanisms at MACLayer for WSNs and WMSNs

There are many MAC layer proposals designedfor WSNs in the literature [18] and most of themmainly focus on energy efficiency and scalabilityand very few of them focus on QoS provisioning [5–9]. There are also recent proposals for QoS-awareand real-time WSN communication [19, 20] andsome on Body-Area Sensor Networks [21], however,these do not address certain requirements of WM-SNs that carry multiple types of traffic.

As mentioned, service differentiation is the mostwidely known and utilized technique for QoS pro-

3

visioning not only in WSNs but also in all kindsof wired and wireless networks [15]. It differenti-ates and prioritizes the traffic carried on the net-work based on one or more criteria and forms sev-eral traffic classes. In this way, MAC layer treatseach of these traffic classes differently by managingthe resource sharing among them and tries to fulfillthe requirements imposed by their degree of impor-tance. Thereby, service differentiation consists oftwo phases: i) priority assignment; and ii) differ-entiation between priority levels. Below, we givea summary of these two phases and further detailscan be found in our previous study [22].

In the priority assignment phase, packets can beassigned priorities in a static, dynamic or hybridmanner. If the assignment method is static, thepacket is assigned a priority once it is created andnever changes until its destination. The decisionparameters for static assignment can be the traf-fic type (such as real-time, best-effort, non-real-time), the source type (sensors or the sink) andthe data delivery model (continuous, event-driven,query-driven [23]. If it is a dynamic assignment,packet priorities may vary during delivery and thepriority criteria can be the remaining hop count to-wards the destination, the packet deadline, etc. Ina hybrid method, on the other hand, priority of thepackets can be determined in a hybrid manner byconsidering both static and dynamic decision crite-ria.

In the differentiation phase, the wireless mediumis shared according to the importance, i.e., prior-ity of the carried data. The techniques to pro-vide different quality of services to different traf-fic classes at the MAC layer can be changing con-tention window (CW) size, changing the backoffexponent in the contention phase, changing theactive-sleep time of a sensor node, etc. accordingto the priority of the packets.

2.3. QoS-aware MAC protocols with Service Differ-entiation for WSNs and WMSNs

In this section, QoS-aware MAC protocols in theliterature will be briefly evaluated along with theiradvantages and disadvantages and details will beprovided on how Diff-MAC differs from these exist-ing works. For a more detailed survey of QoS-awareMAC protocols for WSNs, the reader can refer toour previous study [22]. Comparison of the exist-ing QoS-aware MAC protocols for WSNs will beprovided in Section 2.4.

One of the MAC protocols proposed to meet theQoS requirements of the WSNs is PSIFT [5] thatuses a CSMA/CA based medium access scheme.PSIFT is a QoS-aware protocol designed for event-driven applications and it is based on the previousSIFT protocol [24]. The motivation behind SIFT isthat when an event is sensed, the first R of N po-tential reports is the most crucial part of messagingand has to be relayed with low latency. PSIFT is aCarrier Sense Multiple Access (CSMA)-based MACprotocol and provides traffic differentiation by vary-ing the inter frame space (IFS) and contention win-dow (CW) size for each traffic class. Traffic classesare prioritized in a dynamic manner based on thetraversed number of hops. Although PSIFT mightbe a sensible choice for event-driven applications, itis nearly impossible to be used in any other type ofapplications.

Q-MAC [6] is another QoS-aware MAC protocolwhich utilizes dynamic prioritization. Applicationlayer perspective assigns priorities based on the con-tent of the packet and MAC layer does based ontraversed hop count. Dynamic priority assignmentprovides robustness against changing conditions ofthe sensor network. However, calculation of thetransmission urgency of a node is relatively com-plex. Integration of the increasing geometric prob-ability for CW selecting may decrease the collisionrate but also may result in higher latencies.

PQ-MAC [25] aims to use advantageous featuresof both contention based and schedule based ap-proaches and uses a hybrid scheme for mediumsharing. The slot assignment within the setupphase considers the two hop distance neighbornodes and allocates different time slots based onthe DRAND [26] algorithm. Owner node of a spe-cific transmission slot, assigned in the setup phase,has an exclusive right to send the data in it. If theowner of the slot does not have any data to sendor has lower priority data, non-owners of the slotcan contend for the slot based on priorities of theirdata. One disadvantage of PQ-MAC is that accu-racy of the slot assignment performed once at thebeginning of the setup phase may become obsoleteduring the transmission period gradually due to thedynamic neighborhood.

The closest work to ours is introduced by Saxenaet al. [8] in which authors use a CSMA/CA ap-proach and assume three types of traffic carried inthe network: streaming video, non-real time (NRT)and best effort (BE). Basically, their MAC schemeperiodically monitors the dynamics of the sensor

4

nodes and the medium, and collects relevant net-work statistics like transmission failures and trans-mitted traffic type. Accordingly, the protocol up-dates the CW size and duty cycle adaptively. CWadaptation is performed in a “stop-for-a-round”fashion and differentiation is provided by varyingthe up and down scale factors for different trafficclasses. Consequently, CW size for higher prior-ity traffic decreases faster than the lower prioritywhere an increase is performed more slowly. Dutycycle is adjusted directly according to the dominat-ing transmitted traffic from a sensor node.Although CW size and duty cycle adaptation are

common features between our protocol and Saxenaet al. MAC, we use a different approach for CWsize adaptation. Saxena et al. MAC waits for othersensor nodes to adjust their CW size whereas Diff-MAC continuously adapts the CW size regardless ofthe neighboring sensor nodes, hence chooses betterCW sizes faster. Additionally, Saxena et al. MACuses a FIFO based queuing method to process pack-ets from different priorities where we utilize a pack-etized Weighted Fair Queuing method [27] whichbrings the ability of controlling the medium access,hence relative throughput, for each traffic class.Additionally, Diff-MAC uses a “traversed numberof hops based prioritization” scheme to prioritizethe packets according to their generation times andto deliver them as quickly as possible to the sinknode, whereas Saxena et al. MAC does not differ-entiate the packets from the same class and alwaysprocesses the packets according to the priority oftheir traffic type.RL-MAC [9] is a QoS-aware reinforcement learn-

ing (RL) based MAC protocol and uses a CSMAscheme. It adaptively changes the duty cycle of thesensor nodes based not only on local observationsbut also by the observations of neighbor nodes. As alocal observation, the number of successfully trans-mitted and received packets during the active timeperiod is recorded and for neighbor observation, afield is added to the packet header to provide infor-mation to the receiving node regarding the numberof failed transmission attempts by the sender. Withthis field, RL-MAC tries to save energy while min-imizing the number of missed packets due to earlysleeping. Traffic load in the network is divided intothree traffic categories and service differentiation isachieved by varying the CW size of each category.Although relatively complex RL based algorithmadapts the network conditions very well, it mightnot be feasible to be implemented on energy and

processing power constrained sensor nodes.PR-MAC [28] gives different priorities for each

type of event monitored by the sensor nodes andprovides service differentiation among these eventsby varying both CW size and IFS. The sendernode transmits a short pulse to reserve the mediumrather than using an RTS-CTS exchange. Hence,collisions can only occur during transmission of theburst pulse among nodes of equal priority. Ac-knowledgement mechanism is achieved by sendingpowerful broadcast signals from sink to every nodein the network. Sink-to-source acknowledgementmechanism requires a very powerful sink node tobe heard by every sensor node and seems to be im-practical.

A QoS-aware MAC protocol using Optimal Re-transmission (QoMOR) [29] is designed for theintra-vehicular sensor networks and assumes thesensor nodes have only the transmission capabil-ity. Authors derived an optimization problem tofind the minimum number of retransmissions re-quired to achieve a certain level of frame deliveryprobability bounded by a maximum delay thresh-old. Theoretical analysis of the single QoS class ispresented based on the derived optimization prob-lem and it is extended to multiple QoS classes whereeach sensor node is a member of a QoS class. Re-duction of receiver hardware decreases the cost ofthe sensor nodes considerably. However, as authorsindicated, it is very hard to achieve an acceptablelevel of frame delivery probability with stringent de-lay constraints under dense networks and this ob-jective becomes more challenging as the frame sizeincreases.

EQ-MAC [30] is designed to provide QoS sup-port for cluster based single-hop sensor networksby service differentiation and uses a hybrid mediumaccess scheme. The protocol classifies the receiveddata packets into four priority levels according tothe importance of the packet assigned by the appli-cation layer and uses a queueing architecture sim-ilar to Q-MAC [6]. Each sensor node follows thetransmission schedule received from cluster headand accesses the medium without contention. Prob-ability of collisions and energy consumption are re-duced by using contention based medium access forshort periodic control messages and by scheduledmedium access for long data packets. However, EQ-MAC is designed for single-hop cluster based sen-sor networks and cannot handle multi-hop trans-missions. Additionally, clustering algorithm is notincluded in the MAC protocol itself.

5

2.4. Comparisons

Most of the protocols provide random mediumaccess, i.e., CSMA, or propose hybrid solutions suchas CSMA and TDMA. We observe that insteadof providing deterministic QoS guarantees, major-ity of the protocols follow a service differentiationapproach by classifying data packets according totheir type and associated network parameters at theMAC layer are tuned according to the requirementsof different types. Those protocols that provide ser-vice differentiation usually assign static prioritiesto the traffic types since this is simpler to manage.However, dynamic priority assignment may be nec-essary where the priorities of different packet typesmay vary in time.

Traffic adaptivity is usually not supportedwhereas most of the protocols do not require syn-chronization since they allow for random access. Asthe MAC protocols provide QoS provisioning, theircomplexity increases but still they should be pro-cessed by the sensor devices without any resourceproblems. Although WSNs are becoming popularamong complex applications that require fast andefficient data delivery, energy awareness is still amajor requirement and most of the protocols sup-port energy efficient communication in the network.

As discussed in Section 2.3, previously proposedQoS-aware MAC protocols already defined manytechniques to improve the efficiency of the QoS-provisioning. Nevertheless, they focus on somespecific aspects and are far away from combiningand melting these techniques into a single proto-col to construct a complete solution for the MAClayer. Diff-MAC utilizes methods introduced bymany previous studies in the literature and providesa fair all-in-one QoS-aware MAC protocol whichis supported with an example scenario based on asurveillance application. Besides Q-MAC [6], Diff-MAC is the only protocol that provides hybrid pri-ority assignment: packets are prioritized accordingto their traffic class statically and Diff-MAC alsoprioritizes the packets from the same class both ac-cording to traversed hop count and weighted-fairqueuing, dynamically. For service differentiation,Diff-MAC uses contention window size adaptation,dynamic duty cycling (changing active time), frag-mentation and message passing for long packets andvariable adaptation speeds for different classes oftraffic.

3. Diff-MAC Design and Architecture

In this section, we introduce Diff-MAC and itskey features for QoS-provisioning and adaptationaccording to different types of traffic. Diff-MACadopts a CSMA/CA based medium access withRTS/CTS and acknowledgements and Fig. 1 showsthe state transition diagram for the operation of theprotocol. Sensor nodes adopt a sleep-listen sched-ule to conserve energy and each node follows itsown independent schedule, so that Diff-MAC doesnot require any synchronization between the neigh-boring sensor nodes. Diff-MAC manages the shar-ing of the medium by adapting various parametersaccording to the requirements of the flowing trafficin the network which are explained in the followingsubsections.

3.1. Fragmentation & Message Passing

Created video frames are relatively long messagesand transmitting them as a single packet is toocostly especially in case of MAC failures where re-transmissions are required. Diff-MAC fragmentsthe long video frames into smaller video packetsand transmit them as a burst. Traditional RTS-CTS-DATA-ACK mechanism is used in Diff-MACand once the medium is reserved, all packets of thecorresponding video frame are sent as a burst usinga mechanism similar to the message passing featureof the SMAC protocol [10] as shown in Fig. 1. Inorder to accurately obtain and give meaning to thepackets of the relevant video frame, a field called“packet in frame” is added to the packet structure.This field is used at the receiver side to assure con-sistency of the video frame. Moreover, neighboringsensor nodes around the source and destination pairenter into sleep state during a video frame exchangeafter receiving the RTS-CTS packets which in turnprovides considerable amount of energy saving.

3.2. Contention Window Size Adaptation

The objective of this mechanism is to reduce thenumber of collisions and keep the CW size as smallas possible in order to avoid unnecessary waitingtime to reserve the medium by adjusting the currentCW size of the sensor node based on the dynamicnetwork traffic conditions.

In order to adjust the CW size adaptively, Diff-MAC periodically monitors the behavior of thenetwork, with a period (Tc), and collects two re-lated metrics about the current state of the net-work which are the total number of transmission

6

Init

Idle

Contention

RTS/CTS

Send

DATA

Receive

ACK

Collision

Sleep

RTS/CTS

Send

ACK

Receive

DATA

Packet_To_Send Busy

Timer_Expires

CTS_Arrived

DATA_SentMore_Data_To_Tx

Sleep || Medium_Reserved

Wake_Up || Medium_Reserve_End

RTS_Arrived

CTS_Sent

More_Data_To_Rx DATA_Arrived

Collision

Collision

Collision

RTS_Arrived

DATA_Timeout

ACK_Sent

CTS_Timeout

ACK_Arrived

(default)

Figure 1: Simplified state transition diagram of Diff-MAC

attempts (At) and the number of collisions (Ac).Accordingly, a probability of collision (Pc) valuecan be computed for that observation frame. Thisobtained probability of collision is then used as aninput for the CW adaptation algorithm and it iscalculated by Pc =

Ac

At.

As seen in Algorithm 1, adaptation mechanismvaries the current CW size corresponding to eachtraffic class between the maximum and the mini-mum values step-by-step. Diff-MAC runs the CWadaptation routine if and only if more than a certainnumber of transmissions (ϱ) have been attemptedduring (Tc). Accordingly, redundant and inaccu-rate adjustments are prevented.

Algorithm 1 CW Adaptation Algorithm1: CWcur = (CWmin + CWmax)/22: Observe transmission attempts (At) during (Tc)3: if (At) < ϱ4: go to Step 25: if Pc(t) < Pc(t−1)

6: ∆CW = αdown(CWmin − CWcur)7: else8: ∆CW = αup(CWmax − CWcur)9: CW = CWcur + ∆CW10: go to Step 2

Two methods are utilized for service differen-tiation within adaptive CW size context. Thefirst method sets the speed of the CW adaptationbased on the traffic type by controlling the adap-tation coefficients. Diff-MAC increases the CWsize faster for lower priority traffic, on the otherhand, decreases faster for higher priority traffic,which means αup(RT ) < αup(NRT ) < αup(BE) andαdown(RT ) > αdown(NRT ) > αdown(BE) where αrepresents the adaptation coefficient. Moreover,

different up and down coefficients are used for thesame priority traffic like αup(RT ) < αdown(RT ) andαup(BE) > αdown(BE) in order to decrease laten-cies of the delay-intolerant RT data. Therefore, theCW size of the RT class decreases sharper than itincreases.

The second method for service differentiation issetting different maximum and minimum CW sizesfor each traffic class, hence giving different prioritiesfor reserving the medium. To increase the through-put and to decrease the latency of the higher prior-ity traffic, we set CWRT < CWNRT < CWBE andgive precedence to higher priority traffic. Since weuse non-overlapping CW sizes, this statement holdsfor both minimum and maximum CW sizes1.

Although Diff-MAC dynamically adapts the CWsize to the current network conditions, the min-imum and the maximum CW sizes of the trafficclasses have to be selected carefully. Instead of se-lecting random values for these variables, we adoptthe CW size calculation method introduced in [31]where energy-optimizing and delay-optimizing CWsizes are derived as a function of the number of con-tending nodes. Since we can extract the averagenumber of contending sensor nodes by the methodgiven in [32], CW sizes of Diff-MAC can be easilycalculated.

3.3. Dynamic Duty Cycling

Aim of this mechanism is to reduce both packetlatencies and idle listening. Similar to the CWadaptation mechanism, Diff-MAC observes the to-tal number of processed packets (created, receivedor relayed) every Td seconds and classifies them ac-cording to their traffic classes. After the classifi-cation, Diff-MAC sets the active time of a nodeaccording to the currently dominating traffic classto refrain from both idle waiting time caused bythe sleeping next hops and unnecessary waste ofenergy caused by idle listening. Every traffic classhas a corresponding active time where TABE <TANRT < TART and Diff-MAC directly adjuststhe listen duration of the sensor nodes. Conse-quently, the nodes which dominantly process RTdata, i.e. source and the relay nodes between thedetection area and the sink, stay awake longer andprovide fast delivery of the video data. If the to-tal number of processed packets is smaller than a

1In Section 4.2 we present the values for the mentionedparameters used in Diff-MAC.

7

certain threshold (σ), the active time of the sensornode is set to the smallest level since the traffic onthe node is negligible.

3.4. Intra-node & Intra-queue Prioritization

There is a tradeoff in the operation of multi-queue and single-queue QoS-aware MAC protocols.Main drawback of the single-queue scheme is thehigh cost of managing the relatively long queues.Since packets with different priorities are stored inthe same queue, it is difficult to keep them sortedand process the packets according to their priori-ties. On the other hand, multi-queue scheme chopsthe long single queue into pieces and constitutessmaller queues with different priorities. Thus, pack-ets can be served with a simple FIFO fashion andadditional sorting or searching operations are notrequired. However, multi-queue systems have totradeoff the accuracy of prioritization if there aremore priority levels than the available queues sinceall packets in the same queue are treated as thesame, i.e., with equal priority. Moreover, in thecase of multi-queue systems, a fair packet schedulermust be integrated to the MAC protocol to selectthe next serviced queue based on the requirementsof the classified traffic. If not, explicit precedencemight cause the lower priority traffic to starve andsuffer from intolerable performance.In order to fulfill the requirements of the QoS-

constrained traffic and provide fairness among allnodes in the network, priority assignment methodscome into prominence. Priorities can be assigned ina static, dynamic or hybrid manner. Static priorityassignment is rather simple and easy to implement.However, statically assigned priorities might not bepractical to adapt to the changes in the networkconditions. On the other hand, dynamic priorityassignment methods take the current network con-ditions into consideration and mostly require someadditional information and operations to decide onthe priority. Hybrid methods utilize both staticand dynamic assignment methods and determinethe priority of a packet based on several criteria.

RT Packet Queue

NRT Packet Queue

BE Packet Queue

Packet

SchedulerServed

TNHB

WF

Q

Figure 2: Multi-queue architecture of Diff-MAC

Diff-MAC adopts a hybrid approach and main-tains different priority packet queues for each traf-fic class, as depicted in Fig. 2. As we mentioned,in multi-queue systems, efficient scheduling mecha-nisms are needed to provide fairness among differ-ent priority traffic. Most of the proposed protocolsemploy explicit prioritization and serve higher pri-ority queues always first since this sharing model iseasy to implement. In this work, we utilize pack-etized Weighted Fair Queuing (WFQ) method [27]where each queue has its own weight. Packet sched-uler of Diff-MAC selects the next serviced packetbased on weights of the queues. With WFQ, themedium sharing rates among the traffic classes canbe adjusted easily by changing the correspondingqueue weights. This brings the ability of control-ling the medium access, hence relative throughputfor each traffic class. Moreover, increase in the di-versity of the traffic class to be sent at the contend-ing sensor nodes reduces the collisions since eachtraffic class uses different CW size.

Majority of the queuing systems use a FIFOmodel to manage and determine the next packetto be processed. However, resource constrainednodes may lack memory to allocate separate queuesfor each priority or there might be excessively toomany priority levels. Hence, group of packets be-longing to similar priority levels have to be storedin the same queue. Because of this, some addi-tional intra-queue management mechanisms can beadopted for better network performance at the ex-pense of keeping the queues sorted. In order toprovide more precise prioritization, Diff-MAC as-signs the priorities of the packets based on theirtraversed hop count in a dynamic manner which isnamed as Traversed Number of Hops Based Priori-tization (TNHBP). TNHBP gives precedence to thepackets for which more energy, bandwidth, memoryand time have already been allocated. Since drop-ping these packets will be more costly, TNHBP pre-vents waste of network resources by relaying themto the next hop immediately. Therefore, Diff-MACprovides a two-level hybrid prioritization scheme,first being the type of traffic class and second beingthe traversed hop count among the packets of thesame traffic class. TNHBP keeps the packet queuessorted according to the traversed hop counts ratherthan searching the whole queue for finding the high-est priority packet. Therefore, TNHBP requires asearch operation with a worst and average case com-plexity O(logn) to find an index for a new packetand a shift operation to free space prior to insertion.

8

Field of View

(FoV)

Depth of Field

(DoF)

Orientation

Angle

Image Sensor

(K fps) Camera Observation

Angle (COA)

Figure 3: Camera detection model

With the integration of TNHBP, Diff-MAC dropsthe packets already queued for a longer time, i.e.closer to miss a deadline, among the same prioritypackets, rather than dropping the newly created orreceived packets.

4. Application Scenario and Simulation

4.1. Scenario

Since the effect of an employed protocol on theoverall performance is highly application dependentin WSNs, we set up an example scenario, suitablefor WMSNs. Although various other applicationfields can be found, our main theme will be secu-rity surveillance for which the primary concern isthe fast and reliable delivery of the created videodata related to the observed phenomena. Accord-ingly, video frames will be the first traffic class car-ried by our network and will be given the highestpriority. In order to accurately detect and eliminatethe threats in such a surveillance scenario, we alsocollect non-visual information about the area un-der observation such as temperature, radioactivity,sound, light, vibration or pressure which is giventhe second priority. As the third traffic class, aux-iliary control packets are carried by the network in-cluding the location information of the sensor node,remaining energy, current operation parameters likecamera observation angle (COA), image quality,orientation angle. As a result, we have three traf-fic classes which are real-time (RT), non real-time(NRT), best effort (BE), in the same sequence astheir priorities, and this scenario will be our basisfor evaluating the performance of Diff-MAC.Since continuous video frame generation from all

sensor nodes will be a waste of critical resources,target detection mechanism is used to trigger the

Table 1: Offered Traffic Load

Frame Rate Interarrival Time Average CreatedRT (fps) NRT & BE (sec) Traffic (Pkt/Sec)

Type 1 2 12 23.14Type 2 4 10 31.65Type 3 6 8 43.96Type 4 8 6 58.12Type 5 10 4 83.25Type 6 12 2 139.32

video streaming. A sensor node generates videoframes only when the target is within the camera’sfield-of-view (FoV), i.e., moving between A and Bas shown in Fig. 3. The time spent between A andB is called the dwell time which can be calculatedas Tdwell =

dAB−→V

where dAB is the distance of |AB|and

−→V is the velocity of the target. Thus, a camera

working with K frames per second (fps) creates avideo stream of K.Tdwell frames.

4.2. Simulation Parameters

For the performance evaluation of Diff-MAC,each case is simulated 10 times with different seedsusing the OPNET modeler environment. In com-pliance with our application scenario introduced inSection 4.1, we have a square shape surveillancearea and a single sink deployed to the upper leftcorner of this area for forwarding the gathered in-formation to a safe zone. Deployed sensor nodesare equipped with a camera and have the abilityto compress the produced video in the form of se-quence of images. Quality of the produced videocan be controlled by changing the created image fpsand accuracy of the scalar data can be controlledby changing the packet interarrival times. Differenttraffic loads offered to the network to evaluate theperformance are presented in Table 1.

In the simulations, each video frame has a sizeof 10 Kbits which will be fragmented into 1 Kbits-long data packets. NRT and BE packets are 200bits long and packet inter-arrival times are poissondistributed. Target is assumed to be a pedestrianwhich moves in the surveillance area according tothe Random Waypoint Mobility model and its ve-locity is constant, 1 m/s. We applied binary de-tection model where the target is sensed with themaximum probability of 1 when it is within the FoVof the sensor node as seen in Fig. 3.

With the help of two methods [31, 32] discussedin Section 3.2; minimum CW sizes of RT, NRT andBE traffic are calculated as 4, 12, 24 where the max-imum CW sizes are 12, 24, 36 respectively. Re-spective adaptation coefficients are 0.12, 0.17, 0.3

9

for increments and 0.3, 0.17, 0.1 for decrements.As shown in Fig. 4, which is a result of Algorithm1 presented in Section 3.2, CW size of the higherpriority traffic decreases faster and increases slowerthan the lower priority traffic. Moreover, CW sizeof the higher priority traffic decreases faster than itincreases and CW size of the lower priority trafficincreases faster than it decreases.Selected DC for dominating RT, NRT and BE

traffic are 95%, 60% and 40% respectively whichequals TART = 95msec, TANRT = 60msec andTABE = 40msec. Although these values seem tobe high at first sight, we should note that the sensornodes are operating in a heterogeneous WMSN anddeliver QoS constrained, delay-intolerant real-timetraffic with only 250Kbps transmission rate whichis typical for the currently available sensor nodes.The energy consumption values for transmission,reception, idle and sleep states are 27 mJ, 10 mJ,10 mJ and 1 µJ respectively in compliance with theCrossbow Mica mote products. GPSR [33] is usedas the routing protocol and important parametersused in the simulations are summarized in Table 2.

4.3. Simulation and Performance Evaluation

Performance of Diff-MAC is evaluated with ex-tensive simulations and compared with Saxena etal. MAC [8] and SMAC [10] protocols. We selectSMAC as a competitor of our protocol since it is abasic and well-known MAC protocol for WSNs andSaxena et al. MAC is the closest protocol in theliterature to our protocol.Fig. 5 presents successfully received traffic rate

at the sink node with the x-axis showing differ-ent traffic loads given in Table 1. 95% confidence

0 5 10 15 20 25CWmin

CWmax(RT)

CWmax(NRT&BE)

# Iterations

CW

Siz

e

RT

NRT

BE

Figure 4: Effect of adaptation coefficients (αup & αdown) onthe convergence of CW sizes for each traffic class

Table 2: Simulation ParametersParameter Value

Surveillance Area 400 × 400m2

Network Size 100 NodesDeployment Type Uniform RandomVideo Frame Size 10 KbitsVideo/Scalar Packet Size 1 Kbits/200 BitsCamera Frame Rate 2 to 12 fpsPacket Interarrival Time 12 to 2 secCamera Observation Angle 52 deg.Depth of Field 30mTransmission Rate 250 KbpsVideo/Scalar Buffer Size 50 Kbits/4 KbitsTarget Mobility Model Random WaypointTarget Velocity 1 m/sRouting Algorithm GPSRDetection Model Binary FoVMax. Communication Range 80mQueue Weights (RT/NRT/BE) 0.7/0.2/0.1

intervals are included for assuring the sufficiencyof number of simulation repetitions. All proto-cols achieve nearly the same traffic delivery rate forlightly loaded cases since most of the packets aresuccessfully delivered. However, Diff-MAC achieveshigher throughput and outperforms both its com-petitors as the offered traffic load increases, as aresult of its adaptation and resource managementfeatures.

Fast delivery of produced traffic from sensornodes to sink node is one of the primary goals ofthe MAC layer protocols and becomes necessaryfor the real-time or critical data. Fig. 6 presentsthe results in terms of latency. Diff-MAC achieveslower end-to-end latencies for each traffic class andprovides fast delivery of the data whereas Saxenaet al. MAC performs very badly for BE traffic sincethe other traffic classes are always prioritized. Al-

20 40 60 80 100 120 14010

20

30

40

50

60

70

80

Traffic Load (Pkt/Sec)

Avera

ge T

raff

ic R

eceiv

ed a

t S

ink N

ode (

Pkt/

Sec)

Diff−MAC

Saxena et al. MAC

SMAC

Figure 5: Comparative Successful packet delivery rate

10

20 40 60 80 100 120 1400

2

4

6

8

10

12

14

16

18

20

22

Traffic Load (Pkt/Sec)

Avera

ge S

ourc

e t

o S

ink L

ate

ncy (

sec)

Diff−MAC BE

Diff−MAC NRT

Diff−MAC RT

Saxena et al. BE

Saxena et al. NRT

Saxena et al. RT

SMAC

Figure 6: Comparative source to sink packet delay

20 40 60 80 100 120 1400

1

2

3

4

5

6

7

8

Traffic Load (Pkt/Sec)

Avera

ge M

AC

Late

ncy (

sec)

Diff−MAC BE

Diff−MAC NRT

Diff−MAC RT

Saxena et al. BE

Saxena et al. NRT

Saxena et al. RT

SMAC

Figure 7: Comparative medium access latency

though SMAC achieves reasonable packet latencieswithout any service differentiation, we must recallfrom Fig. 5 that comparative packet delivery ratioof SMAC is very low. In other words, this averageis computed over less packets in case of S-MAC.Since the GPSR routing protocol may also effectthe source-to-sink delay of the traffic, buffer de-lay, i.e., medium access delay, of the protocols arealso examined and depicted in Fig. 7 for pure per-formance evaluation of the MAC layer. Diff-MACprocesses the received packets rapidly and exposeslower queueing delay.

When we look at the comparative energy con-sumption of the protocols in Fig. 8, we see thatDiff-MAC consumes less energy in most of the con-ditions, except for the two heaviest loads (Type 5and Type 6). In these two cases, Diff-MAC succeeds

to deliver much more packets than the other proto-cols which is the reason for higher energy consump-tion. Hence, it can be concluded that Diff-MACadapts well to the current network conditions in or-der to deliver as many packets as possible. The en-ergy consumption variation of SMAC is lower sinceit utilizes a fixed DC of 50% which translates toan average DC for Diff-MAC for different types oftraffic.

Packets created by the sensor nodes far awayfrom the sink have to traverse more hops and deliv-ery of these packets takes more time. Furthermore,explicit prioritization of the packet scheduler maybring an extra delay for the lower priority trafficwhich is the case with Saxena et al. MAC. How-ever, critical events may also occur at the far end ofthe observation field and has to be relayed in a rea-sonable time duration. Fig. 9-12 are obtained un-der the heavily loaded (Type 6) traffic conditions toemphasize the contributions of WFQ and TNHBPclearly. Since video frames are triggered by an eventand are generated by the nodes within a certainarea, i.e., at a similar distance from the sink, pri-oritization of RT packets according to the numberof hops does not provide significant improvements.Therefore, results for RT traffic are not presented.

Fig. 9 and Fig. 10 present the average source-to-sink latencies of NRT and BE traffic respectively.Performance of the Saxena et al. MAC becomesworse as the hop-count increases. Meanwhile, Diff-MAC provides fairness among all traffic types byminimizing the maximum of the packet latenciesand tries to deliver the load evenly by integrat-ing intra-node and intra-queue prioritization mech-

Load 1 Load 2 Load 3 Load 4 Load 5 Load 60

1

2

3

4

Traffic Load

Avera

ge E

nerg

y C

onsum

ption (

mJ/n

ode)

Diff−MAC

Saxena et al. MAC

SMAC

Figure 8: Comparative energy consumption

11

1 2 3 4 5 6 7 8 9 100

5

10

15

20

25

30

Distance to Sink (hops)

Avera

ge S

ourc

e t

o S

ink L

ate

ncy o

f N

RT

Tra

ffic

(sec)

Diff−MAC

Saxena et al. MAC

Figure 9: Effect of WFQ and TNHBP on the source to sinkdelay of NRT traffic

anisms.

Packets generated by the sensor nodes that arefar away from the sink are not only delivered withhigh latencies but are also more vulnerable to colli-sion and buffer overflow. Hence probability of suc-cessful delivery of a packet drops as the distancebetween the source and the destination increases.Diff-MAC overcomes this problem and provides fairdelivery of packets among all sensor nodes regard-less of their geographical position with integrationof WFQ and TNHBP as seen in Fig. 11 and Fig. 12which present the average successful delivery ratioof the created NRT and BE packets. Average dis-tance to sink distribution of sensor nodes in the testcases can be found in Table 3, which explains the

1 2 3 4 5 6 7 8 9 100

50

100

150

200

250

300

Distance to Sink (hops)

Avera

ge S

ourc

e t

o S

ink L

ate

ncy o

f B

E T

raff

ic (

sec)

Diff−MAC

Saxena et al. MAC

Figure 10: Effect of WFQ and TNHBP on the source to sinkdelay of BE traffic

Table 3: Distribution of Average Distance to Sink

Distance to Sink # Sensor Nodes Percentage(hops) (%)

1 11 2.752 27 6.753 45 11.254 54 13.55 63 15.756 76 197 67 16.758 36 99 15 3.7510 6 1.5

drop and increase in the performance of Diff-MACwith increasing hop counts.

In our simulations, we assumed perfect-reception-within-range model for the sake of simplicity. Inother words, a particular sensor node can perfectlyexchange packets with the neighboring sensor nodeswithin its communication range. However, reallife applications are far away from this assumptionand realistic link layer models need to be utilized.Channel conditions and radio capabilities must beconsidered especially in large sensor networks sincethey may have considerable effect on the overallperformance of the network . Therefore, we used arealistic link layer model proposed in [34] for hop-based performance evaluation of Diff-MAC.

Zuniga et al. [34] use mathematical techniquesfrom communication theory to model and analyzelow power wireless links. They consider importantchannel and radio parameters such as the path lossexponent and shadowing variance of the channel;and the modulation and encoding of the radio.

Assuming non-return-to-zero (NRZ) encodingwhere 1 Baud = 1 bit and non-coherent frequencyshift keying (FSK) modulation scheme for the radio

1 2 3 4 5 6 7 8 9 100

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Distance to Sink (hops)

Successfu

l P

acket

Deliv

ery

Ratio o

f N

RT

Tra

ffic

Diff−MAC

Saxena et al. MAC

Figure 11: Effect of WFQ and TNHBP on the fair deliveryof NRT traffic

12

1 2 3 4 5 6 7 8 9 100

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Distance to Sink (hops)

Successfu

l P

acket

Deliv

ery

Ratio o

f B

E T

raff

ic

Diff−MAC

Saxena et al. MAC

Figure 12: Effect of WFQ and TNHBP on the fair deliveryof BE traffic

model similar to MICA2 motes, probability of suc-cessfully receiving a packet (PSR) p(d) at a distanced is:

p(d) = (1− 1

2exp−

SNR(d)2

10.64 )8f (1)

Where f is the packet size in bytes. By this way,a wireless link can be classified by three distinctreception regions: connected, transitional, and dis-connected. In the connected region, mostly perfectpacket reception occurs while in the disconnectedregion, mostly zero packet reception occurs. Tran-sitional region is an intermediate region betweenthe connected and the disconnected regions, andrepresents unreliable links.However, integrating the calculation-intense re-

alistic link model to the simulation tool results invery long execution times. Therefore, we used thismodel only in the hop-based performance evalua-tion of Diff-MAC in which the effect of the linklayer comes into prominence.Fig. 13 and Fig. 14 are obtained by integrating

the realistic link layer model. Integration of the linklayer model decreases the successful packet deliv-ery ratio of the NRT and BE traffic unsurprisingly.However, Diff-MAC still manages to be fair amongthe sensor nodes by utilizing WFQ and TNHBPrelative to Saxena et al. MAC which performs verypoor for distant sensor nodes. Moreover, Fig. 13and Fig. 14 reveals the necessity for a reliable rout-ing protocol which takes the link layer issues intoconsideration since GPSR tries to relay the packetsto the closest one to the sink among its neighbor-ing sensor nodes. Hence, GPSR chooses the farther

1 2 3 4 5 6 7 8 9 100

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Distance to Sink (hops)

Successfu

l P

acket

Deliv

ery

Ratio o

f N

RT

Tra

ffic

Diff−MAC

Saxena et al. MAC

Figure 13: Effect of WFQ and TNHBP on the fair deliveryof NRT traffic with realistic link layer model

1 2 3 4 5 6 7 8 9 100

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Distance to Sink (hops)

Successfu

l P

acket

Deliv

ery

Ratio o

f B

E T

raff

ic

Diff−MAC

Saxena et al. MAC

Figure 14: Effect of WFQ and TNHBP on the fair deliveryof BE traffic with realistic link layer model

neighbor node without considering the channel con-ditions and radio capabilities to deliver the packetto its destination as fast as possible.

5. Implementation and Experimentation ofDiff-MAC on Imote2 Platform

5.1. Imote2 Platform

Diff-MAC is implemented on Crossbow Imote2platform [11]. The platform has the typical char-acteristics of a sensor node: a 320/416/520MHzPXA271 XScale processor with 256kB SRAM,32MB Flash, 32MB on-board SDRAM. The pro-cessor can operate in a low voltage (0.85V) and a

13

low frequency (13 MHz) mode, hence enabling lowpower operation. The processor integrates manyI/O options making it extremely flexible in sup-porting different sensors, A/Ds, radio options, etc.These I/O options include I2C, 3 Synchronous Se-rial Ports one of which dedicated to the radio, 3high speed UARTs, GPIOs, SDIO, USB client andhost, AC97 and I2S audio codec interfaces, fast in-frared port, PWM, Camera Interface and a highspeed bus (Mobile Scalable Link). The processoralso adds many timers and a real time clock.

The sensor platform is equipped with a Zigbee(IEEE 802.15.4) compatible Chipcon CC2420 [35]radio transceiver. The CC2420 supports a 250kb/sdata rate with 16 channels in the 2.4GHz band. TheImote2 platform integrates a 2.4GHz surface mountantenna which provides a nominal range of about30 meters. The platform has tri-color status LED;power LED; battery charger LED, console LED asthe indicators.

5.2. Implementation of Diff-MAC

Diff-MAC is implemented on the Imote2 platformusing Microsoft .NET Micro Framework using theC# as a programming language. Two namespacesare implemented, one serves as a base station andthe other is for the wireless node. We also have twoversions of the code for the wireless node. The firstone is using the fixed DC and fixed CW, and theother one has adaptive CW and DC which behavesaccording to the rules of the Diff-MAC protocol forcomparison purposes.

The base station code permanently listens to themedium trying to hear any packets that are sent tothe base station. It listens for the RTS packets first,if one arrives and the medium is available it sendsback the CTS, and waits for the data packet. Whenconnected to the computer via a USB interface, itcan show the list and details of the received pack-ets. The base station code collects statistic every 5seconds: number of processed packets, their types,number of failures, number of attempts to trans-mit, number of dropped packets, and latency. Thewireless node code generates packets and transmitsthose over the wireless medium to the base station.

5.3. Experimental Evaluation

In our experiments we worked with the non dif-ferentiated MAC and Diff-MAC:

Figure 15: Latency of RT and NRT packets

• Non differentiated: CSMA/CA with Fixedduty-cycle, fixed contention window, no mes-sage passing

• Diff-MAC: Diff-MAC with adaptive duty-cycle, adaptive contention window with mes-sage passing

BE traffic is generated periodically, whereas NRTand RT packets are generated probabilistically emu-lating an event-based scenario. We collected statis-tics both on packet latency and packet drop rate.As mentioned in the previous section, one nodeacted as a sender whereas another node was con-figured as a basestation.

Fig. 15 shows an example set of results whereBE packet generation rate is set to 50ms and RTand NRT packet arrival probability is set to 0.7.Duty cycle for the fixed medium access schemeis 50% and the maximum CW size is given as 8for RT and NRT, whereas it is set to 30 for BEtraffic. The x-axis shows the experiment numberand the y-axis shows the latency in ms. Com-pared to a static medium access scheme (shownas static CSMA/CA) in the graphs), Diff-MACachieves much lower latency for RT and NRT traf-fic by using an adaptive duty cycling and CW size

Figure 16: Latency of BE packets

14

Figure 17: Number of Failed RT and NRT packets

adaptation. Fig. 16 shows the same set of exper-iments but for the latency of BE traffic. The dif-ference between fixed medium access and dynamicDiff-MAC is more drastically visible. Since fixedmedium access (CSMA/CA) does not differentiatethe medium access between different traffic classes,BE traffic suffers from high latencies. On the otherhand, Diff-MAC provides fairness among all traffictypes by minimizing the maximum of the packetlatencies and tries to deliver the load evenly by in-tegrating intra-node and intra-queue prioritizationmechanisms.

Fig. 17 shows the number of failed, i.e., dropped,RT and NRT packets. All the parameters were thesame as in the above scenario (Fixed: 50% dutycycle, etc.). Since there was only one source node,there was no contention on the wireless medium butpacket failures were due to buffer overflows. They-axis shows the number of failed packets and thex-axis shows the experiment number. Diff-MAC de-livers all the packets except in the first experimentwhereas fixed CSMA/CA drops 6 packets on the av-erage for different experiments. Fig. 18 shows the

Figure 18: Number of Failed BE packets

number of failed BE packets. Compared to the RTand NRT traffic, packet failures are much higher,however, Diff-MAC still achieves a much lower fail-ure rate than the fixed medium access.

6. Conclusion and Future Work

We introduced Diff-MAC, a new QoS-aware andhybrid-priority based MAC protocol for heteroge-neous WMSNs that utilizes methods introduced bymany previous studies in the literature and providesa fair all-in-one QoS-aware MAC protocol. Besidesthe introduction of Diff-MAC a detailed evalua-tion on existing QoS-aware MAC protocols in theliterature is provided. Diff-MAC coordinates themedium access of each traffic class by using effectiveservice differentiation mechanisms. Fragmentationand message passing feature of Diff-MAC reducesthe retransmission cost and CW size adaptationmechanism tries to balance both energy consump-tion and delay. Moreover, dynamic DC mechanismprevents unnecessary idle waiting and early sleepingwhile integration of intra-queue and intra-node pri-oritization provides fair delivery of the data amongall sensor nodes and among all traffic classes respec-tively to avoid intolerable performances. Results ofextensive simulation runs based on a typical exam-ple WMSN application scenario showed that Diff-MAC outperforms both Saxena et al. MAC andSMAC by achieving higher throughput and lowerlatencies with reasonable energy consumption. Theimplementation of Diff-MAC on Imote2 platformshows that resource requirements of the protocolin terms of memory and processing can easily bemet on a typical resource-constrained sensor hard-ware and show the efficiency of our proposal overthe default, non-adaptive MAC protocol availableon sensor devices.

As a future work, we will test the protocol ona larger network of devices and a mechanism forsleep-listen synchronization between neighboringnodes will be implemented to reduce packet laten-cies at the cost of control overhead. Also, perfor-mance of the QoS support might be improved byutilizing more decision parameters for packet prior-itization like remaining energy or buffer load andby exploring cross-layer solutions.

7. Acknowledgments

This work is partially supported by the Scientificand Technological Council of Turkey (TUBITAK)

15

under the grant number 108E207, by the Turk-ish State Planning Organization (DPT) under theTAM Project, number 2007K120610, and by theEuropean Community’s Seventh Framework Pro-gramme (FP7-ENV-2009-1) under the grant agree-ment FP7-ENV- 244088 “FIRESENSE”. We alsothank Andrei Ilin for his valuable efforts on the im-plementation of Diff-MAC.

References

[1] I. Akyildiz, T. Melodia, K. Chowdhury, A survey onwireless multimedia sensor networks, Computer Net-works 51 (4) (2007) 921–960.

[2] S. Soro, W. Heinzelman, A survey of visual sensor net-works, Advances in Multimedia 2009 (2009) 1–22.

[3] Terms and definitions related to the quality of telecom-munication services, International TelecommunicationUnion (ITU) Recommendation E.800 (09/08), 2008.

[4] D. Chen, P. K. Varshney, Qos support in wireless sensornetworks: A survey, in: Proc. of the 2004 InternationalConference on Wireless Networks (ICWN 2004), LasVegas, Nevada, USA, 2004.

[5] K. Nguyen, T. Nguyen, C. K. Chaing, M. Motani, A pri-oritized mac protocol for multihop, event-driven wire-less sensor networks, in: Communications and Electron-ics, 2006. ICCE ’06. First International Conference on,2006, pp. 47–52.

[6] Y. Liu, I. Elhanany, H. Qi, An energy-efficient qos-aware media access control protocol for wireless sensornetworks, in: IEEE International Conference on MobileAdhoc and Sensor Systems, 2005, pp. 3 pp. –191.

[7] K. J. Paek, J. Kim, U. S. Song, C. S. Hwang, Priority-based medium access control protocol for providing qosin wireless sensor networks, IEICE Transactions on In-formation and Systems E90-D (9) (2007) 1448–1451.doi:10.1093/ietisy/e90-d.9.1448.

[8] N. Saxena, A. Roy, J. Shin, Dynamic duty cycle andadaptive contention window based qos-mac protocol forwireless multimedia sensor networks, Computer Net-works 52 (13) (2008) 2532–2542.

[9] Z. Liu, I. Elhanany, Rl-mac: A qos-aware reinforce-ment learning based mac protocol for wireless sensornetworks, in: Networking, Sensing and Control, 2006.ICNSC ’06. Proceedings of the 2006 IEEE InternationalConference on, 2006, pp. 768–773.

[10] W. Ye, J. Heidemann, D. Estrin, Medium access con-trol with coordinated adaptive sleeping for wireless sen-sor networks, Networking, IEEE/ACM Transactions on12 (3) (2004) 493–506.

[11] Crossbow imote2.builder (2010).URL http://www.xbow.jp/Imote2.Builder kit.pdf

[12] R. Braden, D. Clark, S. Shenker, Integrated services inthe internet architecture - an overview, IETF RFC 1663(June 1994).

[13] S. Blake, D. Black, M. Carlson, E. Davies, Z. Wang,W. Weiss, An architecture for differentiated services,IETF RFC 2475 (December 1998).

[14] P. K. Wasan Pattara-atikom, S. Banerjee, Distributedmechanisms for quality of service in wireless lans, Wire-less Communications, IEEE 10 (3) (2003) 26–34.

[15] S. Bhatnagar, B. Deb, B. Nath, Service differentiationin sensor networks, in: In Proc. of Wireless PersonalMultimedia Communications, 2001.

[16] T. B. Reddy, I. Karthigeyan, B. S. Manoj, Murthy,Quality of service provisioning in ad hoc wireless net-works: a survey of issues and solutions, Ad Hoc Net-works 4 (1) (2006) 83–124.

[17] J. L. Sobrinho, A. S. Krishnakumar, Quality-of-servicein ad hoc carrier sense multiple access wireless networks,Selected Areas in Communications, IEEE Journal on17 (8) (1999) 1353–1368.

[18] I. Demirkol, C. Ersoy, F. Alagoz, Mac protocols forwireless sensor networks: a survey, CommunicationsMagazine, IEEE 44 (4) (2006) 115–121.

[19] C. Lu, B. Blum, T. Abdelzaher, J. Stankovic, T. He,Rap: a real-time communication architecture for large-scale wireless sensor networks, in: Real-Time and Em-bedded Technology and Applications Symposium, 2002.Proceedings. Eighth IEEE, 2002, pp. 55 – 66.

[20] M. Caccamo, L. Y. Zhang, L. Sha, G. Buttazzo, An im-plicit prioritized access protocol for wireless sensor net-works, in: Real-Time Systems Symposium, 2002. RTSS2002. 23rd IEEE, 2003, pp. 39–48.

[21] G. Zhou, J. Lu, C.-Y. Wan, M. Yarvis, J. Stankovic,Bodyqos: Adaptive and radio-agnostic qos for bodysensor networks, in: INFOCOM 2008: The 27th Con-ference on Computer Communications, 2008, pp. 565–573.

[22] M. Yigitel, O. D. Incel, C. Ersoy, Qos-aware mac protocols for wireless sensor net-works: A survey, Computer Networks, Elsevier-doi:http://dx.doi.org/10.1016/j.comnet.2011.02.007.

[23] S. Tilak, N. B. Abu-Ghazaleh, W. Heinzelman, A tax-onomy of wireless micro-sensor network models, SIG-MOBILE Mobile Computing and Communications Re-view 6 (2) (2002) 28–36.

[24] H. B. K. Jamieson, Y. Tay, Sift: a mac protocol forevent-driven wireless sensor networks, in: Third Euro-pean Workshop on Wireless Sensor Networks (EWSN2006), Vol. 3868, Zurich, Switzerland, 2006, pp. 260–275.

[25] H. Kim, S.-G. Min, Priority-based qos mac protocolfor wireless sensor networks, in: IPDPS ’09: Proceed-ings of the 2009 IEEE International Symposium on Par-allel&Distributed Processing, IEEE Computer Society,Washington, DC, USA, 2009, pp. 1–8.

[26] I. Rhee, A. C. Warrier, L. Xu, Randomized din-ing philosophers to tdma scheduling in wireless sensornetworks, Tech. rep., Computer Science Department,North Carolina State University, Raleigh, NC (2004).

[27] A. Demers, S. Keshav, S. Shenker, Analysis and simu-lation of a fair queueing algorithm, in: SIGCOMM ’89:Symposium proceedings on Communications architec-tures & protocols, ACM, New York, NY, USA, 1989,pp. 1–12.

[28] A. Firoze, L. Ju, L. Kwong, Pr-mac a priority reser-vation mac protocol for wireless sensor networks, in:Proceedings of ICEE ’07: International Conference onElectrical Engineering, 2007, pp. 1–6.

[29] S. Yoon, C. Qiao, R. S. Sudhaakar, J. Li, T. Talty, Qo-mor: A qos-aware mac protocol using optimal retrans-mission for wireless intra-vehicular sensor networks, in:Mobile Networking for Vehicular Environments, 2007,pp. 121–126.

[30] B. Yahya, J. Ben-Othman, Energy efficient and qos

16

aware medium access control for wireless sensor net-works, Concurrency and Computation: Practice andExperience 22 (10) (2010) 1252–1266.

[31] I. Demirkol, C. Ersoy, Energy and delay optimized con-tention for wireless sensor networks, Computer Net-works 53 (12) (2009) 2106–2119.

[32] I. Demirkol, F. Alagoz, H. Delic, C. Ersoy, Wirelesssensor networks for intrusion detection: packet trafficmodeling, Communications Letters, IEEE 10 (1) (2006)22–24.

[33] B. Karp, H. T. Kung, Gpsr: greedy perimeter statelessrouting for wireless networks, in: MobiCom ’00: Pro-ceedings of the 6th annual international conference onMobile computing and networking, ACM, New York,NY, USA, 2000, pp. 243–254.

[34] M. Zuniga, B. Krishnamachari, Analyzing the tran-sitional region in low power wireless links, in:SECON’ 04: First Annual IEEE CommunicationsSociety Conference on Sensor and Ad Hoc Com-munications and Networks, 2004, pp. 517 – 526.doi:10.1109/SAHCN.2004.1381954.

[35] Cc2420 single-chip 2.4 ghz ieee 802.15.4 com-pliant and zigbee(tm) ready rf transceiver,http://www.ti.com/lit/gpn/cc2420.

17