• No results found

DESIGN AND IMPLEMENTATION OF WIRELESS SENSOR NETWORKS UTILIZING SECTOR ANTENNAS

N/A
N/A
Protected

Academic year: 2022

Share "DESIGN AND IMPLEMENTATION OF WIRELESS SENSOR NETWORKS UTILIZING SECTOR ANTENNAS"

Copied!
88
0
0

Loading.... (view fulltext now)

Full text

(1)

DESIGN AND IMPLEMENTATION OF WIRELESS SENSOR NETWORKS UTILIZING SECTOR ANTENNAS

A THESIS SUBMITTED TO

THE GRADUATE SCHOOL OF NATURAL AND APPLIED SCIENCES OF

MIDDLE EAST TECHNICAL UNIVERSITY

BY

YUSUF ALPER BILGIN

IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR

THE DEGREE OF MASTER OF SCIENCE IN

ELECTRICAL AND ELECTRONICS ENGINEERING

FEBRUARY 2016

(2)
(3)

Approval of the thesis:

DESIGN AND IMPLEMENTATION OF WIRELESS SENSOR NETWORKS UTILIZING SECTOR ANTENNAS

submitted by YUSUF ALPER BILGIN in partial fulfillment of the requirements for the degree of Master of Science in Electrical and Electronics Engineering Depart- ment, Middle East Technical University by,

Prof. Dr. Gülbin Dural Ünver

Dean, Graduate School of Natural and Applied Sciences Prof. Dr. Gönül Sayan Turhan

Head of Department, Electrical and Electronics Engineering Prof. Dr. Ali Özgür Yılmaz

Supervisor, Electrical and Electronics Eng. Dept., METU

Examining Committee Members:

Prof. Dr. Yalçın Tanık

Electrical and Electronics Engineering Department, METU Prof. Dr. Ali Özgür Yılmaz

Electrical and Electronics Engineering Department, METU Prof. Dr. Buyurman Baykal

Electrical and Electronics Engineering Department, METU Assoc. Prof. Dr. Cüneyt F. Bazlamaçcı

Electrical and Electronics Engineering Department, METU Assoc. Prof. Dr. Cenk Toker

Electrical and Electronics Engineering Dept., Hacettepe Uni.

Date:

(4)

I hereby declare that all information in this document has been obtained and presented in accordance with academic rules and ethical conduct. I also declare that, as required by these rules and conduct, I have fully cited and referenced all material and results that are not original to this work.

Name, Last Name: YUSUF ALPER BILGIN

Signature :

(5)

ABSTRACT

DESIGN AND IMPLEMENTATION OF WIRELESS SENSOR NETWORKS UTILIZING SECTOR ANTENNAS

Bilgin, Yusuf Alper

M.S., Department of Electrical and Electronics Engineering Supervisor : Prof. Dr. Ali Özgür Yılmaz

February 2016, 68 pages

This thesis considers the medium access control layer (MAC) for a wireless sensor network (WSN) utilizing sector antennas. We propose a communication protocol in- cluding a neighbor discovery protocol, a routing protocol and a transmission protocol similar to ALOHA for WSNs operating with sector antennas. The main contribu- tion to the literature is to compare the outcome of using sector antennas with using omnidirectional antennas in WSNs by both experimental studies and simulations. Ex- perimental studies compare:

• A network performing the proposed MAC protocol and utilizing sector anten- nas,

• A network performing ALOHA and using omnidirectional antennas.

On the other hand, in addition to the networks in the experimental studies, simulation studies include:

• A network using omnidirectional antennas and utilizing Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) algorithm,

(6)

• A network utilizing sector antennas which have 5 sectors with the proposed MAC protocol,

• A network using 3 sector antennas and has 3 different Radio Frequency (RF) modules, each directing to the different sectors, in the sink node.

Both the experimental studies and the simulation results are presented to demonstrate the advantages of sector antennas over omnidirectional antennas by examining packet delivery ratio and latency parameters as networks’ traffic loads are varied.

Keywords: Neighbor Discovery, Directional Antennas, Sector Antennas, Wireless Networks

(7)

ÖZ

SEKTÖREL ANTENLER ˙ILE ÇALI ¸SAN KABLOSUZ ˙ILET˙I ¸S˙IM A ˘GI D˙IZAYNI VE ˙IMPLEMENTASYONU

Bilgin, Yusuf Alper

Yüksek Lisans, Elektrik ve Elektronik Mühendisli˘gi Bölümü Tez Yöneticisi : Prof. Dr. Ali Özgür Yılmaz

¸Subat 2016 , 68 sayfa

Bu çalı¸smada, sektörel antenlerden faydalanan merkezi ileti¸sim a˘gları (WSNs) için orta eri¸sim kontrol tabakası (MAC) ele alınmı¸stır. Kom¸su bulma protokolü, yönlen- dirme protokolü ve ALOHA’ya benzeyen iletim protokolünü içeren bir haberle¸sme protokolü önerilmi¸stir. Literatüre yapılan ba¸slıca katkı, kablosuz ileti¸sim a˘glarında yönsüz antenler yerine sektörel antenler kullanılmasının etkilerini hem deneysel ça- lı¸smalar ile hem de benzetim çalı¸smaları ile kıyaslamaktır. Deneysel çalı¸smalarda a¸sa˘gıda bulunan a˘glar kar¸sıla¸stırılmı¸stır:

• Önerilen MAC protokolü ile birlikte 3 sektörlü sektörel antenleri kullanan bir a˘g,

• ALOHA ile birlikte yönsüz antenleri kullanan bir a˘g.

Benzetim çalı¸smaları, deneysel çalı¸smalardaki a˘glara ek olarak a¸sa˘gıda bulunan a˘glar için yapılan çalı¸smaları da içermektedir:

• CSMA/CA ile birlikte yönsüz antenleri kullanan bir a˘g,

• Önerilen MAC protokolü ile birlikte 5 sektörlü sektörel antenleri kullanan bir a˘g,

(8)

• Önerilen MAC protokolü ile birlikte 3 sektörlü sektörel antenleri ve merkezi dü˘gümde her biri farklı bir sektöre bakan 3 farklı RF modülü kullanan bir a˘g.

Deneysel çalı¸smalar ve benzetim çalı¸smaları sektörel antenlerin yönsüz antenlere kı- yasla olan avantajlarını göstermek için yapılmı¸stır. Bu avantajlar, a˘gdaki trafik yükü- nün artması ile birlikte paket teslim oranındaki ve gecikme zamanındaki de˘gi¸simler ile gösterilmi¸stir.

Anahtar Kelimeler: Kom¸su Bulma, Yönlü Antenlar, Sektörel Antenlar, Kablosuz A˘g- lar

(9)

To my father and my family Per la mia bella principessa

(10)

ACKNOWLEDGMENTS

I would first like to thank my advisor, Prof. Dr. Ali Özgür Yılmaz, for his valuable and constructive suggestions during this work and mentorship which guide me in both academic and personal life.

I would like to express my thanks to Anketek Electronics for providing me a friendly working environment and supporting this thesis work. I am also thankful to my col- leagues Amin Ronaghzadeh, Mehmet Ali Öztürk, Orçun Kiri¸s and Ufuk Tamer for their help and the fruitful discussions that we had.

I am also grateful to my home mate Ali ˙Ibrahim Bostancıo˘glu and my colleague Sarp Mertol for their friendship and motivating chat in my hard times. Moreover, I thank all of my friends who are not mentioned here for all their contributions to my personality and my life.

I would like to express my deepest gratitude to my family for their priceless support to me in my entire life. None of this would have been possible without them. Last but in no way the least, I thank my girlfriend, Selin Oylan, for her love and friendship.

Thanks to her motivating words, I have easily cleared many of the hurdles in my life.

I feel so lucky to have her in my life. I am very thankful to her for staying by my side and supporting me no matter what.

(11)

TABLE OF CONTENTS

ABSTRACT . . . v

ÖZ . . . vii

ACKNOWLEDGMENTS . . . x

TABLE OF CONTENTS . . . xi

LIST OF TABLES . . . xiv

LIST OF FIGURES . . . xv

LIST OF ABBREVIATIONS . . . xix

CHAPTERS 1 INTRODUCTION . . . 1

2 SYSTEM MODEL . . . 7

2.1 Hardware System Model . . . 7

2.1.1 Antenna . . . 8

2.1.2 MCU and RF Transceiver . . . 12

2.1.3 The Integrated System . . . 13

2.2 Simulation Model . . . 13

2.2.1 Antenna Model . . . 14

(12)

3 A MAC PROTOCOL FOR WIRELESS SENSOR NETWORKS WITH

SECTOR ANTENNAS . . . 17

3.1 Neighbor Discovery Algorithm . . . 17

3.1.1 Attracting Neighbors’ Attention . . . 19

3.1.2 Requesting Neighbors’ Information . . . 22

3.1.3 Passing the Token . . . 23

3.1.4 Required Time for Neighbor Discovery Algorithm 23 3.1.4.1 Required Time for Attracting Neigh- bors’ Attention . . . 23

3.1.4.2 Required Time for Requesting Neigh- bors’ Information . . . 25

3.1.4.3 Required Time for Passing the Token . 26 3.2 Routing Algorithm . . . 27

3.3 The Transmission Phase . . . 28

4 SIMULATIONS AND EXPERIMENTAL RESULTS . . . 33

4.1 Simulation and Experimental Results for Different Scenarios 33 4.1.1 The First Scenario . . . 35

4.1.2 The Second Scenario . . . 39

4.1.3 The Third Scenario . . . 41

4.1.4 The Fourth Scenario . . . 47

4.1.5 The Fifth Scenario . . . 48

4.1.6 The Sixth Scenario . . . 53

4.2 Extended Simulations . . . 56

(13)

5 CONCLUSION AND FUTURE WORK . . . 63

REFERENCES . . . 65

(14)

LIST OF TABLES

TABLES

Table 2.1 Signal Path Selection for SP3T . . . 10

Table 4.1 MAC Protocol Parameters . . . 34

Table 4.2 RSSI Measurement for the First Scenario . . . 35

Table 4.3 RSSI Measurement for the Second Scenario . . . 41

Table 4.4 RSSI Measurement for the Third Scenario . . . 41

Table 4.5 RSSI Measurement for the Fourth Scenario . . . 48

Table 4.6 RSSI Measurement for the Fifth Scenario . . . 52

Table 4.7 RSSI Measurement for the Sixth Scenario . . . 55

(15)

LIST OF FIGURES

FIGURES

Figure 1.1 Wireless Sensor Networks . . . 2

Figure 1.2 Multiple Communications with Different Type of Antennas: T rep- resents transmitter, and R represents receiver. . . 4

Figure 1.3 Selectivity: 1, 2 and 3 represent the identification of the nodes . . . 5

Figure 2.1 The System Block Diagram . . . 8

Figure 2.2 3 Sector Antenna . . . 9

Figure 2.3 Radiation Pattern of the Patch Antenna . . . 9

Figure 2.4 The Radiation Pattern of the Manufactured 3 Sector Antenna . . . . 10

Figure 2.5 The Manufactured Sector Antenna . . . 11

Figure 2.6 Omnidirectional Antenna . . . 11

Figure 2.7 The Back Side of the Manufactured PCB . . . 12

Figure 2.8 The Front Side of Manufactured PCB . . . 13

Figure 2.9 A Single Node . . . 14

Figure 2.10 The Radiation Pattern of an Omnidirectional Antenna . . . 15

Figure 3.1 Transmission Conditions: 1 and 2 represent the identification of the nodes . . . 18

(16)

Figure 3.2 Attracting Neighbors’ Attention: (a) Node 2 receives the message from the first sector and stores it. (b) No node receives the message. (c) Both Node 2 and Node 3 receive the message respectively from the third and the first sector and store it. (d) No node receives the message. (e) No node receives the message. (f) Node 3 receives the message from the first sector and stores it. (g) No node receives the message. (h) No node receives the message. (i) No node receives the message. (j) Node 2 compares the received messages’ RSSI from the first and third sectors.

Since the third is higher, it locks to the third one. Node 3 receives two broadcast messages from its first sector coming from two different sectors of the token possessor. Therefore, it locks its first sector. . . 21 Figure 3.3 Passing the Token: (a) Node 2 and Node 3 receive the unlocking

message and start to switch their sectors. (b) Node 4 receives the unlock- ing message. However, it does not unlock its sector, since it is the next token possessor. (c) Node 5 receives the unlocking message and starts to switch its sector. (d) Node 4 receives the passing message. (e) Node 4 takes the token, and Node 1 checks to channel activity by changing its sector periodically. . . 24 Figure 3.4 The Fairness Condition: 1,2 and 3 represent the identification of

the nodes . . . 31

Figure 4.1 Scenarios: Numbers inside the triangles represent the identification of the nodes, and numbers on the sides of triangles represent the sectors.

Arrows represent the communication link. . . 36 Figure 4.2 The First Scenario: Numbers inside the triangles represent the

identification of the nodes, and numbers on the sides of triangles repre- sent the sectors. Arrows represent the communication link, and numbers on the arrows represent the distances. . . 37 Figure 4.3 The First Scenario: Comparison of packet delivery ratio for the

system using sector antennas and the system using omnidirectional anten- nas with changing traffic load . . . 38 Figure 4.4 The First Scenario: Comparison of latency for the system us-

ing sector antennas and the system using omnidirectional antennas with changing traffic load . . . 39 Figure 4.5 The Second Scenario: Numbers inside the triangles represent the

identification of the nodes, and numbers on the sides of triangles represent the sectors. Arrows represent the communication link, and numbers on the arrows represent the distances. . . 40

(17)

Figure 4.6 The Second Scenario: Comparison of packet delivery ratio for the system using sector antennas and the system using omnidirectional anten- nas with changing traffic load . . . 42 Figure 4.7 The Second Scenario: Comparison of latency for the system us-

ing sector antennas and the system using omnidirectional antennas with changing traffic load . . . 43 Figure 4.8 The Third Scenario: Numbers inside the triangles represent the

identification of the nodes, and numbers on the sides of triangles represent the sectors. Arrows represent the communication link, and numbers on the arrows represent the distances. . . 44 Figure 4.9 The Third Scenario: Comparison of packet delivery ratio for the

system using sector antennas and the system using omnidirectional anten- nas with changing traffic load . . . 45 Figure 4.10 The Third Scenario: Comparison of latency for the system us-

ing sector antennas and the system using omnidirectional antennas with changing traffic load . . . 46 Figure 4.11 The Fourth Scenario: Numbers inside the triangles represent the

identification of the nodes, and numbers on the sides of triangles represent the sectors. Arrows represent the communication link, and numbers on the arrows represent the distances. . . 47 Figure 4.12 The Fourth Scenario: Comparison of packet delivery ratio for the

system using sector antennas and the system using omnidirectional anten- nas with changing traffic load . . . 49 Figure 4.13 The Fourth Scenario: Comparison of latency for the system us-

ing sector antennas and the system using omnidirectional antennas with changing traffic load . . . 50 Figure 4.14 The Fifth Scenario: Numbers inside the triangles represent the

identification of the nodes, and numbers on the sides of triangles repre- sent the sectors. Arrows represent the communication link, and numbers on the arrows represent the distances. . . 51 Figure 4.15 The Fifth Scenario: Comparison of packet delivery ratio for the

system using sector antennas and the system using omnidirectional anten- nas with changing traffic load . . . 52 Figure 4.16 The Fifth Scenario: Comparison of latency for the system us-

ing sector antennas and the system using omnidirectional antennas with changing traffic load . . . 53

(18)

Figure 4.17 The Sixth Scenario: Numbers inside the triangles represent the identification of the nodes, and numbers on the sides of triangles represent the sectors. Arrows represent the communication link, and numbers on the arrows represent the distances. . . 54 Figure 4.18 The Sixth Scenario: Comparison of packet delivery ratio for the

system using sector antennas and the system using omnidirectional anten- nas with changing traffic load . . . 55 Figure 4.19 The Sixth Scenario: Comparison of latency for the system us-

ing sector antennas and the system using omnidirectional antennas with changing traffic load . . . 56 Figure 4.20 Comparison of packet delivery ratio for the systems using ALOHA

with omnidirectional antennas, using CSMA/CA with omnidirectional an- tennas, using the proposed MAC protocol with 3 sector antennas, 5 sector antennas and 3 radios in the sink node with changing traffic load for a network with 15 nodes . . . 58 Figure 4.21 Comparison of latency for the systems using ALOHA with om-

nidirectional antennas, using CSMA/CA with omnidirectional antennas, using the proposed MAC protocol with 3 sector antennas, 5 sector anten- nas and 3 radios in the sink node with changing traffic load for a network with 15 nodes . . . 60 Figure 4.22 Comparison of packet delivery ratio for the systems using ALOHA

with omnidirectional antennas, using CSMA/CA with omnidirectional an- tennas, using the proposed MAC protocol with 3 sector antennas, 5 sector antennas and 3 radios in the sink node with changing traffic load for a network with 60 nodes . . . 61 Figure 4.23 Comparison of latency for the systems using ALOHA with om-

nidirectional antennas, using CSMA/CA with omnidirectional antennas, using the proposed MAC protocol with 3 sector antennas, 5 sector anten- nas and 3 radios in the sink node with changing traffic load for a network with 60 nodes . . . 62

(19)

LIST OF ABBREVIATIONS

ACK Acknowledgment

CSMA/CA Carrier Sense Multiple Access with Collision Avoidance

CTS Clear to Send

DOA Direction of Arrival

MAC Medium Access Control

MCU Microcontroller Unit

NAV Network Allocation Vector

PCB Printed Circuit Board

QoS Quality of Service

RF Radio Frequency

RSSI Received Signal Strength Indicator

RTS Request to Send

RTS/CTS Request to Send / Clear to Send

SP3T Single Pole Triple Throw

SPI Serial Peripheral Interface TDMA Time Division Multiple Access

WiFi Wireless Fidelity

WSN Wireless Sensor Network

(20)
(21)

CHAPTER 1

INTRODUCTION

WSNs have showed up in many applications in our daily life. Thanks to the ad- vances in wireless communications and digital electronics, the development of low- cost, low-power, multi-functional sensor nodes that are small in size has been possible [1]. This ease in the production enables the sensor nodes to influence our life in many aspects. Some of these effects can be seen in improving lots of current applications in medicine, transportation, agriculture, industrial process control, and the military as well as creating new revolutionary systems in areas such as global-scale environmen- tal monitoring, precision agriculture, home and assisted living medical care, smart buildings and cities, and numerous future military applications [2].

WSNs consist of many sensor nodes which gather the data from the environment and usually a single sink node. All the data collected by the sensor nodes are forwarded to this sink node through one or multiple hops (see Figure 1.1). Sink node is used to process the collected data. Therefore, the processor of the sink node usually has better performance and the memory of the sink node is usually larger than the sensor nodes.

Most research conducted so far about improving WSNs efficiency and the major re- search activities going on in the field of WSNs are in the following areas [3]:

1. Hardware for WSN: Hardware design issues of WSN include improving sig- nal reception, designing low power and less cost sensors.

2. Wireless Radio Communication Characterization: It includes designing low power communication systems and new architecture for integrated wireless

(22)

Figure 1.1: Wireless Sensor Networks

sensor systems and modulation method and data rate selection.

3. Medium Access Schemes: Conserving energy at MAC layer, handling col- lisions and interferences, susceptibility to the movement, providing minimum latency and high throughput are the main concerns in MAC schemes.

4. Deployment: Improving the range and the visibility of the radio antennas, net- work congestions and bottlenecks are the main considerations while setting up a sensor network in real world environment.

5. Localization: Localization is the fundamental and crucial issue for network management and operation. Indoor and outdoor localization is mainly used to track the movements of sensors. It can also be used to implement energy efficient message routing protocols.

6. Synchronization: Synchronization provides common time for the local clocks of the sensor nodes. Synchronization is intended to process and analyze the data correctly and predict future behavior and routes.

(23)

7. Calibration: In order to provide reliable readings from the sensors, the ob- tained data is corrected by comparing to prerecorded data.

8. Network Layer Issues: Forwarding the data to the sink from the sensor nodes is an important issue which is called routing. Routing protocols consider energy efficiency, provision of multiple paths and support of multi hops.

9. Transport Layer Issues: The main consideration is to provide reliable end to end communication without packet loss. The fragmentation of the data and transmitting of these fragments in the correct order are also considered.

10. Data Aggregation: Data aggregation eliminates redundant transmissions by providing agreement between multiple sensor nodes. Main research issues include improving security in data transmission and aggregation, improving Quality of Service (QoS) in terms of bandwidth and end to end delay, handling tradeoffs between energy consumption, latency and data accuracy.

11. Security: Security is an important factor in WSNs, since WSNs can be de- ployed in battlefield applications, in critical systems such as airports and hos- pitals as well as for surveillance, burglar alarms and monitoring.

These issues have been well studied and numerous research covering on these topics exist in the literature. In recent years, there is more tendency to reduce the energy consumption, since the maximum efficiency in improving the throughput and the la- tency is almost met. However, there are still some gaps in some fields. Especially, even though antenna is one of the most important hardware component that empower wireless networks, studies on antenna optimization have been limited in WSN appli- cations. According to [4], smart antennas currently serve more conventional com- munications and their usage is likely to expand more due to their advantages. Some of the advantages such as reducing interference and increasing signal strength can be easily achieved by controlling the beams of an antenna while accounting for the whole network.

Sector antennas can be used to produce aforementioned smart antennas to realize the potential and increase the efficiency of WSNs. Sector antennas are actually direc- tional antennas that are designed so that they receive and transmit instantaneously in

(24)

(a) Omnidirectional Antennas (b) Sector Antennas

Figure 1.2: Multiple Communications with Different Type of Antennas: T represents transmitter, and R represents receiver.

a particular region within 0- 360. Multiple sector antennas can be brought together to cover the whole 0- 360 region.

Employing sector antennas in WSNs rather than omnidirectional antennas have many advantages [5, 6]. Some of them are mentioned below:

Increasing the Communication Range: Sector antennas focus the transmit power in one direction within a beamwidth. Due to the increase of the Signal-to-noise ratio (SNR), the communication range also increases. This may lead to a decrease in the number of the hops. Since the packets can reach to the destination faster, the latency also decreases. Moreover, the connectivity of the network may be enhanced as well due to range extension. Unconnected nodes may become neighbors reachable through a few hops after the range extension.

Increasing the Spatial Reuse: The communication medium may not be used by two neighbor nodes with omnidirectional antennas. However, with sector antennas multiple neighbor nodes can transmit at the same time, if their active sectors are directed in different directions (see Figure 1.2).

Enabling the Selectivity: A receiver node with sector antennas can selectively re- ceive from a desired direction. Therefore, signals coming from other directions can be rejected. An example scenario is illustrated in Figure 1.3. Node 1 can selectively receive from node 2 or node 3, and reject other one.

Enhancing the Security: By focusing the energy only in the intended direction,

(25)

Figure 1.3: Selectivity: 1, 2 and 3 represent the identification of the nodes

sector antennas reduce the risk of evasdropping and jamming. In consequence, they provide more secure wireless communication.

Utilizing sector antennas may not be as simple as it seems in practice. In the existing MAC protocols, it is assumed that signals are transmitted in all directions at the same time. However, sector antennas direct the signal to the desired direction. Therefore, the signal cannot be heard in other directions. That’s why, where to direct both the transmitter’s and the receiver’s signal becomes very important in enabling communi- cation. If both the transmitter’s and the receiver’s antennas are not directed to each other at the same time, a reliable communication may not be possible. There are no such mechanisms to satisfy the mentioned conditions in the existing MAC protocols.

For this reason, using the existing MAC protocols with sector antennas may degrade the performance of the network. This thesis work includes a proposed MAC protocol to be used with sector antennas. Therefore, the advantages of the sector antennas over omnidirectional ones can be realizable. The outline of this thesis is as follows:

In Chapter 2, the hardware platforms and the system are introduced. In Chapter 3, a MAC protocol to be used with sector antennas is described. This protocol includes a neighbor discovery algorithm, a routing algorithm and a transmission phase which is similar to ALOHA. In Chapter 4, we present experimental and simulation results.

This chapter combines and compares both the experimental and the simulation results for the proposed system where a system using ALOHA with omnidirectional antennas is used as a reference for six different scenarios. Then, the study is extended with simulations performed for different cases, which are mentioned before, and for larger networks. In Chapter 5, the conclusion and future work is presented.

(26)
(27)

CHAPTER 2

SYSTEM MODEL

In this chapter, the hardware system model and the simulation system model that are used in this study are presented. In the first part, the sector antenna model, which consists of a single pole triple throw (SP3T) switch and three patch antennas, and the implemented sector antenna are introduced. Later, the details of the RF transceiver and the microcontroller unit (MCU) are provided. Then, the final topology of the system is introduced. In the second part, the simulation model is presented.

Before introducing the hardware and the simulation system model, the network model used in this study should be presented. This thesis work is proposed for a WSN which consists of one sink node and multiple sensor nodes. There are 4 sensor nodes in our experimental studies. In simulations, there are two different systems which include 15 and 60 sensor nodes. The proposed system is scalable which means that the number of sensor nodes can be variable. These sensor nodes sense and gather data from the enviroment. Then, they forward the sensed data to the sink node. Sink node collects all the sensed data. Moreover, this work assumes a stationary network.

2.1 Hardware System Model

The overall hardware model used in this thesis is depicted in Figure 2.1. The system includes a MCU, a RF transceiver, an SP3T switch and three patch antennas.

(28)

Figure 2.1: The System Block Diagram

2.1.1 Antenna

A sector antenna that has 3 sectors is selected to be used within the scope of this work. In particular, every node is constructed by using three patch antennas whose horizontal beamwidths are approximately 120. Patch antennas are placed such that they form a triangle (see Figure 2.2). Therefore, 360 can be covered. The radia- tion pattern of the used patch antenna is shown in Figure 2.3. 0 corresponds to the boresight. The gain of this patch antenna is 2.49 dBi as illustrated in Figure 2.3. As pointed out in the figure, the gain decreases by −3 dBi at −52.42and 49.18. Hence, the half power beamwidth is approximately 100. Yet, the gain drops by one more dB at −60and 60.

The SP3T switch used in this thesis is Hittite Microwave HMC245QS16 [7]. The antenna to be selected by SP3T is decided according to Table 2.1 and it is controlled by the MCU. One antenna is powered at a time, and it is used for the communication.

The radiation pattern for 3 patch antennas as constructed in Figure 2.2 is demonstrated in Figure 2.4. As can be seen in this figure, the half power beamwidth is marked at

−0.511 dBi. The gain of the 3 sector antenna is almost higher than the gain at the half power beamwidth through the whole azimuth when the correct patch antenna is

(29)

Figure 2.2: 3 Sector Antenna

Angle (degree)

-180 -150 -100 -50 0 50 100 150 180

Gain (dBi)

-15 -10 -5 0

5 X: 0

Y: 2.489

X: 49.18 Y: -0.511 X: -52.42

Y: -0.511

X: 60 Y: -1.342 X: -60

Y: -1.686

Figure 2.3: Radiation Pattern of the Patch Antenna

(30)

Table 2.1: Signal Path Selection for SP3T Control Path Signal Path

A B RF0 to

Low Low RF1

High Low RF2

Low High RF3

High High All Off

-7.7555

-0.511

-0.511

90o 60o 30o

0o -30o

-60o

-90o

-120o

-150o

180o

150o

120o

1st Patch Antenna 2nd Patch Antenna 3rd Patch Antenna

Figure 2.4: The Radiation Pattern of the Manufactured 3 Sector Antenna

selected.

The manufactured 3 sector antenna used in this work is shown in Figure 2.5.

The omnidirectional antenna used in this work is borrowed from a Wireless Fidelity (WiFi) access point. It is used as a reference point in order to give a comparison for the proposed system in this thesis. This antenna operates in the 2.4GHz WiFi band which covers the ZigBee band. The selected omnidirectional antenna to be used can be seen in Figure 2.6.

(31)

Figure 2.5: The Manufactured Sector Antenna

Figure 2.6: Omnidirectional Antenna

(32)

Figure 2.7: The Back Side of the Manufactured PCB

2.1.2 MCU and RF Transceiver

ZigBee modules are widely used in WSNs for their high reliability, low cost, low power, scalability and low data rate [8]. Therefore, a ZigBee module is utilized in this work. The ZigBee module which is used in the experimental study is MRF24J40 [9]. The transmit power of this module is 0 dBm and it is programmable with 36 dB control range. That means, the transmitter power can be programmed between

−36 dBm and 0 dBm. MRF24J40 has −95 dBm RF sensitivity. Moreover, it has a Serial Peripheral Interface (SPI) so that it can be easily interfaced with an MCU.

Received Signal Strength Indicator (RSSI) values of all received signals can also be measured by MRF24J40. The back side of the manufactured Printed Circuit Board (PCB) which includes MRF24J40 is shown in Figure 2.7.

In order to control MRF24J40, a low power MCU (PIC18F46K20) is selected [10]. It is connected with MRF24J40 by SPI connection. The connection between PIC18F46K20 and MRF24J40 is shown in Figure 2.1. The front side of the manufactured PCB which includes PIC18F46K20 is shown in Figure 2.8.

A development board is readily used in the sink node instead of the manufactured PCB which includes MCU and RF transceiver. This development board is called EasyPICv7 [11]. It includes PIC18F45K22 as MCU which has close technical speci- fication to PIC18F46K20 [12].

(33)

Figure 2.8: The Front Side of Manufactured PCB

2.1.3 The Integrated System

The integrated system is the system that consists of both the manufactured sector antenna board and the manufactured MCU and RF transceiver board. It is illustrated in Figure 2.9. Two boards are connected to each other via a male and a female header.

Moreover, a 9V battery powers this system.

2.2 Simulation Model

Simulations are performed in C++ with using Code::Blocks as compiler. A MAC protocol which is proposed and described in Chapter 3 is implemented for the simu- lations. We simulate a network which consists of one sink node and multiple sensor nodes. Location of the sensor nodes in the network are generated randomly inside a predefined area. The area is selected as a circle whose area is determined according to the number of nodes in the network. Two different simulations which consist of 15 nodes and 60 nodes are studied. The corresponding radius for the circle of these simulations are 200 m and 400 m. The nodes are distributed randomly inside this area by ensuring that all nodes are connected to at least one neighbor and to the sink node through hops. The way used to ensure the connectivity is placing a node randomly

(34)

Figure 2.9: A Single Node

inside the area and then checking whether it is in the range of any of the previously generated nodes. If not, its location is randomly generated again. The first generated node is the sink node and it is placed at the origin of the circle.

In the simulations there is a need for a unit for evaluating latency. This unit time is divided into small segments. Due to this segmented time approach, the simulations are close to slotted ALOHA. However, by arranging these segments as small as pos- sible, simulations approach continuous time operation. The smaller the segments are, the more precise results the simulations provide. There are 10000 segments inside a unit time in the simulations. The minimum time used for transmission is formed with 10 segments which is the time needed to send an Acknowledgement (ACK) packet.

2.2.1 Antenna Model

In all simulations, the sector antenna is modeled by using the measured data of the manufactured sector antenna (see Figure 2.4). On the other hand, there is no mea- surement for the selected omnidirectional antenna. Therefore, it is modeled as a hy- pothetical isotropic antenna. That means it transmits a signal in a perfect sphere and has a gain of 0 dBi. Its radiation pattern can be seen in Figure 2.10.

(35)

-30

-30 -20

-20 -10

-10

0 dBi

0 dBi

90o 60o 30o

0o -30o

-60o

-90o

-120o

-150o

180o

150o

120o

Figure 2.10: The Radiation Pattern of an Omnidirectional Antenna

(36)

The range of the nodes is determined by using the following simple path loss formula:

Pr = Pt+ C + 10 × α × log10(d) + Gr+ Gt (2.1)

where Pr is the receiver power, C is a constant which accounts for system losses, α is the path loss exponent, d is the distance between the transmitter and the receiver, Gris the gain of the receiver antenna, Gtis the gain of the transmitter antenna.

Pt+ C in the Equation (2.1) is selected as −53 dBm in the simulations. α is selected as −3. As shown in Figure 2.10 the omnidirectional antenna used in the simulations is modeled as an ideal isotropic antenna with the gain of 0 dBi. In consequence, both Gr and Gt are equal to 0 for the case of isotropic antennas. The antenna gains for the sector antennas used in the simulations are decided according to the measured radiation pattern and the orientations of the transmitter-receiver pairs.

The range for the nodes using omnidirectional antennas can be calculated as follows by rearranging Equation (2.1):

d = 10−Pr +C+Gr +Gt

10×α . (2.2)

The maximum limit where the transmitted signal can be sensed by the receiver hap- pens at the RF sensitivity of the RF module which is −95 dBm as stated in Section 2.1.2. That means Pris selected as −95 dBm. Therefore the range d is equal to

d = 10

−(−95)+(−53)+0+0 10×(−3)

= 101,4= 25, 11m.

(2.3)

(37)

CHAPTER 3

A MAC PROTOCOL FOR WIRELESS SENSOR NETWORKS WITH SECTOR ANTENNAS

Traditional MAC protocols are designed to work with omnidirectional antennas. They are not compatible when sector antennas are used instead of omnidirectional ones.

With traditional MAC protocols, sector selection is not possible. Therefore, a new MAC protocol needs to be proposed.

This chapter is devoted to describing the proposed MAC protocol to be used in WSNs working with sector antennas. Firstly, a neighbor discovery algorithm and the re- quired time for this algorithm to be completed are presented. Secondly, a routing algorithm which actually runs during the neighbor discovery process is introduced.

Finally, the transmission phase of the proposed MAC protocol is described.

3.1 Neighbor Discovery Algorithm

The neighbor discovery process is an important step to take before starting the com- munication phase in WSNs utilizing sector antennas. If the active sectors of the an- tennas are not directed to satisfy the required RSSI, the nodes may not communicate with each other due to the directivity of the sector antennas. That’s why, sector selec- tion becomes a very important subject to be considered. With the neighbor discovery, the sector to be paired with a particular receiver node is determined. As a result, neighbor discovery is the first operation after the power of the nodes is turned on in order to start the communication phase with the information of where to transmit. In other words, without prior knowledge of sector-neighbor pairs that may come from

(38)

(a) Unsuccessful Transmission (b) Successful Transmission

Figure 3.1: Transmission Conditions: 1 and 2 represent the identification of the nodes

the neighbor discovery algorithm, nodes may not deliver their packets to other nodes.

For example, consider the case in Figure 3.1. In Figure 3.1a, Node 1 does not use the neighbor discovery algorithm and it randomly selects a sector to communicate with Node 2, so Node 2 cannot receive the transmission due to the wrong selection of the sector in node 1. On the other hand, Node 1 in Figure 3.1b determines correctly the transmit path by using the neighbor discovery algorithm, so the transmission is successful.

Over the years many neighbor discovery protocols have been proposed. Some pro- posed algorithms use not only directional antennas but also omnidirectional ones dur- ing neighbor discovery process [13] - [16]. This approach eases neighbor discovery since omnidirectional antennas can receive and transmit in all directions contrary to directional antennas. However, when omnidirectional antennas are used, the bene- fits of directional antennas, especially increasing the communication range, are re- strained. To put it in another way, since the communication range of omnidirectional antennas are shorter, it is the determining factor of the range.

Another approach for neighbor discovery is to synchronize all nodes [13], [17] - [22].

Therefore, all nodes try to discover each other at the same time. Time synchronization in directional antennas is a challenging issue due to the directivity of the antennas [23]. In addition, it may require a hardware implementation and control complexity.

[22], [24] - [26] introduced a neighbor discovery algorithm requiring neither omnidi- rectional antennas nor time synchronization. All nodes transmit and listen to random directions in random time. In spite of the simplicity of these algorithms, the time needed to find all neighbors turns out to be unbounded. The neighbor discovery al- gorithm may not be completed in large networks. Although it is not specified, these algorithms are more appropriate for mobile networks. However, our thesis considers

(39)

stationary networks.

[27] presented an asynchronous neighbor discovery algorithm with no omnidirec- tional antennas in the system. The proposed algorithm allows each node to process neighbor discovery in sequence. In order to achieve this, a token based system is used, that is, the node that has the token possesses the right to execute neighbor discovery.

In this study, the neighbor discovery algorithm presented in [27] is implemented with some modifications. The proposed algorithm will be explained by highlighting the modifications in the following sections.

The neighbor discovery algorithm proposed in [27] operates with a token based ap- proach, i.e., the node executes the algorithm and finds its neighbor when it has the token for a bounded time. After finding the neighbors, the token is passed to another node that has not performed the neighbor discovery yet. If all neighbors have finished the neighbor discovery and have found their neighbors, the token is passed to the node from which the token is received. When the token reaches back the first node at which the neighbor discovery is initiated, the process is finished and all nodes store their neighborhood information in self generated tables.

The neighbor discovery process consists of three parts:

1. Attracting Neighbors’ Attention, 2. Requesting Neighbors’ Information, 3. Passing the Token.

3.1.1 Attracting Neighbors’ Attention

This is the first process of the neighbor discovery algorithm. After the nodes are turned on, they start to switch their active sector in a predetermined time to detect a signal activity. Note that the nodes are not synchronized. Their sector switch times are controlled based on nodes’ local clocks. Only the node that possesses the token does not switch its sector as the other nodes do in this step. Instead, initially the first sector is activated. A broadcast message which includes the current number of

(40)

the transmission and the active sector of the node are transmitted periodically. There should be a relationship between the sector switch time and this transmission period- icity. Since the nodes are not synchronized, a node may not receive the transmission if the sector switch time is slower than the transmission time. In the condition that they are equal, a node may still not receive the transmission. This is possible in a sit- uation where the sector is switched to the sector that can receive the transmission just after the transmission is started. During the next transmission the sector may switch again before receiving the whole transmission. This can be prevented by stopping the sector switch when reception of packet starts. To ensure that nodes receive the transmission correctly, the sector switch time is set to the twice of the transmission period. After a preselected number of broadcast message transmissions, the sector of the token possessor is switched and this process is repeated for all sectors. According to [27], just after receiving the broadcast message, all nodes lock their sector to enable communication with the node that has token. However, in this study, this approach is changed, because the broadcast message first heard may not correspond to the best sector pair. That is to say, due to the reasons such as reflections, high gain at the side lobes of the antenna and short distance between nodes, more than one sector pair may be above the RF sensitivity. Therefore, the best sector pair may not be the message that is received first. In consequence, in this thesis work, all nodes except the token possessor continue switching their sector even after receiving the broadcast message to test all sector pairs. Then, these sector pairs are used to select the best pair which results in the highest RSSI. After the completion of Attracting Neighbors’ Attention, all receiving nodes compare sector pairs, and choose the one that has the maximum RSSI. After determining and choosing the best pair, they lock their sector. Since the active sector and the current number of the broadcast message are transmitted inside the message, receiving nodes can calculate when to finish the Attracting Neighbors’

Attention phase and when to lock their sectors.

An example of Attracting Neighbors’ Attention only for the neighbors in the first sector is illustrated in Figure 3.2.

(41)

(a) (b) (c)

(d) (e) (f)

(g) (h) (i)

(j)

Figure 3.2: Attracting Neighbors’ Attention: (a) Node 2 receives the message from the first sector and stores it. (b) No node receives the message. (c) Both Node 2 and Node 3 receive the message respectively from the third and the first sector and store it. (d) No node receives the message. (e) No node receives the message. (f) Node 3 receives the message from the first sector and stores it. (g) No node receives the mes- sage. (h) No node receives the message. (i) No node receives the message. (j) Node 2 compares the received messages’ RSSI from the first and third sectors. Since the third is higher, it locks to the third one. Node 3 receives two broadcast messages from its first sector coming from two different sectors of the token possessor. Therefore, it locks its first sector.

(42)

3.1.2 Requesting Neighbors’ Information

After Attracting Neighbors’ Attention, the second step of the neighbor discovery algorithm is Requesting Neighbors’ Information. Since all neighbor nodes’ sectors are locked such that they are all pointing to the token possessor node in Attracting Neighbors’ Attention, the requesting message can be transmitted directly without any further operation to find the right sector to communicate.

Initially, the token possessor node activates its first sector. Then, it only transmits the requesting message. After the transmission, it starts to wait for the replies. The waiting time is somehow divided into slots, even though nodes are not synchronized.

Upon the reception of the requesting message, neighbors divide the time into time slots by using their own local timers. Due to the propagation delay, time slots of different neighbors may not overlap exactly. Nevertheless, this is not needed for the right operation, since the slot time is chosen such that the propagation delay is negli- gible. Each neighbor selects a random time slot to send its reply which includes the identification of the neighbor, the active sector of the neighbor, routing information, which will be used in Routing Algorithm, and an indication whether neighbor dis- covery is performed or not. Two or more replies may collide because of the same slot selection. The same process is repeated for the second and the third sectors of the token possessor. Then, the token possessor repeats the whole process again to ensure that no replies collide. During each repetition, the token possessor adds the identi- fication of the neighbors whose replies are received successfully into the requesting message. Therefore, the nodes that heard their identification in the message do not respond, and the collision probability of replies decreases. Finally, a neighbor table is formed to hold all the neighboring information.

[27] does not lock the neighbors’ sectors after Attracting Neighbors’ Attention. In- stead, all neighbors switch to their first sector. Then, this whole process is repeated for all sectors of neighbors in order to test all sector pairs between the token possessor and the neighbor. In this study, since all sector pairs are tested in Attracting Neigh- bors’ Attention, this process is skipped and hence a considerable amount of time is saved.

(43)

3.1.3 Passing the Token

After collecting the neighbors’ information, the token possessor node checks its neigh- bor table, and looks for a node that has not performed the neighbor discovery yet.

Recall that there is information inside the replies of the neighbors to indicate whether the neighbor performs the neighbor discovery or not. If such a node is available, then it is selected as the next token possessor node. Otherwise, the token is passed to the node from which the token is received. After the next token possessor node is se- lected, the token possessor node starts to transmit an unlocking message. It is aimed to unlock the neighbors’ sector which is locked in Attracting Neighbors’ Attention.

This unlocking message is transmitted in all sectors respectively starting from the first one. When the unlocking message is received, the neighbors go to the stage at the very beginning of the process, where they periodically switch their sectors except the next token possessor node. After the unlocking message is completed, the token possessor node activates the sector in which the next token possessor is located. Then, it transmits a passing message and waits for acknowledgement. Upon the reception of acknowledgement, the process is successfully completed. Consequently, the node that previously has the token starts to switch its sector repeatedly and try to catch signal activity. Once all nodes perform their neighbor discovery eventually, the to- ken will be released to the first node that started the neighbor discovery and then the process will finish.

An example of Passing the Token procedure is demonstrated in Figure 3.3.

3.1.4 Required Time for Neighbor Discovery Algorithm

3.1.4.1 Required Time for Attracting Neighbors’ Attention

The time required to complete the first part of the neighbor discovery is given in [28]

as

Natt > tswitch× K

tatt (3.1)

where Natt is the number of broadcast messages, tswitch is the sector switch period, K is the number of sectors, and tatt is the time between two broadcast messages. In

(44)

(a) (b)

(c) (d)

(e)

Figure 3.3: Passing the Token: (a) Node 2 and Node 3 receive the unlocking message and start to switch their sectors. (b) Node 4 receives the unlocking message. How- ever, it does not unlock its sector, since it is the next token possessor. (c) Node 5 receives the unlocking message and starts to switch its sector. (d) Node 4 receives the passing message. (e) Node 4 takes the token, and Node 1 checks to channel activity by changing its sector periodically.

(45)

[28], Nattcan be chosen as

Natt = tswitch× K

tatt + 1. (3.2)

The total time required for Attracting Neighbors’ Attention becomes

Tatt = Natt× tatt× K, (3.3)

where Tatt is the total time of the first part of the neighbor discovery according to [28].

In this study, the bound for Natt is decided in a different way. It is assumed that a neighbor just misses the broadcast message by switching its sector. Then, the time needed to go back to that sector is (K − 1) × tswitch. During that time Natt × tatt broadcast messages are transmitted. Therefore,

Natt > tswitch× (K − 1)

tatt , (3.4)

while Nattcan be chosen as

Natt = tswitch× (K − 1)

tatt + 1. (3.5)

Note that the total time is the same as in (3.3). The difference between the total time of the algorithm proposed in [28] and the one in this thesis work is

T[28]

att − Tatt = tswitch× K. (3.6)

3.1.4.2 Required Time for Requesting Neighbors’ Information

[28] introduced the total time required for Requesting Neighbors’ Information as Treq =K2× [(Tf irst+ Tlong× (Nround− 1))

+ Nslot× Treply× Nround]

(3.7)

where Treq is the time required for Requesting Neighbors’ Information, K is the number of sectors, Tf irst is the time of the first message that contains no neighbor information, Tlong is the time of the messages which includes all the neighbors found, Nroundis the number of rounds, Nslotis the number of slots, Treply is the duration of a reply message.

(46)

Within the scope of this work, the sector pairs are found during Attracting Neighbors’

Attention. For that reason, in this step there is no need to check all neighbors’ sectors.

Therefore, K2 in Equation (3.7) will be K since it corresponds to the sector pairs.

Since the neighbors’ sector is locked during the first step in this study, just the token possessor sector is switched. Therefore, the total number of sector pairs is K and the total time becomes

Treq=K × [(Tf irst+ Tlong× (Nround− 1)) + Nslot× Treply× Nround].

(3.8)

The saved time coming from the change in testing all sector pairs is calculated as

T[28]

req − Treq = (K − 1) × Treq. (3.9) As can be seen in (3.9), the time required for this step is one third of [28], when a system that has three sectors is considered as in this study.

3.1.4.3 Required Time for Passing the Token

In [28], timing calculation was not presented for this step. However, since the fol- lowed path is similar, the timing should be the same as in this study. The total time in this step is

Tpass = K × Tunlock+ Ttoken (3.10) where Tpassis the total time of this step, Tunlock is the time of the message to unlock neighbor nodes, Ttoken is the time duration of the message in which the token is sent.

According to [28], inside the token passing message the whole neighbor table is also sent to find routes. As opposed to [28], token passing message includes only the identification of the next token possessor in our algorithm. The routing information is extracted in a different way which will be explained in the next section. As a result, since the message length of token passing in [28] is higher than the one in this algorithm, Ttoken is also higher. This corresponds to higher Tpass so the third step of the algorithm in this thesis performs faster than the algorithm in [28].

(47)

3.2 Routing Algorithm

The system proposed in the scope of this study is a sink based network. That is to say, all nodes try to forward their collected information to a single sink node. In order to successfully achieve this, all nodes need to know how to reach the sink node. This is where a routing algorithm is inevitable.

In the literature, different routing algorithms were proposed for WSNs utilizing direc- tional antennas. [29] introduced an omnidirectional antenna based routing algorithm, even though it is assumed that the directional neighbors are known partially. As dis- cussed in Section 3.1, using omnidirectional antenna in a directional based network reduces the potential advantages, especially the communication range. Similarly, [30]

- [32] followed an approach which transmits the message by switching to all sectors one by one to find a route. After running the neighbor discovery algorithm in [27], [33] performs routing by using the Bellman-Ford algorithm. However, there is not enough information about how it was done exactly. In order to find only one node’s route information by using the Bellman-Ford algorithm, all links need to be checked.

It becomes a heavy burden to find all routing information. [28] proposed another approach. One may recall for the Passing the Token step that the token possessor searches a node that has not performed the neighbor discovery yet. If such a node does not exist, it passes the token to the node from which the token is received. In this study, this passing packet size is too small, since it does not hold information except the passing message indication and the next token possessor identification.

However, [28] suggested that the whole neighborhood information can be sent inside this passing message to obtain the routing information. Due to this process, the length of the passing message may increase dramatically.

The routing algorithm is performed during the neighbor discovery process within the scope of this work. Therefore, extra time is not wasted to find how to direct the packets to the sink node. The approach followed in the proposed algorithm is a kind of distance vector routing protocol. As noted before, the neighbor discovery process is initiated at the sink node. The hop number of the sink node is set to zero. Then, the sink node passes its token to the one of its neighbors. As mentioned before, during Requesting Neighbors’ Information, this hop number is also sent. In the next

(48)

step, the routing algorithm is executed. Within this algorithm, the neighbor table is checked to find the minimum hop number. Then, the hop number is determined by just adding one to that number. With the completion of the neighbor discovery, the routing information for all nodes is discovered.

3.3 The Transmission Phase

According to [5], there are two main classifications of the proposed MAC protocols for directional antennas which can be listed as:

• Synchronized Access MAC Protocols

• Random Access MAC Protocols

Synchronized Access MAC Protocols: [33] presented a Time Division Multiple Access (TDMA) based MAC Protocol. After the neighbor discovery phase, all nodes synchronize their time by sending each other a time synchronization control message.

Even though precise time synchronization may not be realized by this approach due to the variation of packet delivery time over the air, it does not affect the protocol.

This is due to the fact that there is a guard time to compensate synchronization errors at the beginning of each time slot. CSMA/CA was used as the channel access method.

Another TDMA based MAC protocol was introduced in [34]. The time is divided into three frames and each of these frames is divided into slots. The first frame is used for neighbor discovery. A simple approach for neighbor discovery was followed:

nodes either scan or listen. In the scan mode, nodes change their sector and transmit a message. In the listen mode, nodes try to detect the scanning message. When the scanning message is caught, it is responded with a similar message. Then, an ac- knowledgement is expected in return. The second time frame is used for reservation.

When two nodes detect each other at neighbor discovery, they agree on a future time slot to communicate. The last time frame is used for transmission.

Similar to [34], three frames were used in [35] for searching the neighbor, assigning a time slot and transmission. [35] used omnidirectional antennas during the neighbor

(49)

discovery phase and transmission phase. Omnidirectional Request to Send / Clear to Send (RTS/CTS) were used to access the channel.

Another MAC protocol for directional antenna was presented in [36]. A slotted ALOHA based scheme was used in this protocol. Each time slot is again divided into three mini slots. The first slot is used to inform the channel about the transmis- sion. Upon the reception of this message, a Direction of Arrival (DOA) algorithm is executed to determine the direction of the transmitter. The second slot is used for transmission. At the last slot, the transmission is responded by an ACK.

Random Access MAC Protocols: [5] divides the random access protocols into 2 classes which are tone based protocols and RTS/CTS based protocols.

A tone is defined as a pure sinusoidal waveform. It is an unmodulated signal and does not contain any information [5]. In the protocol that was suggested by [36], two channels are used: one is for the transmission and the other one is for the busy tones which are the transmit busy tone and the receive busy tone, respectively. Before starting a transmission, a transmitter node listens to the channel to make sure that no receive busy tone exists. Then, it transmits a RTS. Upon the reception of this RTS, receiver node senses the channel for the transmit busy tone. If the channel is free, it transmits a CTS and turns on the receive busy tone. When the CTS is received, the transmitter node starts not only the transmission but also the transmit busy tone.

A protocol similar to that of [36] was proposed by [37]. Before the transmission, RTS/CTS mechanism is used. As in [38], Network Allocation Vector (NAV) is pro- duced by using RTS/CTS. Moreover, during the transmission, the transmitting busy tone and the receiving busy tone are transmitted in another frequency. Therefore, apart from NAV, another mechanism is also used to inform other nodes about the transmission. However, in this system omnidirectional antennas were used to sense CTS.

An RTS/CTS based MAC protocol was suggested by [25]. The sectors are switched continually to sense the transmission in the receiver node. The transmitter node se- lects the correct sector to communicate with the receiver node. Then, a preamble trainer was transmitted. When the receiver node hears this transmission, it locks its

(50)

sector and a ready to receive ACK is transmitted. After the reception, the transmission and the ACK are followed.

Circular RTS/CTS MAC protocol was proposed by [39, 40]. The RTS is transmitted in all directions in sequence. Then, in [39] it is responded by the CTS in all direc- tions, in [40] it is responded in the transmitter node direction. Then, with the data transmission and the ACK reception, the process is completed.

Another random access MAC protocol was suggested by [41]. At first, the transmitter node listens to the channel. According to the current state of the channel, a backoff counter is set. When it counts down to zero, RTS is transmitted. After the reception of RTC, the channel is sensed by the receiver node. If it is idle, RTS is replied with CTS. Then, the data is transmitted and ACK is expected in return.

[42, 43] used the same approach for RTS/CTS frames. By using the existing neigh- bor information, the transmitter node selects the right sector and sends RTS. RTS is received by the receiver node and it is replied with CTS. Then, the transmitter node and the receiver node start to send RTC/CTS in the diametrically opposite direction and use them to generate NAV. Then, the transmission and ACK exchange are per- formed. In [42], both the transmitter and the receiver nodes transmit a wait to send packet just before the transmission so that they can warn the neighbors about ongoing transmission.

In this thesis, a simple yet efficient MAC protocol which can be classified under ran- dom access MAC protocols is introduced. The neighbor discovery covered in Section 3.1 and the routing algorithm proposed in Section 3.2 are the phases of the MAC pro- tocol before transmission. In other words, after the neighbor table is generated and the routing information to reach the sink node are determined, the transmission phase initiates. In the first step of the transmission phase, the transmitter node has to decide where to transmit its packet to reach the sink node. Within this scope, the transmit- ter node checks its locally generated neighbor table. If the sink node is already its neighbor, the sink node is selected as the destination. However, if the sink node is not one of its neighbors, it selects the one that has the minimum hop number to reach the sink node. If there are multiple nodes that have the same hop number, one of them is selected randomly. Another approach is that the receiver is chosen by considering

(51)

Figure 3.4: The Fairness Condition: 1,2 and 3 represent the identification of the nodes

the RSSI level. RSSI can be measured during a packet reception. The total RSSI level of each path, which is followed to reach the sink node, can be extracted during the neighbor discovery process. After choosing the receiver node, the sector which communicates with the receiver is switched by considering the neighbor table. Then, the packet starts to transmit. The same approach used in Section 3.1.1 is performed in transmission. Briefly, the receiver node scans all its sectors in which it has at least one neighbor in sequence to sense signal activity. Upon detection of the transmission, it stops switching and starts communication. At the end of each transmission, the receiver node replies with an ACK. In two situations, the transmitter node decides whether the collision occurs or not. Then, it waits for a random time before transmit- ting again. The first situation is that three unsuccessful transmissions which are not responded with ACK happen. After each transmission, ACK is expected in a bounded time. If no ACK is received, the transmission is repeated two more times. Unless it does not receive ACK, a random backoff counter is set. The second one is that ten consecutive transmissions are successfully completed. After these transmissions, the transmitter node sets a random backoff counter to start the transmission again. The reason of this backoff is fairness. The fairness situation is demonstrated in Figure 3.4.

Node 2 receives the transmission coming from node 1, in the same time, node 3 tries to communicate with node 1. However, it is not possible in a long time, if node 1 has many packets in its buffer. Therefore, the backoff counter is used to give also chances for communication to node 3.

The proposed MAC protocol in this chapter is realized in both simulation and hard- ware implementation. These works will be presented in the next chapter by compar- ing the one utilizing sector antennas with the one using omnidirectional antennas.

(52)
(53)

CHAPTER 4

SIMULATIONS AND EXPERIMENTAL RESULTS

This chapter is devoted to explain the results of both the simulations and the ex- perimental studies. These simulations and experimental studies give the comparison between using omnidirectional antennas and using sector antennas on the nodes. This chapter is divided into two main parts. In the first part, the results are presented for six different scenarios for not only the simulations but also the experimental studies.

In the second part, simulation results for different cases are presented. There are five different cases which are considered in the second part which include:

1. The network using omnidirectional antennas,

2. The network using omnidirectional antennas and utilizing CSMA/CA algo- rithm,

3. The network utilizing sector antennas which have 3 sectors, 4. The network utilizing sector antennas which have 5 sectors,

5. The network using sector antennas which have 3 sectors and has 3 different RF modules in the sink node.

4.1 Simulation and Experimental Results for Different Scenarios

The MAC protocol which is proposed in Chapter 3 is implemented in both hardware and simulation environments. However, this protocol does not involve data gener- ation. Since this is a WSN, it is expected to sense the data from the environment.

(54)

Table 4.1: MAC Protocol Parameters

The Sector Switching Time 20ms

The Broadcast Message Transmission Period 10ms Number of Broadcast Messages for 1 Sector of Token Possessor 5

Number of Slots 5

Number of Rounds 5

Instead of sensing from the environment, the data is generated randomly by follow- ing a Poisson random distribution in order to see the system’s reaction to different network loads.

Both the simulation and the hardware implementation consist of three main steps.

At first, the neighbor discovery algorithm and the routing algorithm are run together.

By using these algorithms, all nodes form their neighbor tables which include the neighbors’ identification, RSSI value of the received signals, the transmit sector, the receive sector of the neighbor node, hop number to the sink node coming from the routing algorithm and the information of whether the neighbor node performs the neighbor discovery or not. Next, the random data generation is followed. Finally, while the data is generated, the transmission phase of the proposed MAC Protocol also begins.

There are some parameters to be determined in the MAC Protocol defined in Chapter 3. These numbers are chosen as listed in Table 4.1 in this study. Node 1 is the sink node for all of these scenarios.

Six different scenarios are considered in this thesis. They are illustrated in Figure 4.1.

Nodes are situated as in these scenarios. Then, both the simulation and the experi- mental studies are performed. All experimental studies in this work are performed in the facilities of ODTU KOSGEB Building in Ankara, Turkey. These six different scenarios shown in Figure 4.1 are examined further in the following sections. For all of these scenarios the RSSI values of the received signal are measured in the exper- imental studies. Then, the distributions of the nodes in the simulations are arranged such that they satisfy the same RSSI with the experimental studies. Moreover, the powers of RF modules are set to the minimum level so that the communication range decreases to about 15 m with omnidirectional antennas. Therefore, indoor measure-

References

Related documents

To evaluate the effect of temperature on the adsorption behavior as well as to determine the activation parameters of the corrosion of mild steel in 1M H2SO4

In addition, many studies have reported Giardia and Cryptosporidium as zoonotic enteric parasites, especially in cats and dogs, and the occurrence is of potential significance

Human stem cells are in evaluation in clinical stem cell trials, primarily as autologous bone marrow studies, autologous and allogenic mesenchymal stem cell trials, and some

The owner/operator shall notify the Office of Air Resources, in writing, of any noncompliance with the terms of this permit or any other air pollution control rule or

We can retrieve this disease by DNA sequence alignment [Smith waterman algorithm, Blast algorithm].We can improve the quality of the crop by identifying the disease within

If scute4 were a partial allelomorph in relation to the previously known transgenes of type scute, then only the coinciding, homozygous districts.. TABLE

sweetpotato crop through interspecific hybridization of sweetpotato [ Ipomoea batatas (L.) Lam.] with morning glory species ( Ipomoea sp. L.) and the characterization of

(financed by the Norwegian Research Council) (2008- 2012), led by Hege Westskog, Center for International Climate and Environmental Research (CICERO), Oslo. Started spring