Você está na página 1de 90

Wireless Sensor Networks

Applications & Architectures

Operating System TinyOS

Communication Technologie & Protocoles Practices

Wireless Sensor Networks


1)

Introduction

Applications & Architectures

WSNs : Applications
2)
3) 4)

Applications Types of applications Challenges for WSNs

Operating System TinyOS

Communication Technologie & Protocoles Practices

WSNs : Architectures
5) 6) 7)

Hardware components Network architecture Network Deployment

WIRELESS SENSOR NETWORKS

1) INTRODUCTION
Computational devices

Laptops or palmtops

Ambient Intelligence
Computation used to control physical processes Embedded systems (washing machine, a video player, or a cell phone...)

Gather and process information (many different sources)


Wireless Communication & Collaboration ( large number of devices )

WSNS : APPLICATIONS

1) INTRODUCTION
Wireless Sensor Networks
Individual nodes Sensing or controlling physical parameters

Collaborate to fulfill their tasks


Wireless communication Computation

Power supply (onboard batteries)


Accuracy of the delivered results Size and costs of an individual node

WSNS : APPLICATIONS

1) INTRODUCTION
Wireless Sensor Networks
Facilitate many existing application areas and bring into existence entirely new ones For many physical parameters, appropriate sensor technology exists that can be integrated in a node of a WSN ( temperature, humidity, visual and infrared light, acoustic, vibration, pressure, chemical sensors, mechanical stress, magnetic sensors ) Actuators controlled by a node ( servo drive, electrical relay) Different kinds of applications can be constructed, with very different types of nodes, even of different kinds within one application.

WSNS : APPLICATIONS

2) APPLICATIONS
Disaster relief applications
Wildfire detection (thermometers and can determine their own location) Deployed over a wildfire from an airplane

Produce a temperature map


Firefighters equipped with (PDAs) In such an application, sensors should be cheap enough to be considered

disposable since a large number is necessary; lifetime requirements are not


particularly high.

WSNS : APPLICATIONS

2) APPLICATIONS
Environment control and biodiversity mapping
Respect to chemical pollutants ( garbage dump sites) Understanding of the number of animal species that live in a given

habitat
The main advantages of WSNs here are the long-term, unattended, wirefree operation of sensors close to the objects that have to be observed;

since sensors can be made small enough to be unobtrusive. Often, a large


number of sensors is required with rather high requirements regarding lifetime.

WSNS : APPLICATIONS

2) APPLICATIONS
Intelligent buildings
A better, real-time, high-resolution monitoring of temperature, airflow, humidity, and other physical parameters in a building by means of a WSN

can considerably increase the comfort level of inhabitants and reduce the
energy consumption In addition, such sensor nodes can be used to monitor mechanical stress

levels of buildings
The main advantage here is the collaborative mapping of physical parameters, lifetime requirements can be very high, the number of nodes,

and cost, is relatively modest, given the costs of a building

WSNS : APPLICATIONS

2) APPLICATIONS
Machine surveillance and preventive maintenance
One idea is to fix sensor nodes to difficult to reach areas of machinery where they can detect vibration patterns that indicate the need for

maintenance. Examples for such machinery could be robotics or the axles


of trains. Other applications in manufacturing are easily conceivable. The main advantage of WSNs here is the cable free operation, avoiding a

maintenance problem in itself and allowing a cheap, often retrofitted


installation of such sensors. Wired power supply may or may not be available depending on the scenario;

WSNS : APPLICATIONS

2) APPLICATIONS
Precision agriculture
Applying WSN to agriculture allows precise irrigation and fertilizing by placing humidity/soil composition sensors into the fields. A relatively small

number is claimed to be sufficient,


livestock breeding can benefit from attaching a sensor to each pig or cow, which controls the health status of the animal (by checking body

temperature, step counting, or similar means) and raises alarms if given


thresholds are exceeded.

WSNS : APPLICATIONS

2) APPLICATIONS
Medicine and health care
the use of WSN in health care applications is a potentially very beneficial, sensors are directly attached to patients the advantage of doing away

with cables is considerable here to the long-term surveillance of (typically


elderly) patients

WSNS : APPLICATIONS

2) APPLICATIONS
Logistics
it is conceivable to equip goods (individual parcels, for example) with simple sensors that allow a simple tracking of these objects during

transportation or facilitate inventory tracking in stores or warehouses.


a simple RFID tag cannot support more advanced applications. It is very difficult to imagine how a passive system can be used to locate an item in a

warehouse; it can also not easily store information about the history of its
attached object questions like where has this parcel been? are interesting in many applications but require some active participation of the

sensor node

WSNS : APPLICATIONS

2) APPLICATIONS
Telematics
sensors embedded in the streets or roadsides can gather information about traffic conditions at a much finer grained resolution than what is

possible today. Such a so-called intelligent roadside could also interact


with the cars to exchange danger warnings about road conditions or traffic jams ahead.

WSNS : APPLICATIONS

3) TYPES OF APPLICATIONS
Many of these applications share some basic characteristics.
In most of them, there is a clear difference between sources of data the actual nodes that sense data and sinks nodes where the data should be

delivered to.

Event detection
Sensor nodes should report to the sink(s) once they have detected the

occurrence of a specified event. The simplest events can be detected


locally by a single sensor node in isolation (e.g. a temperature threshold is exceeded);

WSNS : APPLICATIONS

3) TYPES OF APPLICATIONS
Periodic measurements
Sensors can be tasked with periodically reporting measured values; the reporting period is application dependent.

Function approximation and edge detection


The way a physical value like temperature changes from one place to another can be regarded as a function of location. A WSN can be used to approximate this unknown function (to extract its spatial characteristics), using a limited number of samples taken at each individual sensor node. This approximate mapping should be made available at the sink.

WSNS : APPLICATIONS

3) TYPES OF APPLICATIONS
Tracking
The source of an event can be mobile (e.g. an intruder in surveillance scenarios). The WSN can be used to report updates on the event sources

position to the sink(s), potentially with estimates about speed and direction
as well. To do so, typically sensor nodes have to cooperate before updates can be reported to the sink.

WSNS : APPLICATIONS

3) TYPES OF APPLICATIONS
Deployment options
They range from well-planned, fixed deployment of sensor nodes (e.g. in machinery maintenance applications) to random deployment by dropping a

large number of nodes from an aircraft over a forest fire.


In addition, sensor nodes can be mobile themselves and compensate for shortcomings in the deployment process by moving, in a post-deployment

phase, to positions such that their sensing tasks can be better fulfilled

WSNS : APPLICATIONS

3) TYPES OF APPLICATIONS
Maintenance options
Is it feasible and practical to perform maintenance on such sensors perhaps even required in the course of maintenance on associated

machinery? Is maintenance irrelevant because these networks are only


deployed in a strictly ad hoc, short-term manner with a clear delimitation of maximum mission time (like in disaster recovery operations)? Or do these

sensors have to function unattended, for a long time, with no possibility for
maintenance?

WSNS : APPLICATIONS

3) TYPES OF APPLICATIONS
Options for energy supply
In some applications, wired power supply is possible and the question is mute. For self-sustained sensor nodes, depending on the required mission

time, energy supply can be trivial (applications with a few days of usage
only) or a challenging research problem, especially when no maintenance is possible but nodes have to work for years. Obviously, acceptable price

and size per node play a crucial role in designing energy supply.

WSNS : APPLICATIONS

4) CHALLENGES FOR WSNS


Quality of Service
In some cases, only occasional delivery of a packet can be more than enough; in other cases, very high reliability requirements exist. In yet other

cases, delay is important when actuators are to be controlled in a real-time


fashion by the sensor network. The packet delivery ratio is an insufficient metric; what is relevant is the amount and quality of information that can be

extracted at given sinks about the observed objects or area.

WSNS : APPLICATIONS

4) CHALLENGES FOR WSNS


Fault tolerance
Since nodes may run out of energy or might be damaged, or since the wireless communication between two nodes can be permanently

interrupted, it is important that the WSN as a whole is able to tolerate such


faults. To tolerate node failure, redundant deployment is necessary, using more nodes than would be strictly necessary if all nodes functioned

correctly.

WSNS : APPLICATIONS

4) CHALLENGES FOR WSNS


Lifetime
The precise definition of lifetime depends on the application at hand. A simple option is to use the time until the first node fails (or runs out of

energy) as the network lifetime. Other options include the time until the
network is disconnected in two or more partitions, the time until 50% (or some other fixed ratio) of nodes have failed, or the time when for the first

time a point in the observed region is no longer covered by at least a single


sensor node

WSNS : APPLICATIONS

4) CHALLENGES FOR WSNS


Scalability
Since a WSN might include a large number of nodes, the employed architectures and protocols must be able scale to these numbers.

Wide range of densities


Different applications will have very different node densities.

Even within a given application, density can vary over time and space
because nodes fail or move; the density also does not have to homogeneous in the entire network and the network should adapt to such

variations.

WSNS : APPLICATIONS

4) CHALLENGES FOR WSNS


Programmability
Not only will it be necessary for the nodes to process information, but also they will have to react flexibly on changes in their tasks. These nodes

should be programmable, and their programming must be changeable


during operation when new tasks become important. A fixed way of information processing is insufficient.

WSNS : APPLICATIONS

4) CHALLENGES FOR WSNS


Maintainability
As both the environment of a WSN and the WSN itself change (depleted batteries, failing nodes, new tasks), the system has to adapt. It has to

monitor its own health and status to change operational parameters or to


choose different trade-offs (e.g. to provide lower quality when energy resource become scarce).

WSNS : APPLICATIONS

4) CHALLENGES FOR WSNS


Multi-hop wireless communication
While wireless communication will be a core technique, a direct communication between a sender and a receiver is faced with limitations. In

particular, communication over long distances is only possible using


prohibitively high transmission power. The use of intermediate nodes as relays can reduce the total required power. Hence, for many forms of

WSNs, so-called multi-hop communication will be a necessary ingredient.

WSNS : APPLICATIONS

4) CHALLENGES FOR WSNS


Energy-efficient operation
To support long lifetimes, energy-efficient operation is a key technique. Options to look into include energy-efficient data transport between two

nodes (measured in J/bit) or, more importantly, the energy-efficient


determination of a requested information.

WSNS : APPLICATIONS

4) CHALLENGES FOR WSNS


Auto-configuration
A WSN will have to configure most of its operational parameters autonomously, independent of external configuration - the sheer number of

nodes and simplified deployment will require that capability in most


applications. As an example, nodes should be able to determine their geographical positions only using other nodes of the network so-called

self-location. Also, the network should be able to tolerate failing nodes


(because of a depleted battery) or to integrate new nodes (because of incremental deployment after failure).

WSNS : APPLICATIONS

4) CHALLENGES FOR WSNS


Collaboration and in-network processing
In some applications, a single sensor is not able to decide whether an event has happened but several sensors have to collaborate to detect an

event and only the joint data of many sensors provides enough information.
Information is processed in the network itself in various forms to achieve this collaboration, as opposed to having every node transmit all data to an

external network and process it at the edge of the network. An example is


to determine the highest or the average temperature within an area and to report that value to a sink.

WSNS : APPLICATIONS

4) CHALLENGES FOR WSNS


Data centric
In a WSN, where nodes are typically deployed redundantly to protect against node failures or to compensate for the low quality of a single nodes

actual sensing equipment, the identity of the particular node supplying data
becomes irrelevant. What is important are the answers and values themselves, not which node has provided them.

WSNS : ARCHITECTURES

5) HARDWARE COMPONENTS
Overview
When choosing the hardware components for a wireless sensor node, evidently the applications requirements play a decisive factor with regard

mostly to size, costs, and energy consumption of the nodes


communication and computation facilities as such are often considered to be of acceptable quality, but the trade-offs between features and costs is

crucial.

WSNS : ARCHITECTURES

5) HARDWARE COMPONENTS
Overview
A basic sensor node comprises five main components

WSNS : ARCHITECTURES

5) HARDWARE COMPONENTS
Controller A controller to process all the relevant data, capable of
executing arbitrary code. Memory Some memory to store programs and intermediate data;

usually, different types of memory are used for programs and data.
Sensors and actuators The actual interface to the physical world: devices that can observe or control physical parameters of the environment.

WSNS : ARCHITECTURES

5) HARDWARE COMPONENTS
Communication Turning nodes into a network requires a device for
sending and receiving information over a wireless channel. Power supply As usually no tethered power supply is available, some

form of batteries are necessary to provide energy. Sometimes, some form


of recharging by obtaining energy from the environment is available as well (e.g. solar cells).

WSNS : ARCHITECTURES

5) HARDWARE COMPONENTS
Controller
The controller is the core of a wireless sensor node. It collects data from the sensors, processes this data, decides when and where to send it,

receives data from other sensor nodes, and decides on the actuators
behavior. It has to execute various programs, ranging from time-critical signal processing and communication protocols to application programs; it

is the Central Processing Unit (CPU) of the node.

WSNS : ARCHITECTURES

5) HARDWARE COMPONENTS
ATmega128L

Program Flash Memory Serial Communications Analog to Digital Converter Speed Grades

128K bytes UART 10 bit ADC (8 channels) 0-16 MHz

Current Draw (Active / Sleep)


Programmable I/O Lines SPI Interface

(8 mA / < 15 A)
53 In-System Programming

WSNS : ARCHITECTURES

5) HARDWARE COMPONENTS
Memory
There is a need for Random Access Memory (RAM) to store intermediate sensor readings, packets from other nodes, and so on. While RAM is fast,

its main disadvantage is that it loses its content if power supply is


interrupted. Program code can be stored in Read-Only Memory (ROM) or (EEPROM) or flash memory. Flash memory can also serve as intermediate

storage of data in case RAM is insufficient or when the power supply of


RAM should be shut down for some time.

WSNS : ARCHITECTURES

5) HARDWARE COMPONENTS
Atmel AT45DB041

Capacity Architecture Current Read / Standby Speed Grades

4-Megabit Serial Interface 4 mA / 8 A 0-16 MHz

WSNS : ARCHITECTURES

5) HARDWARE COMPONENTS
Communication device
The communication device is used to exchange data between individual nodes. Radio Frequency (RF)-based communication is by far the most

relevant one as it best fits the requirements of most WSN applications: It


provides relatively long range and high data rates, acceptable error rates at reasonable energy expenditure, and does not require line of sight between

sender and receiver. (Power consumption, Carrier frequency and


multiple channels, Data rates, Modulations, Gain, Range, RSSI, )

WSNS : ARCHITECTURES

5) HARDWARE COMPONENTS
RFM TR1000

Center Frequency Number of Channels Data Rate RF Power

433 MHz 4 38.4 Kbaud -20 to + 10 dBm

Outdoor Range
Current Draw (MAX Power)

1000 ft
25 mA

WSNS : ARCHITECTURES

5) HARDWARE COMPONENTS
Sensors (three categories)
Passive, omni-directional sensors These sensors can measure a physical quantity at the point of the sensor node without actually

manipulating the environment by active probing (thermometer, light,


vibration, microphones, humidity, pressure, chemical,) Passive, narrow-beam sensors These sensors are passive as well, but

have a well-defined notion of direction of measurement (camera, Infrared


Outdoor Intrusion Detector) Active sensors These sensors actively probes the environment, they

generate shock waves (sonar, radar,)

WSNS : ARCHITECTURES

5) HARDWARE COMPONENTS
Actuators
Actuators are just about as diverse as sensors, yet for the purposes of designing a WSN, they are a bit simpler to take account of: In principle, all

that a sensor node can do is to open or close a switch or a relay or to set a


value in some way. Whether this controls a motor, a light bulb, or some other physical object is not really of concern to the way communication

protocols are designed.

WSNS : ARCHITECTURES

5) HARDWARE COMPONENTS
Power supply
For un-tethered wireless sensor nodes, the power supply is a crucial system component. There are essentially two aspects: First, storing energy

and providing power in the required form; second, attempting to replenish


consumed energy by scavenging it from some node-external power source over time (batteries, Capacity, Photovoltaic, Temperature

gradients, Vibrations, Pressure variations, Flow of air/liquid )

WSNS : ARCHITECTURES

5) HARDWARE COMPONENTS
Energy consumption
The energy consumption of a sensor node must be tightly controlled. The main consumers of energy are the controller, the radio front ends, to

some degree the memory, and, depending on the type, the sensors.
To give an example, consider the energy consumed by a microcontroller per instruction.

One important contribution to reduce power consumption of these


components comes from chip-level and lower technologies: Designing lowpower chips

WSNS : ARCHITECTURES

5) HARDWARE COMPONENTS
Energy consumption
The crucial observation for proper operation is that most of the time a wireless sensor node has nothing to do. Hence, it is best to turn it off.

Naturally, it should be able to wake up again


These modes can be introduced for all components of a sensor node, in particular, for controller, radio front end, memory, and sensors. Different

models usually support different numbers of such sleep states with different
characteristics. For a controller, typical states are active, idle, and sleep; a radio could turn transmitter, receiver, or both on or off; sensors

and memory could also be turned on or off.

WSNS : ARCHITECTURES

5) HARDWARE COMPONENTS
Energy consumption
ATmega 128L has six different modes of power consumption,
idle active power-down

6 mW

15 mW

75 W

Atmel AT45DB041
Reading Writing

1.111 nAh

83.333 nAh

RFM TR1000 transceiver


Transmit a single bit Receive a single bit

0.5 J

0.5 J

WSNS : ARCHITECTURES

6) NETWORK ARCHITECTURE
Types of sources and sinks
There are essentially three options for a sink: it could belong to the sensor network as such and be just another sensor/actuator node

It could be an entity outside this network. the sink could be an actual


device, for example, a handheld or PDA used to interact with the sensor network;

It could also be merely a gateway to another larger network such as the


Internet, where the actual request for the information comes from some node far away and only indirectly connected to such a sensor network.

WSNS : ARCHITECTURES

6) NETWORK ARCHITECTURE

Three types of sinks in a very simple, single-hop sensor network

WSNS : ARCHITECTURES

6) NETWORK ARCHITECTURE
Single-hop versus multi-hop networks
From the basics of radio communication and the inherent power limitation of radio communication follows a limitation on the feasible

distance between a sender and a receiver. Because of this limited distance,


the simple, direct communication between source and sink is not always possible, specifically in WSNs, which are intended to cover a lot of ground.

To overcome such limited distances, an obvious way out is to use relay


stations, with the data packets taking multi hops from the source to the sink.

WSNS : ARCHITECTURES

6) NETWORK ARCHITECTURE

Multi-hop networks: As direct communication is impossible because of distance and/or obstacles, Multi-hop communication can circumvent the problem

WSNS : ARCHITECTURES

6) NETWORK ARCHITECTURE
Multiple sinks and sources
So far, only networks with a single source and a single sink have been illustrated. In many cases, there are multiple sources and/or multiple sinks

present. In the most challenging case, multiple sources should send


information to multiple sinks, where either all or some of the information has to reach all or some of the sinks.

WSNS : ARCHITECTURES

6) NETWORK ARCHITECTURE

Multiple sources and/or multiple sinks. Note how in the scenario in the lower half, both sinks and active sources are used to forward data to the sinks at the left and right end of the network

WSNS : ARCHITECTURES

6) NETWORK ARCHITECTURE
Three types of mobility

Node mobility
The wireless sensor nodes themselves can be mobile. The meaning of

such mobility is highly application dependent.


The network has to reorganize itself frequently enough to be able to function correctly. It is clear that there are trade-offs between the frequency

and speed of node movement on the one hand and the energy required to
maintain a desired level of functionality in the network on the other hand.

WSNS : ARCHITECTURES

6) NETWORK ARCHITECTURE
Three types of mobility

Sink mobility
The information sinks can be mobile. While this can be a special case of

node mobility, the important aspect is the mobility of an information sink that
is not part of the sensor network, for example, a human user requested information via a PDA while walking in an intelligent building.

WSNS : ARCHITECTURES

6) NETWORK ARCHITECTURE

A mobile sink moves through a sensor network as information is being retrieved on its behalf

WSNS : ARCHITECTURES

6) NETWORK ARCHITECTURE
Three types of mobility

Event mobility
In applications like event detection and in particular in tracking

applications, the cause of the events or the objects to be tracked can be


mobile. In such scenarios, it is (usually) important that the observed event is

covered by a sufficient number of sensors at all time. Hence, sensors will


wake up around the object, engaged in higher activity to observe the present object, and then go back to sleep.

WSNS : ARCHITECTURES

6) NETWORK ARCHITECTURE

Area of sensor nodes detecting an event an elephant that moves through the network along with the event source

WSNS : ARCHITECTURES

7) NETWORK DEPLOYMENT
Regular Topology
In this topology, each node has four nearest neighbors at fixed distance, denoted by rgrid. The distance rgrid depends on the node spatial density, and

it can be estimated as follows. One can first observe that constructing a


square lattice of N nodes over a square surface with area A is equivalent to fitting N small square tiles of r2grid into a large square of area A. Hence, it

follows that A = N r2grid, and therefore, the distance to the nearest neighbor
in a square grid topology can be written as, s is the spatial density of nodes.

WSNS : ARCHITECTURES

7) NETWORK DEPLOYMENT
Random Topology
For networks with random topology, we consider a scenario where nodes are randomly and uniformly distributed in a given area. In addition, it is

assumed that the position of a node is independent of those of the other


nodes. For a sufficiently large number of nodes and a large coverage area, the number of nodes in an arbitrary area can be approximated with a two

dimensional Poisson distribution. The probability mass function Pr of the


number of nodes M over a surface of area A in a two dimensional topology is provided s is the average node spatial density.

WSNS : ARCHITECTURES

7) NETWORK DEPLOYMENT
Disk Model Coverage

Probability of Sensing 0

rs Distance, x

The sensing range is assumed to be a uniform disk of radius rs. This model supposes that an event is deterministically detected only if it

happens within distance rs . If an event occurs outside this range, it cannot


be detected. In this case, an area is completely covered when any point in this area has a sensor within the range of rs. However, physical

phenomenon behaviors are not discrete as the disk model assumes. The
disk model coverage assumptions may lead to deploy a higher number of sensors than really needed, interferences between redundant nodes have

negative impact on energy consumption and thus lifetime.

WSNS : ARCHITECTURES

7) NETWORK DEPLOYMENT
S1 S1

S1

ds ds

S2

ds

S2
The hole

ds

Disk Model Coverage

rs

S3 (a) (b) (c)

Sensor model and coverage, (a) disk type sensor model, (b) 2 sensors (S1, S2), and (c) 3 sensors (S1, S2, S3), with coverage hole

S1

ds ds
S3

S2

S1

ds ds ds ds
S3

S2

ds

ds

S4

(a)

(b)

(c)

Optimal placement using disk packing problem, (a) 3 sensors (S1, S2, S3), without hole, (b) circle packing, and (c) 4 sensors (S1, S2, S3), ds is the distance between sensors

Probability of Sensing

WSNS : ARCHITECTURES

e-(x-rs)

7) NETWORK DEPLOYMENT
Probabilistic Model Coverage

rs

Distance, x

The probabilistic sensing model approach is more realistic than the deterministic model. An exponential sensing model could be assumed

where the sensing ability degrades after a certain threshold. Since the
environmental conditions have a stochastic distribution (e.g., temperature) it is more realistic to consider a probabilistic coverage model. This model

supposes that the sensing range is not a disk and the overlaps between
sensors are not clearly defined. Therefore, the minimization overlap approach is not suitable for this probabilistic model coverage.

WSNS : ARCHITECTURES

7) NETWORK DEPLOYMENT
Probabilistic Model Coverage

Example of sensing capacity of 3 sensors S1, S2, S3 using the exponential sensing model. S1, S2, S3 deployed at vertices of equilateral triangle. LCP least covered point at triangle center, rs = 15, = 0.1

WSNS : ARCHITECTURES

7) NETWORK DEPLOYMENT
Connectivity
A two dimensional WSN could be modeled as a random geometric graph G(n, f, rc). n corresponds to the number of vertices (nodes) distributed

according to probability f (i.e., Probability Density Function, PDF), with edge


between two nodes within distance rc. One research question is, for a fixed number of nodes on a given area A, what is the transmission range

requirement to make the network connected under high probability? A


solution for randomly uniformly deployed sensor network is given when n and P(G is connected) are reasonably high values

WSNS : ARCHITECTURES

7) NETWORK DEPLOYMENT
Connectivity

Probability of network connectivity with A = (1000 x 1000) m2

WSNS : TINYOS

APERUS GNRALE DE TINYOS


Systme dexploitation pour rseaux de capteurs embarqus

Ensemble de composants logiciels qui peuvent tre relis ensemble en


un seul excutable sur un mote Fonctions minimales

2 threads: tches et handlers dvnements matriels

WSNS : TINYOS

CONCEPTS DE NESC
Unit de code de base = Composant

Composant
Excute des Commands Lance des Events

Dispose dun Frame pour stocker ltat local


Utilise la notion de Tasks pour grer la concurrence Un Composant implmente des interfaces Utilises par dautres composants pour communiquer avec ce composant

WSNS : TINYOS

COMPOSANTS
Deux types de composants

Module
Composant implment avec du code Configuration

Composants relis ensemble pour former un autre composant

WSNS : TINYOS

APPLICATION TINYOS (EXEMPLE)

WSNS : TINYOS

RSUM
Application un ou plusieurs composants relis ensemble pour former

un excutable
Composant un lment de base pour former une application nesC. Deux types: modules et configurations

Module composant qui implmente une ou plusieurs interfaces


Configuration composant qui relie dautres composant ensemble Interface dfinie dune manire abstraite les interactions entre deux composants

WSNS : TINYOS

INTERFACES
Une interface dfinie les interactions entre deux composants.

Deux types doprations: commands, events

WSNS : TINYOS

INTERFACES, COMMANDS, EVENTS


Les interfaces sont bidirectionnelles: Elles spcifient un ensemble de

fonctions implmenter par les composants fournisseurs de linterface


(commands), et un ensemble implmenter par les composants utilisateurs de linterface (events) Les commands font typiquement des appels du haut vers le bas (des composants applicatifs vers les composants plus proches du matriel), alors que les events remontent les signaux du bas vers le haut.

WSNS : TINYOS

EXEMPLE DUNE INTERFACE

WSNS : TINYOS

INTERFACES, COMMANDS, EVENTS


Appeler une command

call Send.send(1, sizeof(Message), &msg1);


Signaler un event

signal Send.sendDone(&msg1, SUCCESS);

WSNS : TINYOS

MODULES
module C1{ uses interface triangle; } implementation { ... } module C2{ provides interface triangle in; uses { interface triangle out; interface rectangle side; } } implementation { ... } module C3{ provides interface triangle; provides interface rectangle; } implementation { ... }

WSNS : TINYOS

CONFIGURATIONS
Dans nesC, deux composants sont relis ensemble en les connectant

(wiring)
Les interfaces du composant utilisateur sont relies (wired) aux mmes interfaces du composant fournisseur endpoint1 -> endpoint2 endpoint1 <-endpoint2 (equivalent: endpoint2 -> endpoint1)

WSNS : TINYOS

NESC

WIRING SYNTAX

Les lments connects doivent tre compatibles

Interface-interface, commande-command, event-event


On peut connecter Send Send Mais pas Send receive (par exemple)

Connecter un utilisateur dune interface un composant qui implmente


linterface:

WSNS : TINYOS

CONFIGURATIONS (ILLUSTRATION)
Connecter des configurations:

configuration app { }

implementation { uses c1, c2, c3; c1 -> c2; // implicit interface sel. c2.out -> c3.triangle; c3 <-c2.side;

WSNS : TINYOS

BLINK.NC CONFIGURATION

WSNS : TINYOS

BLINKM.NC MODULE

WSNS : TINYOS

BLINK
Nous allons muler l'excution de l'application Blink avec TOSSIM.

Pour cela on compile Blink en tapant la commande suivante :


make pc Comme nous sommes intress par afficher uniquement l'tat des diodes

on doit affecter la valeur led la variable globale DBG en tapant la


commande : export DBG=led Enfin pour lancer l'excution de Blink sur un seul capteur, on tape la commande : build/pc/main.exe 1

WSNS : AD HOC ROUTING PROTOCOLS

PROTOCOLS
Proactive routing protocols
Each node maintains global topology information in its table Reactive routing protocols

Reactive routing protocols establish the path only when it is demanded.


Multicast routing protocols Due to dynamic changes in the network topology, a multicast structure must be reconstructed continuously as connectivity changes.

WSNS : AD HOC ROUTING PROTOCOLS

PROACTIVE ROUTING PROTOCOLS


Destination Sequence Distance Vector (DSDV)

DSDV routing table consists of the destination, next hop, distance, and
sequence number information.

Destination
SN1 SN2 SN3 SN5 SN6 SN7 SN8

Next Hop
SN2 SN2 SN2 SN6 SN6 SN6 SN6

Distance
2 1 2 2 1 2 3

Seq. No
S128_SN1 S564_SN2 S710_SN3 S392_SN5 S076_SN6 S128_SN7 S050_SN8

WSNS : AD HOC ROUTING PROTOCOLS

PROACTIVE ROUTING PROTOCOLS


Cluster-head Gateway Switch Routing (CGSR)

Cluster-head, cluster-gateway, and cluster-member. A cluster-head is


elected by an algorithm and has to be a unique cluster-head within its transmission range. If a node is member of more than one cluster-head, it is

called a gateway.

WSNS : AD HOC ROUTING PROTOCOLS

REACTIVE ROUTING PROTOCOLS


Dynamic Source Routing protocol (DSR)

Employs a flooding technique in order to discover path by sending a


RouteRequest packet. Ones the RouteRequest packet is received by the destination, a RouteReply packet is sent to the source, a RouteReply

packet could take the same path as the RouteRequest packet toward the
source node and then the path could be established. DSR protocol do not use a periodic update messages, because path is established only when it is requested.

WSNS : AD HOC ROUTING PROTOCOLS

REACTIVE ROUTING PROTOCOLS


Dynamic Source Routing protocol (DSR)
Route Request (Source, Destination, Hop) SN4 RREQ (1,5,{1,2}) RREQ (1,5,{1,2,4}) Destination
SN5

SN2 RREQ (1,5,{1}) SN8

SN1
Source

SN6 SN7

Route Replay (Source, Destination, Source Route) RREP (5,1,{1,2,4,5}) SN4

RREP (5,1,{1,2,4,5})

Destination
SN5

RREP (5,1,{1,2,4,5})

SN2 SN8

SN1
Source

SN6 SN7

WSNS : AD HOC ROUTING PROTOCOLS

REACTIVE ROUTING PROTOCOLS


Ad hoc On demand Distance Vector (AODV)

Uses an on-demand method. The basic concept of AODV is that the


destination employs a sequenced numbers to identify path recently discovered. AODV uses tables of intermediate nodes and can determine

the latest path to the destinations.

WSNS : AD HOC ROUTING PROTOCOLS

MULTICAST ROUTING PROTOCOLS


Ad hoc Multicast Routing (AMRoute)

Ad hoc Multicast Routing (AMRoute) protocol exploits the user-multicast


trees and dynamic logical cores in mobile ad hoc network to create a bidirectional and shared tree by using only group of senders and receivers.

In order to connect neighbors on the user-multicast tree, AMRoute protocol


uses the unicast tunnels.

WSNS : AD HOC ROUTING PROTOCOLS

NETWORK SIMULATOR: NS-2


Different kind of networks could be simulated with NS such as Local Area

Network (LAN) and Wireless Personal Area Network (WPAN). Diverse


applications and protocols could be implemented in the NS simulator such as Transmission Control Protocol (TCP) and User Datagram Protocol

(UDP). NS includes signal strength as network elements, File Transfer


Protocol (FTP) and Continuous Bit Rate (CBR) as traffic models.

WSNS : AD HOC ROUTING PROTOCOLS

NETWORK SIMULATOR: NS-2


The users OTcl script creates the event scheduler objects, network

component object and can include also the setting of the output form
results. Graphical software called Network Animation (NAM) could be used in order to show the simulation result.

OTcl : Tcl interpreter With OO extention

Analysis

OTcl Script Simulation Program

NS Simulator Library Event Scheduler Objects Network Component Object Network Setup Helping Modules (Plumbing Modules)

Simulation Result NAM Network Animator

Você também pode gostar