Split-phase programming

Split-phase programming

Handler/task characteristics and separation has
consequences for programming model



How to implement a blocking call to another component?
Example: Order another component to send a packet
Blocking function calls are not an option
! Split-phase programming

First phase: Issue the command to another component




Receiving command handler will only receive the command, post
it to a task for actual execution and returns immediately
Returning from a command invocation does not mean that the
command has been executed!
Second phase: Invoked component notifies invoker by
event that command has been executed
Consequences e.g. for buffer handling

Buffers can only be freed when completion event is received
86
Structuring commands/events into interfaces



Many commands/events can add up
nesC solution: Structure corresponding
commands/events into interface types
Example: Structure timer into three interfaces




StdCtrl
Timer
Clock
Build configurations
by wiring together
corresponding
interfaces
init
StdCtrl
stop fired
start
Timer
TimerComponent
Clock
setRate fire
87
Building components out of simpler ones


Wire together
components to
form more complex
components out of
simpler ones
New interfaces for
the complex
component
StdCtrl
Timer
StdCtrl
Timer
TimerComponent
Clock
Clock
HWClock
CompleteTimer
88
Defining modules and components in nesC
89
Wiring components to form a configuration
StdCtrl;
90
A TinyOS Demonstration (1/2)

Some supported methods (Windows & Linux)



Manually (Windows: cygwin & RPM, Linux: RPM)
Virtual machine image (VMWare, VirtualBox)
Example: starting the Xubuntos 2.1 VMWare image





Plug in Sensor node first!
Start XubunTOS image
Login: user = xubuntos, password = tinyos
y $ z! setxkbmap de
VMPlayerVMRemovable DevicesUSB Devices:
Future Technology Devices USB device (Port 1)
91
A TinyOS Demonstration (2/2)

“Hello World”




Call motelist
Call cd /opt/tinyos-2.1-0/apps/Blink
Call make telosb install
Look at BlinkAppC.nc and BlinkC.nc

“The” resource: www.tinyos.net !!!

Demo:
Plug in USB device
Start Xubuntos
92
Zusammenfassung und Literatur






Beispielanwendungen
Sensor-Hardware und Netzarchitektur
Herausforderungen und Methoden
MAC-Layer-Fallstudie IEEE 802.15.4
Energieeffiziente MAC-Layer
WSN-Programmierung
93
Zusammenfassung

Herausforderungen



Energieeffizienz
Geringe Rechen- und Speicherkapazität
Geringe Kommunikationsbandbreite

Erfordert neue Ansätze auf den einzelnen Protokollschichten: z.B.
energieeffiziente MAC-Layer

Aufweichen von striktem Protokoll-Layering: „Cross-LayerOptimierungen“

Geräte sind in der Regel keiner Person direkt zugeordnet

Neue Sichtweise auf Kommunikation


ID-Zentrisch versus Datenzentrisch
Maschine-zu-Maschine-Kommunikation
94
Literatur




Holger Karl and Andreas Willig, „Protocols and Architectures for
Wireless Sensor Networks”, John Wiley & Sons, 2005.
Jason Hill, Robert Szewczyk, Alec Woo, Seth Hollar, David E.
Culler and Kristofer S. J. Pister, “System Architecture Directions
for Networked Sensors”, Proceedings of the 9th International ACM
Conference on Architectural Support for Programming Languages
and Operating Systems (ASPLOS), 2000.
Philip Buonadonna, Jason Hill and David Culler, “Active Message
Communication for Tiny Networked Sensors”, Proceedings of the
20th Annual Joint Conference of the IEEE Computer and
Communications Societies (INFOCOM), 2001.
David Gay, Philip Levis, Robert von Behren, Matt Welsh, Eric
Brewer and David Culler, “The nesC language: A holistic approach
to networked embedded systems”, Proceedings of the ACM
Conference on Programming Language Design and
Implementation (PLDI), 2003.
95