courseware system-level modeling for wireless sensor networks jan madsen informatics and...

30
courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard Petersens Plads, Building 321 DK2800 Lyngby, Denmark

Upload: denisse-cullis

Post on 14-Jan-2016

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

courseware

System-level Modeling for Wireless Sensor Networks

Jan Madsen

Informatics and Mathematical ModellingTechnical University of Denmark

Richard Petersens Plads, Building 321DK2800 Lyngby, Denmark

Page 2: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 2SoC-MOBINET courseware

Sensor networks?

The Hogthrob project Developing a sensor network

infrastructure for sow monitoring Functionalities

Tracking Detecting heat period …

Low Cost (~1 €) Low Energy (2 years lifetime) Consortium:

DTU, DIKU, KVL National Committee for Pig Production IO Technologies

www.hogthrob.dk

The real HOGTHROB

Page 3: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 3SoC-MOBINET courseware

sending

receiving

idle

Sensor networks

CS P

CS P

CS P

CS P

CS P

CS P

Page 4: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 4SoC-MOBINET courseware

receiving

sending

idle

Sensor networks

CS P

CS P

CS P

CS P

CS P

CS P

Page 5: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 5SoC-MOBINET courseware

Sensor node

rtos

battery

cpu radiosensor

sensingprocessing

communicating

CS P

Page 6: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 6SoC-MOBINET courseware

Sensor node

Ultra low energy Low flexibility Ultra low cost (1$) Small size (1..10 Mtr) Low clock frequency DSP and RF dominated Limited memory Hardware/software codesign

rtos

battery

cpu radiosensor

Page 7: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 7SoC-MOBINET courseware

Sensor node design

rtos

cpu radiosensor

battery

sensing processing communicating

rtos

cpuasic

sensor

sensor

radio

Page 8: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 8SoC-MOBINET courseware

Sensor network model

Page 9: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 9SoC-MOBINET courseware

Sensor node: Uni-processor ...

rtos

a

Framework to experiment with different RTOS strategies

Focus on analysis of timing, energy and resource sharing

Abstract software model, i.e. no behavior/functionality

Easy to create tasks and implement RTOS models

Based on SystemC

Page 10: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 10SoC-MOBINET courseware

System model

rtos

a

Page 11: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 11SoC-MOBINET courseware

System model

rtos

Page 12: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 12SoC-MOBINET courseware

System model

rtos

Page 13: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 13SoC-MOBINET courseware

System model

Task messages: ready finished

RTOS commands: run preemept Resume

rtos

Page 14: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 14SoC-MOBINET courseware

System model - SystemC

pa = new task("task_a",1,50,3,12,0,ready);

registerTask(pa); pb = new

task("task_b",2,40,2,10,0,ready); registerTask(pb);

pc = new task("task_c",3,30,1,10,0,ready);

registerTask(pc);

rtosidentifier

period

priority

offsetWCET

Page 15: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 15SoC-MOBINET courseware

Link model

Aim: Adding tasks without having to create seperate communication links

Uses the SystemC master-slave library

If two tasks send a message at the same time – they are executed in sequence, but in undefined order

Global ”clock” is used to keep track of time

rtos

clock

Page 16: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 16SoC-MOBINET courseware

Task model

r1

r1 = time at which task becomes released (or active)

e1

e1 = worst case execution time (WCET)

d1 = deadline, task should complete before this!

d1s1

s1 = time at which task starts its execution

T1

T1 = period, minimum time between task releases

1

o1 = offset (or phase) for first released

o1

Page 17: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 17SoC-MOBINET courseware

Task model

Page 18: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 18SoC-MOBINET courseware

Sensor node model

Page 19: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 19SoC-MOBINET courseware

Energy modeling

Page 20: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 20SoC-MOBINET courseware

Communication example

s

r

Send node

Receive node

synch.

allocator

scheduler

synch.

allocator

scheduler

WirelessNetwork

Page 21: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 21SoC-MOBINET courseware

Modeling radio communication

cs bo bo cs cs Txp TxpTxp Txd TxdTxdTxdTxd

send idle

Modeling the CSMA protocol

idle

carrier sense preamble data

CPU

Transiver

Protocol

Sender:

Page 22: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 22SoC-MOBINET courseware

CSMA Protocol for sending

idlebackoff

carriersense

Tx pre-amble

Txdata

send

!send

bo_counter>0

bo_counter==0

!channel clear

channel clear &cs_counter==0

cs_counter>0

pr_counter>0

pr_counter==0

data_counter>0

data_counter==0

Page 23: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 23SoC-MOBINET courseware

Modeling radio communication

cs bo bo cs cs Txp TxpTxp Txd TxdTxdTxdTxd

carrier sense preamble data

CPU

Transiver

Protocol

Sender:

poll idle poll idle poll syn syn RxdRxdRxdRxdRxd

poll channel synchronize data

CPU

Transiver

Protocol

Receiver:

Page 24: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 24SoC-MOBINET courseware

Sensor network example

Page 25: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 25SoC-MOBINET courseware

Example 1: Simple broadcast

Application task0 = idle1 = ready2 = running3 = preempted4 = self-preempted

Sending task0 = idle1 = back-Off2 = carrier sensing3 = transmit preamble4 = transmit data

Receiving task0 = idle1 = polling2 = synchronize3 = receive data

Page 26: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 26SoC-MOBINET courseware

Example 2: Radio interference

Application task0 = idle1 = ready2 = running3 = preempted4 = self-preempted

Sending task0 = idle1 = back-Off2 = carrier sensing3 = transmit preamble4 = transmit data

Receiving task0 = idle1 = polling2 = synchronize3 = receive data

Page 27: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 27SoC-MOBINET courseware

Example 3: Network routing

Page 28: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 28SoC-MOBINET courseware

Example 3: Routing

Application task0 = idle1 = ready2 = running3 = preempted4 = self-preempted

Sending task0 = idle1 = back-Off2 = carrier sensing3 = transmit preamble4 = transmit data

Receiving task0 = idle1 = polling2 = synchronize3 = receive data

Page 29: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 29SoC-MOBINET courseware

Example 3: Battery shortage

Application task0 = idle1 = ready2 = running3 = preempted4 = self-preempted

Sending task0 = idle1 = back-Off2 = carrier sensing3 = transmit preamble4 = transmit data

Receiving task0 = idle1 = polling2 = synchronize3 = receive data

Node 2 runs out of battery

Page 30: Courseware System-level Modeling for Wireless Sensor Networks Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard

Jan Madsen 30SoC-MOBINET courseware

Summary

SystemC based framework to study the dynamic behavior of a sensor network

Exploring global effects of sensor node design Example sensor network based on Mica-nodes

and TinyOS from UC Berkeley Work in progress

Power/energy models for power management Mobile sensor nodes Detailed component models

To be used in the Hogthrob project