2024: Domino Containers - The Next Step. News from the Domino Container commu...
Ubiquitous Resources Abstraction using a File System Interface on Sensor Nodes
1. Ubiquitous Resources Abstraction
using a File System Interface
on Sensor Nodes
Till Riedel, Christian Decker
TecO, University of Karlsruhe
Institut for Telematics
Telecooperation Office (TecO)
www.teco.edu
2. Outline
Analysis
Design of a Resource Abstraction
Evaluation
Applications
TecO KuVs FG System Software für Pervasive Computing 2005, October 12, 2005 2
3. Embedded Sensor Devices in
Ubicomp
Motes Particles Telos
Limited computing power, 8-bit microcontroller
Few kilobytes … 512 kilobytes of Flash memory
Customized radio protocols
Battery powered
Extensible by various sensors
TecO KuVs FG System Software für Pervasive Computing 2005, October 12, 2005 3
4. Analysis
Big variety of sensors
Growing APIs
Experiences with developers
Hesitate to develop code for „new“ sensors
Stick to the stuff they know
Use example program
TecO KuVs FG System Software für Pervasive Computing 2005, October 12, 2005 4
5. Ubicomp Development –
State-of-the-Art
Lightweight OS (e.g. TinyOS)
OS shields resources, e.g. sensors
No direct access
Communication through events -> event dispatching
Library based access models
Abstract access functions
Direct access, virtually no overhead
But… shielding/abstraction causes still confusion
TecO KuVs FG System Software für Pervasive Computing 2005, October 12, 2005 5
6. File System for Sensor Nodes
Design principles Application
Developer in the center
Support developer to Name File System Type
File System
follow the simplest way Space Operations System
Easy-to-understand
interfaces -> generic Direct Resources Mediated Resources
Detection
Actuators
unication
Sensors
Memory
Volume
Comm-
Battery
Status
Shock
Audio
...
Support in two ways
Uniform representation of
all resources
Uniform access model Hardware
Microphone
Frontend
Memory
Radio
LEDs
TecO KuVs FG System Software für Pervasive Computing 2005, October 12, 2005 6
7. File System Interface
Operation Explanation
size_t read Reads n data bytes from the resource identified by fd
(int fd, void* buf, size_t n) to buf; returns number of bytes or -1 if error occurred
size_t write writes n data bytes from buf to the resource fd; returns
(int fd, void* buf, size_t n) number of bytes or -1 if an error occurred
int open(char* resource_path) Returns a descriptor for the resource; -1 if it is not
valid.
int close(int fd) Frees the descriptor of a resource; -1 if fd is not valid
int getType(int fd) Returns the type of a resource fd; -1 if fd is not valid.
int mount Creates a resource in the name space. Type and
(char* resource_path, int type, function pointers to their specific read and write
(*pFunc) read, (*pFunc) operations are given. -1 is returned if the
write) resource_path already exists.
int umount(char* resource_path) Removes a resource; -1 is returned if it is not valid.
TecO KuVs FG System Software für Pervasive Computing 2005, October 12, 2005 7
8. Namespace and Ressources
Mount Table
name type read* write*
Name Space Table 0 audio 6 readMic setRate
0 /dev 1 audiovolume . calcVol setRange
1 /light ... ... 3 ... ...
2 /audio n-1 light readLight nop
3 /usr n [free]
4 /file1
5 /subdir
6 /file2
7 /audiolib Storage Table
8 /audiovolume name type read* write*
9 [free] 0 file1
writeFile
readFile
1 file2.frag
...
1
2047 [free]
2048 file2
TecO KuVs FG System Software für Pervasive Computing 2005, October 12, 2005 8
9. File System – Access Model
Name space
Hierarchical
Textual representation of fd= o p en(”/ com /rf”)
resources read write state typ e com rf
Combine freely resource fil desc rip tor
e rf d river
and specific behavior
Streams write(fd ,...)
Access functions “read”, “write”
read write state typ e
Sequential access
enforced by state rf_ read rf_ write 0 21 3
Pass data between streams
-> Stacking of streams
TecO KuVs FG System Software für Pervasive Computing 2005, October 12, 2005 9
11. Optimization
Paralallize write operations
(Flash Buffer, Flash, EEPROM)
13 ms Flash, 4 ms EEPROM, assynchronously programmable
Mimimize writes on Flash/EEPROM
only 50.000-100.000 erase/write cycles per page
Minimize read times for sensor devices
support relatively high sampling rates / bytewise sampling
Minimize RAM consumption
only 4K of RAM available
TecO KuVs FG System Software für Pervasive Computing 2005, October 12, 2005 11
12. Performance
Access overhead
cycles PIC18F6720
Table look up function 15 cycles 3 µs
Dereferencing state 4 cycles 0.8 µs
Passing Parameters 10 cycles 2 µs
Function pointer call 26 cycles 5.2 µs
Accessing Parameters 10 cycles 2 µs
Writing the buffer 15 cycles 3 µs
Returning 13 cycles 2.6 µs
Overhead of file system read 93 cycles 18.6 µs
Overhead of simple Library call 26 cycles 5.2 µs
Relative overhead 67 cycles 13.2 µs
TecO KuVs FG System Software für Pervasive Computing 2005, October 12, 2005 12
13. Performance
Memory Consumption
File library
2 byte on flash per resource (129 per page)
12 byte per file descriptor (3 byte state)
Non-Persistent ressources
▫ 6 byte + name in RAM
+ Library Code in internal flash
▫ about 12 KB (10%)
▫ 6K without persistent storage
TecO KuVs FG System Software für Pervasive Computing 2005, October 12, 2005 13
14. Integration of persistent storage
Simple flash FS
Sequential append-only files
Non-blocking operation
Uncontrolled extrusion
TecO KuVs FG System Software für Pervasive Computing 2005, October 12, 2005 14
15. Application - Integration
Compiled
FTP Proxy Program
Seamless transfer of data
between backend infrastructure PC
and sensor nodes
Composition of name spaces
using URI scheme
ste;1;33
^C
FTP Proxy
Network
Programming is file copy
Sensor logging is downloading
Bridge
Particle
TecO KuVs FG System Software für Pervasive Computing 2005, October 12, 2005 15
16. POSIX interface
Applications can be easily ported
libc standard I/O
fprintf
stdout
compliant C Programming Environment
TecO KuVs FG System Software für Pervasive Computing 2005, October 12, 2005 16
17. Application - Shell
File system as interactive runtime environment
“cat audiovolume“ Application
Command
Shell
ParticleFS
Reources cat
audio
audioVolume
Direct Resources Mediated Resources
Hardware
Microphone
TecO KuVs FG System Software für Pervasive Computing 2005, October 12, 2005 17
18. Application - Shell
File system as interactive runtime environment
Standard output as context
Popping stack elements from pipe stack
TecO KuVs FG System Software für Pervasive Computing 2005, October 12, 2005 18
19. Asynchronous Interaction
Service
/service/
result
Client
Simple IPC mechanism
TecO KuVs FG System Software für Pervasive Computing 2005, October 12, 2005 19
20. Dynamic Loadable Modules
No linking of function calls needded
Specify fixed location for
file descriptor table
open
mount
Functionality instantly available after mount
Hot code replacement
TecO KuVs FG System Software für Pervasive Computing 2005, October 12, 2005 20
21. Thank you.
TecO KuVs FG System Software für Pervasive Computing 2005, October 12, 2005 21