89
MicazXpl Project Report http://micazxpl.googlecode.com Ankit Singh Philipp Orekhov Rishu Seth Mohammad Tarique Abdullah February 12, 2011

Micazxpl wsn

Embed Size (px)

DESCRIPTION

Complete report on project "Intelligent sensor Networks".

Citation preview

Page 1: Micazxpl wsn

MicazXpl

Project Report

http://micazxpl.googlecode.com

Ankit SinghPhilipp Orekhov

Rishu SethMohammad Tarique Abdullah

February 12, 2011

Page 2: Micazxpl wsn

Contents

I MicazXpl Project Description 7

1 Introduction to the Project Details 81.1 Hardware Description . . . . . . . . . . . . . . . . . . . . . . 8

1.1.1 MICAz Motes . . . . . . . . . . . . . . . . . . . . . . . 81.1.2 Sensor Boards . . . . . . . . . . . . . . . . . . . . . . 81.1.3 Micaz Motes Programming Board . . . . . . . . . . . 8

1.2 Software Description . . . . . . . . . . . . . . . . . . . . . . . 91.2.1 Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . 91.2.2 TinyOS . . . . . . . . . . . . . . . . . . . . . . . . . . 91.2.3 Programming Languages . . . . . . . . . . . . . . . . . 9

1.3 Group work and Individual Roles of Group Members . . . . . 101.3.1 Group Work . . . . . . . . . . . . . . . . . . . . . . . 101.3.2 Ankit Singh . . . . . . . . . . . . . . . . . . . . . . . . 101.3.3 Philipp Orekhov . . . . . . . . . . . . . . . . . . . . . 111.3.4 Rishu Seth . . . . . . . . . . . . . . . . . . . . . . . . 111.3.5 Mohammad Tarique Abdullah . . . . . . . . . . . . . 11

1.4 Beginning strategy for Project work . . . . . . . . . . . . . . 11

II Proposal For Reliable Data Acquisition System 14

2 Project Work Proposals for MicazXpl Versions 152.1 MicazXpl Version 0.1 . . . . . . . . . . . . . . . . . . . . . . . 15

2.1.1 Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152.1.2 Transmission . . . . . . . . . . . . . . . . . . . . . . . 162.1.3 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . 172.1.4 Improving Availability . . . . . . . . . . . . . . . . . . 17

2.2 Implementation of MicazXpl Version 0.1 . . . . . . . . . . . . 172.3 MicazXpl Version 0.2 . . . . . . . . . . . . . . . . . . . . . . . 20

2.3.1 Issues on Dynamic Routing Protocol CTP . . . . . . . 202.3.2 Use Version 0.1 in CTP . . . . . . . . . . . . . . . . . 20

1

Page 3: Micazxpl wsn

III TinyOS Manual for Beginners in Linux (Ubuntu) 21

3 TinyOS Installation Guide for Beginners 223.1 Procedure for Installation and configuring TinyOS . . . . . . 22

3.1.1 Installation of TinyOS (Source tinyos.net) . . . . . . . 223.1.2 Configuration of TinyOS . . . . . . . . . . . . . . . . . 233.1.3 Confirming the correct configuration of the Tinyos . . 243.1.4 Connecting Motes & pushing modules to Motes . . . . 243.1.5 Setting Up Environment for Mote Listener . . . . . . 26

3.2 Compiling and Pushing Sensor board specific Application . . 273.2.1 Compile Module . . . . . . . . . . . . . . . . . . . . . 273.2.2 To Push it to the Motes . . . . . . . . . . . . . . . . . 273.2.3 Running GUI in For Base Station . . . . . . . . . . . 27

IV Interesting Findings during Project Work 28

4 Interesting Findings 294.1 TinyOS Applications MicazXpl Version 0.1 . . . . . . . . . . 29

V Summarized Technical Paper 30

5 Adhoc Routing Architecture 315.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

5.1.1 Receiving a Packet . . . . . . . . . . . . . . . . . . . . 315.2 Different Roles . . . . . . . . . . . . . . . . . . . . . . . . . . 33

5.2.1 MultihopRoute . . . . . . . . . . . . . . . . . . . . . . 335.2.2 MultiHopsend . . . . . . . . . . . . . . . . . . . . . . . 335.2.3 RouteSelector . . . . . . . . . . . . . . . . . . . . . . . 33

5.3 OSI Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335.4 Sliding Window Protocol . . . . . . . . . . . . . . . . . . . . 33

5.4.1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . 335.4.2 Problem . . . . . . . . . . . . . . . . . . . . . . . . . . 355.4.3 Approach to the Problem . . . . . . . . . . . . . . . . 355.4.4 Merits . . . . . . . . . . . . . . . . . . . . . . . . . . . 355.4.5 Alertness . . . . . . . . . . . . . . . . . . . . . . . . . 35

5.5 Protocol based Communication . . . . . . . . . . . . . . . . . 355.6 Protocol Operation . . . . . . . . . . . . . . . . . . . . . . . . 35

5.6.1 Receiver Operation . . . . . . . . . . . . . . . . . . . . 365.6.2 Transmitter Operation . . . . . . . . . . . . . . . . . . 375.6.3 Benefit of Sliding Window Protocol . . . . . . . . . . 375.6.4 Drawback of Sliding Window Protocol . . . . . . . . . 37

5.7 Connectionless Communication in Data Link Layer . . . . . . 37

2

Page 4: Micazxpl wsn

5.8 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

6 Generalized Topologies 406.1 General Analysis of Wireless Sensor Network and its Topologies 40

6.1.1 Network Topologies . . . . . . . . . . . . . . . . . . . 406.2 Applications of Wireless Sensor Networks . . . . . . . . . . . 46

6.2.1 Advantages of WSN . . . . . . . . . . . . . . . . . . . 466.2.2 Disadvantages of WSN . . . . . . . . . . . . . . . . . . 47

6.3 Advantages and Disadvantages of Sensor Network Topology . 476.4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

7 Collection Tree Protocol 507.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507.2 Introduction to CTP - TEP 123 . . . . . . . . . . . . . . . . . 50

7.2.1 Assumptions . . . . . . . . . . . . . . . . . . . . . . . 517.2.2 Some other Random Assumptions . . . . . . . . . . . 517.2.3 Collection and CTP . . . . . . . . . . . . . . . . . . . 517.2.4 Routing Loop . . . . . . . . . . . . . . . . . . . . . . . 517.2.5 CTP Address Loop Mechanisms . . . . . . . . . . . . 527.2.6 Solving Of Inconsistency . . . . . . . . . . . . . . . . . 527.2.7 Packet Duplication . . . . . . . . . . . . . . . . . . . . 527.2.8 Four Key Function . . . . . . . . . . . . . . . . . . . . 577.2.9 Limitation of CTP . . . . . . . . . . . . . . . . . . . . 57

8 Received Signal Strength Indicator - RSSI 608.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608.2 RSSI Method . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

8.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . 608.2.2 Use of RSSI . . . . . . . . . . . . . . . . . . . . . . . . 618.2.3 Caution to Use RSSI in TinyOS . . . . . . . . . . . . 618.2.4 Intercept Base . . . . . . . . . . . . . . . . . . . . . . 628.2.5 Sending Node . . . . . . . . . . . . . . . . . . . . . . . 628.2.6 RSSI Base . . . . . . . . . . . . . . . . . . . . . . . . . 628.2.7 Java Application . . . . . . . . . . . . . . . . . . . . . 628.2.8 Advantages of RSSI Method at Localisation . . . . . . 638.2.9 Difficulties at RSSI Method . . . . . . . . . . . . . . . 63

9 Energy Efficient Topologies 659.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659.2 Analysis of Energy-efficient Topology control for WSN’s using

Online Battery Monitoring . . . . . . . . . . . . . . . . . . . 669.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . 669.2.2 Architecture for Wireless Sensor Network systems . . 669.2.3 Energy consumption of WSN components . . . . . . . 67

3

Page 5: Micazxpl wsn

9.2.4 Battery technologies for WSN systems . . . . . . . . . 679.2.5 Battery monitoring . . . . . . . . . . . . . . . . . . . . 699.2.6 Circuitry and Measurements . . . . . . . . . . . . . . 699.2.7 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . 70

9.3 Energy-Efficient Topologies and Routing for Wireless SensorNetworks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . 719.3.2 Modelling Connected-Coverage WSN’s . . . . . . . . . 719.3.3 Performance Comparison : . . . . . . . . . . . . . . . . 76

9.4 Wireless Sensor Networks Energy-Efficient Topologies . . . . 789.4.1 Introduction to Ad Hoc and Wireless Sensor Networks 789.4.2 Communication Methods . . . . . . . . . . . . . . . . 799.4.3 Small Communication Range . . . . . . . . . . . . . . 799.4.4 Topology Control . . . . . . . . . . . . . . . . . . . . . 809.4.5 Location Based Protocols . . . . . . . . . . . . . . . . 819.4.6 The R and M and LMST protocols . . . . . . . . . . 819.4.7 LMST operates in three phases . . . . . . . . . . . . 829.4.8 Phase 1 . . . . . . . . . . . . . . . . . . . . . . . . . . 829.4.9 Simulation results . . . . . . . . . . . . . . . . . . . . 83

9.5 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

4

Page 6: Micazxpl wsn

List of Figures

5.1 Component Architecture . . . . . . . . . . . . . . . . . . . . . 325.2 OSI Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345.3 Our proposed Architecture . . . . . . . . . . . . . . . . . . . 38

6.1 Wireless Sensor Networks . . . . . . . . . . . . . . . . . . . . 416.2 Wireless sensor node functional block diagram . . . . . . . . . 426.3 Basic Network Topologies . . . . . . . . . . . . . . . . . . . . 446.4 Hybrid Star-Mesh Network Topology . . . . . . . . . . . . . . 45

7.1 CTP Data Frame . . . . . . . . . . . . . . . . . . . . . . . . . 537.2 Origin Packet . . . . . . . . . . . . . . . . . . . . . . . . . . . 547.3 Packet Instance . . . . . . . . . . . . . . . . . . . . . . . . . . 557.4 CTP Routing Frame . . . . . . . . . . . . . . . . . . . . . . . 557.5 Sample Structure of CTP Node Deployment . . . . . . . . . . 58

8.1 RSSI Method . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

9.1 Wireless sensor node functional block diagram . . . . . . . . . 679.2 Comparison of power consumption . . . . . . . . . . . . . . . 689.3 Li-Ion and NiCd/NiMH battery behaviour. . . . . . . . . . . 689.4 Measurement setup and resulting graphs for 10 C and 10 C. . 699.5 Approximated discharge characteristics with Varying Tem-

perature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709.6 A WSN with hexagon-based topology . . . . . . . . . . . . . 739.7 A WSN with square-based topology . . . . . . . . . . . . . . 739.8 A WSN with triangle-based topology . . . . . . . . . . . . . . 749.9 A WSN with strip-based topology . . . . . . . . . . . . . . . 759.10 Performance comparison among WSNs with different pat-

terned topologies . . . . . . . . . . . . . . . . . . . . . . . . . 769.11 Energy consumption and lifetime comparison among three

approaches . . . . . . . . . . . . . . . . . . . . . . . . . . . . 789.12 Placement of topology control layer in the OSI stack . . . . . 809.13 Formula for Topology Control . . . . . . . . . . . . . . . . . . 819.14 Average energy usage for transmission w.r.t. to the number

of relay nodes; different TC methods . . . . . . . . . . . . . 82

5

Page 7: Micazxpl wsn

9.15 Average energy usage for transmission w.r.t. the distance tothe base station; different TC methods . . . . . . . . . . . . 83

9.16 Topology calculated using LMST method . . . . . . . . . . . 849.17 Topology calculated without TC protocols . . . . . . . . . . 859.18 Average energy consumption by one node for single transmis-

sion to the base station; different TC methods and networksize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

6

Page 8: Micazxpl wsn

Part I

MicazXpl ProjectDescription

7

Page 9: Micazxpl wsn

Chapter 1

Introduction to the ProjectDetails

MicazXpl project is a project which explores the basic concepts and under-standings of Intelligent Sensors Network working models. That is why Xplstands for explorer. The description of the required hardware and softwaresare described below.

1.1 Hardware Description

1.1.1 MICAz Motes

The MICAz is a 2.4GHz, IEEE 802.15.4 compliant, Mote module used forenabling low-power, wireless, sensor networks.

1.1.2 Sensor Boards

Crossbow offers a variety of sensor and data acquisition boards for the MI-CAz Mote. All of these boards connect to the MICAz via the standard51-pin expansion connector.We are using MTS300CA Light, Temp, Acoustic, and Sounder SensorBoard for our project.

1.1.3 Micaz Motes Programming Board

Crossbow offers the MIB family of basic Mote programming and interfaceboards for the MICA, MICA2, MICAz and MICA2DOT. The MIB510 offersRS-232 based serial programming and serial interface to the MICA familyof Motes. The MIB520 provides USB connectivity to the MICA2/MICAzMotes for both communication and in-system programming. The MIB600Ethernet Interface board delivers a LAN data interface and Mote program-ming.

8

Page 10: Micazxpl wsn

Base Stations

A base station allows the aggregation of sensor network data onto a PC orother computer platform. Any MICAz Mote can function as a base stationwhen it is connected to a standard PC interface or gateway board. TheMIB510 or MIB520 provides a serial/USB interface for both programmingand data communications. Crossbow also offers a stand-alone gateway so-lution, the MIB600 for TCP/IP-based Ethernet networks.

We are using LAN data interface for PC-Motes Communication.

1.2 Software Description

1.2.1 Linux

We used Linux Ubuntu Version 10.4 operating system a platform for in-stalling and working on TinyOS. The simple reason to use Linux is thatthere is lots of support for linux environment and easy to configure it tostart working quickly with TinyOS and its application.

1.2.2 TinyOS

TinyOS is an open source, BSD-licensed operating system designed for low-power wireless devices, such as those used in sensor networks, ubiquitouscomputing, personal area networks, smart buildings, and smart meters. Itis a component-based operating system and platform targeting wireless sen-sor networks (WSNs). TinyOS is an embedded operating system writtenin the nesC programming language as a set of cooperating tasks and pro-cesses. TinyOS started as a collaboration between the University of Califor-nia, Berkeley in co-operation with Intel Research and Crossbow Technology,and has since grown to be an international consortium, the TinyOS Alliance.

1.2.3 Programming Languages

nesC

TinyOS applications are written in nesC, a dialect of the C language opti-mized for the memory limits of sensor networks.nesC Programming Language Supports the TinyOS Kernel Design (Eventsand Tasks).

Shell Scripting

We used Shell scripting for making Automation tools for Motes and en-vironment setup. It is also used for developing front end for the TinyOSapplication

9

Page 11: Micazxpl wsn

Java

Java also used for front end applications. Specially for GUI Interfaces ofTinyOS applications.

1.3 Group work and Individual Roles of GroupMembers

1.3.1 Group Work

• TinyOS Tutorial study and presentation to the team.

• Research on TinyOS modules and applications.

• Discussion of possible ideas for the project using tutorials.

• Proposals and presentations of possible solutions from various researchpapers/work in the area of Intelligent Sensor Network to the teammembers.

• Reviewing each others work time to time.

• Implementation of the individual tasks and push to projects reposito-ries And

• Writing the reports on findings and work done by individuals.

• Review of the project developments.

1.3.2 Ankit Singh

• Managing Team and Project developments.

• Written Shell Script tools to automate settings and running of TinyOSenvironment and applications.

• Tutorial Presented to the Team: Mote-Mote radio communication

• Design and development of TinyOS applications in nesC (MicazXplVersion 0.1 & 0.2) .

• Project documentations.

10

Page 12: Micazxpl wsn

1.3.3 Philipp Orekhov

• Tutorial Presented to the Team: Sensing

• Finding and research on implementation solutions on ideas proposedby the team.

• Design and development of TinyOS applications in nesC (MicazXplVersion 0.1 and 0.2).

1.3.4 Rishu Seth

• Tutorial presentation to the team. Tutorial Presented: Boot Sequence

• Summarize and present the findings to the team for possible solutionsfor different issues or problems discussed during project developments(MicazXpl Version 0.1) .

• Responsible for research topics: Ad-Hoc Routing Architecture, Mi-cazXpl Version 0.2 Topic RSSI

1.3.5 Mohammad Tarique Abdullah

• Tutorial presentation to the team. Tutorial Presented: Mote-PC serialcommunication and SerialForwarder

• Summarize and present the findings on the research topic to the inter-est of our Project MicazXpl: Generalized Topology

• Research on the topic of interest for the development MicazXpl Version0.2 and presented the result to the team. Topic related to Multi-HopRouting: Collection Tree Protocol (CTP)

1.4 Beginning strategy for Project work

We started Intelligent Sensors Network project MicazXpl from scratch. Webegin learning and understanding the TinyOS environment from the tutori-als provided on official website of TinyOS.

1. First tutorial ”Getting Started with TinyOS” given an overview ofvarious Motes family and steps to install the TinyOS on Linux Ubuntu.We made one brief tutorial TinyOS Installation Guide for Beginnersto make it very simple for the beginners and newbie to linux. Wealso included the tweaks and some tricks to make Micaz motes runand shell scripts for making developers life easy to avoid typing manycommands to get started with TinyOS application pushed and run onthe motes.

11

Page 13: Micazxpl wsn

2. Second tutorial ”Modules and the TinyOS Execution Model” intro-duces nesC modules, commands, events, and tasks. It explains theTinyOS execution model using simple BlinkC application provided inTinyOS applications folder. We learned how TinyOS applications arewritten nesC language and usage of Interfaces, commands and Events.

BlinkC is a simple nesC application for motes which blinks the threeLeds of the motes at different timings. This helped us in understandingTinyOS Execution Model.

3. The Tutorial ”Mote-Mote Radio Communication” introduced us toradio communication in TinyOS. We familiar to the interfaces andcomponents which is used for communications. We learned to use thecommon message buffer abstraction called message t and how to sendor receive buffer over radio.

In this tutorial, we get familiarized with various basic Communica-tions interfaces given in tos/interfaces directory such as

• Packet

• Send

• Receive

• PacketAcknowledgements

• RadioTimeStamping

It also gives the oversight of Active Message Interfaces ”AM Type”refers to the field used for multiplexing. AM types are similar in func-tion to the Ethernet frame type field, IP protocol field, and the UDPport in that all of them are used to multiplex access to a communica-tion service.

• AMPacket

• AMSend

This tutorial modified BlinkC application which now uses Radio com-munication. We followed the tutorial and tested the radio communi-cation application provided in the tutorial.

4. The ”Mote-PC serial communication and SerialForwarder” tutorial isone of the important tutorial for the scope of our project. This com-munication helps us know how to communicate with a mote from acomputer which is very much needed to see the output data given bymotes.

12

Page 14: Micazxpl wsn

But this tutorial uses serial communication which was not in our case.We used RJ 45 cable i.e TCP/IP network for connecting programmingboard to computer (in our case Laptop). The detail about this givenin the tutorial in the later chapters.

There is a java module to net.tinyos.tools.Listen for listening motes.There is a already a base station utility application given in TinyOSapplication directory which acts as a bridge between serial or TCP/IPnetwork port and radio network. We successfully tested the Base sta-tion module by using BlinkToRadioC application by receiving the Datapacket with incrementing counter from motes.

5. ”Sensing” This tutorial introduces sensor data acquisition in TinyOS.The two application demonstration is given in the tutorial.

• Sense Application It periodically takes sensor readings and dis-plays the values on the LEDs.

• Oscilloscope It periodically broadcast their sensor readings to abase station explained above. We tweaked Oscilloscope to senseTemperature TempC, Light PhotoC, Sound MicC and send to thebase station.

After we received the sensors data to base station PC, we used theJava GUI module to visualize the data on PC.

13

Page 15: Micazxpl wsn

Part II

Proposal For Reliable DataAcquisition System

14

Page 16: Micazxpl wsn

Chapter 2

Project Work Proposals forMicazXpl Versions

2.1 MicazXpl Version 0.1

2.1.1 Data

CRC

Cyclic redundancy check used to ensure the integrity of the data is intact.There is a library function in TinyOS module for calculating the CRC sumfor the data. .../tos/interfaces/Crc.nc:

async command uint16_t crc16(void *buf, uint8_t len);

.../tos/system/CrcC.nc and crc.h: implementation

Timestamp

The idea is to avoid repeatition of the data by assigning the unique times-tamp. There is timer available in the timer module..../tos/lib/timer:

startPeriodic()

startOneShot()

getNow()

Message Structure

MicazXpl own Message header to be implemented.

typedef nx_struct name {

nx_uintX_t var1...

}

15

Page 17: Micazxpl wsn

counter + timestamp + security & integrity + msg content

Possibly two formats: for plain message and for encrypted message:message data + crc of message data → encypted message + crc encrypted

Security

We planned to acheive this using simple encryption and Decryption. Forexample, XOR operation with pre-defined shared value.

void crypt(void *buf, uint8_t lenBuf, uint16_t key);

void crypt(void *buf, uint8_t lenBuf, void *key, uint8_t lenKey)

and possibly: CC2420 radio builtin security features

Sensor readings

Checking sensor reading for missing data and possible outliers.missing/wrong: predefined value eg 0xFFoutliers: dependent on sensor, statistics?

2.1.2 Transmission

Mulitihop And Routing

We are trying to achieve the reliable data transmission by different routingscenarios. For example, simple multihop by forwarding to previous mote.

Simple:mote id 3 with sensor→ mote id 2→ mote id 1→ mote id 0 or base stationproblem: what if some middle mote is missing/stops working?

Other:tymo, ctp, ...

Data Loss and Damage

We are trying to prevent accidental or malicious data modification andpacket injection. Using the security and Data integrity proposals in pre-vious section.

loss: use control messages eg Ack/Syn + timeout values/countersdamage: integrity+security

Network Congestion

We can use the local storage and retransmission of the data on demand.Problems: how to identify network is busy??

16

Page 18: Micazxpl wsn

Mote Availability

Identifying the lost and available motes. It is important to avoid data losses.Example simple solution: motes broadcast their id periodically, base

station keeps counter. Problem: more motes added or base station fails...or RSSI- radio signal strength

2.1.3 Methods

Redundancy

Storing multiple versions of the collected data and using multiple motes toperform the same operation ⇒ Software redundancy + Data redundancy +Hardware redundancy

Local Storage

It should have a locally stored copy of the data to be able to retransmit ifdata is damaged and/or lost.

2.1.4 Improving Availability

Power Management

We try to keep the power consumption to the minimum to conserve batterypower. Disable unnecessary components / put components to sleep whennot used...

Low Power Listening

Its a feature provided by TinyOS. for example, the motes will go on sleepand Wakeup on the event/timer expiry/remote message.

The implementation details are given in the later chapter.

2.2 Implementation of MicazXpl Version 0.1

We successfully implemented MicazXpl Version 0.1 with features given be-low:

• Decremental Multihop Routing. Although its Static in nature andmajor drawback of the this version is that if any mode goes down thenwhole multihop routing architecture will fail.

• CRC checksum successfully applied on data to ensure integrity of data

17

Page 19: Micazxpl wsn

• Successfully Encrypted data with the first CRC calculated and againtake CRC checksum of the encrypted data. For more clarificationplease check the message structures of MicazXpl Version 0.1 headerfile

• Base Station receives the encrypted data. Then it calculates the CRCof encrypted data and compares with the received CRC. Then data isdecrypted successfully, the internal CRC is calculated and comparedagainst the one in the decrypted data and saves in the log file forfurther processing of the data. If there is any change in CRC, thenwhole message is set to 0xFF to indicate it being incorrect.

MicazXpl Version 0.1 Header File given below which represents the DataPayload structure:

#ifndef MICAZXPL_H

#define MICAZXPL_H

enum {

NREADINGS = 8,

AM_ENC_MSG_CRC=0xEE,

ENCRYPTION_KEY=0xFEED,

DEFAULT_INTERVAL=250

};

typedef nx_struct data {

nx_uint16_t moteid; // ID OF THE SENSING MOTE

nx_uint16_t timestamp; // timestamp to distinguish between older data

// 3 types of sensor readings

nx_uint16_t light[NREADINGS];

nx_uint16_t sound[NREADINGS];

nx_uint16_t temp[NREADINGS];

} data_t;

// message content + crc sum of the content

typedef nx_struct msg_crc {

data_t msg_data;

nx_uint16_t crc;

} msg_crc_t;

// message to be encrypted + encrypted crc sum

typedef nx_struct enc_msg_crc {

msg_crc_t msg;

nx_uint16_t final_crc;

18

Page 20: Micazxpl wsn

nx_uint8_t counter; // hop (incremented at each successive mote)

} enc_msg_crc_t;

#endif

The sample of live recorded data with encrypted and decrypted payloaddata is given below:

Encrypted Payload Data

00 00 01 00 02 19 00 EE FE EF FE ED FF 12 FF 12 FF 12 FF 12 FF

12 FC ED FC ED FC ED DD F0 1D BF 00

00 00 01 00 02 19 00 EE FE EF FE EC FC ED FC ED FC ED FC ED

FC ED FC ED FC EC FC EF B4 45 1D BF 00

00 00 01 00 02 19 00 EE FE EF FE EF FC FF FC F5 FC F6 FC F3 FC

F1 FC FA FC F9 FC FF 88 22 1D BF 00

00 00 01 00 02 19 00 EE FE EF FE EE FC CA FC C6 FC C3 FC C2 FC

DD FC DD FC C6 FC CB 2F BF 1D BF 00

00 00 01 00 02 19 00 EE FE EF FE E9 FC F2 FC CE FC C2 FC DA FC

D6 FC D0 FC D3 FC D0 61 44 1D BF 00

00 00 01 00 02 19 00 EE FE EF FE E8 FC DE FC C3 FC C7 FC C2 FC

D7 FC AF FC AB FC AA 86 B4 1D BF 00

00 00 01 00 02 19 00 EE FE EF FE EB FC AB FC A9 FC AF FC D3 FC

D5 FC D9 FC DF FC DC D3 EA 1D BF 00

Decrypted Payload Data

00 00 01 00 02 19 00 EE 00 02 00 00 01 F5 01 F5 01 F5 01 F6 01 F6 01

F6 01 F6 01 F6 0F A7 1D BF 00

00 00 01 00 02 19 00 EE 00 02 00 02 02 11 02 1A 02 1C 02 16 02 11 02

0D 02 1B 02 25 DD 15 1D BF 00

00 00 01 00 02 19 00 EE 00 02 00 06 02 40 02 3B 02 36 02 33 02 31 02

3D 02 43 02 45 BD 4F 1D BF 00

00 00 01 00 02 19 00 EE 00 02 00 07 02 46 02 41 02 3C 02 37 02 34 02

32 02 31 02 30 81 80 1D BF 00

00 00 01 00 02 19 00 EE 00 02 00 08 02 30 02 30 02 2F 02 2F 02 2F 02

2E 02 2E 02 2E 47 E3 1D BF 00

00 00 01 00 02 19 00 EE 00 02 00 09 02 2C 02 2A 02 29 022E 02 39 02

41 02 44 02 46 73 FC 1D BF 00

00 00 01 00 02 19 00 EE 00 02 00 0A 02 45 02 43 02 41 02 3E 02 3B 02

38 02 3E 02 45 A0 93 1D BF 00

19

Page 21: Micazxpl wsn

2.3 MicazXpl Version 0.2

2.3.1 Issues on Dynamic Routing Protocol CTP

In MicazXpl version 0.2, the CTP protocol was intended to be used toallow for more efficient multihop transmission of the data. The use of CTPhowever does not allow for easy monitoring of traffic paths due to the use ofdynamic link estimation (eg. 4 bit link estimation protocol), which wouldnot add a significant benefit to the application. Additionally, CTP adds anextra overhead on the message format and size, which makes the operationson the data that are supposed to be happening in real time more timeconsuming.

2.3.2 Use Version 0.1 in CTP

To allow for the use of the CTP in our application, the above meintionedissues need to be considered. Assuming the uncontrolled use of CTP multi-hop to be sufficient, the steps would be to:

• Link with the CTP, net and some link estimator libraries (in the Make-File)

• Setup the rootnode to be at the basestation

• enable the routing to be performed using the CTP

• manage the message format and size for proper data handling

20

Page 22: Micazxpl wsn

Part III

TinyOS Manual forBeginners in Linux (Ubuntu)

21

Page 23: Micazxpl wsn

Chapter 3

TinyOS Installation Guidefor Beginners

3.1 Procedure for Installation and configuring TinyOS

3.1.1 Installation of TinyOS (Source tinyos.net)

In Ubuntu operating system open following file:

System → Administration → Synaptic Package Manager

After Synaptic Package Manager get open goto:

Settings → Repositories → Other software → (Press) Add

After pressing Add button, Please enter the following line to add the tinyOSrepositories:

deb http://tinyos.stanford.edu/tinyos/dists/ubuntu <distribution> main

Distribution is the distribution name of the Ubuntu. If you do not knowthe distribution name then please follow the steps to know your UbuntuDistribution:

Type the the folllowing command on your linux command line:

ankit@ubuntu:~$ lsb_release -a

No LSB modules are available.

Distributor ID: Ubuntu

Description: Ubuntu 10.04.1

LTS Release: 10.04

Codename: lucid

You will get some output like the above. The Codename: lucid is my dis-tribution name. So, Just use the name which shows to you.

22

Page 24: Micazxpl wsn

After you inserted the above line in the add pop-up then press close. Thelinux will ask your permission to update the repositories. Just close it andit will automatically do it.Now, there is a option called Quick Search: Please enter tinyos as searchkey. You can see some result on it. Choose tinyos-2.1.1.Then press Apply button in Synaptic Package Manager.

It will install tinyos for you.

3.1.2 Configuration of TinyOS

Open Terminal in Ubuntu

You need to source the tinyos.sh (shell script) in bashrc. Type the followingcommand:

ankit@ubuntu:~$ sudo gedit .bashrc

The .bashrc file will be open after hitting enter

Then copy & paste the following lines after the first syntax lines:

#Sourcing the tinyos environment variable setup script

source /opt/tinyos-2.1.1/tinyos.sh

After that, save & exit.

Change the owner ship of the tinyos directory

Change directory to: (use the following command)

ankit@ubuntu:~$cd /opt/

ankit@ubuntu:~$sudo Chown -R ankit:ankit tinyos-2.1.1/

Note: use your home folder name given before ’@’ sign - Add path totinyos.jar file in tinyos.sh

ankit@ubuntu:~$cd /opt/tinyos-2.1.1

ankit@ubuntu:/opt/tinyos-2.1.1$sudo gedit tinyos.sh

Add the following line just after the end of the CLASSPATH:

:$TOSROOT/support/sdk/java/tinyos.jar:.

The line should look like:

CLASSPATH=$CLASSPATH:$TOSROOT/support/sdk/java:

$TOSROOT/support/sdk/java/tinyos.jar:.

23

Page 25: Micazxpl wsn

3.1.3 Confirming the correct configuration of the Tinyos

Change directory to:

ankit@ubuntu:~$cd /opt/tinyos-2.1.1/apps/Blink

Type the make command for the module Blink

ankit@ubuntu:/opt/tinyos-2.1.1/apps/Blink$ make micaz

You should see the output like this:

mkdir -p build/micaz

compiling BlinkAppC to a micaz binary

ncc -o build/micaz/main.exe -Os -fnesc-separator=__ -Wall -Wshadow -Wnesc-all

-target=micaz -fnesc-cfile=build/micaz/app.c -board=micasb -DDEFINED_TOS_AM_GROUP=

0x22 --param max-inline-insns-single=100000 -DIDENT_APPNAME=\"BlinkAppC\" -

DIDENT_USERNAME=\"ankit\" -DIDENT_HOSTNAME=\"ubuntu\" -

DIDENT_USERHASH=0x1bba31edL

-DIDENT_TIMESTAMP=0x4cec121eL -DIDENT_UIDHASH=0x92b330deL -fnesc- dump=wiring -

fnesc-dump=’interfaces(!abstract())’ -fnesc- dump=’referenced(interfacedefs,

components)’ -fnesc- dumpfile=build/micaz/wiring-check.xml BlinkAppC.nc -lm

compiled BlinkAppC to build/micaz/main.exe

2052 bytes in ROM

51 bytes in RAM

avr-objcopy --output-target=srec build/micaz/main.exe

build/micaz/main.srec avr-objcopy --output-target=ihex

build/micaz/main.exe build/micaz/main.ihex

writing TOS image

If you are able to see ’writing TOS’ image at end then you have successfullyconfigured the Tinyos.

3.1.4 Connecting Motes & pushing modules to Motes

Every time you connect a new mote to the serial-based programming board, you have to again setup & configure the network address of the program-ming board and system. So, to make life easy, I wrote a shell script.

All SHELL SCRIPTS tools can be found in MicazXpl project repositories.

Following are the shell script for configuring network

ankit@ubuntu:~$sudo gedit /bin/runMoteSetup.sh

#!/bin/sh

sudo ifconfig eth0 10.5.5.1

24

Page 26: Micazxpl wsn

sudo arp -s 10.5.5.5 00204A13E829

netcat 10.5.5.5 1

netcat 10.5.5.5 9999

NOTE: 00204A13E829 is the MAC address of my serial-based programmingboard. You need to put your own MAC address finding on the board.

This will save the shell script in /bin folder which will make this shell scriptaccessible from any folder or path. Don’t forget to make the shell script toexecutable file by using the following command.

ankit@ubuntu:~$sudo chmod +x /bin/runMoteSetup.sh

ankit@ubuntu:~$ runMoteSetup.sh

??#??#

*** Lantronix Universal Device Server ***

Serial Number 1359433 MAC address 00204A13E829

Software version V5.8.0.1 (041112) LTX

Press Enter for Setup Mode

Now, The shell script to push the modules to the Motes:

ankit@ubuntu:~$sudo gedit /bin/pushToMotes.sh

#!/bin/sh

## For comiling Data And pushing it in the Mote

make micaz install eprb,10.5.5.5

For making the above shell script executable.

ankit@ubuntu:~$sudo chmod +x /bin/pushToMotes.sh

ankit@ubuntu:/opt/tinyos-2.1.1/apps/Blink$ pushToMotes.sh mkdir -p build/micaz

compiling BlinkAppC to a micaz binary ncc -o build/micaz/main.exe -Os

-fnesc-separator=__ -Wall -Wshadow -Wnesc-all -target=micaz -fnesc-cfile=

build/micaz/app.c -board=micasb -DDEFINED_TOS_AM_GROUP=0x22

--param max-inline-insns-single=100000 -DIDENT_APPNAME=\"BlinkAppC\" -

DIDENT_USERNAME=\"ankit\" -DIDENT_HOSTNAME=\"ubuntu\" -

DIDENT_USERHASH=0x1bba31edL -DIDENT_TIMESTAMP=0x4ceef6c4L -

DIDENT_UIDHASH=0x44161342L -fnesc- dump=wiring -fnesc-dump=’interfaces(!abstract())’ -

fnesc- dump=’referenced(interfacedefs, components)’ -fnesc- dumpfile=build/

micaz/wiring-check.xml BlinkAppC.nc -lm

compiled BlinkAppC to build/micaz/main.exe

2052 bytes in ROM

51 bytes in RAM

25

Page 27: Micazxpl wsn

avr-objcopy --output-target=srec build/micaz/main.exe

build/micaz/main.srec avr-objcopy --output-target=ihex build/micaz/main.exe

build/micaz/main.ihex

writing TOS image

cp build/micaz/main.srec build/micaz/main.srec.out

installing micaz binary using eprb uisp -dprog=stk500 -dhost=10.5.5.5

--wr_fuse_h=0xd9 -

dpart=ATmega128 --wr_fuse_e=ff --erase --upload if=build/micaz/main.srec.out

--verify Firmware Version: 1.7 Atmel AVR ATmega128 is found.

Uploading: flash

Verifying: flash

Fuse High Byte set to 0xd9

Fuse Extended Byte set to 0xff \\

rm -f build/micaz/main.exe.out build/micaz/main.srec.out

3.1.5 Setting Up Environment for Mote Listener

Mote Listner is used to read the data broadcasted by motes in the networkand saves to the output file. Following are the commands for listening:

java net.tinyos.tools.Listen -comm [email protected]:10002

It is supposed to be serial communication but in our case, we are us-ing TCP/IP connection. That is why we are using ”network@IP:PORT” inabove command.

You can also go through the java source for getting more details on numberof options available for your type of connection to your PC:

ankit@ubuntu:/opt/tinyos-2.1.1/support/sdk/java/net/tinyos$

vim packet/BuildSource.java

You can export the MOTECOM for not always passing option -comm

export [email protected]:10002

Then run java listner without -comm parameter

ankit@ubuntu:/opt/tinyos-2.1.1/apps/tests/TestSerial$

java net.tinyos.tools.Listen

26

Page 28: Micazxpl wsn

3.2 Compiling and Pushing Sensor board specificApplication

We are going to take example of Oscilloscope application given with TinyOSpackage.Application Path is :

/opt/tinyos-2.1.1/apps/Oscilloscope/

3.2.1 Compile Module

To Compile this Module, You need to provide Sensor board type. In ourCase its: mts300.Type the following command on your linux console.

SENSORBOARD=mts300 make micaz

3.2.2 To Push it to the Motes

Type the following command on your linux console using your variables intothe syntax bracket.

make micaz reinstall eprb,<Node-ID> <IP-Adr>

Node-ID: Mote ID you want to set like Mode ID 1 or 2 or anythingIP-Adr: IP address of the Motes

3.2.3 Running GUI in For Base Station

Goto to Java folder of Oscilloscope:

/opt/tinyos-2.1.1/apps/Oscilloscope/java/

Setting Environment variable for motes communication:

export [email protected]:10002

Then RUN the Java Application:

ankit@ubuntu:/opt/tinyos-2.1.1/apps/Oscilloscope-Mic/java$./run

Hope it will be helpful for you to get started!!! Thank You!!

27

Page 29: Micazxpl wsn

Part IV

Interesting Findings duringProject Work

28

Page 30: Micazxpl wsn

Chapter 4

Interesting Findings

4.1 TinyOS Applications MicazXpl Version 0.1

1. CRC Module given with TinyOS: The function CRC16 function givenin the CRC module to calculate CRC16 is actually calculating CRC-CCITT (XModem). The functionality of the function is different fromthe function name. Need to be changed by TinyOS distributions.

2. The Default message Packet length is set to 28 Bytes. But we canchange it to any number required by our own setup. The file you needto alter is /tinyos/tos/types/message.h in the following part

#define TOSH_DATA_LENGTH 28

You can change that 28 to your message packet size requirement.

29

Page 31: Micazxpl wsn

Part V

Summarized Technical Paper

30

Page 32: Micazxpl wsn

Chapter 5

Adhoc Routing Architecture

5.1 Introduction

Multihop routing has been broken into several components. At the top ofthe layer architecture is an application component and between applicationcomponent and the multihop component is an arbitrary networking stackcomponent.

Multihop router is the top level configuration for the routing layer.

Sending a packet - Before sending a packet ,component uses getbuffercomm.In Ad -Hoc routing originator of the packet should call send.getbuffer.

Callingsend → multihopsends send command → MultihopRoute com-mand (chooses) Route→ Selected route→ Packet Transmit(AM sendMsgInterface)MultihopRoute depends on some numbers of estimator components to makedecisions on which route to use.

5.1.1 Receiving a Packet

AMs message reception signals MultihopRoute and it determines if thepacket is destined for local node and then it signals Multihop Routers Re-ceive Interface.

Not Local Node

It signals Multihop Routers Intercept and it allows high level component topeek into or modify packet payload.

31

Page 33: Micazxpl wsn

Figure 5.1: Component Architecture

32

Page 34: Micazxpl wsn

5.2 Different Roles

5.2.1 MultihopRoute

MultihopRoute is responsible for receiving protocol messages and decidingwhether it should forward them. If MultihopRoute decides that it shouldforward a message,then it passes the packet to Multihopsend.

5.2.2 MultiHopsend

It is responsible for sending packets using the implemented Ad - Hoc routingprotocol. MultiHopSend does not have any route selection logic and doesnot fill in the header fields necessary to send a packet, this is all performedby RouteSelector.

5.2.3 RouteSelector

RouteSelector maintains routing state which it uses to choose routes forpackets to send. MultiHopsend passes it a packet buffer, which it fills inwith the necessary header fields to be later understood by MultiHopRoute.RouteSelector makes its routing decisions using some number of Estimators,each of which can have different interfaces.

5.3 OSI Model

Open System Interconnection Model (OSI) -Layer - A layer is a collection of conceptually similar functions that provideservices to the layer above it and receives services from the layer below it.

5.4 Sliding Window Protocol

A sliding window protocol is a feature of Packet based data transmissionprotocols. They are used where reliability in order to delivery of packetsis required, such as in data link layer as in the transmission control proto-col(TCP).

5.4.1 Features

Each position of the transmission (Packets) is assigned a unique consecutivesequence number and the receiver uses the numbers to place received packetsin the correct order. i.e.

• Discarding duplicate packets.

• Identifying missing packets.

33

Page 35: Micazxpl wsn

Figure 5.2: OSI Model

34

Page 36: Micazxpl wsn

5.4.2 Problem

There is no limit of the size or sequence numbers that can be required inthis protocol.

5.4.3 Approach to the Problem

This problem can be chacked by placing a limit on the number of packetsthat can be transmitted or received at any given time.

5.4.4 Merits

A sliding window protocol allows an unlimited numbers of packets to becommunicated using fixed sequence numbers.

5.4.5 Alertness

For highest possible throughput, it is important that the transmitter is notpermitted to stop sending by the sliding window protocol earlier than oneRound Trip Delay Time(RTT).RTT: It is the length of time it takes for a signal to be sent plus the lengthof time it takes for an acknowledge of that signal to be received.RTT = SendTime + AckTime

5.5 Protocol based Communication

In communication based protocol , the receiver must acknowledge receivedpackets. If transmitter does not receive an acknowledgement within a rea-sonable time, it resends data.If a transmitter does not receive an acknowledgement it cannot know whetheractually receiver received the packet or not, or packet was damaged or itmay also happen that acknowledgement was sent but it was lost.

5.6 Protocol Operation

Basic terms used in it are -

• Transmitter sequence number = n(t)

• Receiver sequence number = n(r)

• Transmitter window size = w(t)

• Receiver window size = w(r)

35

Page 37: Micazxpl wsn

Window size must be greater than Zero. As we mentioned , n(t) is the nextpacket to be transmitted and the sequence number of this packet is not yetreceived and n(r) is the first packet not yet received. These both numbersare in increasing mode.

5.6.1 Receiver Operation

n(s) is one more than the sequence number of the highest sequence numberreceived.

• Received a Packet

• Updates its Variable

• Transmit acknowledgement with the new n(r)

• Transmitter keeps track of the highest acknowledgement it has receivedn(a)

But it is uncertain about the packets n(a) and n(s).

n(a)<= n(r)<= n(s)

Some Facts

There are some facts that are listed below -

• The highest acknowledgement received by the transmitter cannot behigher than the highest acknowledged by the receiver.

n(a)<= n(r)

• The span of fully received packets cannot extend beyond the end ofthe partially received packet.

n(r)<=n(s).

• The highest packet received cannot be higher than the highest packetsend.

n(s)<=n(t)

• The highest packet sent is limited by the highest acknowledgementreceived and the transmit window size.

n(t)<=n(a) +w(t)

36

Page 38: Micazxpl wsn

5.6.2 Transmitter Operation

If transmitter wants to send data, it may transmit upto w(t) packets aheadof the latest acknowledgement n(a). A transmitter can send packet numbern(t) if and only if

n(t) < n(a) +w(t)

5.6.3 Benefit of Sliding Window Protocol

Some benefits of sliding window protocol -

• Data Reliability

• Data Integrity

• Unlimited Sequence numbers are used

5.6.4 Drawback of Sliding Window Protocol

• Ambiguity occurs

• Maintaining a Sequence number is difficult

5.7 Connectionless Communication in Data LinkLayer

Packet switching network (connectionless network) is a data transmissionmethod in which each data packet carries some information. The connec-tionless communication mode has advantages over connection oriented com-munication. It allows multihop also in Data link layer.The data link layer supports reliable packet transmission between node tonode wireless connection. The sliding window protocol supports the reliabledata communication in data link layer. In our architecture all reliable datasare going to upper layer which ensures there is no missing of data.

5.8 Conclusion

In our proposed architecture we mentioned how data can be sent with in-tegrity and reliablity as we want reliable communication in multihop routing.As data is very important and valuable, if we lose data then it has a greatimpact on a persons condition and also has some environmental influences.

• So our proposed architecture refers Safety Critical Ad - Hoc routingArchitecture.

37

Page 39: Micazxpl wsn

Figure 5.3: Our proposed Architecture

38

Page 40: Micazxpl wsn

Bibliography

[1] Adhoc Routing Architecture, Philip Levis et.at, February 5, 2003

[2] Topology Control in Wireless Adhoc and sensors networks, Paolo Santi,Institute of Information e Telematica

[3] Topological Detection on wormholes in wireless sensor Adhoc and sen-sor networks, Dept. of Computer science and engineering, Hongkonguniversity of science and Technology, Dept. of computer science, Illi-nois institute of Technology, chicago, IL, USA

39

Page 41: Micazxpl wsn

Chapter 6

Generalized Topologies

6.1 General Analysis of Wireless Sensor Networkand its Topologies

Now a days wirelss sensor network has a great impact in various sectors. Forexample - It has application in defence sector, buliding, monitoring, safetymedical application, and also sensitive area observation, even the observa-tion of sea level and its application is increasing day by day.Typically a wirelsess sensor network consists of spartially distributed au-tonomous sensors to cooperatively monitor physical or environment condi-tions such as temperature, sound, vibration, pressure, motion or pollutants.In addition each sensor node consists of a radio transceiver, or wireless com-munications device, a small microcontroller and an energy source usually abattery.

6.1.1 Network Topologies

There are various kinds of network topologies in wireless sensor network.The basic issue in communication networks is the transmission of messagesto achieve a prescribed message throughput (Quantity of service) and qual-ity of service, quality of service can be specified in terms of message delay,message due dates, bit error rates packet loss, economic cost of transmission,transmission power etc.A communication network is composed of nodes, each of which has comput-ing power and transmit and receive messages over communication links.Basic network topologies are -

• Star

• Ring

• Bus

40

Page 42: Micazxpl wsn

Figure 6.1: Wireless Sensor Networks

41

Page 43: Micazxpl wsn

Figure 6.2: Wireless sensor node functional block diagram

42

Page 44: Micazxpl wsn

• Tree

• Fully Connected

• Mesh

• Hybride star - mesh

• Self Healing Ring

Description of above topologies are -

• Star: In this topology, all nodes are connected to a single hub node.The hub has some specific different functions than other nodes likehandling messages and routing and decision making capabilities. If acommunication link is damaged or cut it only affects only one nodewhile other nodes are able to communicate with other nodes. If thehub is damaged the network is destroyed.

• Ring : In this topology all nodes are logically same and they per-form the same function and there is no head node. Messages travelaround the ring in a single direction. If the ring is cut or damaged allcommunication is lost.

• Bus : In this topology, messages are broadcast on the bus to all nodes.Each node has to check the destination address in the message headerand each node processes the messages addresed to it. The bus topologyis passive and in this topology each node simply listens for messagesand no node is responsible for retransmitting the messages.

• Tree : In this topology, there is root node or head node. It has twochild node and each child node again in turn has two child nodes. It isa hierarchical structure. In it first messages are send to root or parentnode and then it goes to the destination node. If the root node isdamaged then the whole network is failed or damaged.

• Fully Connected : In this topology, every node is connected to eachother which means according to graph theory it is a complete graph.For smaller number of nodes it is very efficient. If the number of nodesincreases there occurs great complexity and number of links increasesexponentially and also there is a routing problem.

• Mesh : In this topology, all nodes are equally distributed over a ge-ographic region. For example, personnel or vehicle security surveil-lance systems. Actually this architecture provides a square relation-ship among the nodes that means 3*3 and 4*4 mesh architecture pro-vides 9 and 16 respectively. It has an advantage, although all nodes

43

Page 45: Micazxpl wsn

may be identical and have the same computing and transmission capa-bilities, certain nodes can still be designated as ’group leader’ and takean additional function. Also is the current group leader is damaged ordisabled, another node can take the charge and act as ’group leader’.

• Hybride star - mesh : In this topology, there is a more robust andversatile communications network. Also it maintains the wireless sen-sor node power consumption to the minimum. In this topology lowestpower sensor node is not capable of forwarding messages. It allowsfor minimal power consumption to be maintained. On the other handother nodes of the networks have the ability with multihop capability,that means they can forward messages from the low power nodes toother nodes in the network.

• Self Healing Ring : In this topology, there are two rings as comparedto one ring of ’Ring Topology’ and is more fault tolerant.

Figure 6.3: Basic Network Topologies

44

Page 46: Micazxpl wsn

Figure 6.4: Hybrid Star-Mesh Network Topology

45

Page 47: Micazxpl wsn

6.2 Applications of Wireless Sensor Networks

Various fields of applications of wireless sensor networks are :

• Environment Monitoring

• Acoustic Detection

• Seismic Detection

• Military Surveillance

• Inventory Tracking

• Medical Monitoring

• Smart Spaces

• Process Monitoring

• Green House Monitoring

• Landslide Detection

• Machine Health Monitoring

• Water Monitoring

• Agriculture Sector

• Medical Sector

6.2.1 Advantages of WSN

Advantages of WSN are :

• Implementation cost is cheaper than wired network.

• Ideal for temporary network setups.

• Ideal for the non reachable such as across river or mountains or ruralareas.

46

Page 48: Micazxpl wsn

6.2.2 Disadvantages of WSN

Various disadvantages of WSN are :

• Lower speed compared to wired network.

• Less secure because hacker’s laptop can act as acess point.

• More complex to configure than wired network.

• Can be affected by surrounding’s. For example, walls(blocking), mi-crowave oven(interference), far distance.

• Sensor node has low battery power, so as battery goes down, nodegoes down and so does the whole network.

6.3 Advantages and Disadvantages of SensorNetwork Topology

All topologies have various advantages and disadvantages :

• Ring : In this topology, one node failure causes whole network failureand also messages can travel only in one direction.Advantage is that each node is equal and no node is leader.

• Star : In this topology, if hub is damaged the whole network is dam-aged.Advantage is that if one node is cut of there is no effect on anothernode.

• Bus : In this topology, there is no retransmitting capacity for eachnode.Advantage is that it is very simple to implement.

• Tree : In this topology, if root node is damaged then whole network isdamaged.Advantage is that we can add priority according to structure or posi-tion of nodes.

• Fully Connected : In this topology, implementation is difficult andalso routing problem is there if there is increase in network.Advantage is that direct communication is achievable and all nodesare identical.

• Mesh : In this topology, it can only be expanded with the same numberof nodes in both direction as it is having a square relation between the

47

Page 49: Micazxpl wsn

nodes.Advantage is that all nodes have equal priority and are identical. Ifone node is damaged another node takes on the responsibility. It isgood for large scale network over a geographical region.

6.4 Conclusion

Wireless sensor networks already has huge application in various sec-tors and fields inspite of some limitations one of which is ’low batterypower capacity’ which is also its main drawback. Still its applicationsare increasing day by day. Also a thing to keep a check on in sensorsapplications is its topology. We have various options and every topol-ogy is having Pros and Cons.The applications of WSN will increase in near future and its draw-backs will hopefully reduce significantly as lot of research is goin onboth internationally and at domestic level in this field.

48

Page 50: Micazxpl wsn

Bibliography

[1] Wireless Sensor Networks, F. L. LEWIS, Associate Director for Re-search, Head, Advanced Controls, Sensors, and MEMS Group, Au-tomation and Robotics Research Institute, The University of Texas atArlington, 7300 Jack Newell Blvd. S, Ft. Worth, Texas 76118-7115

[2] Wireless Sensor Network Topologies, May 1, 2000 By:Wayne W. Manges, http://www.sensorsmag.com/networking-communications/wireless-sensor-network-topologies-778

[3] Wireless Sensor Networks: Principles and Applications, ChrisTownsend, Steven Arms, MicroStrain, Inc.

49

Page 51: Micazxpl wsn

Chapter 7

Collection Tree Protocol

7.1 Introduction

Collection tree’s are a core building block for sensor network applicationand protocols. In their simplest use, collection tree’s provide an unreliable,datagram routing layer that is used to gather data. Further collection proto-cols provide the topology underlying most point to point routing protocolssuch as BVR, RCRT etc. Despite the fact that it has played key role inmany systems, collection tree has some persistent problems if we look at it’shistory.There are some key principles that are used for designing the collectionprotocols to simultaneously achieve the following goals :

• Reliability : A collection tree protocol should deliver at least 90%of end to end packets when a route exists even under worse networkcondition.

• Robustness : It should be able to operate without tuning or configu-ration in a wide range of network condition, topologies, workload andenvironments.

• Efficiency : We can achieve this reliability and robustness while send-ing few packets.

• Hardware Independence : Sensor networks use a wide range of plat-forms, the implementation should be robust, reliable and efficient with-out assuming specific radio chip features.Achieving these goals depends on link estimation, accuracy and agility.

7.2 Introduction to CTP - TEP 123

CTP is a tree based collection protocol. Some number of nodes in a networkadvertise themselves as tree roots. CTP has some special features like :

50

Page 52: Micazxpl wsn

• CTP is address free.

• A node does not send packet to a particular root.

• CTP implicitly chooses a root by choosing a next hop.

• Node generate routes to root using a routing gradient.

7.2.1 Assumptions

But for doing so, CTP assumes that data link layer provides following fourthings :

• The layer provides an efficient local broadcast address.

• It provides synchronous acknowledgement for unicast packet.

• It provides protocol dispatch field to support multiple higher levelprotocol.

• The layer has single hop source and destination address.

7.2.2 Some other Random Assumptions

There are some other assumptions also which are listed below :

• It has link quality estimates of some number of nearby neighbours.

• These provide an estimate of the number of transmission it takes forthe node to send a unicast packet whose acknowledgement is success-fully received.

7.2.3 Collection and CTP

CTP uses expected transmission as its routing gradient. A root has EXE 0.The EXE of a node is the EXE of its parent node and the EXE of its linkto its parent node. In this case nodes uses link level transmission.For choice of valid routes :

• The CTP choose the one with the lowest EXE value.

• CTP represent ETX values as 16 bit fixed point real number with 100precision.

7.2.4 Routing Loop

A routing loop is a problem in a CTP network. A routing loop generallyoccurs when a node choose a new route that has a higher value of ETX thanits old value of ETX.A loop occurs when new routes include a node which was descendent.

51

Page 53: Micazxpl wsn

7.2.5 CTP Address Loop Mechanisms

There are two CTP address loop mechanisms :

The First Mechanism is :

• Every CTP packet contains the current gradient value of a node.

• An inconsistency occurs when a CTP receives a packet with a gradientvalue and it is lower than its own gradient value.

The Second Mechanism is :

• The second mechanism of CTP does not consider routes with an ETXhigher than a reasonable constant.

• The value of the constant is implemented and is dependent.

7.2.6 Solving Of Inconsistency

Ways of solving inconsistency is :

• By broadcasting a beacon frame.

• Then the node that sent the data frame will hear it and adjust itsroutes.

7.2.7 Packet Duplication

Packet duplication is another problem in CTP and various reasons for it arelisted below :

• When a node receives a packet successfully and transmit an acknowl-edgement but the sender does not receive the acknowledgement.

• So the sender re-transmit’s the packet again and receiver receives itfor the second time.

Packet Duplication in Multihop

In multihop :

• The duplication is exponential.

• If each hop produces one duplicate, the second hop produces 4, thirdproduces 8, that means it grows 2n form.

Field definitions are as follows :

52

Page 54: Micazxpl wsn

Figure 7.1: CTP Data Frame

53

Page 55: Micazxpl wsn

• P : Routing pull. The P bit allows nodes to request routing informationfrom other nodes. If a node with a valid route hears a packet with theP bit set, it SHOULD transmit a routing frame in the near future.

• C: Congestion notification. If a node drops a CTP data frame, itMUST set the C field on the next data frame it transmits.

• THL : Time Has Lived. When a node generates a CTP data frame,it MUST set THL to 0. When a node receives a CTP data frame,it MUST increment the THL. If a node receives a THL of 255, itincrements it to 0.

• ETX : The ETX routing metric of the single-hop sender. When a nodetransmits a CTP data frame, it MUST put the ETX value of its routethrough the single-hop destination in the ETX field. If a node receivesa packet with a lower gradient than its own, then it MUST schedulea routing frame in the near future.

• origin : The originating address of the packet. A node forwarding adata frame MUST NOT modify the origin field.

• seqno : Origin sequence number. The originating node sets this field,and a node forwarding a data frame MUST NOT modify it.

• collect id : Higher-level protocol identifier. The origin sets this field,and a node forwarding a data frame MUST NOT modify it.

• data : the data payload, of zero or more bytes. A node forwarding adata frame MUST NOT modify the data payload.

Figure 7.2: Origin Packet

54

Page 56: Micazxpl wsn

Figure 7.3: Packet Instance

Figure 7.4: CTP Routing Frame

55

Page 57: Micazxpl wsn

• P: Same as data frame.

• C: Congestion notification. If a node drops a CTP data frame, itMUST set the C field on the next routing frame it transmits.

• parent: The node’s current parent.

• metric: The node’s current routing metric value.

In order to implement CTP it has three major subcompnonents :

• A Link Estimator : It is responsible for estimating the single hop ETXof communication with single hop neighbours.

• A Routing Engine : It uses link estimates as well as network levelinformation to decide which neighbour is the next routing hop.

• A Forwarding Engine : It maintains a queue of packets to send. Itdecides when and whether to send data or not. It is also responsiblefor forwarded traffic.

Link Estimator

In this case the implementation uses two mechanisms to estimate the qualityof a link, periodic LEEP packets and DATA packets. The implementationsends routing beacons as LEEP packets. These packets send the neighbourtable with bidirectional ETX value. The implementation reset the timer toa small value when one or more of the following conditions are met.

• If the routing table is empty.

• The nodes routing ETX increases by ≥transmission.

• The node hears a packet with P bit set.

Additionaly, the rate at which CTP collects data estimates is proportionalto the transmission rate. Also it can quickly detect a broken link and switchto another candidate neighbour.

Routing Engine

It is responsible for picking the next hop for a data transmission. It keepstrack of the path ETX values of a subset of nodes and it is maintained bythe link estimation table.

56

Page 58: Micazxpl wsn

Forwarding Engine

It has four responsibilities :

• Transmitting packets to the next hop, retransmitting when necessaryand passing acknowledgement based information to the link estimator.

• It also takes decision when to transmit packet.

• It also detects routing inconsistencies and informs the routing engine.

• It also detects single hop transmission duplication caused by acknowl-edgement.

7.2.8 Four Key Function

There are four main key functions in CTP protocol :

• Packet Reception [SubReceive.receive( ) ]: It decides whether or notthe node should forward packet. It checks for duplicates using a smallcache or recently received packets. If it decides a packet is not dupli-cate, it calls the forwarding function.

• Packet Forwarding [ forward ( ) ] : It formats the packet for forwarding.It also detects loop by checking the received packets. It also checkswhether there is a space in transmission queue. If there is no spacethen it drops the packet.Set the C bit. If the transmission queue is empty it posts the sendtask.

• Packet Transmission [sendTask ( ) ] : It also examines the packet atthe head of the transmission queue.

• Packet Examination [ SubSend.sendDone ( ) ] : It examines the packetto see the result. If the packet was acknowledged, it pulls the packetoff the transmission queue. If the packet is locally generated it signalssendDone( ) to the client above. If the packet is forwarded it returnsthe packet to the forwarding message pool.If there are packets remaining in the queue (was not acknowledged) itstarts a timer which is random that reposts the tasks.

7.2.9 Limitation of CTP

There are various limitations of CTP :

– Although CTP has several mechanisms in order to improve de-livery but does not promise 100% delivery.

57

Page 59: Micazxpl wsn

– It is designed for low traffic rates.

– CTP is best effort, but best effort tries very hard.

Figure 7.5: Sample Structure of CTP Node Deployment

58

Page 60: Micazxpl wsn

Bibliography

[1] The Collection Tree Protocol (CTP), TEP 123

59

Page 61: Micazxpl wsn

Chapter 8

Received Signal StrengthIndicator - RSSI

8.1 Introduction

In wireless sensor networks (WSN) there are three main principles of mea-surement that can be used to obtain distances and to measure distance isnecessary to obtain the position of the sensor node.Three main principles are given below :

• Received Signal Strength Indicator (RSSI)

• Angle of Arrival

• Propogation Time Based. It includes -

– Time of Arrival

– Round Trip - Time - of - Flight

– Time Difference of Arrival

8.2 RSSI Method

Here we will discuss the RSSI in detail in Wireless Sensor network.

8.2.1 Introduction

Some basic characteristics of RSSI are :

• Received signal strength indication is a measurement of the receivedsignals power.

• Radio frequency signals : Power decreases with the distance.loss(dB)Loss(db)=20log(d)+20log(f)+32.45d = km,f = MHz

60

Page 62: Micazxpl wsn

• We know communication frequency and transmit power. So, if we canmeasure received signal’s power. We can find the distance ’d’.Received power = Transmitted power - Path loss.

• In telecommunication, received signal strength indicator (RSSI) is ameasurement of the power present in a received radio signal.

• RSSI is an acronym for received signal strength indication. It is ameasure of the signal power on the radio link, usually in the units ofdBm while a message being received.

Figure 8.1: RSSI Method

8.2.2 Use of RSSI

Various uses of RSSI are listed below :

• RSSI can be used for estimating node connectivity and node distance.

• Another usage of RSSI is to sample the channel power, when no nodeis transmitting to estimate the background noise also called noise floor.

8.2.3 Caution to Use RSSI in TinyOS

Various cautions to be taken while using RSSI in TinyOS are listed below :

61

Page 63: Micazxpl wsn

• The RSSI data is not provided by the standard platform independenthardware interface layer.

• RSSI must be accessed by a platform specific HAL interface.

• The RSSI values given by the TinyOS are usually not in dBm units andshould be converted by the platform specific relation to get meaningfuldata out of it.

8.2.4 Intercept Base

It is a modified version of the Base station component that provides theIntercept interface to allow the user application to inspect and modify radioand serial messages before they are forwarded to the other link and to decidewhether they shall be forwarded or not.

8.2.5 Sending Node

Sending Node is the application to be put in the node that sends the mes-sage whose RSSI will be ready by the base. It contains a simple logic toperiodically send a RSSI Msg.

8.2.6 RSSI Base

Various Characteristics of RSSI base are :

• It is the application that will be put in a node connected to the serialport and will effectively read RSSI.

• It uses the Intercept Base component to forward the messages over theradio but Intercept the RSSIMsg before it is forwarded and also theRSSI value is included.

• It contains some cryptic macros so that it can work correctly withchips that use either the CC2420 or CC1000 radio.

• It always forward the messages but modifies the payload by includethe RSSI.

8.2.7 Java Application

A java application called RSSIDEMO was created to see the results on thecomputer. The output would be like this :

• RSSI Message received from node 1 : RSSI = -14.

• RSSI Message received from node 1 : RSSI = -1.

• RSSI Message received from node 1 : RSSI = 2.

62

Page 64: Micazxpl wsn

8.2.8 Advantages of RSSI Method at Localisation

Various advantages of RSSI Method are :

• No directional sensor like ultrasonic systems.

• Indoor and Outdoor usage.

• Data communication and sensor usage at the same hardware.

8.2.9 Difficulties at RSSI Method

Distance calculation is related RF signal power receiver :

• Multiple Propagation.

• Fading Effects.

• Bad frontend devices

63

Page 65: Micazxpl wsn

Bibliography

[1] Received signal strength indication (RSSI), RSSI Demo

64

Page 66: Micazxpl wsn

Chapter 9

Energy Efficient Topologies

9.1 Introduction

The performance of wireless sensor networks (WSNs) is greatly influencedby their topology. WSNs with patterned topologies can efficiently save en-ergy and achieve long networking lifetime. Energy efficiency is one of the bigissue in wireless sensor networks. As we know a sensor network consists ofcollection of sensor node and each node has limited energy .If one node failsit is disconnected from other node and the connectivity of networks fails.Energy is a scarce resource for this class of devices. Mostly running onbatteries as energy source the improvement of energy-efficiency and powermanagement are becoming ever important research topics. Considering com-mon application profiles for Wireless Sensor Networks (WSN).In this paper we describe three energy efficiency approaches.In the first approach we described, towards cooperative energy managementin wireless sensor networks using online battery monitoring. It is a simpleconcept for measuring the battery voltage on the mote with little additionalhardware is shown. This is used for modelling of the battery discharge be-havior of Li-Ion batteries and deriving the remaining lifetime under givenenvironmental conditions.In the second approach we describe, the various kind of topologies in wire-less sensor network with respect to minimum energy conservation. WSNswith patterned topologies can efficiently save energy and achieve long net-working lifetime. We discuss different patterned topologies for constructingWSNs which can provide the required coverage area and the connectivityof all sensor nodes. Different performance measures among all patternedtopologies are compared, and find that WSNs in strip-based topology canprovide the greatest coverage area with the same number of sensor nodesas used for WSNs in other patterned topologies. Strip-based topology alsoconsumes least energy in the routing protocol of flooding. We also describeseveral routing protocols for WSNs in patterned topologies, which are based

65

Page 67: Micazxpl wsn

on different parameters when selecting next-hop neighbor.An ad hoc network is a wireless decentralized structure network and it iscomprised of nodes, which autonomously set up a networks.There is noexternal network infrastructure is necessary to transmit data there is nocentral administration. Freely located network nodes participate in trans-mission. In the third approach we discuss two efficient energy conservationtopologies. It is location based protocol LMST (Local Minimum SpanningTree) and R and M protocol.

9.2 Analysis of Energy-efficient Topology controlfor WSN’s using Online Battery Monitoring

9.2.1 Introduction

Wireless Sensor Networks (WSN) offers a broad range of applications, fromindustrial surveillance over security to medical monitoring. Another emerg-ing application of WSN systems is the monitoring of perishable or sensitivefreight in logistics. Energy is a scarce resource for this class of devices.Mostly running on batteries as energy source the improvement of energy-efficiency and power management are becoming ever important researchtopics. Because the power of sensor network for communication among thenodes depends on the battery energy of the node. As the node batterypower is very limited so it is very important to utilize the battery power ofthe sensor node and also life time of the sensor network s depends on thebattery power.

9.2.2 Architecture for Wireless Sensor Network systems

The basic elements of Wireless Sensor Networks are the network nodes ormainly referred to as motes. These motes consist of an RF-transceiver, amicrocontroller for protocol processing and sensor interfacing, sensors formeasuring.The use of flash memory allows the remote nodes to acquire data on com-mand from a base station, or by an event sensed by one or more inputs tothe node. Furthermore, the embedded firmware can be upgraded throughthe wireless network in the field.The microprocessor has a number of functions including :

• Managing data collection from the sensors.

• Performing power management functions.

• Interfacing the sensor data to the physical radio layer.

• Managing the radio network protocol.

66

Page 68: Micazxpl wsn

A key feature of any wireless sensing node is to minimize the power consumedby the system. Generally, the radio subsystem requires the largest amountof power. Therefore, it is advantageous to send data over the radio networkonly when required.

Figure 9.1: Wireless sensor node functional block diagram

9.2.3 Energy consumption of WSN components

A hardware platform based on the commercially available TmoteSky sys-tem by Moteiv Corporation is used here. These systems use the IEEE802.15.4-compliant RFtransceiverCC2420 and the 16-bit low-power micro-controllerMSP430F1611, both from Texas Instruments. The following mea-surements were made for the sending of a data message (41 bytes) and thereading of the internal temperature sensor in the microcontroller. The re-sults are shown in Table below : From the table We can say that adaptivelytuning the output power of the transceiver and decreasing communicationoverhead may drastically improve energy efficiency of a single mote and thismay increase the network lifetime.

9.2.4 Battery technologies for WSN systems

In this case Batteries are the common energy sources for motes. Althoughenergy harvesting may be an option for certain application where there isenough energy in the surroundings of the WSN system. When sensor nodes

67

Page 69: Micazxpl wsn

Figure 9.2: Comparison of power consumption

are surrounded by air ,light etc then there is enough energy. Consideringlogistics as an application the amount of energy being harvested is much toolow to power a mote sufficiently. If we consider the discharge curves of the

Figure 9.3: Li-Ion and NiCd/NiMH battery behaviour.

most common types of secondary cells, NiCd and NiMH cells behave almostequally with almost flat discharge behaviour while Li-Ion batteries have aconstant negative slope.There is a advantage of this feature of the Li-Ion cells discharge character-istic offers the advantage of computing the remaining capacity of the bat-tery when the actual load and the temperature of the battery are known.Li-Ion batteries are more favourable then using Ni-based batteries becausethe small slopes of Ni-based batteries impose higher demands on the mea-surement of the voltage as small changes in output voltage result in largerchanges in discharge capacity. Therefore, I-Ion cells were selected due to

68

Page 70: Micazxpl wsn

their higher energy density and their behaviour towards discharge model-ing.

9.2.5 Battery monitoring

There are some advantages using Li-Ion batteries. These kind of batteriesare more favourable for modelling due to their higher negative slope. Thisenables the usage of the internal AD-converter of microcontroller of themote. It offers a sufficient resolution of 12 bits for the measurement of thebattery voltage.

9.2.6 Circuitry and Measurements

In order to measurement setup it is required minimum additional hardwarefor the mote system. To verify this setup a series of measurements is takenunder controlled temperature using a constant load. As selected battery isThe Panasonic CGA103450A cell with a nominal output voltage of 3.6V.The results for 10 C and 10 C are also shown in figure given below andreflect the temperature dependency of the discharge behaviour.

Figure 9.4: Measurement setup and resulting graphs for 10 C and 10 C.

Modelling

By using these measurements, a simple numeric model is generated by divid-ing the discharge curve into two phases: first is normal operation and secondis post-cut-off. One can get the normal operation for the slightly decreasingslope. Post-cut-off is given just before the battery is empty. Both phases canbe described by a simple linear model as a set of four numerical parametersc0 to c3, the temperature v and the output voltage of the battery Vout inthe following equation :C = (c0 + c1 v) + (c2 + c3 v) Vout. (1) Furthermore a cut-off capacity

69

Page 71: Micazxpl wsn

Figure 9.5: Approximated discharge characteristics with Varying Tempera-ture

is defined which clearly marks the border of the two operational phases.Ccutoff = Cbase + c4 .v........................................................... (2)Here Cbase is a numerically found base capacity and constant c4 is theslope of the cut-off capacity with varying temperature ’v’.The switch-overbetween these phases is realized by using a different parameter set (c0 to c3)for Eq. (1). The maximally usable capacity can be calculated by defining anend-point voltage which is used in adding Eqs. (2) and (1) with the cut-offparameters.The endpoint voltage dependable. For example it is dependent on the usedvoltage regulator type and the minimum system supply voltage. It can beobtained by simply subtracting the current capacity from this maximumcapacity, the residual capacity is calculated.

9.2.7 Conclusion

It is an emerging field of research and that is the need for information onresidual energy in wireless sensor networks. The temperature behaviour ofbatteries has strongly affect the residual energy and thereby the performanceof the network. Based on a standard platform, a simple measurement setupand acomputationally simple linear model was developed which is capableof calculating the residual energy as a function of temperature directly onthe mote.

70

Page 72: Micazxpl wsn

9.3 Energy-Efficient Topologies and Routing forWireless Sensor Networks

9.3.1 Introduction

The right kind of topology is must to get optimum performance from wirelesssensor networks (WSNs). WSNs with patterned topologies can efficientlysave energy and achieve long networking lifetime. We have a look at dif-ferent patterned topologies for constructing WSN’s which can provide therequired coverage area and the connectivity of all sensor nodes and also arehighlighted the performance measures of each kind of topology. Then wediscuss several routing protocols for WSNs in patterned topologies, whichare based on different parameters when selecting next-hop neighbor.

9.3.2 Modelling Connected-Coverage WSN’s

In this model some important parameters that effect the performance ofWSN’s are featured : Connected-Coverage WSN’s is defined as network thatcan ensure the coverage and connectivity within specified and described areabetween the sensor nodes.We assume the region to be 2-dimensional. Assume the area of the region tobe ’A’ and sensor nodes ’N’ and one base station placed in the region. Eachnode participating can sense the event and collect data within a circularregion with radius rs, centre point being the node itself. No two nodes cancommunicate with each other if the Euclidean distance (distance calculatedby Pythagorean formula) between them is maximum rt, that is, nodes s1and s2 can communicate with each other if their Euclidean distance Ed(s1,s2) ≤ rt.The sensing ability of each sensor node diminishes as distance increases.The sensing ability at point ’y’ of sensor node si is assumed to be inverselyproportional to Ed(si, y)k where ’k’ is a sensor technology-dependent param-eter. This characteristic of sensor nodes introduces an important parameter,we call it sensing strength factor dmm, stating how well region A is coveredand sensed. If we define mini Ed(si, y) as the distance of point y to its clos-est sensor node, y ∈ A, then all points in A have a distance at most maxyεAminiEd(si, y). We use dmm to denote this distance :

dmm= maxyεA miniEd(si, y)A.

Thus dmm is the maximum distance from any point to its closest sensornode. The power consumption is another important parameter to measurehow much energy different topology patterns can save for WSNs. Eachsensor node includes :

71

Page 73: Micazxpl wsn

• Sensing unit.

• Processing unit.

• Transceiver unit.

• Power unit.

Based on these ’power consumption’ can be divided into three domains :

• Sensing.

• Communication.

• Data Processing.

Out of these three our area of concern is with the maximum energy spent bya sensor node in data communication which involves both power consumedin data transmission, denoted by Pt, and in data reception, denoted by Pr.That is, the power consumed by a sensor node is Ps = P t + Pr.

Patterned Topologies for Connected-Coverage WSNs :

In this section we discuss various topology patterns with a fixeed criteriaof having 25 sensor nodes and then compare performance of WSN’s underthose patterns :

WSN’s with Hexagon-Based Topology :

In hexagon-based WSNs, each sensor node has three neighbour nodes locateduniquely around the node and connection to the neighbour nodes are madein such a way that it obtains the minimum unit in the shape of hexagon andthat is why it is called as Hexagon-Based WSN. The distance between twoneighbouring nodes is set to be rt so that direct communication is availablebetween them and each neighbor provides maximal additional sensing area.A figure is given below and in that node 06 is assumed to be aggregationnode which plays the role of aggregating the sensed information in the WSNand reporting to the base station.

WSN’s with Square-Based Topology :

In square based node each sensor node has four neighbour nodes locatedaround it and connection is made in such a way that it obtains the minimumunit in shape of a square.The distances of the node to its neighbor nodesare set to rt and node 04 is assumed to be the aggregation node.

72

Page 74: Micazxpl wsn

Figure 9.6: A WSN with hexagon-based topology

Figure 9.7: A WSN with square-based topology

73

Page 75: Micazxpl wsn

WSNs with Triangle-Based Topology :

In triangle-based WSNs each sensor node has six neighbour nodes locatedaround it and connection is made in such a way that it obtains the minimumunit in shape of triangle.The distances of the node to its neighbor nodes areset to rt and node 04 is assumed to be the aggregation node. In this topologywe find that every point within the area is covered by at least two sensornodes and the reliability provided by such kind of node placement is called2-reliability. A 2-reliability WSN can maintain its connected-coverage forany single sensor node failure. When every point is covered by at least ksensor nodes, the sensor network is called k-reliability. The WSNs withother patterned topologies are 1-reliability.

Figure 9.8: A WSN with triangle-based topology

WSNs with Strip-Based Topology :

We know that to maintain the connectivity, the distance between two nodesshould not be more than rt. So in order to maximise the coverage area withsame no of nodes, strip-based topology may be used.The strip-based WSNbelow given figure clearly shows that sensor nodes 40, 41 and 42 connect 4self-connected strips 00 - 05, 10 - 14, 20 - 25 and 30 - 34. By this way of nodeplacement, these sensor nodes construct a connected WSN with strip-basedtopology. The total number of sensor nodes is 25 as before and here weassume node 05 to be the aggregation node.

74

Page 76: Micazxpl wsn

Figure 9.9: A WSN with strip-based topology

75

Page 77: Micazxpl wsn

9.3.3 Performance Comparison :

Now we compare the above four types of patterned topologies on basis of :

• Coverage area.

• Sensing strength factor.

• Reliability.

• Energy consumption.

We assume rt= rs = r in all WSN’s.For coverage area comparison we do not consider the marginal places cov-ered by edge sensor nodes because it occupies negligible portion of wholecoverage area.For energy consumption comparison, we fix the destination to be the ag-gregation node as designated above. The source is fixed to be a node withdistance ’4r’ from the destination. In this case, the less the energy is con-sumed, the better the node placement pattern is.The following table gives the results of these performances comparison.

Figure 9.10: Performance comparison among WSNs with different patternedtopologies

Looking at the table we can see that strip-based topology provides maxi-mal connected-coverage with the same number of sensor nodes and consumesleast energy by the routing protocol of flooding. WSNs in triangle-basedtopology provide the best reliability and the best sensing strength whiletrading off total coverage area and energy consumption. These conclusionshold when comparison is performed in general cases of large-scale WSNs.

76

Page 78: Micazxpl wsn

Routing Protocols in Patterned WSNs :

Several routing protocols which only require local information and this waythey are different from Directional Source-Aware Protocol (DSAP) whereeach node must have the knowledge of global information of topology arehighlighted.We define a routing selection function f(h, s) for a sensor node to chooseneighbor nodes when routing the message back to the aggregation node.The function is determined by the hop count value ’h’ of neighbor nodesand stream unit ’s’ which has been sent by neighbor nodes. We denote thebattery life of sensor node i by bi.There are three approaches to route back the message for different aims. Allof them are based on the routing selection function f(h, s) = α h + β s.

• Maximize the total energy saving for WSNs, i.e., B =∑i bi: This can

be obtained by minimizing first the hop count value ’h’ when choosingnext-hop neighbor and then minimize ’s’. In this case, α = 1, andβ =σ,where σ is a small number which approximates to 0.

• Maximize the minimal energy maintained by all sensor nodes, i.e.,minibi : This can be obtained by minimizing first the stream units ’s’of next-hop neighbour and then ’h’. In this case, α = σ, andβ = 1.

• Maximize both the total energy and minimal energy of all sensor nodes.This can be obtained by minimizing both ’h’ and ’s’. In this case, α =β= 1.

We name the protocols as routing selection function-based protocols. Itworks as follows :

• Distance identification : The aggregation node floods the discoverymessage in the WSN with a determined TTL value. Each sensor noderecords its distance from the aggregation node by hop count. If asensor node receives several broadcast messages, it records the leastvalue of hop count.

• Data collection: When a sensor node senses any abnormal event andneeds to report the event, it chooses a neighbor with minimized f(h,s) to route back the message.From Figure given below, we can see that Approach 1 provides leastnetwork lifetime. Approach 2 gets a longer lifetime than approach 1and, however, trades off much more energy consumption by choosinga longer path to the aggregation node in the WSN. Approach 3 canprovide the longest lifetime, which is almost as twice as that providedby Approach 1 because it tries to find a shorter path and a next-hopneighbor with more energy in every step.

77

Page 79: Micazxpl wsn

Figure 9.11: Energy consumption and lifetime comparison among three ap-proaches

9.4 Wireless Sensor Networks Energy-Efficient Topolo-gies

9.4.1 Introduction to Ad Hoc and Wireless Sensor Networks

Ad hoc networks are the ultimate technology in wireless communication thatallows network nodes to communicate without the need for a fixed infras-tructure. In this we describe addresses issues associated with control of datatransmission in wireless sensor networks (WSN) a popular type of ad hocnetworks with stationary nodes. Since the WSN nodes are typically batteryequipped, the primary design goal is to optimize the amount of energy usedfor transmission.An ad hoc network is a wireless decentralized structure network and it iscomprised of nodes, which autonomously set up a networks.There is no exter-nal network infrastructure is necessary to transmit data there is no centraladministration. Freely located network nodes participate in transmission.Network nodes can travel in space as time passes, while direct communica-tion between each pair of nodes is usually not possible. Generally, ad hocnetwork can consist of different types of multi functional computation de-vices.Wireless sensor network (WSN) is most often set up in an ad hoc mode bymeans of small-size identical devices grouped into network nodes distributeddensely over a significant area. Each device is equipped with central pro-cessing unit (CPU), battery, sensor and radio transceiver networked through

78

Page 80: Micazxpl wsn

wireless links provide unparalleled possibilities for collection and transmis-sion of data and can be used for monitoring and controlling environment,cities, homes, etc. In most cases WSNs are stationary or quasi-stationary,while node mobility can be ignored. There is no prearrangement assumptionabout specific role each node should perform. Each node makes its decisionindependently, based on the situation in the deployment region, and itsknowledge about the networks. When the networks consist of hundreds ofnodes then it is necessary to make a physical architecture for a wireless sen-sor networks. WSNs need some special treatment as they have unavoidablelimitations, for example, limited amount of power at their disposal. Eachbattery powered device, participating in WSN needs to manage its power inorder to perform its duties as long, and as effective as possible.

9.4.2 Communication Methods

For the communication in wireless sensor networks there are some commu-nication issues .These issues are given below :

Limited Resources

A sensor networks consists of nodes and these are an often small battery-feddevice, which means their power source is limited. The networks through-put is also limited.

Poor Quality of Connection

In the wireless sensor networks the quality of wireless transmission dependson numerous external factors, like weather conditions or landform features.Part of those factors change with time. So, there must have some limitationsin communication in wireless sensor networks.

9.4.3 Small Communication Range

It is one of the main problems of wireless sensor networks. Small communi-cation range in WSN networks results in communication limitations. Eachnode communicates only with the nodes present in its closest vicinity theneighbors .For this reason, the natural communication method in wirelesssensor networks is the multihop routing. When using multihop routing, it isassumed that the receiving node is located outside the transmitters range.Contrary to single-hop networks, the transmitter must transmit data to thereceiver by means of intermediate nodes. This is a certain limitation thathinders the implementation of routing algorithms but enables the construc-tion of network of greater capacity. Multihop network enables simultaneoustransmission via many independent route Independence of routes reducesthe interference between individual nodes, which additionally enhances the

79

Page 81: Micazxpl wsn

wireless transmission speed in comparison to single-hop networks, wheredevices share a common space.

9.4.4 Topology Control

Transmission of data package between two network nodes xi and xj requirespower proportional to d2

ij , where dij denotes the Euclidean distance be-tween sender and receiver.Lets assume that instead of performing directtransmission, a re-lay node xk is used. In such case two transmissions needto be performed: from a source node xi to a relay node xk (distance dik andfrom the node xk to the destination node xj (distance dkj).Lets consider atriangle xixkxj , also let a be an angle at vertex xk. By elementary geometrywe have:d2ij = dik

2 +dkj2 2dikdkjcos(α).....................(1)

Whencos(α) ≤ 0, total amount of energy spent to transmit a data packageis smaller when a relay node is used.Topology control protocols are responsible for providing the routing proto-cols with the list of nodes neighbors, and making decisions about the rangesof transmission power utilized in each transmission. The open systems in-terconnection (OSI) network model assumes that routing task is dealt withthe network layer. On the other hand all functions and procedures requiredto send data through the network are stored in the OSI data link layer.Therefore the topology control layer is placed partially in the OSI networklayer and the OSI data link layer.

Figure 9.12: Placement of topology control layer in the OSI stack

Topology controls protocols are divides into several groups. Descriptionis given below :

Homogeneous Topology Control Protocols

In this case it is assumed that each node uses the same value of transmissionpower, which reduces the problem to simpler task of finding the minimal level

80

Page 82: Micazxpl wsn

of transmit power such that certain network property is achieved.

Location based Topology Control Protocols

In this protocol it utilizes the information about geographical location ofnodes in the deployment area.

Neighbor ased Topology Control Protocols

It is assumed that no information about location of nodes is avail-able buteach node can determine set of its neighbors and build an order on this set.Order may be based on round trip time, link quality or signal strength.

9.4.5 Location Based Protocols

9.4.6 The R and M and LMST protocols

In this case we assume that N be a set of n wireless nodes deployed in thecertain region and forming WSN. Assuming that Ri denotes the maximaltransmission range assigned to ith node we can generate the communicationgraph G = (N,E) induced by R on a given WSN. The E denotes a set ofdirected edges, and the directed edge [xi,xj ] exists if xi and xj are neighbors,i.e., dij≤ Ri, where dij denotes the Euclidean distance between sender andreceiver. The communication graph G obtained when all the nodes transmitat maximum power is called max- Power graph.Let us consider the situation when all nodes transmit the collected datato one (or more) master node(s) xm a base station(s). We can formulatethe minimum energy all-to- one communication problem of calculating theoptimal re- verse spanning tree T of max power graph G rooted at xm :

Figure 9.13: Formula for Topology Control

Where PredT (xi) denotes the predecessor of ith node in the spanningtree T and C() the energy cost of transmission from xi to its predecessor.The R and M protocol calculates the most energy-efficient path from anynode to the master node. It is composed of two phases.

Phase 1

In the first phase the goal is to compute the enclosure graph of all nodes inWSN. Each node sends a broadcast message, at maximum power, containing

81

Page 83: Micazxpl wsn

its ID and location information. As such message is received by xi from anyneighbor node, xi identifies the set of nodes locations for which communicat-ing through relay node is more energy efficient than direct communication(the relay region of xi). Next, xi checks if the newly found node is in therelay region of any previously found neighbors. A node is marked dead ifit lays in the relay region of any neighbor of xi, and alive otherwise. Afterreceiving broadcast messages from all neighbors, the set of nodes markedwith alive identifier creates the enclosure graph of xi.

Phase 2

In the second phase the optimal, i.e., minimum-energy reverse spanning treerooted at the master node is computed. The Bellman-Ford algorithm forshortest path calculation is used on the enclosure graph that was determinedin the phase 1. Each node computes the minimal cost, i.e., minimal energyto reach the master node given the cost of its neighbors, and broadcasts themessage with this value at its maximum power. The operation is repeatedevery time a message with a new cost is received. After all nodes determinethe minimum energy neighbor link, the optimal topology is computed.

Figure 9.14: Average energy usage for transmission w.r.t. to the number ofrelay nodes; different TC methods

In the LMST location base protocol. LMST can be used to WSN withnodes equipped with transceivers with the same maximum power.

9.4.7 LMST operates in three phases

9.4.8 Phase 1

Each node sends a broadcast message, at maximum transmit power, con-taining its ID and location information to its one hop neighbor in the maxpower graph.

82

Page 84: Micazxpl wsn

Figure 9.15: Average energy usage for transmission w.r.t. the distance tothe base station; different TC methods

Phase 2

The topology is generated. Each node determines a set of its neighbors, cal-culates Euclidean distance to every neighbor, and finally creates a minimumspanning tree based on its neighbors and computed distances (edge weightsin the MST). Final net-work topology is derived from local MST created byall nodes. Neighbor set of each node consists of nodes, which are its directneighbors in its local MST. Unfortunately, created topology may containunidirectional links. Two approaches are pro-posed to solve this problem: itis assumed that all of them are bidirectional links or all unidirectional linksare removed.

Phase 3

Transmission power required to reach every neighbor in a given topology iscalculated based on the broadcast messages transmitted in the first phase.Based on the measurements of power of the broad-cast messages and knowl-edge about power level used when transmitting the message, it is possibleto compute power level needed to reach the target neighbor.

9.4.9 Simulation results

The performance of LMST in terms of energy conservation is investigatedthrough simulation. In this case a set of experiments for various wirelesssensor network topologies. It was assumed that all data collected in sensorswere transmitted to one base station. Compared the results obtained usingboth algorithms with those when energy consumption was not considered

83

Page 85: Micazxpl wsn

while routing calculation. The key metric for evaluating the listed methodswas the energy consumption used for data transmission. All experimentswere conducted using the popular software for net-work simulation ns-2.

Figure 9.16: Topology calculated using LMST method

Two versions of LMST: LMST0 (topology can contain unidirectionallinks), LMST1 (topology contains only bidirectional links). The total energyconsumed by all nodes for data transmission was divided by the number ofnodes. Data transmission while applying the LMST protocol is more energy-intensive.

9.5 Conclusion

We discuss 3 energy efficient topologies here. Actually all the topologies dis-cussed have some limations.But their main intension is to consume minimumpower. As we know sensor nodes are the back bone of a sensor networks,if one sensor node goes off (For lack of energy) the structure of a sensornetworks fails. So it is one of the main issues to utilized sensor power sothat no information is damaged.In our first discussion we discussed :Energy-efficient topology control for wireless sensor networks using onlinebattery monitoring,because we know a sensor node is a very small deviceand it operates according to its battery power. If the battery power is lowaccording to required operatial level the node can not work properly or can

84

Page 86: Micazxpl wsn

Figure 9.17: Topology calculated without TC protocols

Figure 9.18: Average energy consumption by one node for single transmis-sion to the base station; different TC methods and network size

85

Page 87: Micazxpl wsn

not communicate with other node properly. The need for information onresidual energy in wireless sensor networks is an emerging field of research.The temperature behaviour of batteries may strongly affect the residual en-ergy and thereby the performance of the network. Based on a standardplatform, a simple measurement setup and a computationally simple linearmodel was developed which is capable of calculating the residual energy as afunction of temperature directly on the mote. But in this case self-dischargeand load dependence is not discussed here .It is the limitation. As we knowthat the discharge behaviour has a great impact on battery power and alsoload has impact on that.In this case no networks structure and also topologyis discussed. But networks physical structure that means topology structureis needed to optimal utilize the sensor node.In our second discussion we discussed :We discussed different patterned topologies for WSNs in this paper. It isfound that strip-based topology provides the maximal connected coverageand consumes the least energy by flooding protocol, whereas triangle-basedtopology reaches the best coverage performance with a higher reliabilityand greater sensing strength. In WSNs with patterned topology, we pro-posed several routing protocols which achieve different goals. The simulationshowed that the networking lifetime is maximized by selecting routing basedon both hop count and stream unit of next-hop neighbor. Thus, patternedWSNs equipped with their protocols provide great promises and guaranteestheir potential applications to meet different needs. In this case numberof sensor node is not mentioned and also it is not mentioned the area ofthe sensor networks. In the WSN with hexagon-based topology each sensornode has three neighbour nodes and those are directed connected. But if wetake large number of nodes and also big area it is difficult to arrange such akind of topology. It is also difficult for triangle based, square based and aswell as strip based topology.In our third discussion we discussed :The Rand M and LMST protocols can be successfully used to calculate op-timal topology in many WSN application scenarios. Both methods haveto spent some energy to build the topology, which is concerned with bea-con messages broadcasting in the first phase of their operation. In summary,both techniques generate different topologies and have some advantages anddrawbacks. In case of R and M we obtain more energy-efficient topologiesbut two potential drawbacks of the algorithm can be observed. The compu-tation performed in the second phase of Rand M requires the exchange ofglobal information, which induces message overhead, and the explicit radiopropagation model is used to compute the optimal topology. Hence, thecalculated topology strongly depends on the accuracy of the channel model.On the other hand Data transmission while applying the LMST protocol ismore energy-intensive, but created topology is more robust and preservesconnectivity in the worst case.

86

Page 88: Micazxpl wsn

So far we discussed that each topology has its own merits and demerits.But when we design and establish a sensor network we must concern thenetwork life time and the network life time depends on the sensor node andthe sensor nodes depends on battery power. So battery power is the mainsource for the network life time .If we use less energy of battery then thenetwork life time will increase also. This is now is on -going research forsensor networks and new topologies and techniques are inventing for theWNS. The best way is to convey information within network with minimumenergy loss and maximum information gathering.

87

Page 89: Micazxpl wsn

Bibliography

[1] Advances in Radio Science Adv. Radio Sci., 5, 205208, 2007, www.adv-radio-sci.net/5/205/2007/

[2] Wireless Sensor Networks: Principles and Applications ChrisTownsend, Steven Arms MicroStrain, Inc.

[3] Developing Energy-Efficient Topologies and Routing for Wireless Sen-sor Networks, Hui Tian, Hong Shen, and Teruo Matsuzawa. GraduateSchool of Information Science, Japan Advanced Institute of Science andTechnology

[4] An EnergyEfficient Coordination Algorithm for Topology Maintenancein Ad Hoc Wireless Networks Benjie Chen, Kyle Jamieson, Hari Bal-akrishnan, and Robert Morris Laboratory of Computer Science, Mas-sachusetts Institute of Technology Cambridge Massachusetts 02139.

[5] Comparative Study of Wireless Sensor Networks Energy-EfficientTopologies and Power Save Protocols, Ewa Niewiadomska-Szynkiewicz,Piotr Kwaniewski, and Izabela Windyga.

88