courseware system-level modeling for wireless sensor networks jan madsen informatics and...
TRANSCRIPT
courseware
System-level Modeling for Wireless Sensor Networks
Jan Madsen
Informatics and Mathematical ModellingTechnical University of Denmark
Richard Petersens Plads, Building 321DK2800 Lyngby, Denmark
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
Jan Madsen 3SoC-MOBINET courseware
sending
receiving
idle
Sensor networks
CS P
CS P
CS P
CS P
CS P
CS P
Jan Madsen 4SoC-MOBINET courseware
receiving
sending
idle
Sensor networks
CS P
CS P
CS P
CS P
CS P
CS P
Jan Madsen 5SoC-MOBINET courseware
Sensor node
rtos
battery
cpu radiosensor
sensingprocessing
communicating
CS P
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
Jan Madsen 7SoC-MOBINET courseware
Sensor node design
rtos
cpu radiosensor
battery
sensing processing communicating
rtos
cpuasic
sensor
sensor
radio
Jan Madsen 8SoC-MOBINET courseware
Sensor network model
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
Jan Madsen 10SoC-MOBINET courseware
System model
rtos
a
Jan Madsen 11SoC-MOBINET courseware
System model
rtos
Jan Madsen 12SoC-MOBINET courseware
System model
rtos
Jan Madsen 13SoC-MOBINET courseware
System model
Task messages: ready finished
RTOS commands: run preemept Resume
rtos
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
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
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
Jan Madsen 17SoC-MOBINET courseware
Task model
Jan Madsen 18SoC-MOBINET courseware
Sensor node model
Jan Madsen 19SoC-MOBINET courseware
Energy modeling
Jan Madsen 20SoC-MOBINET courseware
Communication example
s
r
Send node
Receive node
synch.
allocator
scheduler
synch.
allocator
scheduler
WirelessNetwork
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:
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
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:
Jan Madsen 24SoC-MOBINET courseware
Sensor network example
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
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
Jan Madsen 27SoC-MOBINET courseware
Example 3: Network routing
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
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
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