Title: Verification and Power Analysis of TinyOS with Hybrid Automata
1Verification and Power Analysis of TinyOS with
Hybrid Automata
- Sinem Coleri Mustafa Ergen
- EECS EECS
- csinem_at_eecs.berkeley.edu ergen_at_eecs.berkeley.edu
2Outline
- Introduction
- TinyOS
- TinyOS characteristics
- Hytech
- Hytech Description
- Verification of TinyOS
- Power Analysis of a TinyOS sensor node
- SHIFT
- SHIFT description
- Power Analysis of a Sensor Network
- Conclusion
3Introduction
- Why need sensor networks?
- Monitoring environment
- What is the characteristic of sensor networks?
- Deploy once and leave without future maintenance
- Why need verification?
- Guaranteed correct operation in every
circumstance. - Why need power analysis?
- Predict the lifetime.
- What type of modelling?
- Discrete events and continuous activities Hybrid
Automata - What are the tools?
- HyTech for verification, SHIFT for simulation
- What are the metrics?
- Power consumption of a single node
- Lifetime of the network
4TinyOS
- Component-based
- Modularity by assembling just the software
components to synthesize app. from hardware
components - Components as reentrant cooperating state
machines - Event-based
- Components communicating through events and
commands - Power efficient
- Spending unused CPU cycles in sleep
- Turning radio off when not is use
5Complete TinyOS application
- Scheduler
- Graph of components
- Each component has
- Interface(.comp)
- Internal Implementation(.c)
6Complete TinyOS application Component
- Interface comprises of synchronous commands and
asynchronous events - Upper Interface
- Commands it implements
- Events it signals
- Lower Interface
- Commands it uses
- Events it handles
- Internal Storage
- Fixed-size frame containing the state of
component - Internal Implementation
- Light-weight threads tasks
- Command and event handlers
7Description of Application
- Describes the wiring of the interfaces
- Efficient modularity
- Optimization by static info
8Application Graph of Components
9Scheduling
- Events have higher priority
- Events preempt tasks
- Almost instantaneous event execution
- Not wait for long latency actions
- Small amount of work related to component state
10Scheduling
- Tasks have lower priority
- Tasks do not preempt events or other tasks
- Scheduled by FIFO scheduler
- Handled rapidly without blocking or polling
- Unused CPU cycles in sleep state
11Ex. Communication
post a task
Event handling
Put processor sleep
Task handling
12Hytech
- Hytech inputs
- System description
- Composition of linear hybrid automata
- Temporal Logic Requirement
- Hytech outputs
- Safety check
- Debugging traces
13From TinyOS to Hytech
- TinyOS component
- -gt Hytech automaton
- TinyOS event, commands
- -gt Hytech discrete events
- TinyOS clock cycle
- -gt Hytech discrete time step
- TinyOS energy
- -gt Hytech variable
14Overall View of TinyOS Automata
15Packet Generation and Application Automata
Application
Packet_generation
idle
rtgtcbit_time/ rt0, ptpt1, sync rfm_clock
rt0,pt0
at0
atgtcbetween/ at0, sync transmit_pack
rtltcbit_time ptltcidle drt1
ptgtcgeneration/ rt0, bit0, pt0, sync
rfm_clock
atltcbetween dat1
ptgtcidle/ rt0, bit1, pt0, sync rfm_clock
rtltcbit_time ptltcgeneration drt1
sync receive_pack/ sync trans_packet
rtgtcbit_time/ rt0, ptpt1, sync rfm_clock
generate
16RFM Automata
17Task Handler Automata
Task Handler
exec
dht0 dct0 denergycactive
sync rfm_rx_comp sync rfm_tx_comp /
htlt0/
idle
op
dht0 dct0 denergycinactive
htgt0 dht-1 dct0 denergycactive
sync rfm_clock/
sync rfm_clock/
sync decode/ htcdecode, ct0
sync encode/ htcencode, ct0
sync rfm_rx_comp sync rfm_tx_comp /
sync decode/ hthtcdecode, ct0
ctltctask_post dht0 dct1
denergycactive
dht0 dct0 denergycactive
sync encode/ hthtcencode, ct0
op_wait
ctgtctask_post/ sync post_task_done
op_exec
18Verification of TinyOS with Hytech Motivation
Application
Application assumes that packet is sent
successfully
transmitting
packet level
idle
idle
receiving
byte level
receiving
19Verification of TinyOS with Hytech
- Analysis commands for verification
- init_reg ..
- final_reg locrpackettransmit
locrbytereceive - reached reach forward from init_reg endreach
- if empty(reached final_reg)
- then prints working fine
- else print trace to final_reg using reached
- endif
20Power Analysis of TinyOS with Hytech
- Power analysis through variable energy by using
trace generation feature of Hytech - by setting
- final_reg tgt300000
- by checking variable energy at the end
21Power Analysis of TinyOS with Hytech
- As the number of children increases,
- time to wait before transmitting increases due to
backoff - number of packets to be forwarded increases
BS
22Power Consumption vs. of Children
23SHIFT
- Describes dynamic networks of hybrid automata
- Components created, interconnected, destroyed as
the system evolves - Components interact through their inputs, outputs
and exported events
24Clustering of the Network
- Uniform Distribution
- 100 node
- 100m x 100m
- 4 Macro Clusters
- Children determined according to position
distribution
25Modeling of a sensor network
- 4 Types of Node Automata.
- Create an instance for each node.
- Destroy the instance when the node dies.
- Distribute the load to its group.
- Notify upper group when there is a death.
26Model of a node
X Energy F from the HyTech result.
27Result
- Need powerful nodes in group 1.
- Group 1 suffers from high load and backoff time.
- Group 4 dies at the same time.
28Conclusion
- Sensor nodes are aimed to be left without
maintenance. - Power is a detrimental concern in sensor world.
- Verification is needed for reliability.
- Power analysis is needed for the lifetime of the
node. - Network power analysis is needed for the lifetime
of the network. - Verification and Power analysis with HyTech .
- Network power analysis with SHIFT.