• No results found

[Phi]-MAC : an energy-aware multi-phase MAC protocol for wireless sensor networks

N/A
N/A
Protected

Academic year: 2021

Share "[Phi]-MAC : an energy-aware multi-phase MAC protocol for wireless sensor networks"

Copied!
89
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

@-MAC:

An Energy-Aware Multi-Phase MAC Protocol for Wireless

Sensor Networks

Abdul-Elah Sanad AL-Sanad

B.Eng, King Fahd University of Petroleum and Minerals (KFUPM), 2002

A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree of

in the Department of Electrical and Computer Engineering

(@ Abdul-Elah Sanad AL-Sanad, 2005 University of Victoria

All rights resewed. This thesis may not be reproduced in whole or in part by photocopy or other means, without the permission of the author:

(2)

Supervisor: Dr. Fayez Gebali

ABSTRACT

Wireless sensor networks can enable numerous advanced monitoring and control ap- plications. They are characterized by a need to maximize their efficiency, especially with respect to energy consumption, since the lifetime of a sensor node has a huge impact on the usability of a wireless sensor network. In this thesis, an energy efficient MAC protocol for wireless sensor networks is proposed. The protocol is based on IEEE 802.11, with some modifications to accommodate power efficiency and scalability which are the two main design factors for wireless sensor networks. The proposed Multi-Phase MAC (@-MAC) protocol uses periodic listen and sleep modes to save energy. Sensor nodes in @-MAC pro- tocol are allocated into different phases so that the listen periods of the different phases are non-overlapping. Distributing the nodes among the phases allows the nodes to sleep longer and conserve battery power. This distribution also effectively reduces the traffic seen by the nodes in each phase, which reduces the probability of collisions and retransmissions. The results of the numerical simulations show that @-MAC outperforms other proposed MAC protocols in its efficiency of consuming power.

(3)

Table of Contents

Abstract Table of Contents List of Tables List of Figures List of Abbreviations Acknowledgement iv vii viii X xi Dedication xii 1 Introduction 1

1.1 Wireless Sensor Networks ,

. .

. .

. . .

.

. .

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

1

1.1.1 Typical applications of wireless sensor networks

.

.

. . . . . . . .

2

1.1.2 Typical architecture of wireless sensor node

. .

. .

.

.

.

.

. . . .

2

1.1.3 Architectures of wireless sensor networks

.

. . . .

.

.

. . . .

. .

.

4

1.1.4 Typical deployment environment

. . . . .

.

.

.

. .

.

.

.

. . . . .

4

1.1.5 Characteristics of wireless sensor networks

. .

.

.

.

.

.

.

.

.

.

. .

7

1.1.6 Energy consumption in the MAC protocols for wireless sensor networks .

. . .

.

. . .

.

. .

.

. . . . .

.

. . . .

.

. . .

8

1.2 Thesis Motivation

.

. . .

. .

.

.

.

.

. . .

.

. .

.

.

.

.

.

. . . . . . . . .

9

1.3 Thesis Contribution

. . .

.

.

.

. . .

.

. . . .

. . .

.

.

.

.

.

.

.

.

. . .

. 9

(4)

Table of Contents v

2 MAC Protocols for Wireless Sensor Networks 12

. . .

2.1 Overview of MAC Protocols designed for Wireless Sensor Networks 12

. . .

2.1.1 Types of MAC Protocols for Wireless Sensor Networks 13

. . .

2.2 Reservation-Based MAC Protocols 16

2.2.1 TRAMA

. . .

16

2.2.2 ER-MAC

. . .

16

. . .

2.3 Contention-Based MAC Protocols 17

. . .

2.3.1 IEEE802.11 17 2.3.2 Adaptive rate Control scheme with CSMA mechanism

. . .

18

2.3.3 S-MAC

. . .

18

2.3.4 T-MAC

. . .

20

2.3.5 SIFT

. . .

20

3 Proposed @-MAC Protocol 21 3.1 Energy consumption in a sensor node

. . .

21

3.2 Design overview of @-MAC

. . .

22

3.3 Design considerations

. . .

26

3.3.1 Design Procedure

. . .

27

3.3.2 Coherent and non-coherent traffic

. . .

30

3.3.3 Assignment of nodes to the phases

. . .

31

4 Numerical Simulations and Results 32 4.1 Simulation Environment

. . .

32

4.1.1 Model assumptions

. . .

32

4.2 Traffic Inter-arrival time Model

. . .

34

4.3 Traffic destination Model

. . .

38

4.4 Data Gathering

. . .

38

. . .

4.5 Numerical Simulation Code Validation 39

4.5.1

Assignment of access phases to nodes ( d i s t r i b u t e )

. . .

39

(5)

Table of Contents vi

4.5.2 Traffic generation ( g e n e r a t e - t r a f f i c )

. . .

39

4.5.3 MAC operations

. . .

40

4.5.4 Simple example for the non-coherent case

. . .

40

. . .

4.6 Protocol Performance 43

. . .

4.6.1 Overall energy consumption 44

. . .

4.6.2 Average packet delay 49

. . .

4.6.3 Probability of collision 49

. . .

4.6.4 Throughput 54 5 Conclusions and Future Work 55

. . .

5.1 Conclusions 55 5.2 Future work

. . .

56

Bibliography 58 Appendix A MATLAB Source Code 64

.

A 1 Main function (main.m)

. . .

64

A.2 MAC function (mac.m)

. . .

71

A.3 Distribute function (distribute.m)

. . .

78

(6)

List of Tables

2.1 Comparison between reservation-based and contention-based MAC proto- cols

. . .

15

. . .

2.2 Techniques to reduce energy consumption in S-MAC 19 3.1 Modes of operation in a radio transceiver

. . .

21

. . .

4.1 Model parameters 35

. . .

4.2 Model parameters used in the simple example 41

4.3 The phase number for each node in the network. after distributing them using the function dis t ribut e

. . .

42 4.4 Arrival times of packets

. . .

42

. . .

4.5 Node destination addresses of the packets generated by all nodes 43 4.6 The schedule that has the phases to which each node in the network belongs

(7)

List of Figures

. . .

1.1 Architecture of a typical wireless sensor node 3

. . .

1.2 Example of a real wireless sensor node 3

1.3 Flat architecture for wireless sensor network

. . .

5

1.4 Clustered architecture for wireless sensor network with four clusters

. . .

5

2.1 TDMA divides time into frames. and frames into time slots. for the nodes .

.

13 2.2 The periodic listen and sleep in S-MAC

. . .

18 3.1 Design overview of @MAC

. . .

23 3.2 Timing relations of sleep and listen schedules for S.MAC. T-MAC and the

proposed @-MAC protocols

.

Shaded area indicates periods of activity

. . . .

25 3.3 Network lifetime TN is divided into

Nf

frames

. . .

27 3.4 Timing parameters of @-MAC: phase duration t l . dead time between suc-

cessive phases t 2 . and frame duration t3

. . .

28

. . .

4.1 The network architecture assumed in this simulation 33

. . .

4.2 Biased exponential distribution with the two design parameters a and b 36 4.3 Total energy consumption per node for S-MAC and @-MAC with q5 = 3;

for the non-coherent case

. . .

45 4.4 Total energy consumption per node for S-MAC and @-MAC with q5 = 3;

for the coherent case

. . .

46 4.5 Energy consumption per node for @MAC in the non-coherent case. traffic

(8)

List of Figures ix

4.6 Energy consumption per node for @-MAC using the non-coherent case in logarithmic axis scale, traffic is fixed: X = 0.2 packetsls

.

.

. . . . . . .

48

4.7 Average delays for all packets sent for the three protocols: IEEE 802.1 1, S-MAC, and @MAC with q5 = 3; for the non-coherent case. .

. .

.

. . . .

.

50 4.8 Average delay for all packets sent for @-MAC in the non-coherent case,

traffic is fixed: X = 0.2 packetsls

.

.

.

. . . .

.

. . .

.

. . . . . . . . . .

.

5 1 4.9 Probability of collisions for @-MAC in the non-coherent case, traffic is

fixed: X = 0.2 packetsls

. . . . .

.

. . . . . . . . . .

.

. .

.

. .

52 4.10 Probability of collisions for @MAC in the non-coherent case, traffic is

fixed: X = 0.1 packetsls

. . . . . . . . .

.

. . . . . . . . .

.

. . . . . . . .

53 4.11 The buffer in the node has unlimited size

. . .

.

. .

.

. . . . . . . . . . . .

54

(9)

List

of

Abbreviations

CSMNCA ER-MAC IEEE MAC PDF QoS S-MAC TDMA T-MAC TRAMA

Carrier Sense Multiple Access with Collision Avoidance Energy and Rate based-Media Access Control

Institute of Electrical and Electronic Engineers Media Access Control

Probability Density Function Quality of Service

Sensor-Media Access Control Time-Division Multiple-Access Timeout-Media Access Control

(10)

Acknowledgement

Above all, all praise and thanks are due to Allah, for his compassion and mercy and for giving me the ability to complete this thesis.

In addition, I would like to give a special acknowledgement and thanks to my supervi- sor Professor Fayez Gebali for his continued excellent guidance, concern, endless support, and for his invaluable spiritual and academic advice during my research study. His wide knowledge and his logical way of thinking have been of great value for me. His under- standing, encouragement and personal guidance have provided a good basis for my thesis. His trust and scientific excitement inspired me throughout the completion of this thesis. His valuable feedback and corrections also contributed greatly to this thesis. I am very glad and proud to work with such great a scientist who has a deep vision, and more importantly, who is a kind person.

Additionally, I am deeply grateful to my research group's members: Khalid Khayyat, Mohamed Fayed, Abdelsalam Amer, Newaz Rafiq, and Esam Khan. I wish to express my deepest thanks to them for all of their help, support, interest and valuable hints.

However, there are those whose spiritual support is even more important. I would like to extend my sincere gratitude to my father, Sanad, my mother, Husah, and to all of my family members for their encouragement, support and prayers during my study in Canada. Furthermore, I would like to express my deeply, sincere, warm, hearty and lovely grat- itude to my wife, Maey. This achievement would not have been feasible without the sacri- fice, patience, understanding and encouragement of her all the time.

Also, the financial support provided by King Fahd University of Petroleum and Miner- als (KFUPM) which enabled me to complete this degree is gratefully acknowledged.

Finally, it is difficult to individually acknowledge everyone who has helped me to reach this point. Therefore, I would like to thank everyone who, knowingly or otherwise, has provided support, encouragement and assistance along the way.

(11)

Dedication

To my parent, Sannd and Husah, and my family.

(12)

Chapter 1

Introduction

1 . Wireless Sensor Networks

A wireless sensor network is a collection of a large number of sensor nodes that are de- ployed in an ad-hoc manner and communicate using a short-range radio channel. Wire- less sensor networks are designed and deployed with a specific application in mind since their efficiency is application dependent. Energy dissipation is critical in wireless sensor networks since node lifetime is limited by battery capacity. Communication is a major consumer of energy. Therefore, designing energy-efficient communication protocols is im- portant in wireless sensor networks.

This chapter gives an overview of wireless sensor networks in general such as their ap- plication areas, architecture, deployment, characteristics, and how they are different from normal wireless networks. It also explains how energy consumption can be reduced in wireless sensor networks by designing energy-aware MAC protocols. The sources of en- ergy consumption during the operation of MAC protocols are identified and explained. At the end of the chapter the motivations of this work and the contributions and organization of this thesis are described.

(13)

1.1 Wireless Sensor Networks 2

1.1.1 Typical applications of wireless sensor networks

There are a variety of possible applications for wireless sensor networks, such as environ- mental monitoring, traffic monitoring, security, and military applications. [I-51.

Recent advances in electronics and wireless network technologies have enabled the development of wireless sensor networks to be more feasible. In the near future, they might be used in shopping malls or parking garages to provide security; in homes to monitor and control home appliances; in factories to monitor and control products; and, in highways or traffic lights to monitor vehicle traffic [6]. For example, sensor nodes might be attached to taxi cabs to study traffic conditions and plan routes effectively [ 7 ] . There are also many possible applications in irrigation and agriculture

[$I.

1.1.2 vpical architecture of wireless sensor node

A wireless sensor node usually consists of the following components, as Figure 1.1 illus- trates:

0 Embedded microprocessor or microcontroller 0 Radio transceiver

Small memory 0 Small battery

Sensing hardware

The functions of these components are: computing, communication, and sensing where communication is the dominant part in energy consumption.

Figure 1.2 shows an example of a real wireless sensor node [65]. The size of a sensor node is usually smaller than one cubic centimeter and its weight is less than 100 grams.

(14)

1.1 Wireless Sensor Networks 3

Microprocessor

T

u4--P

Figure 1.1. Architecture of a typical wireless sensor node

(15)

1.1 Wireless Sensor Networks 4

1.1.3

Architectures of wireless sensor networks

The communication range that a single sensor node can cover is small because its radio signal is weak in order to reduce the transmission power to save energy consumption. This limitation affects the architecture of the network. Therefore, the architecture of wireless sensor networks can be classified into two basic types [2]:

Flat architecture Clustered architecture

Figure 1.3 shows the flat architecture for a wireless sensor network where there is only one base station and all the sensor nodes surround it. However, some nodes cannot communicate with the base station because of their limited radio signal range. Therefore, protocols that are designed for this type of network, especially those protocols that are in the network and data link layer, have to be capable of sending the data to the base station from any node by routing the data to its destination using other nodes. This type of network is called a multi-hop network where intermediate nodes are used as relays. Nodes in these networks transmit over short distances which reduces the transmission power.

On the other hand, Figure 1.4 shows the clustered architecture for a wireless sensor network with four clusters. A clustered architecture divides the nodes into separated clus- ters with each cluster having its own base station. The base stations are connected to the main station using either wired or wireless connections.

1.14 Qpical deployment environment

In order to design efficient wireless sensor networks, there are important design factors that should be kept in mind. The efficiency of designing protocols for wireless sensor networks depends on the application requirements and specifications. Some applications are real time where latency is an important design factor. However, most of the applications of wireless sensor networks to date are not as sensitive to delay as they are to power consumption [9].

(16)

1.1 Wireless Sensor Networks 5

Figure 1.3. Flat architecture for wireless sensor network.

(17)

1.1 Wireless Sensor Networks 6

Nevertheless, all of the following design factors play an essential role in the efficiency of wireless sensor networks [lo].

Power consumption The battery in the node can not be recharged or replaced because it is cheaper to discard the node than recharge the battery. Also, in most of the applica- tions, the lifetime of the sensor nodes must be in the order of months to years [I I]. Therefore, energy efficiency is the main design factor in wireless sensor networks. Scalability The range of the number of nodes in wireless sensor networks could be from

hundreds to thousands of nodes [7,11]. Therefore, wireless sensor networks should be scalable to accommodate such a number of sensors, especially if the sensor nodes are densely deployed since new nodes might join the networks at any time or they might die over time. Thus, adding or removing nodes from the network should not affect the functionality or the performance of the network. It should also be straight- forward to add or remove a node from the network.

Fault Toierance Fault tolerance is an important issue for wireless sensor networks, espe- cially if the environment of the networks is not reliable. The reliability of wireless sensor nodes is very low compared to normal wireless devices. Sensor nodes are very prone to failure because they might be physically damaged or run out of power [12]. Therefore, wireless sensor networks are usually densely deployed.

Topology In most of the applications of wireless sensor networks, the locations of the sensor nodes are not known or defined in advance, which makes their deployment random [I]. Therefore, the protocols designed for wireless sensor networks should be self-organizing. Moreover, the topology of wireless sensor networks change very frequently due to node failure and addition or replacement of nodes.

Operating Environment There are many applications of wireless sensor networks that could be run in different environments with different risks. For example, designing a wireless sensor network for an application that will be deployed in a forest will be different from another application that might be deployed in a factory [3].

(18)

1.1 Wireless Sensor Networks 7

Hardware Constraints Sensor nodes have limited resources, such as a simple

micro-

processor, small memory and limited battery capacity.

v p e of communication Sensor nodes mainly use broadcast communication [13].

1.1.5 Characteristics

of

wireless sensor networks

Wireless sensor networks and the behavior of their applications as well as the generated traffic characteristics are different from other traditional wireless networks [l 11. Therefore, existing protocols cannot be used for sensor networks since they have different design criteria. Sensor networks have to be power efficient and scalable, whereas throughput, latency and fairness are the main points in normal wireless networks that are designed for voice or data in order to provide high Quality of Service (QoS) [2,14].

Wireless sensor networks require low power consumption even at the cost of lower throughput and higher delay. A tradeoff can be made between power consumption and others constraints that are not important for wireless sensor networks such as throughput, delay and fairness. In fact, most applications of wireless sensor networks can tolerate some delay since network response time is typically orders of magnitude faster than the event that a sensor node might be detecting [15]. Moreover, fairness between the nodes to access the network is not important at all in sensor networks, as it is in other wireless networks that are designed for data or voice. In wireless sensor networks, all nodes cooperate for a single common task. Therefore, the performance of the application is more important than the individual node performance. It does not matter if one node has more data to send than other nodes and uses the channel for a long time [16].

(19)

1.1 Wireless Sensor Networks 8

1.1.6 Energy consumption in the

MAC

protocols for wireless sensor

networks

Energy consumption can be reduced dramatically by designing energy-aware communi- cation protocols in the data link layer and more specifically in the Media Access Control (MAC) layer protocols. MAC protocols are needed to control access to a shared medium by defining how and when nodes may access the medium. The energy consumption in MAC protocols mainly happens when the node is just listening and waiting for a packet to be sent. Traffic in wireless sensor networks is very low and is triggered by sensing events which would make it bursty [ l 11. Therefore, wireless sensor networks have a low message rate. Also, packets in wireless sensor networks are relatively short; it takes only about 5 ms to transmit a single packet. For example when the packets inter-arrival time is 5 s, i.e.,

they arrive every 5 seconds on average, then the nodes spend about 4.955 s waiting for a packet. Therefore, most of the time (about 99%) is wasted simply waiting for a packet to arrive. These features of sensor networks can be exploited to reduce energy consumption by introducing a listedsleep duty cycle [17]. This would save energy significantly since the radio port is the major source of energy consumption, and the best way to conserve energy is through the MAC protocol, because it controls the activity of the radio directly.

There are four main sources of energy consumption where energy might be wasted in the sensor node because of the operation of MAC protocols 1171. These sources of energy wastage are:

Idle listening Most of the energy is consumed when a node is in idle mode listening and waiting for messages to arrive.

Collision and retransmission When there is a collision, more energy will be consumed because the corrupted data has to be retransmitted.

Overhearing Most of the time, nodes are wasting energy by receiving packets that are not destined for them. Overhearing might consume a lot of energy in the node, especially if the traffic is heavy in the network.

(20)

1.2 Thesis Motivation 9

Control packet overhead The overhead of the control packets, such as synchronization, is another source of energy consumption.

All of these factors influence the design of MAC protocols in order to make it efficient in consuming energy. However, energy consumption can be reduced significantly by letting nodes in the network go to sleep when they are idle, because about 50-100% of energy is wasted when a node is idle [17]. Reference [l 11 shows that the ratio of power consumption of id1e:receiving:transmitting is 1 : 1.05: 1.4 and because the nodes are in an idle state for a long time, idle listening is an important factor in node power consumption.

Thesis Motivation

The previous sections indicate that energy consumption is the most important design factor for wireless sensor networks. Also, efficient MAC protocols have a great effect on the power consumption for wireless sensor networks as they affect the efficiency of controlling and exchanging data. Therefore, energy-aware MAC protocol is very critical in wireless sensor network in order to minimize energy consumption in communication and to extend the lifetime of the network.

1.3 Thesis Contribution

In this thesis, a new energy-efficient MAC protocol for wireless sensor networks is pro- posed. The protocol is called Multi-Phase MAC (@MAC). It was designed to reduce energy consumption which is a primary design factor in wireless sensor networks. @-MAC reduces energy consumption by reducing the idle listening time and also by reducing the probability of collision.

This thesis surveys MAC protocols used for wireless sensor networks. Important MAC protocols that are proposed in the literature and designed for wireless sensor networks to

(21)

1.4 Thesis Organization 10 reduce energy consumption are identified and explained in this thesis.

The main contributions of this thesis are:

New Protocol A new MAC protocol called @-MAC is designed for wireless sensor net- works with two main features: low duty cycle and low number of collisions. Sensor nodes in @-MAC have a very short listening time which would reduce the energy that is required to communicate with other nodes by switching off the radio port for as long as possible. Also, the probability of collision, where two or more nodes try to send at the same time, is very low in @-MAC. This will save the energy that is required to send the corrupted packets.

Design Procedure A design procedure is given in order to find the important parameters in @-MAC. For a given application with its specifications and requirements, an engineer can follow the steps in this procedure to find the important timing parameters and also the appropriate number of phases in @MAC .

Numerical simulation A numerical simulation was written in MATLAB to test the per- formance of @-MAC and compare it with other MAC protocols.

1.4 Thesis Organization

Chapter two discusses MAC Protocols for Wireless Sensor Networks. The two different types of MAC protocols for wireless sensor networks, i.e., reservation-based and contention- based, are described and compared. Moreover, various MAC protocols that are specifically designed for wireless sensor networks and have been proposed in the literature are given with brief explanations for some of them.

Chapter three explains the design overview of the proposed MAC protocol for wireless senors networks which is called Multi-Phase MAC (@-MAC). It also discusses some of the parameters of the proposed protocol.

(22)

1.4 Thesis Organization 11

ulation environment that was assumed, the traffic model that was used to generated the traffic for the simulation, and how the data and results were gathered. Then, it shows the performance results of @-MAC compared with others protocols like S-MAC 1171.

Chapter five gives a brief conclusion for this research, and any other work that might be conducted in the future to further improve @-MAC and expand it.

Appendix A lists the source code that has been written in MATLAB to do the numerical simulations for @-MAC. Three functions have been implemented and used in the main program. These functions are:

MAC function This function does all the operations of the MAC protocol that are either @-MAC with more than one phase or S-MAC with one phase. It takes as input the number of phases, listening time, and inter-anival time of the packets and produces as output all the statistics needed to plot the results.

Distribution function The inputs for this function are the number of nodes and phases, and the function then generates the phase to which the nodes belong to by distributing them uniformly to the phases at random.

Traffic generation function This function generates the inter-arrival time of packets based on a Poisson Distribution.

(23)

Chapter

2

MAC Protocols for Wireless Sensor

Networks

2.1 Overview of

MAC

Protocols designed for Wireless Sen-

sor Networks

MAC protocols play an essential role in determining the channel efficiency by resolving the contention between nodes to access a shared channel. This problem is known as the contention or multiple access problem. MAC protocols for wireless sensor networks must create a network infrastructure to establish communication links for data transfer among thousands of densely and randomly scattered sensors. All the features of wireless sensor networks described in the previous chapter emphasize the need for MAC protocols that are designed specifically for wireless sensor networks. An energy-aware MAC protocol for wireless sensor networks should maximize the probability of successful transmission of packets in the network by consuming the minimum required power in the nodes for transmission and receiving so that the overall lifetime of the nodes and the network can be maximized.

(24)

2.1 Overview of MAC Protocols designed for Wireless Sensor Networks 13

I

Frame 1

I

Frame 2

I

\ /

Time Slots Time

Figure 2.1. TDMA divides time into frames, and frames into time slots, for the nodes.

2.1.1

Types of

MAC

Protocols for Wireless Sensor Networks

MAC protocols can be classified into two types depending on the way the access is being controlled: reservation-based [18-221 and contention-based [15,17,23-271. Each of these access methods has its own advantages and disadvantages.

In reservation-based MAC protocols, the channel is reserved for the nodes for a certain amount of time. This could be done by dividing time into frames and each frame is also divided into slots for allocation to nodes in the network as shown in Figure 2.1. This technique is called Time Division Multiple-Access (TDMA).

Reservation-based MAC protocols are deterministic by using schedules and reservation to determine which node has access to the medium at any time. Reservation-based MAC protocols have many disadvantages that make them difficult to implement for wireless sen- sor networks [ I , 153. These disadvantages include:

Requires coordination Reservation-based MAC protocols need coordination to allocate and maintain the reservation slots. For example in TDMA, allocating time slots to the nodes requires frequent control and synchronization overhead. Also, network dynamics, such as node failure or migration, complicates the control tasks [24].

Exact timing is critical Synchronization is important in reservation-based MAC because the reservation slots are very small, which could cause a problem due to clock drift [25]. Therefore, strict global clock synchronization is critical in reservation-based

(25)

2.1 Overview of MAC Protocols designed for Wireless Sensor Networks 14

MAC protocols.

Not scalable Reservation-based MAC protocols are not scalable which is an important design requirement for sensor networks as more nodes could be added to the network, or the nodes might die over time due to failure or low battery. However, reservation- based MAC protocols have limited slots to accommodate all the nodes. For a given coverage area, there is a limit on the number of nodes that could be serviced for a given clock drift.

Reservation-based MAC protocols require a base station to control and coordinate the operation of the protocol. Therefore, reservation-based MAC protocols can only be de- ployed in the clustered architecture where all the nodes can only communicate with the base station as there is no peer-to-peer communication.

However, reservation-based MAC protocols are collision-free since each node is as- signed a specific slot that is reserved specifically for a node to use for communication. It is also easy to let nodes sleep in reservation-based MAC protocols when they do not need to use their slots, which results in a very low duty cycle because nodes are only required to wake up during their reserved slots for transmitting or receiving [ I 8,191. Also, when nodes turn off their radio port during reservation slots for others, they are not affected by others' traffic. Therefore, reservation-based MAC protocols reduce the energy consumption from most of the major sources of energy waste, i.e., idle listening, collision, and overhearing.

On the other hand, nodes in contention-based MAC protocols determine if they can access the medium by sensing the shared channel and competing to get access to it instead of defining schedules for access. Carrier Sense Multiple Access (CSMA) is the most com- monly used technique for this type of protocol. A node first senses the channel and if it is free, it transmits; otherwise it tries to access the channel later on. A collision occurs when two or more nodes try to access the medium at the same time. Nodes that suffer a collision employ a binary exponential back-off mechanism to minimize the probability of another collision..

(26)

2.1 Overview of MAC Protocols designed for Wireless Sensor Networks 15

Table 2.1. Comparison between reservation-based and contention-based MAC prc

I

I

I

Overhearing Attribute Idle listening Collision Low

I

High Reservation-based Small Free Contention-based Varies Possible

Peer-to-peer communication No

1

Yes

Control overhead Synchronization ocols. High Critical QoS support

carrier sense in wireless sensor networks is expensive and consumes a lot of energy. Re- ducing energy consumed by listening to the network channel is accomplished through con- trolling wakelsleep periods of the sensor nodes.

Table 2.1 compares some attributes of reservation-based and contention-based MAC protocols. It can be seen from the table that contention-based MAC protocols have some drawbacks in the attributes related to the sources of energy consumption, as contention- based protocols consume more power than reservation-based protocols. Therefore, many researchers are trying to define contention-based MAC protocols that overcome these sources of energy inefficiency.

Several researchers have proposed different MAC protocols for wireless sensor net- works that are either reservation-based [18-221 or contention-based [15,17,23-271.

Low Not critical

(27)

2.2 Reservation-Based MAC Protocols 16

2.2

Reservation-Based

MAC

Protocols

The following subsections give some examples of reservation-based MAC protocols that have been proposed in the literature for wireless sensor networks.

2.2.1 TRAMA

TRAMA (Traffic-adaptive medium access protocol) [22] is a reservation-based MAC pro- tocol that reduces energy consumption by being collision free and by making the nodes switch to sleep mode when they are idle. TRAMA uses a distributed election scheme based on information about the traffic at each node to determine which node can transmit at a particular time slot. The schedules in TRAMA are dynamic and adaptive based on current traffic patterns. Therefore, the schedules are influenced by the traffic information in order to make the protocol more adaptive to the application being used. It tries to avoid wasting slots when nodes do not have packets to send by not assigning them time slots, and also to switch nodes to sleep mode when they are not selected to transmit and they are not the intended receiver of traffic using real time traffic information.

Therefore, the main goal of TRAMA is to significantly save energy by reducing en- ergy consumption from two important sources: collision and idle listening. Thus, TRAMA tries to make no idle node an intended receiver and no receiver suffer collisions. The per- formance of TRAMA is comparable with contention-based MAC protocols such as IEEE 812.1 1 1231 and S-MAC [17] that will be discussed in the next section. Its results show that the energy saving of TRAMA is comparable with S-MAC.

2.2.2 ER-MAC

ER-MAC [20] is another reservation-based MAC protocol designed for wireless sensor networks that uses the TDMA technique. ER-MAC periodically switches nodes to sleep in order to save energy. However, unlike other protocols that treat all the nodes equally and try

(28)

2.3 Contention-Based MAC Protocols 17

to minimize energy consumption at a single given node, ER-MAC selects nodes to sleep based on their criticality, which is a measure of the lifetime of the node. The criticality of a sensor node is an attribute that is based on energy and traffic rates. For example, a node is defined as critical if it has more data to send than other nodes. Then, this node is critical and is assigned more time slots to send its data packets. Also, if a node has lower battery life than other nodes, then this node is critical and will be assigned more time to sleep. Making weaker nodes that are critical sleep longer balances energy consumption and also increases the efficiency of the protocol. Therefore, the duty cycle is based on the criticality of the nodes. A distributed algorithm is used to find the critical nodes. Then, these nodes are assigned appropriate time slots for transmitting or receiving. Those nodes that are not critical are assigned fewer time slots. Simulation results show that ER-MAC has good performance especially when the traffic load is high.

2.3

Contention-Based

MAC

Protocols

The following subsections explain some of the contention-based MAC protocols that are used for wireless sensor networks.

2.3.1

IEEE 802.11

The IEEE 802.1 1 [23] is an international standard of physical and MAC layer specifications for wireless networks. It uses CSMAICA (Carrier Sense Multiple Access with Collision Avoidance). It is a simple and reliable MAC protocol that is widely used in many tradi- tional ad hoc wireless networks. However, it is not suitable for sensor networks because throughput, latency, and fairness were the primary design criteria, not power consumption. However, because of its simplicity and reliability, many researchers are trying to modify and develop the IEEE 802.1 1 so that it is applicable for wireless sensor networks.

(29)

2.3 Contention-Based MAC Protocols 18

Figure 2.2. The periodic listen and sleep in S-MAC

One Frame

*

c:

2.3.2 Adaptive rate Control scheme with CSMA mechanism

Reference [15] has done various experiments to study the efficiency of CSMA by analyzing the following parameters:

Using random delay before transmission Constant or random listening time

0 Fixed or exponential window back-off mechanisms

Simulations of the proposed MAC protocol in [15] show that using random delay before transmission and random listening time would give the best performance regardless of the mechanism that is used for back-off.

Sleep Active

2.3.3 S-MAC

Time

S-MAC [17,26] is a contention-based approach that modified the JEEE 802.11 standard to be suitable for sensor networks. As shown in Figure 2.2, S-MAC divides time into frames and each frame is divided into active and sleep periods. The ratio of the active period to the frame length is called the duty cycle. Communication occurs only in the active period. Packets that are generated during the sleep period are buffered for the next frame cycle. This increases the latency because the sender has to wait for the active period.

Synchronization in S-MAC is not critical because clock drift is typically much smaller

than the active period. For example, if the frame period is

1

s

and the duty cycle is 30%,

(30)

2.3 Contention-Based MAC Protocols 19

Table 2.2. Techniques to reduce energy consumption in S-MAC.

then the active period duration is 300 ms, which is much longer than a typical clock drift of 0.5 ms.

S-MAC tries to reduce energy consumption from all of the sources of energy consump- tion identified in the previous chapter. Table 2.2 summarizes the techniques that S-MAC uses as a modification to IEEE 802.11 to be suitable for wireless sensor networks.

In S-MAC, nodes try to form one cluster by following the same listedsleep schedule, i.e., by listening and sleeping at the same time, so that broadcasts need only be transmitted once and also the number of control packets are decreased. Therefore, S-MAC eliminates clustering to reduce inter-cluster communication and interference, but at the expense of making the listening period longer.

When a new node in S-MAC joins the network, it first waits for a certain amount of time to get a schedule from another node and then follows that schedule. If it does not hear any schedule, it chooses its own and broadcasts it to the other nodes. After that, all nodes broadcast their schedules periodically using the control packets SYNC which have the time of the next frame cycle. Using this scheme a node can easily join the network.

The duty cycle in S-MAC is fixed and predefined depending on the application require- ments, such as latency and buffer limitation. Therefore, many nodes might be idle during their listen periods which can lead to a large wastage of energy. Consequently, this is not an optimal solution to minimize the idle listening time because traffic in sensor networks

Source of energy wastage Idle listening

Collision Overhearing Control overhead

Technique employed to reduce energy consumption Switch off radio (low duty cycle)

Collision avoidance as in IEEE 802.11 Switch off nodes when others are communicating

(31)

2.3 Contention-Based MAC Protocols 20

varies.

2.3.4

T-MAC

As was discussed above, many nodes in S-MAC are in active mode while not participating in the exchange of data. T-MAC [25] was proposed to address this problem. It is another contention-based MAC protocol that has an adaptive duty cycle, as opposed to S-MAC which is static based on a predefined duty cycle. Nodes in T-MAC go to sleep when they sense the channel is idle for a certain amount of time. Therefore, the duty cycle is variable based on the traffic level. When there are no events taking place for a predefined time period, the nodes switch to sleep mode. Simulations of T-MAC show that when the traffic is high, T-MAC outperforms S-MAC in consuming energy by having a lower duty cycle.

2.3.5

SIFT

SIFT [27] is another medium access protocol for wireless sensor networks that makes use of the event-driven nature of sensor networks for MAC protocol design. Usually in sensor networks, more than one node that are close to each other sense the same event and they need to transmit the same data. However, it is enough if some of the nodes that observe the same event report it. As a result, the number of sensor nodes that contend to get access to the channel can be reduced. Unlike other contention-based MAC protocols, SIFT does not use a varying contention window where a node picks a transmission slot randomly. In- stead, SIFT uses a fixed size contention window with a carefully chosen and non-uniform probability distribution of transmission in each slot within the window to reduce the la- tency for reporting the event. Therefore, SIFT results in good performance for latency and throughput, and also in energy consumption.

(32)

Chapter 3

Proposed @MAC Protocol

3.1

Energy consumption in

a

sensor node

As wireless sensor networks are expected to operate for a long time without external inter- vention and with limited power in the sensor nodes, energy consumption is critical in these types of networks. The radio transceiver in a sensor node is the primary consumer of en- ergy compared to other node components such as the microprocessor or the sensing device. The radio can operate in four different modes of operation as Table 3.1 illustrates [15].

The first three modes, i.e., transmit, receive and listen, require almost the same amount of power [15]. Therefore, turning off the power of the radio port when it is idle listening could save a large amount of energy.

Table 3.1. Modes of operation in a radio transceivel:

I

Transmit

//

A node is in transmit mode when its radio is transmitting packets

I

"

-

Mode

(

Listen

I(

A node in listen mode when its radio is sensing the channel and waiting for packets

I

Comment

Receive

A node is in sleep mode when its radio is switched off

I

(33)

3.2 Design overview of @-MAC 22

The performance of the MAC layer determines the efficiency of energy consumption in the sensor nodes since it decides when and for how long to switch the radio off or on. As stated in the previous chapter, energy is consumed in the operation of the MAC protocol from four sources: idle listening, collisions, overhearing and control overhead. However, idle listening and collisions are the main sources of energy inefficiency that can be minimized.

A MAC protocol can reduce energy consumption by:

(a) Controlling the modes of operations of the sensor node, as in S-MAC.

(b) Controlling collisions through employing CAMA and back-off techniques.

( c ) Controlling access requests by introducing random wait, as in IEEE 802.1 1.

3.2

Design overview of

@MAC

A Multi-Phase MAC protocol (@-MAC) is proposed as a technique to reduce node power consumption beyond that achieved by S-MAC and T-MAC. @-MAC is a distributed contention- based MAC protocol where nodes discover their neighbors based on their radio signal level. @-MAC is a self-organizing MAC protocol that does not require a central node to control the operation of the nodes.

As Figure 3.1 shows, time in @MAC is divided into frames and each frame is divided into two periods: listen and sleep. The listen period is also divided into

4

non-overlapping phases. Nodes are distributed among this set of phases where nodes in each phase follow a listenhleep schedule that is skewed in time compared to the schedules of the other phases. Therefore, the listen periods of the nodes in different phases are non-overlapping. A node in @-MAC protocol wakes up only at its assigned phase. Therefore, @-MAC requires a lesser amount of energy than S-MAC because the the listen period of a node in @-MAC is shorter than the listen period of the frame in S-MAC.

(34)

3.2 Design overview of @MAC 23 Frame

Cime

Phase 1 Phase 2 Phase cp

-

1

(35)

3.2 Design overview of @-MAC 24

1. Reduced energy consumption. The listen period for the nodes in each phase is re- duced in proportion to the number of phases employed. Therefore, energy loss during listen periods in @-MAC is reduced compared to S-MAC protocol.

2. Low average traffic. The number of nodes associated with a phase in @-MAC is a fraction of the total nodes in the network. This results in less average traffic and a reduced chance of collisions. Therefore, the probability of collision in @-MAC is reduced, which saves the energy required for retransmitting the collided packets and also the associated control packets.

3. Extended network lifetime. By reducing the energy consumption in the nodes, the lifetime of the nodes and the network are increased.

Figure 3.2 compares the listen and sleep schedules of S-MAC [17] and T-MAC [25] with the proposed Q-MAC protocol. The shaded areas show periods of activity. The figure shows a @-MAC with three phases; the sleep time is much longer in comparison with the other two protocols.

Making the listening period shorter increases the probability that a node generates a packet while it is in the sleep mode. Those packets are buffered for transmission during an upcoming listen period. This results in a longer packet delay. However, since delay is not a primary design factor, this effect is acceptable in most sensor network applications [15].

In @-MAC, any packet needing to be sent is initially assigned a reservation slot between 0 and 7 as in the IEEE 802.1 1 Distributed Control Function (DCF) implementation. If there is a collision, then the collided packets are assigned another reservation slot but this time the number of reservation slots is doubled from 8 to 16. To minimize the number of collisions, the number of reservation slots is doubled each time a collision occurs up to the 8th retransmission which would increase the number of reservation slots to 256. This is called binary exponential back-off.

Upon deployment, all the nodes are allocated schedules randomly. When a new node joins the network later, it chooses a schedule randomly and broadcasts its schedule to other nodes.

(36)

3.2 Design overview of @-MAC 25 One Frame S-MAC e I

'

! I I

:

I

Figure 3.2. Timing relations of sleep and listen schedules for S-MAC, T-MAC and the proposed @-MAC protocols. Shaded area indicates periods of activity.

I I I I I I I I I I I I with S-MAC I I I T-MAC I I I I I I I I I I I I I I I I I I I I I I I I I i -, Phase 2; , * ! I I I I I Time L - I I I I I

(37)

3.3 Design considerations 26

In order for any node in the network to be aware of the listening time of other nodes in different phases, each node maintains a schedule table to store the schedules of all other nodes. As in S-MAC [26], nodes broadcast their schedules to other nodes using a control packet called SYNC. Also, to prevent clock drift, nodes update their schedules by periodi- cally exchanging the control packet SYNC. This control packet is very short and it has the node number and the number of its access phase with the time of its next listen period.

3.3

Design considerations

The following subsection discusses the main design parameters that need to be carefully studied and analyzed because they can affect the performance of @-MAC. A network ap- plication has the following design specifications as shown in Figure 3.3:

n: Total number of nodes in the network.

A: Average packet rate per node. T N : Network lifetime.

TR: Maximum response time delay.

T ~ : Packet transmission delay.

rp: Propagation delay. ~ d : Clock drift delay.

C:

Battery capacity.

P:

Average node power consumption.

In addition, as shown in Figure 3.4, the design parameters of @-MAC include the following:

(6: Number of access phases.

(38)

3.3 Design considerations 27

Network lifetime

TN

<

1

Figure 3.3. Network lifetime TN is divided into

Nf

frames

Frame 1 Frame 2 Frame 3 Frame N,

T/+

0

Nf

: Number of frames. 0 tl : Phase duration.

t 2 : Dead time between phases. C ,

3.3.1

Design Procedure

...

The values of the design parameters of @-MAC listed above can be obtained by following the design procedure described below for a given application with its design specifications and requirements.

t 1

Step 1 (Calculating the frame duration

Tf)

For a given maximum response time delay TR that is governed by the time to respond to and report events, the frame duration

Tf

is bounded from above by:

Tf

5

TR

(39)

3.3 Design considerations 28

I

One Frame I

k I

I d

Figure 3.4. Timing parameters of @-MAC: phase duration tl, dead time between succes- sive phases

tz,

and frame duration

t3.

I I Listen I I

4

* Sleep

ir?,

I I

9

Phase 0

-

I I I I

I

I : Time C t 2 I I b I Phase 1 : I

-

I I I I I : Time I I

f I

I Phase : I cp-1 . -1 I I I

i

Time I I I I I I

(40)

3.3 Design considerations 29

where tl can be found from step 2.

Thus, the number of frames

Nf

is also bounded by:

Step 2 (Calculating the phase duration

t l )

The duration of the listening period for one phase tl is governed by the battery capacity C and the average node power consump- tion P:

where V is the average output voltage of the battery. Thus, tl is bounded from above by:

Also, tl is bounded from below by the time needed to send at least one packet which is given by the following equation:

where rt is the packet transmission delay, rP is the propagation delay, rd is the clock drift delay, and W is the maximum number of reservation slots which is called the window size.

Thus,

tl

is bounded by:

Step 3 (Estimating the number of phases

4)

The number of phases

4

is based on the av- erage traffic generated per frame in each phase which is given by the following equa- tion:

(41)

3.3 Design considerations 30

Xa,, = n x X x

Tf

(3.8)

Then, the total active time should be greater than the time needed to send all the packet generated by the nodes:

Thus,

4

is bounded from below by:

Moreover, the dead time between phases t2 is governed by the inequality:

Therefore, the upper limit in

4

is:

4(tl

+

t 2 ) L T,

Thus,

4

has the following design bounds:

Other specifications and requirements in the application, such as delay limitations and buffer size in the node, can be used to determine the values of these timing parameters and to specify how many phases should be deployed to get the best performance.

3.3.2 Coherent and non-coherent traffic

The type of traffic in @MAC can affect the performance of the protocol. If all the traffic emanating from a node is destined to other nodes in the same phase, i.e., the source and destination are in the same access phase, then nodes do not have to wake up at different

(42)

3.3 Design considerations 31

phases. This case is called the coherent traffic. However, if a node can send to any other nodes in a different access phase, which is called non-coherent traffic, then nodes might wake up at different phases if they have packets destined to nodes in other phases.

3.3.3 Assignment of nodes to the phases

Sensor nodes in @-MAC are divided among the phases. However, there are no character- istics or restrictions on the distribution of the nodes to the phases. Upon deployment, each node will choose a phase randomly using the uniform random distribution.

In the non-coherent traffic case, if nodes can migrate between the phases to further balance the traffic for the whole network, then the energy consumption will be reduced because nodes will not have to wake up at extra phases. However, this is an optional feature of @-MAC that has not been explored here.

(43)

Chapter 4

Numerical Simulations and Results

4.1 Simulation Environment

The performance of @-MAC is simulated using MATLAB version 6.5 on a PC machine to compare the results with other MAC protocols that have been proposed for wireless sensor networks. The following subsection explains the assumptions that are made to implement @MAC as a MAC protocol for wireless sensor networks.

4.11 Model assumptions

The network model that is simulated consists of 100 nodes that can communicate with each other directly. In this simulation, nodes are distributed uniformly among the access phases at random. The network architecture that was assumed is a large network that consists of a base station surrounded with sensor nodes as shown in Figure 4.1. However, due to the limited range that a sensor node can cover, a multi-hop routing protocol is required to route the packets from a far node through other nodes to the base station. Therefore, the only part of the network simulated is where nodes can communicate among each other.

(44)

4.1 Simulation Environment 33 //

.

\ Sensor node \ ' 0 . 0 \ I

. .

\ I I

(

being simulated

(

(45)

4.2 Traffic Inter-arrival time Model 34

In order to perform the numerical simulations for @-MAC, the following assumptions are made:

1. A sensor node generates packets that follow the Poisson distribution.

2. Time is divided into frames where each frame is composed of listen and sleep periods. 3. Each node has three modes of operation: transmit, listen, and sleep.

4. Nodes have unlimited transmit and receive buffer sizes. 5. All MAC operations are based on the IEEE 802.1 1.

6. The wireless channel is assumed to be perfect, i.e., there are no channel 7. The radio transceiver of the node is TR 1000 from RF Monolithics [2E

impairments.

I]. The power consumption for this radio transceiver in transmitting, listening, and sleeping modes are 24.75 mW, 13.5 mW and 15 pW respectively. The transmission data rate of this radio transceiver is 19.2 Kbps.

According to assumption 4, packets will not be dropped as they are all ultimately going to be sent to their destinations.

The parameter values chosen for numerical simulations are summarized in Table 4.1.

4.2

Traffic Inter-arrival time Model

The model that describes the generation of traffic in this simulation was chosen to be the Poisson distribution. The assumption of Poisson distribution for the traffic implies that nodes statistically generate traffic that is based on an exponentially distributed inter-arrival time [29]. This traffic model was chosen to test the protocol's performance for different arrival rates.

Let the inter-arrival time between two successive packets be the random variable T. Then, the PDF (Probability Density Function) for the inter-arrival time of Poisson traffic follows the exponential distribution that can be expressed as:

(46)

4.2 Traffic Inter-arrival time Model 35

Table 4.1. Model uarameters

Parameter

Average packet inter-arrival time T (range of variation) Number of access phases

4

Number of nodes n

Frame duration

t3

Phase duration tl

Number of initial reservation slots W Node transmitting power

Node listening power Node sleeping power Node transmission data rate

Average packet length a Simulation time

Value Unit

I

(47)

4.2 Traffic Inter-arrival time Model 36

a Inter-arrival time

Figure 4.2. Biased exponential distribution with the two design parameters a and b.

where A is the average packet arrival rate in packetsts. However, to be more realistic in describing the traffic, the source has to be specified with more parameters than only the average data rate A. These parameters are [29]:

0 A: average data rate. 0 a: maximum burst rate.

0 a: average packet length in bits.

Therefore, the inter-arrival time distribution is modified to get the shifted exponential distribution that can be expressed as [29]:

for t

2

a

where a

>

0 is the position parameter which represents the minimum time between adjacent packets and b is the shape parameter that determines how fast the exponential function decays with time. Figure 4.2 shows the biased exponential distribution with the two design parameters a and b.

(48)

4.2 Traffic Inter-arrival time Model 37 The values of a and b for a source with parameters A, a , and a , can be calculated as

in [29] from the following equations:

In this simulation, the average packet length a was assumed to be fixed with only 38 bytes since most wireless sensor networks have a very small packet size. Also, the average inter-arrival time T of the packets in this simulation was varied from 2 to 10 seconds. Therefore, X and a can be found based on the packet inter-arrival time from the following two equations:

1 A = -

T (4.5)

where 9 is a constant value between 1 and (T - 1). In this simulation, 0 was assumed to be 1.

To make the simulation simpler, the traffic is first generated at the beginning of the simulation for all the nodes in the networks for the entire simulation time. Each packet generated from any node is stored in the node transmit buffer and is assigned three flags:

Arrival time

Destination node address

Reservation slot address (as will be described in Section 4.5.3)

These flags are used to calculate the time and the energy required to send that packet to its destination.

(49)

4.3 Traffic destination Model 38

4.3

Traffic destination Model

The destination of each packet generated by a node is selected using the uniform random distribution for the non-coherent case where the destination could be any other node in any access phase including the same access phase. On the other hand, in the coherent case, the destination of a packet could be any other node in the same access phase which would give the best performance. Results are shown for both cases in order to test the performance of the protocol for different extreme situations.

Data Gathering

According to Table 4.1 time is divided into frames of 1 s duration and the simulation time is 2000 s. These values have been specified after running the simulation using dif- ferent simulation times to ensure all transients have disappeared and enough data has been collected.

The duty cycle is 33% which makes the duration of the listen period 300 ms for the S-MAC. However, for the @-MAC with q5 phases, the listen period is 30014 ms. The size of the data packet is fixed with 38 bytes which takes only 20 ms to send in a typical radio channel [I 51.

The traffic is analyzed by advancing the time index and checking for packets until the end of simulation. In this simulation, the time index is set to be frame duration/1000, i.e., frames are divided into 1000 slots.

The total energy consumed by each node over the entire simulation time is determined by calculating the time each node spends in the three modes, i e . , listen, transmit and sleep. Then, the total time nodes spend in each mode is multiplied by the amount of power con- sumed in that mode to get the total energy consumed by the node.

Delay in this simulation is the sum of the time a packet may encounter in the transmit buffer and the time needed to send that packet. Therefore, the queuing delay is the dominant

(50)

4.5 Numerical Simulation Code Validation 39

part that affects the delay. Delay is calculated by subtracting the time a packet is received by the destination from the time it was generated.

A collision occurs where two or more nodes try to access the channel at exactly the same time index. The collided nodes have to back-off. The probability of collision is calculated by dividing the number of collisions by the total number of packets generated.

4.5

Numerical Simulation Code Validation

The numerical simulations have been written in MATLAB using several simple functions that can be tested separately. All the functions and operations of the MAC protocol have been defined and tested to ensure that the results are accurate. The following subsections explain how the numerical simulation code was built and tested in order to validate and verify the results of the numerical simulations.

4.5.1 Assignment of access phases to nodes

( d i s t r i b u t e )

At the beginning of the simulation the function d i s t r i b u t e (page 78) is executed to assign a phase to each node in the network using the uniform random distribution. In the non-coherent case, if any node needs to communicate with any other node in a different phase, then that node has to wake up according to the receiver's phase. All the schedules of the nodes are stored in tables as will be shown in section 4.5.4.

4.5.2 Traffic generation

(generate-traf

f

i c )

The traffic in the network being simulated is generated in advance using a shifted Poisson distribution. Each node in the network calls the function g e n e r a t e - t r a f f i c (page 78) to get the inter-arrival times of its packets for the entire simulation time. Then, in the non- coherent case, each packet is assigned a destination address that could be any other node in

(51)

4.5 Numerical Simulation Code Validation 40

the network whether in the same phase or in a different phase. In the other extreme, which is the coherent case, the destination address can be any other node within the same phase. The inter-amval times of these packets are verified based on the parameters that are used to generate the traffic as described at the beginning of this chapter.

4.5.3

MAC

operations

A simplified version of the DCF function of the IEEE 802.1 1 using CSMA-CA is imple- mented (details on page 71). Each packet in the node transmit buffer is assigned a trans- mission slot which is selected randomly between 0 and 7 as discussed in reference [29]. Each node has a counter for the head of the line packet in the transmit buffer. The simu- lation time is then incremented using the time index to check for any packet. If a packet is encountered then that packet is sent to its destination successfully provided that only the node that generated that packet got access to the channel in that specified time index. Then, all the other counters of each packet are updated by adding the time needed to send one packet because the channel is busy sending that packet. When the channel becomes idle, the time index is incremented to search for another packet.

If two or more nodes have packets at the same time index when the channel is idle, then a collision will happen. In this case, these packets will be retransmitted using the exponential back-off mechanism.

4.5.4 Simple example for the non-coherent case

The following example shows how the code of the simulation was validated by running the simulation on a simple network of 5 nodes. Only 2 phases were used. The average packet arrival rate X is chosen to be 0.2 packetsls. The simulation time is 20 s which is enough to generate approximately 4 packets per node. Thus, it would be simple to check the individual results of the simulation. Table 4.2 shows the parameters values used in this

Referenties

GERELATEERDE DOCUMENTEN

Desde esta posición, donde todos los lazos se encuentran y se separan, la aplicación de tal escritura se vuelve posible para realmente hacer de Íntimas un ‘cuento de

Furthermore, by introducing the other three heterosexual cases, I aimed to go beyond the HVN identity politics based on sexual orientation and show the decisive factors through

To see if the sensemaking process of the RNLM is influenced by the authorities and the airport itself, the following research question is posed: “How does the Royal Netherlands

Stellenbosch. Van nou af wy by horn aan die joernalistiek en aan die Bybelvertaling.. politieke gebied het hy ~gter verloor deur sy ho~g teenoor Kruger en

Bearing the above in mind, the purpose of the present study was (i) to evaluate the sensitivity of continuous and discretely measured in- dicators of the plant water status to use

Allereerst wil ik alle deelnemers van de verschillende studies bedanken, bedankt voor jullie enthousiaste deelname en interesse voor het wetenschappelijk onderzoek.. Daarnaast wil

Although depressed individuals synchronized with their partners’ pupils, they trusted partners with dilating pupils just as much as partners with constricting pupils, which

The Bophuthatswana National Education Act of 1979 and the Botswana Edu= cation Law of 1966 determine that the systems of education in those countries remain