evaluation of analytic interference, reception and ...597800/fulltext01.pdf · evaluation of...

84
Evaluation of Analytic Interference, Reception and Detection Modeling for IEEE 802.15.4 Networks with the MiXiM Omnet++ Framework PEDRO JORGE TEIXEIRA SOUSA Master’s Degree Project Stockholm, Sweden XR-EE-LCN 2013:001

Upload: dangthuy

Post on 18-Apr-2018

216 views

Category:

Documents


1 download

TRANSCRIPT

Evaluation of Analytic Interference,Reception and Detection Modeling for

IEEE 802.15.4 Networks with theMiXiM Omnet++ Framework

PEDRO JORGE TEIXEIRA SOUSA

Master’s Degree ProjectStockholm, Sweden

XR-EE-LCN 2013:001

KTH Royal Institute of Technology

School of Electrical EngineeringLaboratory for Communication Networks

IST Instituto Superior Técnico

Departamento de Engenharia Electrotécnica e de Computadores

Evaluation of Analytic Interference, Receptionand Detection Modeling for IEEE 802.15.4Networks with the MiXiM Omnet++Framework

Pedro Jorge Teixeira Sousa

Advisor: Ioannis GlaropoulosExaminer: Assoc. Prof. Viktoria Fodor

StockholmDecember 2012

A B S T R A C T

Wireless Sensor Networks have emerged among the different wireless technologies sharing theISM spectrum band. This band sharing between the technologies started to raise coexistenceissues in accessing the overpopulated spectrum. The WSN power constrains make them vul-nerable to higher power devices, such as WLAN. Simulation studies are of great importancein predicting the coexistence phenomena in heterogeneous scenarios. Simulations allows usto have a prediction on how a network will behave without the need to physically deploythe network. We address the coexistence phenomena between WSN and WLAN devices anddemonstrate a performance comparison. We evaluate the capability of the MiXiM simulator topredict the coexistence issues in heterogeneous networks, raised by WLAN and WSN devices. Westate the importance of having an accurate simulator to predict the phenomena.

In this work, we propose a new framework for MiXiM to allow more realistic simulationresults in heterogeneous networks, when evaluating the interference phenomena betweenconcurrent technologies. We implement a new definition of custom transmission power andcustom reception filter.

Further, we evaluate simulation results provided by MiXiM in simulating WSN homogeneousscenarios and compare its prediction with analytical models.

We implement a new simulation paradigm in MiXiM, cross networks simulation sharing thesame ISM spectrum band. We evaluate and analyse the coexistence phenomena of WLAN andWSN devices.

Finally, we complete our work with the implementation of a channel sensing module, basedon a fixed a priori false alarm probability, for WSN devices. We evaluate its sensing results bycomparing it with MiXiMs implementation for channel sensing and conclude that our simpleanalytic model for sensing comply with MiXiMs implementation.

iii

A C K N O W L E D G E M E N T S

I would like to thank to all those who have made this work possible. First of all, I wouldlike to express my gratitude to Prof. António Rodrigues, my supervisor in Portugal, for theopportunity to study abroad and to Prof. Viktoria Fodor, my supervisor in Sweden, for theopportunity of being able to do this work and, her guidelines during the master thesis workand for the thesis review. I would like to deeply thank to Ioannis Glaropoulos for his invaluableadvice, guidance and support throughout all this work. I would also to thank him for hisconstructive suggestions during the project time and for the review and feedback during thedrafting of the thesis. I would also like to thank all my friends in Sweden that supported methe whole time. Most importantly, I thank my parents, my sister and my family for all theencouragement and support they give me, without them none of this would be possible.

v

C O N T E N T S

1 Introduction 1

2 Background 32.1 Related Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32.2 Motivation and Contribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

I The MiXiM Simulator 7

3 MiXiM Topology 93.1 Omnet++ Simulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93.2 MiXiM Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

4 Power Spectrum and Filter Characteristic 134.1 MiXiMs Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134.2 New Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

4.2.1 Power Spectrum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144.2.2 Filter Characteristic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

4.3 Simulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194.3.1 No Interference Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194.3.2 Interference Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

II Simulation 25

5 WSN Standalone 275.1 Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275.2 Analytic Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275.3 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285.4 Performance Metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295.5 Simulation Set Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305.6 Simulation Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

5.6.1 SNR Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305.6.2 Packet Reception Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

6 WLAN / WSN Interference 356.1 Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356.2 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366.3 Performance Metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386.4 Experiment Set Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386.5 Simulation Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

6.5.1 SINR Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396.5.2 Packet Reception Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

7 WLAN / WSN Channel Sensing 51

vii

7.1 Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517.2 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527.3 Performance Metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547.4 Experiment Set Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567.5 Simulation Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

7.5.1 Path Loss Coefficient α . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577.5.2 Transmission Power . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587.5.3 Receiver Sensitivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597.5.4 Sensing Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607.5.5 Noise Variance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607.5.6 Shadowing Interval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627.5.7 Shadowing Standard Deviation . . . . . . . . . . . . . . . . . . . . . . . . . 62

8 Conclusion 65

9 Future Work 67

Acronyms 69

Bibliography 73

viii

1 I N T R O D U C T I O N

Wireless Sensor Networks (WSN) have become a rising technology providing, among manyothers, the infrastructure for monitoring and actuating in a wide range of applications suchas robotics, domotics, medical systems and factory automation [18]. The sensors are charac-terized by their low energy consumption, reduced coverage, low transmission power and lowtransmission rate. These characteristics reduce the production cost and therefore allow us tohave several hundreds of these sensors per network. Despite the sensors low cost, standardperformance and reliability are guaranteed and their reduced dimensions allow them to havethe multi-purpose applications described before.

Due to the low coverage, the WSN may consist of a large number of distributed andautonomous battery operated sensors that are usually coordinated to perform a common task.The nodes in this multi-hop wireless network communicate with each other by operating,mostly, in the Industrial, Scientific and Medical (ISM) band at 2.4 GHz.

The WSN Media Access Control (MAC) layer, responsible for the channel access, and Physical(PHY) layer, the sensor interface to the physical medium, are standardized by the Institute ofElectrical and Electronics Engineers (IEEE) 802.15.4 protocol. WSN MAC layer uses the ClearChannel Assessment (CCA) procedure to solve the medium status acknowledgement by definingthree operation modes of considering the channel busy, based on power threshold, on samemodulation characteristics and on the merging of the two criteria stated before [7].

With the proliferation of wireless devices, WSN devices need to compete with differenttechnologies for the same spectrum band access, such as Bluetooth, Wireless Local AreaNetwork (WLAN) and cordless phones. The spectrum accommodation for all these technologieshas become a major issue in this overpopulated band [14].

The variety of technologies competing for the same band has raised coexistence issue. Thedevices competing for the same band do not have the same hardware characteristics. As anexample a WSN or a Bluetooth device does not have the same transmission power capability asa WLAN device. The lower transmission power and the lower range means they cannot competeequally for the same shared band, WLAN will not detect them and will act as they are notpresent.

As a result of the different technologies sharing the same spectrum band, coexistenceproblems have started to occur. A common issue from coexistence is the lack of awareness, bythe high powered network, when a small ranged sensor network is nearby. As an example,WLAN devices are not aware of the presence of WSN devices, unless the WSN are at a shortdistance from the WLAN. When WLAN and WSN packet transmissions coincides both in timeand frequency a collision occurs. These collisions will lead to packet losses. This will causea major impact in the WSN performance, leading to a high WSN packet loss rate, although thesame effect does not persist while analysing WLAN transmitted packets [2, 6].

To address the coexistence problems of the spectrum access with WSN and WLAN devices,several studies have been made during the past years and solutions have been proposed, such asthe prediction of the WLAN behaviour, opportunistic spectrum access and frequency hops amongother. It is also proposed the use of cognitive radios [1, 4], transceiver capable of changing itstransmitting and receiving parameters, and algorithm investigation to predict WLAN behaviourand this way use the white WLAN space, the idle time.

The complexity of the analysis of coexistence issues make simulators and analytic modelsfor coexistence scenarios of major importance in predicting, planning, studying and analysing

2 introduction 1

the phenomena, so better and more efficient networks can be designed. Analytic models allowus to better predict the phenomena, though these models have limitations. The limitationsin the models are usually due to their simplicity, based on ideal assumptions and this waynot providing accurate predictions, or by the contrary, complex models, providing accurateresults, though difficult to compute. Analytic models are implemented in simulators helpingus in the task of obtaining results for planning and implementing networks, without havingto actually deploy a real network not knowing the behaviour it would follow. Simulators takespecial importance in computing and predicting the results for complex cases, especially withno closed form models exist.

Several simulators are available for simulating WSN scenarios [8], though our choice forthis work is to use the MiXiM simulator [11], a simulator with advanced physical layer options,specifically the signal concept that allow us to define a transmission signal defined in howmany dimensions we want, being the most common, time and frequency domains. MiXiM

also provides a non-centralized module for packet transmission, transmission of packets goesdirectly from the transmitter to the receiver, which replicates with accurateness the wirelesstransmission in the medium.

In this work, we investigate and evaluate MiXiMs results from simulating coexistence scenariosbetween WLAN and WSN devices, sharing and competing for the same spectrum in the ISM band.We propose a new way of defining the transmitted signal class, class that represents the devicesreal transmitted signal, useful for cross network simulations. We also propose a new way ofprocessing the signal at the reception by adding a non-ideal filter in the devices.

We perform and present a comparison between MiXiMs simulations and analytical modelsresults under different scenarios.

We investigate the reception rate of a WSN standalone network by evaluating the Signal-to-noise ratio (SNR) and packet loss rate and comparing its results with analytic models,log-distance path loss model combined with log-normal shadowing model.

An investigation is carried to assess MiXiMs results while simulating interference resultedfrom WLAN in WSN under a coexistence scenario between IEEE 802.11 and IEEE 802.15.4 protocols.The simulation results are later evaluated by a comparison with interference analytic modelsproposed in the literature.

Furthermore, we implement a sensing module for the WSN devices, based on an analyticmodel that considers an a priori false alarm probability, to sense the channel of the medium.A comparison between the results of our sensing module and MiXiMs implemented sensingmodule is performed.

The report is organized as follows. In chapter 2 we present the related work. In chapter3, a brief description of the MiXiM simulator is presented. Our new implementation for thetransmitted signal mapping and reception filter is described in chapter 4. In chapter 5 a WSN

standalone simulation is performed and the results are provided. In chapter 6 we simulatea coexistence scenario between WLAN and WSN devices and provide the results. The newimplemented sensing module is described in chapter 7 and the results are presented. In chapter8 and 9 we conclude our work and suggest future work to be done, respectively.

2 B A C K G R O U N D

2.1 related work

WLANs have become one of the most popular networks all over the world. Soon these highpowered devices became to have coexistence issues in the 2.4GHz ISM spectrum band. Toovercome the problems of in-network collisions, the Request-To-Send/Clear-To-Send (RTS/CTS)mechanism was implemented. In [3], a performance evaluation in a homogeneous scenario,networks connecting devices with the same protocol scenario, is analysed. The authors take anextensive study of the WLAN performance using Carrier Sense Multiple Access with CollisionAvoidance (CSMA/CA) and assume a finite number of devices and ideal channel conditions.They provide an extensive study of access mechanisms for the IEEE 802.11 protocol regardingthroughput performance. An accurate analytic model to compute the WLAN throughput ispresented. The author proves the effectiveness of RTS/CTS mechanism avoiding collisions andimproving the throughput rate.

With the rising of new technologies in the same spectrum band, new challenges were raised.One recent technology has been rising among all, WSN. In this new scenario of heterogeneousnetworks, different networks in the same spectrum band, the authors of [2] study the coexistencebetween IEEE 802.15.4 and IEEE 802.11b wireless networks. In this study, the authors take intoaccount the scenario where WLAN is under WSN interference and the scenario where WSN isunder WLAN interference and present the results according packet loss rate. With these resultsthe authors affirm the coexistence is possible with some performance degradation of packetloss rate and throughput. The authors also state the WSN under WLAN interference is the worstpossible scenario. In this case to increase the WSN reliability the time duration of the pollingwindow should be increased, or instead the WLAN duty cycle should be reduced.

Due to the interference between different protocols sharing the same ISM spectrum band,the location of the devices placement should be taken into consideration. This is proposed bythe authors of [13]. They show the packet delivery rate can be variable, according to the WLAN

nodes placement, the traffic flow orientation of the WSN with respect to the WLAN. The authorsalso conclude the high sensitivity of the Clear Channel Assessment (CCA) threshold, in WSN

devices, is interfered by the WLAN device, even though not transmitting in the same operatingchannels.

Other solutions are proposed to mitigate the undesired consequences of coexistence. In[10], the authors examine interference between technologies and propose BuzzBuzz, a MAC layerprotocol designed to mitigate WLAN interference for WSN. This proposed protocol implementsmultiple headers in WSN devices, giving them multiple options of detecting an incoming packet,and also uses a full-featured Reed Solomon library to help decoding the packet payload. Theauthors present this implementation in a real experiment, a medium sized test-bed and achievea increase in the packet reception rate by 70 %.

The coexistence between WLAN and WSN is harmful for the WSN devices and it is crucial tobetter predict the effects of this coexistence. Due to this issue, several simulators have appearedto face the coexistence prediction issue, so that the effects could be predicted without the needof real physical scenario experiments.

Therefore, it is of high importance to simulate in appropriate simulators this coexistencebetween IEEE protocols to predict, study and avoid undesirable phenomena in the networks.

4 motivation and contribution 2.2

The authors of [17] present a comparison between two commonly used simulators for WSN. Theauthors implement direct diffusion protocols and compare the performance of OMNeT++ [12]and NS2 regarding execution time and memory usage. This is of high importance, since WSN

usually have a large scale with hundreds of devices. The authors conclude that OMNeT++ ismore scalable and has better performance, use less memory and less execution time.

For simulations purpose, the authors of [9] present MiXiM [11], an OMNeT++ frameworkmade for wireless and mobile simulations. Due to the lack of direct support and concisemodelling chain for wireless communications in OMNeT++ the authors propose the use ofthis framework. This framework is a merging of several old MiXiM frameworks. A completedescription is made in [9].

MiXiM is a project in development, though already very useful to wireless simulations. Herethe pioneer concept of signal allows us to define complex scenarios. Also, in [16] the authorspresent the physical (PHY) layer of the simulator. We have the ability to define complex signalsin several domains, or a simple signal, just defined in time domain. MiXiM also has severalanalogue models implementations for path-loss, shadowing, fading and IEEE 802.15.4 and IEEE

802.11 standards.In [15] the authors test several simulators, including MiXiM, with a set of experiments using

sensor nodes indoors and outdoors. Using the data gathered in the experiment, they calibratethe radio propagation and the noise levels. After the calibration, simulations are set andrun. None of the simulators provided models for non-omnidirectional antennas, though thesimulators provided some propagation models widely accepted. From the results the authorssuggest to calibrate and validate the models with data from real experiments, to avoid thedisparity in the results observed.

The authors of [5] extend the MiXiM framework with the possibility of each device to beequipped with multiple radios, where these radios can be toggled between on, sleep and offmodes. For this purpose each device has two Network Interface Controller (NIC) cards, aprimary and a secondary. The secondary card has a high power radio used only for the purposeof transmissions, uploading and downloading data, while the primary card has a low powerradio used to sense the channel and for service discovery. When the device is not transmittingthe high power radio is either on sleep mode or on off mode allowing the module to saveenergy. The high power radio only wakes up when the lower power radio senses a transmissionrequest or the device has to send data. With this implementation we cans save a considerableamount of energy.

2.2 motivation and contribution

Several studies about homogeneous scenarios in MiXiM were performed, though we weredriven by the need to simulate the interference phenomena in heterogeneous scenarios ofcoexisting networks. We were interested in the MiXiMs ability to hold its results accurateness inheterogeneous networks and whether our simple analytic models comply with MiXiM.

In this report, we propose a framework where nodes can have custom signal and receptiondefinitions. We implement a new way of defining the transmitted signal, to approach realscenarios, and we add a filter at each nodes packet reception. In this implementation, weoffer the possibility of defining the signals and the filters mask pattern and allow them tohave a more realistic implementation. This implementation will allow us to simulate, in amore accurate way, the real scenarios phenomena and will also allow us to study cross nonoverlapping channel interference. Some examples of simulations and their results are presentedto validate the implementation.

We will perform a WSN standalone network simulation to test MiXiMs simulation results and

2.2 motivation and contribution 5

evaluate them by comparing them with analytic results on path loss and shadowing models.In addition, we perform a inter protocol interference measurement to assess how MiXiM

predicts the simulation of heterogeneous networks with WLAN and WSN devices. We willsimulate the effect of interference caused by a WLAN device on WSN devices along the distanceand compare the results with analytical predictions. The evaluation will be made based on SINR

and packet loss rate.Our contribution also includes an implementation of a sensing module for WSN devices based

on a a priori false alarm probability. We will also compare our sensing module implementationwith MiXiMs own implemented procedure of sensing the channel status.

Part I

T H E M I X I M S I M U L AT O R

3 M I X I M T O P O L O G Y

3.1 omnet++ simulator

Omnet++ [12] is an open-source simulator, written in C++ programming language, that allowsus to replicate wired and wireless networks. The simulator is module based, every componentis defined in a module, and these modules can be combined into more complex compoundmodels. This modular structure allows us to build models for our networks and to easily changeevery component in it, just by removing and adding a module, so performances comparisoncan be done.

Omnet++ is also a discrete event based simulator, a chronological sequence of events arescheduled in time to perform changes in the system. In this way, it allows us to create oursimulations in a time driven basis, the flow of simulation events will be driven by a clock, eventswill follow a time driven schedule.

The Omnet++ simulator allows us to define our simulations in different types of files, NEDfiles, INI files and the C++ files. These different types of files have their own purpose on thesimulator. In the C++ files, we implement the simple modules we want to use in the simulation.In the NED files, we design the simulation network and build more complex modules byaggregating several simple modules into a single compound module. In the INI file, we configurethe simulation parameters, such as which models to use in the simulation, we assign thenetwork parameters for the modules defined in the NED files and also the number of devices ofeach type we want to use in the simulation. Here, in this INI file we can configure each of theseveral modules according to its specific parameters, making possible to have similar sensorswith different transmitting power or sensitivity.

3.2 mixim framework

MiXiM [11], a simulator framework for wireless networks and uses the Omnet++ simulatorengine. One of the features of this framework is to establish the connection, to create a linkfor data exchange, between nodes, modules hierarchically placed to simulate a device. This ismade by auto generating connections based on a certain limited distance, possible to change.This way of generating connections, will allow us to simulate collisions, overlap in time andfrequency of data messages, in the network.

The Connection Manager module is the module responsible for setting up all the connectionsbetween the nodes. This is the solution the simulator provides to simulate the real scenariospropagation in the medium. This module holds all the information regarding the transmissionof messages between nodes.

MiXiM nodes are created as an aggregate of compound modules, which are also an aggregateof simple modules, to form as an example the true Transmission Control Protocol (TCP) andInternet Protocol (IP) protocol stack, though it could form any other protocol stack. Thesecompound modules simulate the behaviour of the TCP/IP model layers, application, network,MAC and PHY layers. These two last layers are combined into a large compound model defininga NIC, module, just like we see in real physical devices. In figure 3.1, we can see the describedMiXiMs node.

10 mixim framework 3.2

MiXiMNode

PhyLayer

MacLayer

NetworkLayer

ApplicationLayer

Nic

Figure 3.1: MiXiM Node Scheme

MiXiM has already some implemented nodes, hosts. These hosts can be selected by selectingMiXiM to auto generate them. To do so, we need to select the IEEE protocol we want to take intoaccount and then choose between the remaining already implemented TCP/IP protocol layers,application and network, we want to use. Several examples for all the layers and NIC cards arealready provided. Here, we can find, libraries implementing the standard IEEE 802.11 and thestandard IEEE 802.15.4 protocols.

The layers that are most useful to our work are the PhyLayer and the PhylayerBattery classesfor the PHY layer, and the Mac80211 and the CSMA802154 classes for the MAC layers, becausethey truly implement the standards for IEEE 802.11 and IEEE 802.15.4 standard protocols.

For the MAC models, the Mac80211 implements the MAC layer for a WLAN device according tothe IEEE 802.11 protocol. This will be useful to our WLAN nodes. The CSMA802154 implementsthe MAC layer for the IEEE 802.1.4 protocol, so again it is important to our work, but this timefor the WSN nodes.

The MAC layer is also the module that creates the signal, radio transmitted signal of a device,mapping, the way the signal is represented in the simulator. The mappings can hold as manydimensions as we want, but mostly it is used the time and frequency dimensions. When amapping is created we specify its duration and bandwidth, so the analogue models can beapplied and any collision can be taken into account while processing the signals reception.

The PhyLayer class extends the BasePhyLayer class and implements a good base implemen-tation to use. It assures the radio modes on/off, and the times between the switches. Also itprovides a good handling of the airframes, data messages transmitted between nodes to simulatethe packets, adding and removing them from the channel. This class is especially important be-cause it applies the analogue models, mathematical models to simulate the propagation medium,that we will choose to use.

The PhyLayerBattery has special relevance for WSN sensors, because they extend the PhyLayerclass adding it a battery module that will simulate a real battery by extracting current from itstotal capacity whenever an action is performed.

In MiXiM we have the option of creating new analogue models, extending them or use theones already implemented. In our simulations we will use only two of them, the SimplePathLoss-Model and the LogNormalShadowing. We chose the SimplePathLossModel because it implementsaccurately the signals attenuation over the transmission distance. Also, the LogNormalShadowingchoice is due to the fact we wanted to include the multi path experienced by the transmissionsignal before reaching the reception point. A countless number of analogue models can be usedin one experiment, we just need to define them in a XML, Extensible Markup Language, file.

The SimplePathLossModel implements the attenuation of a signal over the distance accordingto the mediums path loss coefficient α, signals wavelength λ, distance between the receiver

3.2 mixim framework 11

node and the transmitter node d. Some of these parameters are set in the analogue models XML

file. The calculation of this attenuation can be seen in equation 3.1.

Path Loss Attenuation = PL0× d−α

Where:

PL0 =

)2 (3.1)

The LogNormalShadowing model adds shadowing to the signal. This is generated by a randomnumber generator according to a normal distribution with a mean and standard deviationdefined by us in the XML file for the analogue models. This random number was generated indB, so it is converted to Watt and added to the power when the signals attenuation is computed.In this model we also specify the fading interval time. This will make that for each intervala random fading value, according to the procedure above described, is computed and addedat the proper signals time. This interval definition enables us to tune between slow and fastfading.

The total signals attenuation is computed in the PHY layer at a nodes reception by adding tothe received signal all the attenuations resultant from the analogue models.

The PHY layer finally holds a module of most importance, the decider. The decider is theobject that decides whether the packet arrived with errors or not. It will decide according towhat we specify in its implementation, it can be a SINR threshold or a sensitivity threshold, andit is the module that processes the airframe several times. First, it checks the header of thereceived packet, once, and then it will check the body of the received packet, as many times asthe fading interval changes for the signals bandwidth.

The deciders specifications and choice are also set in a XML file.

4 P O W E R S P E C T R U M A N D F I LT E R C H A R -A C T E R I S T I C

MiXiMs PHY models fail to mask the signals transmitted power in a realistic way to represent cross-channel interference. Adjacent channels will contribute to signals degradation, interference inadjacent frequencies caused by more than one transmission during a packets duration time. IEEE

protocols specify maximum interference power on the adjacent channels caused by hardwarelimitations when a transmission over a specific bandwidth occurs. This power in MiXiM isneglected, mostly because MiXiM was not intended to be a cross network simulator. Thoughfor the pursued purposes of this work we are forced to take it into account, so we can have arealistic scenario regarding the cross networks interference scenario.

These scenarios require that a signal should be mapped differently, closer to real powertransmission masks. It should not be restrained under the bandwidth limits of the channel,but it should follow the attenuation pattern from the center frequency to adjacent channelsaccording the IEEE protocol in use, or according to the hardware limitations. The same procedureshould apply to the filters at the receivers. They should not be set as an ideal filter, in which wereceive all the power over the bandwidth of the channel, but they should try to approach in thebest possible way the events in real scenarios, how the hardware processes the received signals.

For these reasons, it was required a new way of creating a signals mapping and a receiversfilter mapping over the spectrum. By doing this, we could simulate cross channels interference,in non-overlapping channels, and simulate inter protocol interference like it happens in realscenarios, where the transmission power is not only contained within the channels bandwidth.

4.1 mixims implementation

MiXiM implements both ideal power spectrum, transmission power mask, mapping and filterscharacteristic, receivers mask, in which we obtain a uniform distributed function over thebandwidth of the signals IEEE protocol in use. This means that no cross channel interference willoccur while transmitting signals, inside airframes, centred in different frequencies correspondingto two adjacent non overlapping channels. Similar will occur while using different protocolsthat share the same ISM band, like it happens with IEEE 802.11, WLAN, and IEEE 802.15.4, WSN,protocols using non overlapping channels.

To occur inter IEEE protocol interference, we need to use only one connexion manager objectin MiXiMs simulation. This way, all the nodes can see and receive any transmitted power fromany node despite using or not the same IEEE protocol.

The implementation of MiXiMs signals creation over the frequency domain can be seen infigure 4.1. We can notice the power distribution over the frequency is uniform along the signalsbandwidth, making it an ideal signal, instead of a real hardware generated signal, figure 4.2.In this figure 4.2, we can see the power density increasingly decays as we go further from thecentral frequency. Furthermore, the total transmitted power should not be contained in thechannel bandwidth limits, it should continue to be defined outside the channel bandwidthwith certain attenuation. The attenuation is defined by the IEEE protocol or by the hardwarelimitations in use, like it happens in real scenarios. This way inter channel interference, innon-overlapping channels, can be studied in simulations.

14 new implementation 4.2

power

frequencyf0 − ∆f f0 + ∆ff0

Tx Mapping

Figure 4.1: Transmitted power mask in MiXiMs signal

Figure 4.2: Real signals transmitted power mask

Similar methodology to the one used for the new definition of transmitted power, shouldbe considered regarding signals reception. MiXiM implements the reception filter as an idealfilter, figure 4.3, receiving only the power in the channels bandwidth with a uniform distributedcharacteristic, mask. The filter characteristic should be defined as much as possible closer tothe real filters characteristic, figure 4.4. This real characteristic mapping is not constrained tothe channel bandwidth and it is not uniform all over the channels bandwidth, in fact it hasattenuation within the channels frequency domain, meaning the signal will not have the samereceived power all over the spectrum.

power

frequencyFilter Mapping

f0 − ∆f f0 + ∆ff0

Figure 4.3: MiXiMs receivers filter mask

4.2 new implementation

In this section the new implementations for the power spectrum and the filter characteristic inMiXiM will be presented.

4.2.1 Power Spectrum

The objective of the new transmitted power mapping is to implement in a new and morerealistic model, also to make it as general as possible, so it can be shaped according the userspurposes and objectives. For this goal, a general concept was idealized, it needed to be simplefor the user and it should be able to represent any type of mapping, as long as it would followthe symmetry between the central frequency and the distance, both positive and negative, fromit.

To achieve such goal we decided to approach this problem in a simple way, to create the

4.2 new implementation 15

Figure 4.4: Filters real characteristic

mapping as a combination of power density steps that would represent the signal transmissionpower. These steps would be as many as the user intends, for complex models, and as few assimple models require. With this implementation, figure 4.5, we would achieve the proposedobjective. It would grant complex and also simple models, just by changing the number andthe level of the steps, achieving a customized granularity model.

Figure 4.5: New Implemented Transmission Power Mapping

To implement the desired power spectrum mapping in MiXiM some classes were extendedand new files were created. For the definition of the steps we thought the best option wouldbe to write it in a text file, so a .txt file was created containing the definitions of the steps.The way to define it is to write a 2 column matrix containing in the first column the spacingbetween the center frequency and the border of the step, and in the second column we definethe attenuation of the power for that step. The attenuation of the power defined in each step iscalculated using Step Power = Power×Attenuation, so 1 means no attenuation at all, and 0mean total attenuation and Power = 0 Watt.

As an example we can see how the table should look like, in table 4.1, the first columndefining the step width and the second column defining the step height. For this case we have2× n = 5 steps in the mapping, being n the number of entries in the first column. We can statethat there will be a central lobe defined between f0 ± 11MHz, with total transmission power,and then the adjacent lobes defined from f0 + 11MHz to f0 + 22MHz and from f0 − 22MHz tof0 − 11MHz, both adjacent lobes with only half of the total transmitted power. Same procedureapplies to the remaining lobes until the last entry of the file.

Frequency in Hz Gain11× 106 1.0

22× 106 0.5

33× 106 0.1

Table 4.1: Transmission Power Mapping Definition

Having defined the mapping, we had to change some MiXiM classes, in this case the MAC

16 new implementation 4.2

classes. This new MAC class purpose is to override some functionalities of the previous class,especially the initialize and the createSignal, function that will generate the transmitted powermapping, functions.

In the initialize function, we extract the data from the file, by adding the functionality ofreading the previously referred .txt file and store its info into two different vectors with thesame size, the frequencies vector and the attenuation vector. In the frequencies vector we storethe values for the frequency steps and in the attenuations vector the respective attenuation isalso stored.

The other function that needs to be overridden is the createSignal, called by the MAC class tocreate the signal and send it to the PHY layer. Here, we have to change the way to create thesignal to be set in the AirFrame. In this function, a new method of creating the transmissionsignal mapping is called and the proposed new mapping is returned and associated with thetransmitted signals mapping. This method will receive as argument the signals duration, thecentral frequency and the transmitted power value. Then it will create a mapping in time forthe signals duration and in frequency according to the described above, setting the attenuatedpower values in the respective lobes. We should take into account that the signal will alwaysbe symmetric regarding its central frequency, as we go further from the center frequency thesignal suffers the same attenuation behaviour for f0 + ∆f and for f0 − ∆f.

4.2.2 Filter Characteristic

The MiXiM filter characteristic represents an approximation to real scenarios, in this case an idealfilter characteristic. Though this could be set in a different way, a better way that could allow usto shape the mapping according the user needs, our needs, independently how the user wantsit. With this objective, we propose a different approach to this problem, an approach in whichthe user defines the mask of the filter. The filter can be closer to the real filters, closer to idealfilters or even completely different, all at users choice.

To address this goal we proceeded with a similar approach to the power spectrum mapping.We will map the filter characteristic in several steps, as many or as few the user desires. Thefinal filter characteristic will be similar to, figure 4.6, in case the user chooses to have a filtercharacteristic closer to real scenarios. Again with this option of creating the desired receptionfilter mapping we can get more flexibility.

Figure 4.6: New Implemented Filter Characteristic

In order to implement those changes in MiXiMs we had to change and add some functional-ities to it. The first important change was, also like the change in power spectrum mapping,the addition of a .txt file where the user could define the filters mapping according to his orher purpose. The stated file would contain a two column matrix in which the first columncorresponds to the frequencies spaced from the central frequency, to create the steps, frequencyinterval, and the second column would refer to the gain at those steps bandwidth. The first rowof this file should contain the central frequency and the respective gain in dB. The definition

4.2 new implementation 17

of the filters gain along the frequency should be in dB due to practical reasons, it is usual torefer to filters characteristic in dB and data sheets usually provide this information in this unitof measurement. An example of the filters .txt file can be seen in table 4.2.

Frequency in Hz Gain in dB2.412× 109 0

11× 106 0

22× 106 −40

33× 106 −80

Table 4.2: Filter Characteristic Mapping Definition

To implement this new filter mapping in MiXiMs we had to extend the PHY layer so that anew decider could be implemented. This new PHY layer named PowerPhyLayer extends thePhyLayer class and it adds to it the initialization of the new decider, PowerDecider. When a newobject of this decider is created it reads the .txt file with the definitions of the filter characteristicand stores both frequencies and respective attenuations into two different vectors with the samesize, so it can be used later for mapping purposes according to our objective.

The newly implemented decider has its main purpose to implement the new filter mapping,so it will have to override the function calculateRSSIMapping. The new overridden functioncalculateRSSIMapping will have the main role in applying the filter. Here in this function wecompute the interferences of other packets in the medium, the air, and also add the noise thatwill be added to the received signal. So in this function we multiply the interferers signals withthe filter, so we can obtain the right interference pattern.

The new filter mapping is created by a new function, createAttenuationMapping, and its onlyobjective is to create the mapping of the filter, based on the vectors containing the filter definitionin the file. The function, createAttenuationMapping, whenever called returns a filter mapping. Asan example, if the information in the table 4.2 was inside the .txt file, a filter mapping would becreated with 0 dB attenuation in the band f0 ± 11MHz, with −40 dB attenuation in the bandsfrom f0 − 22MHz until f0 − 11MHz and from f0 + 11MHz until f0 + 22MHz, and finally with−80 dB attenuation in the bands from f0− 33MHz until f0− 22MHz and from f0+ 22MHz untilf0 + 33MHz. The resultant filter mapping would be like figure 4.7.

power

frequency[Hz]2.412× 109 − 33× 106 2.412× 109 + 33× 1062.412× 109

0dB

−40dB −40dB

−80dB −80dB

22MHz

11MHz 11MHz

11MHz 11MHz

Figure 4.7: Example of Resultant Filter Mapping Built From Input

When a collision occurs between airframes, the situation in figure 4.8, between t1 and t2we have to count with interferer airframes and the filter will multiply its mask in both signals,meaning that in figure 4.9, the interferer frame only interferes in a small part of the signalsbandwidth, and this part of it will not have the same filtering as it was in its central frequency,it gets much more attenuated, due to its distance to the central frequency of the receiver centralfrequency.

18 new implementation 4.2

timeAirFrame1

AirFrame2

t1 t2t0 t3

Figure 4.8: Interference Between Signals in Time Overlap

Figure 4.9: Interference Between Signals in Spectrum Overlap

Furthermore, the calculateRSSIMapping will return the addition of all interference and thenoise. In this function, calculateRSSIMapping, we filter the signals received power by dividingthe total interference power plus the noise, by the filter mapping. This way, we can get the rightSINR when we compute this ratio, dividing the receive power, by the noise plus interferenceover the filters mask, this means:

SINR =Received Signals Power

Total Noise + Interference(4.1)

Taking into account that calculateRSSIMapping will return:

Total Noise + Interference =Noise + (Interference× Filter Mask)

Filter Mask(4.2)

When the SINR is computed outside calculateRSSIMapping dividing the received power byreturned mapping we will obtain according to equations 4.1 and 4.2:

4.3 simulations 19

SINR =Received Signals Power

Total Noise + Interference

Having into account equation 4.2:

=Received Signals Power

Noise + (Interference× Filter Mask)Filter Mask

Resulting:

=Received Signals Power× Filter MaskNoise + (Interference× Filter Mask)

(4.3)

Which is exactly what we wanted to achieve, the signals SINR taking into account the filterscharacteristic.

4.3 simulations

In this section some results will be presented to confirm the implementation of the powerspectrum mapping and the filter characteristic mapping. We will present two scenarios, onewith no interference and other with interference, in order to cover all case scenarios.

4.3.1 No Interference Scenario

In the first scenario we want to confirm if the changes to MiXiM are working as we intended. Forthis experiment we will consider two nodes, one transmitter and one receiver scenario, figure4.10. This simulation purposes is to assess whether the new transmission mapping is beingcreated or not and also to check the filter mapping.

Figure 4.10: Two Node Scenario

For the experiment we will transmit a packet, centred in 2.412GHz, with 100 milliwatt oftransmission power and map it in frequency according to table 4.1. The two nodes are distancedby 15 meters and we consider a thermal noise level of −110 dBm. In figure 4.11 we can seethat the mapping was successfully created and according to the requirements in table 4.1. Inthe mapping figures, we can see at the top the time mapping, signals duration and at the leftcolumn the border frequencies are defined. Note that these prints only show the values at theborder frequencies and not at the lobes center. Also the values shown in the mappings print arein dBm.

After sending the packet as an airframe we receive the packet in the receiver node. This

20 simulations 4.3

Figure 4.11: Transmitted Power Mapping Created by createSignal Function

node receives the signals power, figure 4.12, not filtered by the filter yet. The filter characteristicimplemented in this experiment is defined by table 4.2.

Figure 4.12: Received power Mapping Created by the Decider Class

In order to apply the filter mapping to the signals received power we have to calculate theSNR, as described above in equation 4.3. In figure 4.13 we can see the noise divided by the filtercharacteristic and after returning this mapping to calculate the SNR we obtain the final mapping,figure 4.14, which is according to the expected, variable in the signals spectrum, as defined inthe .txt files for the filter and the power mappings. We observe a better SNR in the signals mainlobe, the lobe containing the central frequency, and as a contrast we get, as expected, a worseSNR as we go further from the central frequency to the outer lobes.

Figure 4.13: Noise Mapping with Filter Mapping Created by calculateRSSIMapping Function

4.3.2 Interference Scenario

Having presented the first case, a simple scenario, where just 2 nodes could communicate,we present the second scenario, a scenario far more interesting for the purposes of this work,a scenario where we have 3 nodes, two transmitters and one receiver, figure 4.15. The twotransmitters are at different distances, Transmitter 1 at 15 meters and Transmitter 2 at 35 metersaway from the receptor. Both will have their own central frequencies, Transmitter 1 with2.412× 109Hz and Transmitter 2 with 2.445× 109Hz, and both will have a 33MHz bandwidth.The Transmitter 2 will act as an interferer and the airframe send by Transmitter 1 will only suffer

4.3 simulations 21

Figure 4.14: Final SNR Mapping Created by the Decider Class

interference at the frequencies between both nodes central frequencies, so that we can expect tosee a difference between the mappings of both sides of the central frequency of the Transmitter1 airframe at the reception.

Figure 4.15: Three Node Scenario

Given that the interferer, Transmitter 2, is further than Transmitter 1, regarding the receiversdistance, we set a transmission power 100 times higher. This transmitted power will be mappedaccording the old MiXiM mapping, figure 4.1, not the new one, figure 4.5. The purpose of thesedifferent mappings is to see a major difference between the frequencies suffering interferenceand the ones that do not. Again, the data frame from Transmitter 1 will have 100 milliwattof transmitted power and the thermal noise level will be −110 dBm. In figure 4.16 we havethe data frame transmitter power mapping, and in figure 4.17 we have the interferer framemapping. This interference scenario will correspond to figure 4.8 in time domain and figure 4.9in frequency domain.

In table 4.3, we have a brief description of the used parameters.When the receiver receives the airframes it computes the first one received, the data airframe,

and the second airframe received, interference airframe, will be added to the interference. Theinterference frame will be filtered and then added to the noise mapping, in figure 4.18 we havethe interference power that will be added to the noise mapping, resulting in the mapping infigure 4.19.

Note that the −inf values in figure 4.18 correspond at time values where there is nointerference between the airframes. Also the −inf values in frequency domain happen due tothe fact the packets are not centred at the same frequency and only part of the frequencies will

22 simulations 4.3

Parameter ValueDistance Between Transmiter 1 and Receiver 15 m

Distance Between Transmiter 2 and Receiver 35 m

Noise Variance σ2N −110 dBm

Transmiter 1 Bandwidth 33 MHz

Transmiter 1 Central Frequency 2.412× 109 HzTransmiter 1 Maximum Transmitted Power 100 mW

Transmiter 2 Bandwidth 33 MHz

Transmiter 2 Central Frequency 2.445× 109 HzTransmiter 2 Maximum Transmitted Power 10 W

Table 4.3: New Power and Filter Implementation Experiment Parameters

Figure 4.16: Transmitted Power of Data Airframe Created by createSignal Function

suffer interference.Having presented this mapping we now present the final SINR, in figure 4.21, by dividing

the received transmission power, figure 4.20, by the noise plus interference and with the filterincluded, that according to equation 4.3 will result in the final SINR mapping. We can see in thefinal SINR mapping, figure 4.21, a considerable difference between the frequency values lowerthan the center frequency and the frequency values that have interference. This difference isdue to the fact the high interference power only affects the frequencies between the centralfrequencies of both packets. We can also see the SINR, in figure 4.21, follows a decreasing patterncause by the filter.

4.3 simulations 23

Figure 4.17: Transmitted Power of Interferer Airframe Created by the old createSignal Function

Figure 4.18: Interference Power After Filtered Created by calculateRSSIMapping Function

Figure 4.19: Noise Plus Interference Power and Filter Created by calculateRSSIMapping Function

Figure 4.20: Received Data Transmitted Power Mapping Created by the Decider Class

Figure 4.21: Final SINR Mapping Created by the Decider Class

Part II

S I M U L AT I O N

5 W S N S TA N D A L O N E

In this chapter we will use MiXiMs modules, application, network, MAC and PHY layer classes, forWSN nodes with the purpose of evaluating if it provides accurate data, data that should followthe same pattern and have similar values to the analytic models prediction, with IEEE 802.15.4.We want to use MiXiMs simulations results to obtain the packet loss probability, between nodestransmission, and also SNR measurements so we can compare MiXiMs performance with theperformance derived analytically, to validate, if the results are accurate, MiXiMs simulator forWSN with IEEE 802.15.4 protocol.

5.1 scenario

To achieve the simulation results we want to analyse, a simple experiment was performed. Weconsidered two WSN nodes, one node transmitting packets over the medium, and the othernode receiving the packets at a certain distance d.

We will vary the distance between them, d, from 5 meters up till 685 meters, so we can havenegative SNR values in dB. This last distance exceeds by far the receivers sensitivity, minimumpacket power level a sensor can detect in order to be received, but it is interesting to see theevolution of the results pattern, so only for this reason we extrapolate by far the maximumdistance between the nodes. The scenario we describe can be seen in figure 5.1.

Figure 5.1: WSN Standalone Simulation Scenario

Later, at the end of this chapter, we will analyse the obtained simulation results based onthe received packets SNR and the packets reception rate.

5.2 analytic models

The theoretical model we will use to compare the MiXiMs results will be based on the transmittedpower and its attenuation over the distance between the transmitter and the receiver device,equation 5.1.

Received Power = PowerWSN × PL0× d−α × 10-Z (5.1)

The attenuation will apply the path loss attenuation, according to equation 3.1, and a montecarlo simulation for the fading. This monte carlo simulation will compute samples for thefading, by generating a random normal distributed value with mean 0 dB and 5 dB of standarddeviation, and add this value, in Watts, to the received power. The received power is computed

28 implementation 5.3

by adding the path loss attenuation to the transmitted power. The reason we compute a montecarlo experiment is that it is simpler to define the shadowing by a sum of values, see equation5.3, than to calculate the exact shadowing expression, see equation 5.2. With this computationalsimplification we will obtain a real close value to the exact one, calculated by the integral, aslong we provide enough samples in this addition of terms in equation 5.3.

Z =

∫+∞−∞ s fs (s) ds

where s = Shadowing(5.2)

Monte CarloReceived Power =1

N∑i=0

PowerWSN × PL0× d−α × 10-Nvalue (5.3)

For each received packet we compute a monte carlo simulation with 1000 samples, in orderto have an accurate and completely random value for the fading and the final received power.

5.3 implementation

The considered nodes in the scenario are Host802154 nodes using SensorApplLayer as applicationlayer, BaseNetwLayer as network layer, CSMA802154 as MAC layer and PhyLayerBattery as PHY

layer. Furthermore, we use as decider the Decider802154Narrow class.All the layers chosen are MiXiM basic classes, and the node name Host802154 comes from

the MiXiMs auto generated node process. In figure 5.2, we can see the layers of a WSN node,in this experiment. The choice of the classes was driven by the purpose of the experiment,for the MAC and PHY layer, we chose these classes because they implement the IEEE 802.15.4

protocol standards. For the application layer, we needed a constant packet generator andthe SensorApplLayer is a good class for this purpose, while for the network layer we choseBaseNetwLayer because we wanted it to be simple and just propagate the packet to the lowerlayer.

WSNNode

PhyLayerBattery

CSMA802154

BaseNetwLayer

SensorApplLayer

Nic

Figure 5.2: Layers of WSN Nodes in the Standalone Network

5.4 performance metrics 29

5.4 performance metrics

MiXiMs IEEE 802.15.4 PHY layer implements a receiver based on SINR, in this scenario SNR, andcompletely ignores the nodes sensitivities. This model of reception is defined by the choice ofthe decider class. This decider, Decider802154Narrow, will, whenever an airframe is received,be processed and assessed two times. The first time, it will analyse the signals header and thesecond, and last, analyse the entire packet. When the signals header is checked, we meant toassess if the receiver can synchronize, detect and receive the PHY header with no errors, with theWSN packet.

This assessment is done by checking the probability of error for the PHY header length, thiscase 8 bits, and it is computed using the BER value for the header, equation 5.4. The BER valueis obtained by using the headers SNR value and also taking into account the modulation used,OQPSK16, equation 5.5. After this, we have the header error probability, so the decider generatesa random number from a uniform distribution between 0 and 1. If the number is below theerror probability we will have an error while trying to synchronize with the packet header, if itis above, the receiver has successfully synchronized with the packet.

Error Probability = 1− (1− BER)Number of Bits (5.4)

BER =8

15× 1

16×

16∑k=2

(−1)k(16

k

)e20× SNR× ( 1

k−1 ) (5.5)

Being the WSN packet synchronized with the receiver, we have to do a similar process for theentire packet. Again we have to evaluate the BER from the SNR, equation 5.5, and later computethe packet error probability, using equation 5.4, but this time using the packet length, the 168bit. Again, after having computed the packet error probability we generate a random number,using a uniform distribution between 0 and 1 and if bellow the error probability the packet isdiscarded, if above the packet is considered to have no errors.

Whenever a packet is rejected due to PHY header synchronization errors we define it asa packet loss. If the packet contains errors in its body but not in the header, we define it as adiscarded packet. We can see in figure 5.3 the WSN packet structure, and in figure 5.4 we cansee the process, described above, done by the decider to assess if the packet was receivedsuccessfully with no errors.

PHY Synchronization Header

Body

Figure 5.3: WSN Packet Structure

DeciderPHY

SynchronizationHeaderErrors ?

BodyErrors ?

No

Yes

PacketArrives

No

Yes

PacketLost

PacketDiscarded

PacketOK

Figure 5.4: Reception Decision for WSN Packets

30 simulation results 5.6

5.5 simulation set up

We consider, for the medium in the experiment, the SimplePathLossModel and LogNormalShad-owing models available in MiXiM as the propagation models. In the SimplePathLossModel weconsider the path loss variable α equal to 3 and use a carrier frequency of 2.412× 109Hz. Asshadowing parameters we will choose zero mean with a standard deviation of 5 dB. Also forthe shadowing we will consider two scenarios, one where the shadowing interval changes everymillisecond, slow shadowing, and another much faster, where the shadowing will change every10 microseconds, fast shadowing. In table 5.1, we can see the medium models and parametersconsidered.

Parameter ValueCentral Frequency 2.412× 109 Hz

Fast Fading Interval 10 µs

Path Loss Coefficientα 3.0

Path Loss Model SimplePathLossModel

Shadowing Mean µS 0 dB

Shadowing Model LogNormalShadowing

Shadowing Standard Deviation σS 5 dB

Slow Fading Interval 1 ms

Table 5.1: Standalone Experiment Parameters

The experiment will consist of transmitting, in broadcast mode, 4000 packets of 168 bit ata rate of 250kbit/s, each generated at a periodic inter generation packet time of 0.01 seconds.The transmitted power of the airframe will be 1.1 milliwatt, and will only be defined in timedimension, due to MiXiMs MAC class for IEEE 802.15.4 implements only this mapping, though noproblem will occur with this mapping, there are only WSN nodes and only one is transmitting,so no interference could occur. The receivers sensitivity will be −85 dBm, and the mediumthermal noise level will be −110 dBm. In the decider, we define the PHY synchronization headerlength, the minimum possible BER, bit error rate, and the modulation of the packet to be sent.Here, we chose 8 bits for the PHY header synchronization length, according to IEEE 802.15.4, alsofor the minimum BER the value of 10−8 and a modulation of OQPSK16.

In table 5.2 we have a resume of all parameters.

5.6 simulation results

After having set up the experiment and the described the decision process, we present theresults of the simulation in this section. First we will compare the MiXiMs SNR measurementsfor the fast shadowing and the slow shadowing case with the analytical model that considerslog-distance path loss model combined with log-normal shadowing model. This log-normalshadowing model is computed by a monte carlo simulation. Later we will present and discussabout the reception probabilities of the packets.

5.6.1 SNR Analysis

In figure 5.5, we can analyse the SNR, see equation 5.6, of the received packets. We plot MiXiMsresults for the fast fading case and for the slow fading case, and we compare it with thetheoretical model described in section 5.2.

5.6 simulation results 31

Parameter ValueCentral Frequency 2.412× 109 Hz

Fast Fading Interval 10 µs

Inter Packet Generation Rate Periodic

Inter Packet Generation Time 10 ms

Minimum BER Value 10−8

Modulation OQPSK16

Noise Variance σ2N −110 dBm

Packet Length 168 bit

Path Loss Coefficientα 3.0

PHY Header Synchronization Length 8 bit

Receiver Sensitivity −85 dBm

Shadowing Mean µS 0 dB

Shadowing Standard Deviation σS 5 dB

Slow Fading Interval 1 ms

Transmitted Packets 4000

Transmission Power 1.1 mW

Transmission Rate 250 kbit/s

Table 5.2: Standalone Experiment Parameters

By analysing the figure 5.5, we can state that MiXiMs curve follows the theoretical predictioncurve very closely, both for the fast and slow shadowing experiments, when comparing themean values, as expected. The reason why we see, with the same exact values, the SNR foraverage minimum and average cases, considering slow shadowing, is due to the fact that packetsare small enough to be contained within the variation interval of the shadowing. Different caseoccurs when we consider fast fading and here it changes within a packet duration time, so theaverage minimum of the packets is much lower than the case of slow fading.

SNR =Received Signals Power

Noise(5.6)

SNRminimum(dBm) = −85dBm −−110dBm = 25dB (5.7)

We should also state that if the decider took into account the receivers sensitivity we wouldstop receiving packets at a distance of 30 meters. This distance can be found due to the constantnoise level and also due to no interference is present. We can consider in equation 5.6 thesensitivity as the minimum signal power of a packet, and with this value obtain the minimumSNR for the packet to be detected and received by the WSN receiver. Calculating this value,equation 5.7, we get a SNR equal to 25 dB, which will correspond to a distance of around 30meters.

5.6.2 Packet Reception Analysis

Now, we analyse the results of packet loss and discarded rates. In figure 5.6, we have theloss packet rate, number of lost packets over total number of transmitted packets, due to misssynchronization, meaning error in the header. It is interesting to note that the packet loss ratesin both slow and fast shadowing scenarios are really close to each other. This is explained dueto the header length, 8 bits, transmitted at a 250kbit/s rate. This means a 32 microsecondsheader and during this interval the shadowing does not change considerably.

32 simulation results 5.6

Figure 5.5: Signal-to-Noise Ratio

Contrary to this, we have two different evolutions of the discarded packets rate, number ofdiscarded packets over total received packet with no errors on synchronization, for the slow andfast shadowing scenarios, see figure 5.7. This figure 5.7 shows clearly the difference of havingfast and slow shadowing. We have packets of 168 bits so at a rate of 250kbit/s, which makes a672 microseconds of packet duration. During this time the shadowing interval does not changefor the slow scenario while for the fast scenario it changes between 67 and 68 times, risingup the probability of error, it just takes that during one time interval the SNR goes bellow theerror level and the packet gets discarded. For this reason, we can explain that in the presentedfigure 5.7 we drop much more packets at the same distances when fast shadowing scenario isconsidered than when we consider slow shadowing scenario.

In figure 5.8, we see the total of non-received packets rate, lost plus discarded packet rate, sameas the sum of lost plus discarded packets over the total transmitted packets. Here, in this figure5.8 the fast shadowing scenario takes a more abrupt transition between total reception and totalloss. We can state that with a faster shadowing interval the transition becomes more abruptand we start losing packets at shorter distances and in more quantity.

5.6 simulation results 33

Figure 5.6: Airframe Loss Rate

Figure 5.7: Airframe Discard Rate

34 simulation results 5.6

Figure 5.8: Total of Loss and Discarded Airframes

6 W L A N / W S N I N T E R F E R E N C E

WLAN, IEEE 802.11 protocol, and WSN, IEEE 802.15.4 protocol, coexist in the same area and spec-trum space, so it is important to predict the coexistence scenario phenomena. This coexistencebrings collisions to WSN devices whenever frames from both networks overlap in time and infrequency generating interference to each other. Due to their low power characteristics the WSN

devices are the weakest link in this coexistence, resulting into unsuccessful data transmissionswithin this protocol, IEEE 802.15.4.

In this chapter, we want to assess if the simulator, MiXiM provides useful and correctinformation about this WLAN and WSN devices co-existence and whether MiXiMs simulationsresults reflect the interference, predicted by the analytic models, between these devices.

We will present in this chapter the experiment set up, followed by the implementation andfinally, we will analyse the results obtained from the simulations, as well as the comparisonbetween these results and the analytic models prediction.

6.1 scenario

In this experiment, we want to achieve and compare the interference pattern between WLAN

and WSN devices, more specifically, when a network of WSN devices suffer interference from aWLAN device transmitting at the same time and in the same spectrum space. This is meant toassess the implications of the high power interferer in the WSN devices transmissions. We wantalso to study the interference behaviour along the distance between the two present networks.

To achieve the pursued results we will consider a simple scenario, a scenario where we havetwo WSN devices, one device transmitting and one device receiving. Also, we will considerone WLAN transmitter. This high power transmitter, the WLAN device, while compared withthe WSN devices transmission power, will be synchronized with the WSN transmitter. Thesynchronization is in practical terms the ability of the receiver to detect a packet in the mediumand start the reception process. Such synchronization will force the WSN transmissions to havealways interference in the transmitted airframes.

To study the variation of the interference pattern, two variations in two variables will beperformed, we will have a variable, d, representing the distance, in meters, between the twoWSN devices and another variable, D, representing the distance, also in meters, between theWLAN transmitter, the interferer, and the WSN transmitter. We will define this D with positiveand negative values. If negative, we intend to refer that the WLAN transmitter is before the WSN

devices, see figure 6.1. If the values are positive, it means the WLAN transmitter is between thetwo WSN devices, see figure 6.2.

Figure 6.1: WLAN Before WSN Network Scenario

36 implementation 6.2

Figure 6.2: WLAN Between WSN Nodes Scenario

For this experiment, we will vary the distance, d, between 5 and 50 meters, and for eachvariation of d, we will vary the placement of the interferer, meaning we will vary D from −100

up to 100 meters for each variation of d.The simulation results analysis will be based on the received packets SINR and the packets

reception rate. This evaluation will be done in section 6.5.

analytic models We will consider the analytic models described in section 5.2 for thesimulation result analysis.

6.2 implementation

In order to make the simulation, we had to extend some classes in MiXiM, so the WLAN and WSN

nodes could behave the way we wanted them to do.The WSN nodes we considered in the scenarios were Host802154 using as application layer

SensorApplLayer, as network layer BaseNetwLayer, as MAC layer InterferenceMacLayer, and finallyas PHY layer InterferencePhyLayer with an InterferenceDecider802154 decider.

The choice of the classes for the WSN device layers were made regarding the objectives wepursued, so the application layer is the SensorApplLayer, because it provides us a good packetgenerator where we can define the periodicity of the packet generation, which in our case willbe every 0.01 seconds at a periodic time basis. The network layer we chose was BaseNetwLayer,because we just want this layer to propagate the packet down to the MAC layer, after havingencapsulated the packet as a network layer packet.

For the MAC layer, we implement this new class, InterferenceMacLayer, which extends theCSMA802154 MAC class and changed some aspects for this simulation. We chose to extendthe CSMA802154 because this class would be a better basis for our purpose. We want to sendthe packet immediately, not having to wait for any timer, such as Clear Channel Assessment, orback-off, so we can control it better for a better synchronization with other devices. So, thisnew MAC class whenever receives a new packet coming from an upper layer, we propagateit immediately to the physical layer to be broadcasted into the medium. We also changed,here in this new MAC layer class the function createSignal, responsible for the creation of thetransmitted power mapping. Now, this function will create a mapping in two dimensions, timeand frequency, because the original function in the class was only mapping it in time domain,and for this experiment it is crucial to have a frequency domain mapping, due to the bandwidthdifference between the WSN and WLAN airframes.

The new PHY layer class, InterferencePhyLayer, extends the PhyLayerBattery class, and its onlypurpose is to initialise a new decider we created. The new decider class we created is theInterferenceDecider802154, and it is extending the Decider802154Narrow class. Its main purpose isto process the received signal, both in time and frequency domains, since the previous deciderwas only processing the signal in the time domain. For this reason, we changed the function

6.2 implementation 37

calcChannelSenseRSSI and added the new feature of processing the signal also in the frequencydomain.

In figure 6.3, we can see the scheme of the WSN device.

WSNdevice

Nic

InterferencePhyLayer

InterferenceMacLayer

BaseNetwLayer

SensorApplLayer

Figure 6.3: Layers of a WSN Node

The WLAN node we will consider in the scenarios will be Host80211 nodes using as applicationlayer SensorApplLayer, as network layer BaseNetwLayer, as MAC layer WLANInterferenceMacLayer,and for the PHY layer PhyLayer with the Decider80211 class as a decider.

The choice of the SensorApplLayer as application layer and the BaseNetwLayer as networklayer is the same as for the WSN nodes, referred before. As for the MAC layer, we chose this newclass, WLANInterferenceMacLayer, that extends the Mac80211 class, because we wanted a WLAN

node with the IEEE 802.11 protocol, but here some changes were made.In order to achieve synchronization between networks and to assure the WLAN does not

detect any packet from the WSN devices at any location, we extended this MAC class, so that noback-off timer was triggered. We changed the way to process a received packet from the upperlayer, in the function handleUpperMsg. Whenever we receive a packet from the network layerwe send immediately this packet to the PHY layer, after having encapsulated it in a MAC packetand attaching the signal to the airframe. This packet will be sent down to be immediatelytransmitted as a broadcast airframe.

Regarding the PHY layer and the decider, we used the classes that already implemented theWLAN, IEEE 802.11 protocol standards. We can see in figure 6.4 the scheme of the WLAN device.

WLANdevice

Nic

PhyLayer

WLANInterferenceMacLayer

BaseNetwLayer

SensorApplLayer

Figure 6.4: Layers of a WLAN Node

Also, in order to make all nodes to communicate, despite their different protocol, we useda single connection manager so the WSN receiver could receive both WSN airframes, as data

38 experiment set up 6.4

packets, and WLAN airframes, as interferer packets, in this experiment.

6.3 performance metrics

The MiXiMs model for the IEEE 802.15.4 PHY layer we are using implements the reception asit was described in section 5.6, so this model will ignore the nodes sensitivity and instead,it computes a reception probability based on the received signal SINR. The main differencein this section is that instead of computing the BER according to equation 5.5, it is computedaccording the equation 6.1, which is very similar to equation 5.5, the only difference is that nowthe received frame will have interference cause by the WLAN transmission, so instead of havingthe packet SNR we have to compute the BER considering the SINR, due to the interferer airframepresent in the medium. We can see that the WSN airframe will suffer interference during itsentire duration in figure 6.5.

BER =8

15× 1

16×

16∑k=2

(−1)k(16

k

)e20× SINR× ( 1

k−1 ) (6.1)

Furthermore, for the interference of the WSN airframe by the WLAN airframe, we shouldrealize that the total WSN power ratio, ratio between WSN received power and WLAN receivedpower, defined in equation 6.2, is proportional to the distances of the receiver device andinversely proportional to the interferer device distance, both distances regarding the WSN

receivers position. This equation 6.2 is important in the scenario where the WLAN device isbetween the two WSN devices, configuration in figure 6.2. Note that the variable PL0 in equation6.2 defines the reference distance attenuation.

WSN Power Ratio =WSN Signal Power

WLAN Signal Power

=PowerWSN × PL0WSN × d−α × 10-ShadowingWSN

PowerWLAN × PL0WLAN ×D−α × 10-ShadowingWLAN

∝ d−α

D−α

(6.2)

6.4 experiment set up

In the experiment we will consider the transmission of 25000 packets, each generated at aperiodic inter generation time of 0.01 seconds for both WLAN and WSN transmitters since theyare synchronized. The WSN transmitter will generate packets of 168 bits length, at a rate of250kbit/s, according to IEEE 802.15.4. The WLAN device, the interferer, will transmit packets of1696 bits length at a rate of 1Mbit/s, according to IEEE 802.11. In figure 6.5 we can see how theframes will interfere during the transmission from the transmitters to the receiver.

In the decider class, we chose the modulation of the packets, the header synchronizationlength and the minimum possible BER for the WSN devices. For the modulation, we have chosen

6.5 simulation results 39

OQPSK16 with a minimum BER of 10−8 and a header synchronization length of 8 bits, everythingaccording to IEEE 802.15.4.

timeWLANAirFrame

WSNAirFrame

t1 t2t0 t3

Figure 6.5: Interference Between Airframes

The experiment will be performed with the SimplePathLossModel and the LogNormalShadowingmodels, available in MiXiM. We will again consider two scenarios, slow-changing shadowingscenario and fast shadowing scenario. The parameter for these models are defined in table 5.1,section 5.5.

The WSN devices will have a packet transmission power of 1.1 milliwatt, and will be mappedin time and frequency. As for the interferer, the WLAN device, will have a packet transmissionpower of 100 milliwatt and will also be mapped in time and frequency domains. Both devices,WLAN and WSN will have the same central frequency of 2.412× 109Hz, but the WSN devices willhave a bandwidth of 3MHz, according to IEEE 802.15.4, while the WLAN device, the interferer,will have, according to IEEE 802.11, a bandwidth of 22MHz, which means that only a small partof the 100 milliwatt of the transmission power of the airframe will actually interfere with theWSN transmitted airframe, due to its reduced bandwidth.

The WSN devices will also have a sensitivity of −65 dBm, and the medium thermal noisepower will be −80 dBm.

In table 6.1, we can see a brief resume of the simulation parameters.

6.5 simulation results

After having described the simulation parameters and the WLAN and WSN devices descriptionwe will present the experiment results in this section. First we will present the measurementsfor the SINR, in the slow shadowing scenario and fast shadowing scenario, considering the nodeconfiguration in figure 6.1, where the interferer is before the WSN devices, and the configurationin figure 6.2, in which the WLAN device is in between the two WSN devices. Later, for thesescenarios and configuration we will compare the probabilities of loss and discarded packets.

6.5.1 SINR Analysis

Having stated how the reception of a packet is processed we present the results obtained fromthe simulation. In figure 6.6, we can observe the WSN SINR at the receiver node, for the scenarioof figure 6.1, and considering slow shadowing. In this figure 6.6, the y axis represents thesignals SINR, while the x axis represents the distance between the WSN receiver and the WSN

transmitter. Here, for each distance between the WLAN node and the WSN transmitter node acurve is drawn, and each colour represents this distance.

We can state we observe, as expected, the SINR of the received packets is decreasing as theWLAN node is approaching the WSN node. This decrease of the SINR is explained easily due tothe WLAN high transmission power, this case, a high interferer power, and the case in which weget better SINR is when we have the WLAN node, the interferer, further away, 100 meter awayfrom the WSN transmitter node. The worst case is, as expected, the case where we have both,

40 simulation results 6.5

Parameter ValueCentral Frequency 2.412× 109 Hz

Distance Between WLAN Tx and WSN Tx −100 to 100 m

Distance Between WSN nodes 5 to 50 m

Fast Fading Interval 10 µs

Minimum BER Value 10−8

Noise Variance σ2N −110 dBm

Path Loss Coefficientα 3.0

Receiver Sensitivity −65 dBm

Shadowing Mean µS 0 dB

Shadowing Standard Deviation σS 5 dB

Slow Fading Interval 1 ms

WLAN Bandwidth 22 MHz

WLAN Inter Packet Generation Rate Periodic

WLAN Inter Packet Generation Time 10 ms

WLAN Packet Length 1696 bit

WLAN Transmitted Packets 25000

WLAN Transmission Power 100 mW

WLAN Transmission Rate 1 Mbit/s

WSN Bandwidth 3 MHz

WSN Inter Packet Generation Rate Periodic

WSN Inter Packet Generation Time 10 ms

WSN Modulation OQPSK16

WSN Packet Length 168 bit

WSN PHY Header Synchronization Length 8 bit

WSN Transmitted Packets 25000

WSN Transmission Power 1.1 mW

WSN Transmission Rate 250 kbit/s

Table 6.1: Interference Experiment Parameters

the WLAN and the WSN nodes at the exact same position, and in this case the SINR is less than 0dB, meaning the interferer signal is much stronger than the data signal, the WSN transmittedsignal. Also the signal SINR suffers an exponential decay due to the path loss attenuation, seeequation 3.1.

Now, let us analyse the results the SINR for the scenario in figure 6.1. For this scenario, weobtain the SINR in figure 6.7. Here, we are still considering the case of slow shadowing. It isinteresting to observe in figure 6.7 that the SINR follows a different pattern compared to figure6.6.

We can see some negative peaks in the figure 6.7, these negative peaks correspond to theposition of the WLAN node between the WSN network. This is easily understandable, becausewe have a high powered interferer between the transmitter and the receiver, so it is expectedto have a major interference on that place, meaning we will have a really low SINR. It is alsointeresting to notice that the SINR take its lower peak at the exact place where the interferernode is placed and from this point the SINR is increasing. This fact can be explained with theattenuation of the power regarding the distance, equation 3.1, and also if we take into accountthe relation in equation 6.2.

If we continue to observe the SINR evolution over the distance, when the WLAN node goesfurther than the WSN receiver, we can notice the pattern is getting similar to the case we hadwhen the interferer was before placed before the WSN devices.

6.5 simulation results 41

Figure 6.6: WLAN Before WSN Network Scenario SINR with Slow Shadowing

Figure 6.7: WLAN Between WSN Network Scenario SINR with Slow Shadowing

42 simulation results 6.5

After the slow shadowing case we should assess what happens when fast shadowing ispresent. In figure 6.8, we can see the case where the WLAN node is before the WSN network,figure 6.1, for the fast shadowing scenario. In this figure 6.8, we can see with a dashed linethe slow shadowing scenario and at full line the fast shadowing case. We can state that theSINR pattern does not change, although we can notice a lower SINR for the fast shadowingscenario. This scenario was expected since we have a higher variation in time for the shadowingattenuation.

Figure 6.8: WLAN Before WSN Network Scenario SINR with Fast Shadowing and Comparison with SlowShadowing

Same statement can be done about the figure 6.9, where we have the scenario of figure 6.2,scenario where we have the WLAN node in between the WSN nodes. We can see the same SINR

pattern along the distance for both fast and slow shadowing cases, though we can observea lower SINR for the fast shadowing case, the full line case in figure 6.9, than for the slowshadowing case, the dashed line in figure 6.9. The same statements for the slow shadowingcase, previously stated, are valid for this fast shadowing case.

6.5.2 Packet Reception Analysis

Now that the SINR pattern along the nodes was presented, we will analyse the results about thepacket loss and packet discarded rates.

First, we analyse figure 6.10. In this figure we have the scenario in figure 6.1, WLAN beforeWSN network, so as expected from the SINR figure analyses, when the interferer is further awaywe have the least packet drop rate. This packet drop rate refers to the packets that we actuallyreceive, were able to synchronize with the header, but have errors within their payload. We canalso see from figure 6.10 that the worst case, the case in which we have more than 70 % loss, isthe case where the interferer is at the same place as the WSN transmitter. We can denote a clear

6.5 simulation results 43

Figure 6.9: WLAN Between WSN Network Scenario SINR with Fast Shadowing and Comparison withSlow Shadowing

correlation between the SINR and the dropped packet rate. We can see that as further away wego in distance more packets we lose, this is due to the decrease of the SINR value, the lower itgets the more packets we lose.

In figure 6.11, we have the packet dropped rate for the scenario in figure 6.2. In this figure6.11, we notice a drop rate of 100 % of the packet near the interferer, when the case of having theinterferer between the WSN transmitter and the receiver. This value of total losses is explainedby the lower SINR, due to the high interference power. It is also interesting to note that after the100 % loss rate we actually receive some packets due to equation 6.2. Also we can state thatwhen the interferer is again away from the WSN nodes the packet loss rate gets closer to thescenario in figure 6.1, because the interferer power is, again, much lower than it was when theWLAN node is at closer distances.

As for the fast shadowing scenario we denote an increase of the drop rate, due to the increaseof time variation of the shadowing values. This is explained because the relevant parameter toaccept or not a packet is its minimum SINR, since the BER is calculated based on the SINR. Withfast shadowing, the packet SINR value will change more often, and it just requires one of thoseintervals to drop below the error level for the packet to be dropped. In figure 6.12 and figure6.13 we have the packet drop rate for the scenarios in figure 6.1 and figure 6.2, respectively. Wecan see at full line the packet drop rate for the fast shadowing case and at dashed line the slowshadowing case.

We also have to consider the packet lost due to miss synchronization. In figure 6.14, we havethe loss rate due to miss synchronization with the WSN packet header, in the figure 6.1 scenario,interferer node before the WSN nodes. We see the same behaviour of the drop rate, which issomething expected, since we decide if we drop or synchronize the same way, by using the BER,calculated with the SINR value.

The same behaviour can be seen in figure 6.15, with the scenario in figure 6.2, interferer

44 simulation results 6.5

Figure 6.10: WLAN Before WSN Network Scenario, WSN Receiver Packet Dropped Rate with SlowShadowing

Figure 6.11: WLAN Between WSN Network Scenario, WSN Receiver Packet Dropped Rate with SlowShadowing

6.5 simulation results 45

Figure 6.12: WLAN Before WSN Network Scenario, WSN Receiver Packet Dropped Rate with FastShadowing and Comparison with Slow Shadowing

Figure 6.13: WLAN Between WSN Network Scenario, WSN Receiver Packet Dropped Rate with FastShadowing and Comparison with Slow Shadowing

46 simulation results 6.5

Figure 6.14: WLAN Before WSN Network Scenario, WSN Receiver Packet Loss Rate with Slow Shadowing

between the WSN nodes, when we analyse this figure 6.15 and compare it with the drop rate,figure 6.11, both use the same way to decide if the packet is dropped or lost.

Now in figure 6.16 and in figure 6.17 we have the comparison between the slow shadowingcase, dashed line, and the fast shadowing model, full line. From this figures, figure 6.16 and6.17, we can again conclude that the evolution of the pattern remains the same as the droppedrate pattern. The decreasing of the shadowing time interval increases the loss rate of the packet,due to the fact of having more variations of the shadowing attenuation within a packet time,which will make more probable that during one shadowing interval the SINR value drops belowa level that will cause an error within the packet, since the BER is calculated based on theminimum SINR.

Having analysed the losses independently from the drops, we merge both lost and droppedpacket to obtain the total probability of not receiving a packet. In figure 6.18 and figure 6.19,we have the scenario where the WLAN node is before the WSN nodes and the scenario where theWLAN node is between the WSN nodes, respectively. At dashed line we have the slow shadowingscenario, while at full line we have the fast shadowing scenario. It is interesting to confirm thatin the fast shadowing scenario we obtain higher probability of losses, but the most interestingconclusion is to see the effect the interferer cause when it is placed between the WSN nodes.We can see that in this case, figure 6.2, the interferer cause a huge loss of packets, and theprobability of actually receiving a packet is really low, lower than 5 %. This is explained becauseeven though a packet can be accepted with no errors in the header, it will most probably haveerrors in its payload.

Finally in figure 6.20 we present, again at a dashed line the slow shadowing scenario and atfull line the fast shadowing scenario, the minimum distance that the interferer, the WLAN device,can be, specified in y axis, to provoke a specific percentage of discarded plus lost packets at aWSN device located at a determined location, specified in the x axis. Here, in this figure 6.20, wecan also notice that a propagation medium with faster shadowing will generate higher losses of

6.5 simulation results 47

Figure 6.15: WLAN Between WSN Network Scenario, WSN Receiver Packet Loss Rate with Slow Shad-owing

Figure 6.16: WLAN Before WSN Network Scenario, WSN Receiver Packet Loss Rate with Fast Shadowingand Comparison with Slow Shadowing

48 simulation results 6.5

Figure 6.17: WLAN Between WSN Network Scenario, WSN Receiver Packet Loss Rate with Fast Shadow-ing and Comparison with Slow Shadowing

Figure 6.18: WLAN Before WSN Network Scenario, WSN Receiver Packet Loss Plus Dropped Rate withFast Shadowing and Comparison with Slow Shadowing

6.5 simulation results 49

Figure 6.19: WLAN Between WSN Network Scenario, WSN Receiver Packet Loss Plus Dropped Ratewith Fast Shadowing and Comparison with Slow Shadowing

packets at the same distance than a medium with slow shadowing, because the BER is calculatedbased on the minimum SINR and this has more variation within a packet time.

50 simulation results 6.5

Figure 6.20: Limit Distances for Packet Reception

7 W L A N / W S N C H A N N E L S E N S I N G

WSN and WLAN data transmissions during the same time period generate interference andcollisions, due to the fact of sharing the same ISM band, IEEE 802.11 and IEEE 802.15.4. Thisadversity of using both WLAN and WSN devices made us consider a channel detection modelbased on energy detection. This detection scheme detects both WSN and WLAN transmissions.

We will implement this energy based detector as a sensing module in MiXiM and measure itsaccurateness and performance on the basis of a packet miss detection rate. The model we willconsider, takes into account for the sensing module, the distance between the signals sourceand the WSN radio device. Later, a probability of miss detection will be computed based on thisdistance and parameterized by channel and signal transmission properties.

Finally, the results of this sensing module will be compared with the results from the existingimplementation in MiXiM for channel sensing, under various scenarios.

In this chapter we will present the experiment set up, followed by the implementation thatis required to, actually, implement this module and at the end we will present and compare thesimulations results.

7.1 scenario

To achieve our objective, we will implement an experiment scenario where one WLAN deviceis considered and it will be transmitting packets to the medium at a certain rate in broadcastmode. Then, we will place, away from the WLAN transmitter, a WSN node with this new sensingmodule spaced at a regular interval in distance. The WSN node will be set to activate thissensing module for brief instants of time and sense the medium in the channel in which it isoperating. The sensing module, when active, senses the medium and decides whether or notthe channel is busy.

To study this module performance, we will set several experiments in which we will varythe path loss coefficient α, the noise power level, the transmission power, the sensing time of thesensing module, the receiver sensitivity, the shadowing standard deviation and the shadowinginterval. For all this parameters we will simulate and compare the obtained results with thepreviously implemented detection models in MiXiM. We can see in figure 7.1 the experimentscenario we will consider for the MiXiMs experiments.

Figure 7.1: Sensing Module Experiment Scenario

In the experiment, the WSN node will be placed at a certain distance, d, ranging from 4

meters up to 82 meters of distance from the WLAN transmitter. This WSN node distance to theWLAN will increase progressively based on steps of 3 meters.

52 implementation 7.2

We compare the results obtained with the new sensing module with the previously imple-mented sensing module in MiXiM. This comparison, based on the received packets SINR and thepackets reception rate, is presented in section 7.5.

analytic models The signals attenuation on the receiver will be calculated based on thelog-distance path loss model combined with log-normal shadowing model. These models aredescribed in section 5.2.

7.2 implementation

The experiment we describe in this chapter is meant to implement a sensing module in MiXiM

for WSN devices. This sensing module purpose is to sense the bandwidth we are using of theISM band and decide if there is any power transmission over the medium in the used channeland during the sensing time.

The sensing module is a module that will complement the WSN devices and will act likea switch, we want this module to be able to sense just for a small period of time, in order todecide if there is any power transmission on the medium, at a specific bandwidth.

Some MiXiMs implemented classes were extended, so that we could achieve our goal ofimplementing the sensing module.

We used new classes for both WLAN and WSN nodes to make the experiment possible andwe used only one connection manager, so that all nodes would be connected between then,despite their different protocol, IEEE 802.11 and IEEE 802.15.4. For the WLAN nodes we used theclass TestApplLayer, for the network layer BaseNetwLayer, for the MAC layer Mac80211 and forthe PHY layer the PhyLayer. As for the decider, we used the decider class Decider80211.

The choices for the classes implementing this WLAN device were based on the fact that wejust wanted a node that would implement the IEEE 802.11 protocol and that could generatepackets at a certain given rate. Due to this, we chose the TestApplLayer class for the applicationlayer due to its properties of generating a packet at a periodic time at a determined interpacket generation time. For the network layer, we chose the BaseNetwLayer because we justwanted the message created in the application layer to be propagated to the lower layer, theMAC layer, without any processing, just the normal encapsulation process and send it downimmediately. Now, for the MAC layer we chose the Mac80211 class, because it is a class thatalready implements the MAC layer for the IEEE 802.11 protocol so here the choice was easy.Similarly, we did the same choice for the PHY layer, which was the PhyLayer class. This classalready implements the IEEE 802.11 protocol and is used in MiXiMs auto generated nodes forWLAN devices. The same applies to the decider class choice, we chose the class Decider80211,because it is a threshold decider based on the IEEE 802.11 protocol. In figure 7.2 we can see thescheme of the layers for the WLAN device.

The WSN devices required more effort to be defined. We had to create and extend new classesin order to have the new sensing module fully operational. We chose for the WSN applicationlayer the UBurstApp, for the network layer we chose the class NewBaseNetwLayer and for thePHY layer the choice was the PhyLayerSense.

Here, in the WSN devices we needed to make two types of devices. One type based on theMiXiMs implemented sensing process, and another based on the new sensing module we wantedto implement, so to make this possible we used two different WSN devices. One device wouldcompute MiXiMs sensing and the other device would implement our own sensing module.

For these two ways of sensing we created two different MAC classes. The one based onMiXiMs decision it would be called MyCSMA802154, and for the new sensing module the MAC

class would be called MyCSMA802154_Mat. The differences between both classes will be stated

7.2 implementation 53

WLANdevice

Nic

PhyLayer

Mac80211

BaseNetwLayer

TestApplLayer

Figure 7.2: Layers of a WLAN Node for the Sensing Model Experiment

later on. In figure 7.3 we can see the WSN device layers that will implement MiXiMs sensing,while in figure 7.4 we can see the layers of the WSN device implementing the new sensingmodule.

WSNdevice

Nic

PhyLayerSense

MyCSMA802154

NewBaseNetwLayer

UBurstApp

Figure 7.3: Layers of the WSN Node for Sensing Model Experiment with MiXiMs Implementation

The class we chose for the application layer, UBurstApp, extends the MiXiMs class BurstAp-plLayerBattery, and its main purpose is to implement a timer that will, at periodic times, wakeup and send a message to the layer bellow. This is important in order to make the sensingmodule, since we want it to wake up at pre-determined time intervals, so in order to do this,we added a timer in this class so it would wake up when we defined it, 650 microseconds andsend a message down ordering the PHY to sense the channel, as a control message. Once thetimer wakes up, the class sends a self-message to itself that will arrive in the specified time, 650microseconds, to generate the next wake up call. The remaining functionalities of the previousclasses are not used, since we just want to send orders to sense and we do not generate anytraffic in these WSN nodes.

The network class chosen was NewBaseNetwLayer. This class extends the BaseNetwLayer classand its new functionality is just to detect when we receive a control message from the upperlayer with the meaning of ordering a sensing to the channel, a wake up message, and send itdown to the MAC layer, again as a control message.

Now, for the MAC layer we will address first the class MyCSMA802154, which will implementthe MAC layer in the MiXiMs previously implemented for sensing the channel. This MAC class,MyCSMA802154, extends the CSMA802154 class and whenever it receives a wake up order tosense the channel from the upper layer, it will create a Channel Sense Request until the sensing

54 performance metrics 7.3

WSNdevice

Nic

PhyLayerSense

MyCSMA802154_Mat

NewBaseNetwLayer

UBurstApp

Figure 7.4: Layers of the WSN Node for Sensing Model Experiment with New Sensing Module

time is over. This sensing time is a variable set by us, section 7.4.Let us address now the class MyCSMA802154_Mat, that will implement the MAC layer for

the WSN device with the new sensing module. This MyCSMA802154_Mat class, also extends theCSMA802154, but when it receives the sensing order from the upper layer, just propagates itdown, it does not create any request, that will be the PHY layer job to do. This MAC layer classalso has the role of storing the statistics. It will receive the decisions from the decider, whetherwe got as a sensing result a busy, an idle, a false alarm or a missed detection and will store thisdecision for further data analyses.

Having described the two MAC layers, we now present the new implemented PHY class,PhyLayerSense. This class, PhyLayerSense, extends the PhyLayerBattery, and has the purpose ofinitializing the new decider classes, that will be soon presented, and also to process the upperlayer control message ordering a channel sensing. When this message arrives a request is sentto the decider to sense the channel and compute the decision for it. Note that this functionwill only be triggered by the WSN device with our sensing module, because only its MAC class,MyCSMA802154_Mat, will propagate the channel sensing order down to the PHY layer.

Both, WSN devices, the one which implements MiXiMs previously implemented sensing andthe one implementing the new one, have different deciders. The first, in figure 7.3, has as adecider the class MyDecider802154Narrow, and the second, in figure 7.4, has as a decider theclass NewMyDecider802154Narrow.

The decider class MyDecider802154Narrow, extends the Decider802154Narrow class, and hasthe only purpose to calculate the RSSI value using both time and frequency domains, sincethe previous implementation of the function calcChannelSenseRSSI would only accept packetsdefined in time dimensions. This new implementation accepts both domains and only takesinto account a bandwidth of 3MHz, according to the IEEE 802.15.4 protocol.

The decider class NewMyDecider802154Narrow, extends the MyDecider802154Narrow class,because we need this option of processing the packet, in both time and frequency domains withthe correct bandwidth for the IEEE 802.15.4, and has the purpose of computing the request forour new sensing implementation.

7.3 performance metrics

When a device is send to sense there are only two possible results, channel is Busy or channelis Idle. These two possible outcomes may correspond to four final results, two from the Busydecision and two from the Idle decision. The Busy detection may refer to an actual busy medium,

7.3 performance metrics 55

when we have a packet being transmitted in the medium, or a false alarm, when no packet isbeing transmitted, but, for some reason, we actually sense a packet transmission in the medium.As for the Idle decision, we also have two different outcomes, if the channel has indeed noon-going transmission is a true idle situation, or the channel has a packet being transmitted,at any point of the sensing, and for some reason, we do not detect it, then we have a misseddetection.

In MiXiMs implemented sensing process, we need to send a Channel Sense Request from theMAC to the decider. This request is then processed, by the decider, and the maximum RSSIvalue detected in the medium, during the sensing period, is returned to the MAC layer. Whenthe answer to this Channel Sense Request is received, we compute and compare it to a thresholdvalue, the sensitivity. If the RSSI value if above this threshold the channel is assumed to be busy,if not it is assumed to be idle. This decisions are then stored in the MAC for further data process.

For the MiXiMs channel sensing implementation a vector containing every decision made bythe decider is stored in the MAC. This vector will have only 2 values, 0 for channel idle, or 1 forchannel busy. To analyse this vector and to know if a busy is, indeed, a busy and not a falsealarm, or an idle is, indeed, an idle and not a miss detection, we have a WSN sensor 1 meter awayfrom the WLAN transmitter. By doing this we have a reference with the real decision, because at1 meter there will not be any considerable attenuation of the signal. During the results analysesevery sensor is compared with the reference one and this way we assess whether or not thedecision was correct.

In the new sensing modules, when a sensing request is ordered to the decider, it willcompute the comparison threshold, γ, taking into account a false alarm probability, probability ofdeciding channel busy while it is idle, set a priori, for assessing if the channel is busy or not.The false alarm probability, pFA, we took into consideration for our simulations was 1 %.

The threshold, γ, is computed according to equation 7.2, where ts denotes the sensing time,ψ0 the receivers sensitivity and σ2N the noise standard deviation. We chose to use 6MHzas the sampling frequency fs. The Q function is a transformation of the normal CumulativeDistribution Function (CDF), and it is defined in equation 7.1.

Q(x) =1√2π

∫ infx

exp(−u2

2) du (7.1)

γ(pFA) = max{ψ0, σ2N[1+√2

fstsQ−1(pFA)]} (7.2)

After having calculated the busy threshold, we calculate the received power at the WSN

node, the receivers node, based on the distance, d between the WSN and WLAN devices. We useequation 7.3 to generate a Monte Carlo simulation with 10000 samples for the received powerwith log-normal shadowing. Note that PL0 denotes the path loss attenuation reference and αdenotes the pass loss coefficient.

PowerRx = PowerTx × PL0× d−α × 10-Shadowing (7.3)

Finally having the received power, PRx, value, we compute the miss detection probabilityPMD, by calculating equation 7.4.

PMD(ts, d, γ(pFA)) = 1− Q(γ(pFA) − (σ2N + PRx(d))

σ2N

√2

fsts

) (7.4)

After this we generate a random number according to a uniform distribution between 0 and1 and compare this number to the miss detection probability. If the number is lower than themiss detection probability, the packet is not detected, but if it is higher the packet is detected

56 simulation results 7.5

and instead of a miss detection we have a detection, busy. This procedure only applies whenwe have a packet in the medium, if we do not have a packet in the medium we generate arandom number according a uniform distribution between 0 and 1, but this time we compare itto the false alarm probability and if the number is lower, we have a false alarm, if the number ishigher we have an idle decision.

The way we chose to assure the medium had, indeed, any packet, was to access the vectorthat contains all the airframes in the medium and check its size. If its size is higher or equal to1 then the medium is actually busy, so only 2 options may occur, a detection or a miss detection.On the other side, if the airframes vector size is 0 then the medium will be idle and we can onlyhave either idle or false alarm decision.

After the decider decision, the results are sent to the MAC layer, so they can be stored andlater processed. The statistics will be stored in a counter for each result option, idle, false alarm,busy or miss detection, and the respective counter is incremented every time a decision is made.

7.4 experiment set up

For this experiment, we will consider the WLAN device transmits 9000 packets, being each oneof them generated at a periodic inter packet generation time of 0.001 seconds. The transmittedpackets will be 528 bit length and transmitted at a rate of 2Mbit/s.

The WSN sensing module will have a call to sense the medium every 650 microseconds, andwhenever ordered to sense they will sense the medium at their bandwidth for a variable time.This time will vary from 32 microseconds up to 128 microseconds.

The WLAN transmitted packet power will take values from 50 milliwatt up to 150 milliwatt.The transmission power will be mapped in time and frequency domains and with 22MHz ofbandwidth, according to IEEE 802.11 protocol. Also, the WSN devices will sense this power in a3MHz bandwidth, so only some of the transmitted power will be actually sensed by the sensingmodule.

We are going to take into consideration for the WSN devices variable sensitivities from arange of −65 dBm up to −55 dBm, and for the thermal noise level we will consider values from−90 dBm up to −80 dBm.

As for the propagation medium we have chosen the MiXiMs SimplePathLossModel and theLogNormalShadowing models. We consider two scenarios, slow-changing shadowing scenarioand fast shadowing scenario. The parameter for these models are defined in table 5.1, section5.5.

The increased number of variable parameters aim to test and compare our proposed sensingmodule with the previously implemented by MiXiM, so we can have a wide results comparisonbased on each parameter.

In table 7.1 we can see a brief resume of the simulation parameters.

7.5 simulation results

In this section we present the results for the simulations described on the previous section.Here, we will divide the simulation results into several subsections. These subsections willrepresent each variable we varied, and in order to study the effects of a variable change inthe results, whenever we vary one variable in a range of values, the other variables are holdconstant so we can compare in a proper way its evolution in the results.

For all subsections, a reference line was plotted in the figures. This reference line has thesame parameters in all the experiments, so the variable effects can be evaluated. The reference

7.5 simulation results 57

Parameter ValueCentral Frequency 2.412× 109 Hz

Distance Between WLAN Tx and WSN Rx 4 to 82 m

Fading Interval 1000 to 10 µs

Inter Packet Generation Rate Periodic

Inter Packet Generation Time 1 ms

Noise Variance σ2N −90 to − 80 dBm

Path Loss Coefficientα 2.5 to 3.5

Receiver Sensitivity −65 to − 55 dBm

Sensing Interval 650 µs

Sensing Time 32 to 128 µs

Shadowing Mean µS 0 dB

Shadowing Standard Deviation σS 0 to 10 dB

WLAN Bandwidth 22 MHz

WLAN Packet Length 528 bit

WLAN Transmitted Packets 9000

WLAN Transmission Power 100 mW

WLAN Transmission Rate 2 Mbit/s

WSN Bandwidth 3 MHz

Table 7.1: Sensing Module Experiment Parameters

line will have as path loss coefficient α the value of 3, a WLAN transmission power of 100milliwatt, a WSN receiver sensitivity of −65 dBm, a sensing time of 64 microseconds, a noisevariance of −80 dBm, a shadowing interval time of 1 millisecond and a shadowing standarddeviation of 5 dB.

In table 7.2, we present the resume of the reference line parameters.

Parameter ValuePath Loss Coefficientα 3.0

Transmission Power 100 mW

Receiver Sensitivity −65 dBm

Sensing Time 64 µs

Noise Variance σ2N −80 dBm

Shadowing Interval 1 ms

Shadowing Standard Deviation σS 5 dB

Table 7.2: Reference Line Parameters

7.5.1 Path Loss Coefficient α

In this subsection, we want to analyse the missed detections obtained from the simulationwhere we varied the path loss coefficient α value from 2.5 up to 3.5. The aim of this experimentis to understand how the MiXiMs simulation differs from our implemented sensing model, andto see the variation between this range of values.

Except for the α, all other variables were held constant to the same values of the referenceline. This way, we will be able to study just the α variable and its evolution.

In figure 7.5, we have the missed detections for the path loss coefficient α for both MiXiMssensing model and our mathematical implemented sensing model. We can see for each α value

58 simulation results 7.5

two lines, the one with the marker ∗ represents the results from our newly implemented sensingmodule, while the one with the marker ◦ represents the results from the MiXiMs previouslyimplemented sensing module. As expected, the higher the α the sooner we start to loosepackets, because the medium has more attenuation with higher α.

Figure 7.5: Comparison Between MiXiM and Mathematical Model for the α Parameter

In the figure 7.5, we can notice the lines for the same α value, corresponding to the newand the previously implemented sensing modules are close to each other, and follow the samepattern. This pattern is kept independently from the α values. The lines of both sensing module,for the same α value, cross at some point, which indicate the difference between them could bethe way of calculating the shadowing.

It is interesting to notice that for higher values of α this difference between the two sensingmodules tend to disappear, and for α > 3 the difference is almost negligible, scenario that isgood for indoor propagation, due to its high α value.

We can conclude that both models follow the expected pattern and are very similar regardingits final results, though MiXiM underestimates the detection of packets in the medium comparedwith our new sensing model implementation.

7.5.2 Transmission Power

This subsection has the purpose of analysing the obtained miss detections when we vary thevariable Transmission Power and its role in the experiment. We vary the WLAN transmissionpower from 50 milliwatt up to 100 milliwatt and all the other parameters are set accordingto the reference line. This way, can know the precise results regarding the changing of thetransmission power.

In figure 7.6 we can see the results of the simulation with three different WLAN transmissionpowers, 50, 100 and 150milliwatt. We can see, for the same transmission power value, both lines,the new implemented sensing module and the MiXiMs previously implementation, followingsimilar patterns. Again, the marker ∗ denotes the new implementation, and ◦ denotes theprevious MiXiMs implementation.

7.5 simulation results 59

Figure 7.6: Comparison Between MiXiM and Mathematical Model for the Transmission Power Parameter

In this figure 7.6, the results follow the expected pattern, if the transmitted power increasesthe more packets will the further nodes detect. This is shown by the shift to the right on thecurves with the increase of the transmitted power. We can also notice the more the transmittedpower is the more the gap between the two lines open, though not in a significant difference.

All of the lines, for the same transmitted power, cross around the same percentage, whichis a good indicator of consistency. We can state again that the MiXiMs implementation for thesensing module underestimates the detection of packets in the medium.

7.5.3 Receiver Sensitivity

The objective of this subsection is to present the results the we vary the sensitivity variable.Here, we vary the sensitivity from −55 dBm up to −65 dBm. Also, as stated in the previoussubsections, the other variables are constant with their values equal to the reference line valuesin table 7.2.

In figure 7.7, we can see the curves, being the curve with marker ∗ the new implementation,and with the marker ◦ the one correspondent to MiXiMs, for the results when varying thesensitivity values.

We see in figure 7.7 some similar results with the previous ones. We obtain the expectedresult, the lowest the sensitivity goes, the higher the shift in the curves to further distances is.This result is more than expected due to the capacity of the sensor to detect the signal at lowerreceived power. We also see the same pattern in the curves and the same crossing betweenthem we noticed in the previous subsections.

60 simulation results 7.5

Figure 7.7: Comparison Between MiXiM and Mathematical Model for the WSN Receiver SensitivityParameter

7.5.4 Sensing Time

In this subsection, we analyse the results of varying the sensing time of the sensing modules. Thesensing time will vary from 32 microseconds up to 128 microseconds in both new implementedmodule and MiXiMs module. Apart from this variable, the sensing module, all other variableswill remain unchanged and according to the reference line.

In figure 7.8 we can see with the marker ∗ the results for the new implemented module andwith the marker ◦ the MiXiMs implemented sensing module. In this figure 7.8, we see the linescorrespondent to each implementation are overlapped. It is interesting to state that despite theabsolute values are not the exact same for each sensing time interval, the rate remains the same,resulting in figure 7.8, where all the sensing times for one implementation are overlapped withthe same rates at the same distances.

Again as before, we see the missed detection probability curves for both implementationcross each other, follow the same expected pattern.

7.5.5 Noise Variance

In this subsection, we present and analyse the results of the simulation when we vary the noisevariance. This variable will vary from −90 dBm up to −80 dBm. Once more, the remainingvariables are held constant so we can analyse just this variable contribution to the result.

In figure 7.9 we have, again with the ∗ marker, the results from the new implementedsensing module, and with the ◦ marker the results from the MiXiMs previously implementedmodel.

In the figure 7.9, we can see the curves follow the same pattern as expected, crossing eachother at a certain distance. For both curves we have slightly the same results, which make sensedue to the fact of this value is much lower than the sensitivity and will not affect the reception.

7.5 simulation results 61

Figure 7.8: Mathematical Model Results for the Sensing Time Parameter

Figure 7.9: Comparison Between MiXiM and Mathematical Model for the Noise Variance Parameter

62 simulation results 7.5

7.5.6 Shadowing Interval

This subsection is meant to analyse the results regarding the variation of the shadowing intervaltime variable. This variable will be vary from 1 millisecond down to 10 microseconds, in orderto cover slow and fast fading and see the difference of performance. The remaining variableswill not vary and will, once again, be set to equal to the reference line, see table 7.2.

This subsection only contain results from the MiXiM implementation because only thismodule allows the variation of this variable. Our module does not contain any possible way ofdefining the time in which the shadowing interval changes.

In figure 7.10, we can notice the lines follow the same pattern, and the only differencebetween them is the abruptness of the curve when changing from total detection to total missdetection.

Figure 7.10: Comparison Between MiXiM and Mathematical Model for the Shadowing Interval Parameter

This more abrupt changing when fast fading is considered is expected and the betterperformance of this curve may be related with this fast interval rate. With a higher interval rateof the shadowing, we have more different values for the power when sensing the channel. So itis more probable that if a packet was present in the medium, and with slow fading this packetwould be hidden from the receiver, now with a higher variation it is more plausible that it willnot. During the variations, it is likely probable that at some point the receiver power valueincreases to pass the threshold level for detection.

This is the reason why with faster fading we have better channel detections.

7.5.7 Shadowing Standard Deviation

In this chapter we will analyse and compare the results from both modules in study, while wevary the variable shadowing standard deviation. We will vary the variable from 0 dB up to 10dB, so we can study the effect of the shadowing variation.

7.5 simulation results 63

In figure 7.11, the line with the marker ∗ represents the new sensing model, and the linewith the marker ◦ represents the MiXiMs implementation.

In this figure 7.11, we can observe that the previously seen pattern holds and despite thevariation of the shadowing standard deviation, both models offer similar results.

Figure 7.11: Comparison Between MiXiM and Mathematical Model for the Shadowing Standard DeviationParameter

Also interesting to see the lowest the shadowing interval is, the more abrupt the curvebecomes. If we take the shadowing out of consideration, the received power will decayconstantly, and at a certain value for the distance, it will drops below the sensitivity. Once thishappens we will go from a total detection to a total miss detection, originating this abruptchange.

8 C O N C L U S I O N

In this work we addressed the compliance between MiXiM and analytic models while simu-lating both homogeneous scenarios, considering WSN devices, and heterogeneous scenarios,considering WLAN and WSN devices. We were interested in analysing the coexistence effect inheterogeneous networks and evaluate its accurateness in predicting the interference patterngenerated by a WLAN device in WSN devices.

We proposed a framework extension to simulate in a more realistic way the data transmissionand interference between devices when they transmit in different, but overlapping spectrumbands. For the transmitter, we suggested a new way of defining a transmitted signal, byimplementing a custom mapping instead of the ideal used by MiXiM. This way we woulddefine the signal not in total power over a spectrum band, but in power densities over the usedspectrum band. For the receiver, we implemented a custom reception filter to simulate the realdevices characteristic, where the signal would suffer different gains at different frequencies,representing well the hardware implementation, instead of the ideal MiXiMs reception filter.These new definitions play an important role in simulating cross-channel interference, with nocentral frequency overlap.

We evaluated a WSN standalone network to evaluate MiXiMs simulation results compared toanalytical models, log-distance path loss model combined with log-normal shadowing model.The results were evaluated in SNR and in packet loss rate, where MiXiM has an interestingdifferentiation of packet losses resultant from packet PHY header error and packet payload error.We concluded that the results between MiXiMs simulation and analytical models follow a similarpattern.

We performed a pioneer heterogeneous network simulation with WLAN and WSN devicesusing MiXiM. To achieve the heterogeneous network a single connection manager module had tobe used to establish all the connections between the different devices. In this simulation wewanted to evaluate the MiXiMs simulation results in a coexistence scenario between the WLAN

and the WSN devices. For this evaluation we analysed the interference pattern the WLAN devicewould cause in the WSN transmissions. The results were evaluated by the study of the WSN

SINR and the WSN packet loss rate. Once again, we distinguish between packets loss due to PHY

header error and payload error. The results obtained showed the coexistence between these twotypes of devices is harmful for the WSN, specially if the WLAN device is close to the WSN. Despitehaving some packet losses with this proximity between devices, we show that the worst casescenario is when the WLAN is located in the interval between the WSN transmitter and the WSN

receiver pair. We can state the MiXiMs simulation results are accurate and follow the analyticalmodels prediction.

We implemented and evaluated a sensing module for the WSN devices, based on an a priorifalse alarm probability. We intended to evaluate our simple analytic model for detection bycomparing its results with the MiXiMs pre-implemented sensing procedure, and measure theresults in a signal miss detection rate. The results in this experiment showed us that bothimplementation follow similar patterns and can, clearly, be correlated with each other, validatingthis way the sensing module.

The purpose of this work was to assess whether our analytic models comply with MiXiM,in the case of heterogeneous networks simulation, WLAN and WSN coexistence. We wantedto evaluate the simulation results by testing MiXiM in this new simulation paradigm, crossnetworks scenario with shared ISM band spectrum.

9 F U T U R E W O R K

A new experiment was implemented in MiXiM, cross network simulation, sharing the same ISM

band channel. Several experiments were developed in this work, showing that some issues,regarding the simulations, could be improved.

First, we propose an improvement to the class Decider802154Narrow, in the WSN devices, toconsider the device sensitivity threshold and not only the received packet SINR.

Another possible improvement could be the possibility of defining the devices bandwidthfor the transmitted power and its pattern in the INI file. This option would also consider theamount of mapping domains we would like to map the signal.

Also, a improvement could also be done in our sensing module. The computed shadowingsamples, in the Monte Carlo simulation, could be a variable dependent to the sensing timeand the shadowing interval time. On top of the computed samples for the fading, we wouldgenerate a certain small number of samples according to the packet length so that a fast fadingrealization could be simulated. This could replicate in a more precise way real scenario results.

Finally, we suggest a new framework for MiXiM. The new framework would have a newApplication Programming Interface (API) for the presented custom definitions of transmittedsignal and reception filter. This new API would be useful for future heterogeneous networkssimulations, either for WLAN and WSN coexistence scenarios, or more generally to study anycoexistence between networks scenario.

A C R O N Y M S

API Application Programming Interface

BER Bit Error Rate

CCA Clear Channel Assessment

CDF Cumulative Distribution Function

CSMA/CA Carrier Sense Multiple Access with Collision Avoidance

dB Decibel

dBm power ratio in Decibel referenced to milliwatt

IEEE Institute of Electrical and Electronics Engineers

IP Internet Protocol

ISM Industrial, Scientific and Medical

MAC Medium Access Control

MiXiM Mixed Simulator framework

NIC Network Interface Controller

OQPSK Offset Quadrature Phase-Shift Keying

PHY Physical

RTS/CTS Request-To-Send/Clear-To-Send

SINR Signal to Interference plus Noise Ratio

SNR Signal-to-noise ratio

TCP Transmission Control Protocol

WLAN Wireless Local Area Netwok

WSN Wireless Sensor Network

XML Extensible Markup Language

List of Figures

3.1 MiXiM Node Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

4.1 Transmitted power mask in MiXiMs signal . . . . . . . . . . . . . . . . . . . . . . 144.2 Real signals transmitted power mask . . . . . . . . . . . . . . . . . . . . . . . . . 144.3 MiXiMs receivers filter mask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144.4 Filters real characteristic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154.5 New Implemented Transmission Power Mapping . . . . . . . . . . . . . . . . . . 15

69

70 LIST OF FIGURES

4.6 New Implemented Filter Characteristic . . . . . . . . . . . . . . . . . . . . . . . . 164.7 Example of Resultant Filter Mapping Built From Input . . . . . . . . . . . . . . . 174.8 Interference Between Signals in Time Overlap . . . . . . . . . . . . . . . . . . . . 184.9 Interference Between Signals in Spectrum Overlap . . . . . . . . . . . . . . . . . . 184.10 Two Node Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194.11 Transmitted Power Mapping Created by createSignal Function . . . . . . . . . . . 204.12 Received power Mapping Created by the Decider Class . . . . . . . . . . . . . . . 204.13 Noise Mapping with Filter Mapping Created by calculateRSSIMapping Function 204.14 Final SNR Mapping Created by the Decider Class . . . . . . . . . . . . . . . . . . 214.15 Three Node Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214.16 Transmitted Power of Data Airframe Created by createSignal Function . . . . . . 224.17 Transmitted Power of Interferer Airframe Created by the old createSignal Function 234.18 Interference Power After Filtered Created by calculateRSSIMapping Function . . 234.19 Noise Plus Interference Power and Filter Created by calculateRSSIMapping Function 234.20 Received Data Transmitted Power Mapping Created by the Decider Class . . . . 234.21 Final SINR Mapping Created by the Decider Class . . . . . . . . . . . . . . . . . 23

5.1 WSN Standalone Simulation Scenario . . . . . . . . . . . . . . . . . . . . . . . . . 275.2 Layers of WSN Nodes in the Standalone Network . . . . . . . . . . . . . . . . . . 285.3 WSN Packet Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295.4 Reception Decision for WSN Packets . . . . . . . . . . . . . . . . . . . . . . . . . . 295.5 Signal-to-Noise Ratio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325.6 Airframe Loss Rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335.7 Airframe Discard Rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335.8 Total of Loss and Discarded Airframes . . . . . . . . . . . . . . . . . . . . . . . . 34

6.1 WLAN Before WSN Network Scenario . . . . . . . . . . . . . . . . . . . . . . . . 356.2 WLAN Between WSN Nodes Scenario . . . . . . . . . . . . . . . . . . . . . . . . . 366.3 Layers of a WSN Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376.4 Layers of a WLAN Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376.5 Interference Between Airframes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396.6 WLAN Before WSN Network Scenario SINR with Slow Shadowing . . . . . . . 416.7 WLAN Between WSN Network Scenario SINR with Slow Shadowing . . . . . . 416.8 WLAN Before WSN Network Scenario SINR with Fast Shadowing and Compari-

son with Slow Shadowing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426.9 WLAN Between WSN Network Scenario SINR with Fast Shadowing and Com-

parison with Slow Shadowing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436.10 WLAN Before WSN Network Scenario, WSN Receiver Packet Dropped Rate with

Slow Shadowing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446.11 WLAN Between WSN Network Scenario, WSN Receiver Packet Dropped Rate

with Slow Shadowing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446.12 WLAN Before WSN Network Scenario, WSN Receiver Packet Dropped Rate with

Fast Shadowing and Comparison with Slow Shadowing . . . . . . . . . . . . . . 456.13 WLAN Between WSN Network Scenario, WSN Receiver Packet Dropped Rate

with Fast Shadowing and Comparison with Slow Shadowing . . . . . . . . . . . 456.14 WLAN Before WSN Network Scenario, WSN Receiver Packet Loss Rate with

Slow Shadowing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466.15 WLAN Between WSN Network Scenario, WSN Receiver Packet Loss Rate with

Slow Shadowing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476.16 WLAN Before WSN Network Scenario, WSN Receiver Packet Loss Rate with

Fast Shadowing and Comparison with Slow Shadowing . . . . . . . . . . . . . . 47

6.17 WLAN Between WSN Network Scenario, WSN Receiver Packet Loss Rate withFast Shadowing and Comparison with Slow Shadowing . . . . . . . . . . . . . . 48

6.18 WLAN Before WSN Network Scenario, WSN Receiver Packet Loss Plus DroppedRate with Fast Shadowing and Comparison with Slow Shadowing . . . . . . . . 48

6.19 WLAN Between WSN Network Scenario, WSN Receiver Packet Loss PlusDropped Rate with Fast Shadowing and Comparison with Slow Shadowing . . 49

6.20 Limit Distances for Packet Reception . . . . . . . . . . . . . . . . . . . . . . . . . . 50

7.1 Sensing Module Experiment Scenario . . . . . . . . . . . . . . . . . . . . . . . . . 517.2 Layers of a WLAN Node for the Sensing Model Experiment . . . . . . . . . . . . 537.3 Layers of the WSN Node for Sensing Model Experiment with MiXiMs Implemen-

tation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537.4 Layers of the WSN Node for Sensing Model Experiment with New Sensing Module 547.5 Comparison Between MiXiM and Mathematical Model for the α Parameter . . . 587.6 Comparison Between MiXiM and Mathematical Model for the Transmission

Power Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597.7 Comparison Between MiXiM and Mathematical Model for the WSN Receiver

Sensitivity Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607.8 Mathematical Model Results for the Sensing Time Parameter . . . . . . . . . . . 617.9 Comparison Between MiXiM and Mathematical Model for the Noise Variance

Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617.10 Comparison Between MiXiM and Mathematical Model for the Shadowing Interval

Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627.11 Comparison Between MiXiM and Mathematical Model for the Shadowing Stan-

dard Deviation Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

List of Tables

4.1 Transmission Power Mapping Definition . . . . . . . . . . . . . . . . . . . . . . . 154.2 Filter Characteristic Mapping Definition . . . . . . . . . . . . . . . . . . . . . . . . 174.3 New Power and Filter Implementation Experiment Parameters . . . . . . . . . . 22

5.1 Standalone Experiment Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . 305.2 Standalone Experiment Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

6.1 Interference Experiment Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . 40

7.1 Sensing Module Experiment Parameters . . . . . . . . . . . . . . . . . . . . . . . 577.2 Reference Line Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

71

B I B L I O G R A P H Y

[1] O. Akan, O. Karli, and O. Ergul. “Cognitive radio sensor networks”. In: Network, IEEE23.4 (2009), pp. 34–40 (cit. on p. 1).

[2] L. Angrisani, M. Bertocco, D. Fortin, and A. Sona. “Experimental study of coexistenceissues between IEEE 802.11 b and IEEE 802.15. 4 wireless networks”. In: Instrumentationand Measurement, IEEE Transactions on 57.8 (2008), pp. 1514–1523 (cit. on pp. 1, 3).

[3] G. Bianchi. “Performance analysis of the IEEE 802.11 distributed coordination function”.In: Selected Areas in Communications, IEEE Journal on 18.3 (2000), pp. 535–547 (cit. on p. 3).

[4] I. Glaropoulos, V. Fodor, L. Pescosolido, and C. Petrioli. “Cognitive WSN transmissioncontrol for energy efficiency under WLAN coexistence”. In: Cognitive Radio Oriented Wire-less Networks and Communications (CROWNCOM), 2011 Sixth International ICST Conferenceon. 2011, pp. 261 –265 (cit. on p. 1).

[5] Ólafur Helgason and Sylvia T. Kouyoumdjieva. “Enabling multiple controllable radios inOMNeT++ nodes”. In: Proceedings of the 4th International ICST Conference on Simulation Toolsand Techniques. SIMUTools ’11. Barcelona, Spain: ICST (Institute for Computer Sciences,Social-Informatics and Telecommunications Engineering), 2011, pp. 398–401. isbn: 978-1-936968-00-8. url: http://dl.acm.org/citation.cfm?id=2151054.2151124 (cit. onp. 4).

[6] J. Hou, B. Chang, D.K. Cho, and M. Gerla. “Minimizing 802.11 interference on ZigBeemedical sensors”. In: Proceedings of the Fourth International Conference on Body Area Net-works. ICST (Institute for Computer Sciences, Social-Informatics and TelecommunicationsEngineering). 2009, p. 5 (cit. on p. 1).

[7] “IEEE Standard for Information technology– Local and metropolitan area networks–Specific requirements– Part 15.4: Wireless Medium Access Control (MAC) and PhysicalLayer (PHY) Specifications for Low Rate Wireless Personal Area Networks (WPANs)”.In: IEEE Std 802.15.4-2006 (Revision of IEEE Std 802.15.4-2003) (July 2006), pp. 1 –320. doi:10.1109/IEEESTD.2006.232110 (cit. on p. 1).

[8] A. Kellner, K. Behrends, and D. Hogrefe. “Simulation Environments for Wireless SensorNetworks”. In: no. June (2010) (cit. on p. 2).

[9] Andreas Köpke et al. “Simulating Wireless and Mobile Networks in OMNeT++ – TheMiXiM Vision”. In: OMNeT++ 2008: Proceedings of the 1st International Workshop on OM-NeT++ (hosted by SIMUTools 2008). Marseille, France: ICST (Institute for Computer Sciences,Social-Informatics and Telecommunications Engineering), 2008 (cit. on p. 4).

[10] C.J.M. Liang, N.B. Priyantha, J. Liu, and A. Terzis. “Surviving wi-fi interference in lowpower zigbee networks”. In: Proceedings of the 8th ACM Conference on Embedded NetworkedSensor Systems. ACM. 2010, pp. 309–322 (cit. on p. 3).

[11] MiXiM. http://mixim.sourceforge.net (cit. on pp. 2, 4, 9).

[12] OMNeT++. http://www.omnetpp.org/ (cit. on pp. 4, 9).

[13] M. Petrova, L. Wu, P. Mahonen, and J. Riihijarvi. “Interference measurements on perfor-mance degradation between colocated ieee 802.11 g/n and ieee 802.15. 4 networks”. In:Networking, 2007. ICN’07. Sixth International Conference on. IEEE. 2007, pp. 93–93 (cit. onp. 3).

74 bibliography

[14] A. Sikora and V.F. Groza. “Coexistence of IEEE802.15.4 with other Systems in the 2.4 GHz-ISM-Band”. In: Instrumentation and Measurement Technology Conference, 2005. IMTC 2005.Proceedings of the IEEE. Vol. 3. 2005, pp. 1786 –1791. doi: 10.1109/IMTC.2005.1604479(cit. on p. 1).

[15] A. Stetsko, M. Stehlík, and V. Matyas. “Calibrating and comparing simulators for wirelesssensor networks”. In: Mobile Adhoc and Sensor Systems (MASS), 2011 IEEE 8th InternationalConference on. IEEE. 2011, pp. 733–738 (cit. on p. 4).

[16] Karl Wessel, Michael Swigulski, Andreas Köpke, and Daniel Willkomm. MiXiM – ThePhysical Layer An Architecture Overview (cit. on p. 4).

[17] Xiaodong Xian, Weiren Shi, and He Huang. “Comparison of OMNET++ and othersimulator for WSN simulation”. In: Industrial Electronics and Applications, 2008. ICIEA 2008.3rd IEEE Conference on. 2008, pp. 1439 –1443. doi: 10.1109/ICIEA.2008.4582757 (cit. onp. 4).

[18] Jianliang Zheng and M.J. Lee. “Will IEEE 802.15.4 make ubiquitous networking a reality?:a discussion on a potential low power, low bit rate standard”. In: Communications Magazine,IEEE 42.6 (2004), pp. 140 –146. issn: 0163-6804. doi: 10.1109/MCOM.2004.1304251 (cit. onp. 1).