ELF: An Efficient Log-Structured Flash File System For Micro Sensor Nodes
Hui Dai, Michael Neufeld, Richard Han
PresenterYamuna Krishnamurthy
Sensor Node Memory Usage
Existing File Systems
File System Type
Characteristics Example
Log Structured Represented as a log of metadataData gathered in cache before writing to disk
Sprite LFS, BSD-LFS
Flash Large flash memorySmall battery backed SRAM for write bufferingLarge bandwidth bus between RAM and SRAMAllows garbage collection
eNVy,MFFS,JFFS
Distributed Data Storage
Distributed event storage using geographic hash table
DCS, Dimension
Micro Sensor Storage
Work with sensor flash storage on each sensor nodeProvide efficient, reliable complete file operations
Matchbox, ELF
Flash Memory Characteristics
Most common storage medium for micro sensors
Flash is divided into sectors (sector = n* 264byte page)
On-chip cache (264 bytes) Concurrent read/writes
prohibited Flash pages have limited life Reliability mechanisms like
logging can either use Flash or EEPROM as is done for ELF’s implementation on Mica2 mote
Sensor Data Types and Their Characteristics
Sensor Data Form major part of the data stored Data written sequentially without modifying earlier
records Cleared periodically
Configuration Data Changes infrequently after deployment Require high reliability for proper sensor functioning
Binary Program Images Dynamic reprogramming of sensor nodes with either
a complete new binary image or patches Store the binary image in flash memory before
rebooting the system Requires high reliability
ELF Design Goals
Allow access to flash memory with simple file operations like write-modify,write-append,reading,creation and deletion
Extend the operational lifetime of the flash with wear leveling
Achieve a small memory footprint Optimize common sensor file operations Avoid excessive energy consumption Provide optional best-effort data
reliability
ELF File System Architecture
Resource Abstraction Run-time memory In-memory representation of
open files Configuration data like
cleaning policy General File Operations
Logical abstraction of file/dir operation
ELF Maintenance Tasks System maintenance tasks
like snapshot of dir structure and file meta data in EEPROM
Data Structures in RAM, EEPROM and FLASH
Flash Data Structures
Physical Nodes Meta-Data
Unique 16-bit node identifier
16-bit version number indicating age
32-bit field storing length of the node and included data
Types ELF_DIR – Represents a
dir entry in the file system
ELF_FILE – Includes meta-data to operate on file
ELF_COMMON – Represents changes to the file
Per-Page Meta Data
struct page_info{ uint16_t crc; uint16_t nextPage:11; uint16_t flags:5; uint16_t writeEncounter; uint16_t magicNumber;}
In-Memory Data Structures
File Abstraction Node
Abstraction File Descriptor
In-EEPROM Data Structures
Cache dir structure for fast file access
Store system snapshot to enable file consistency
Allows fast startup or system reboot
Allows crash recovery
File Operations in ELF
Open/Create Append Modify
Read/Seek Rename Delete
ELF Flash Memory Operations
Read Flash->Data Flash->Cache->Data
Write Data->Cache->Flash Page contents erased before writing
Modify Page ->Cache->Modify->Flash
Resource Management
Bitmap approach to maintain free/dirty used blocks
Garbage Collection Cleaner called
when number of free pages drop below threshold
Crash Recovery
Optional Checkpoint Roll Forward Maintains snapshots of current
operation {inodeNum,action,curr_version,highest_version}
Performance Results
Sequential Read Performance Elf reads data
directly from flash whereas matchbox reads from flash to cache and then reads the data
Performance Results
M corresponds to maximum write throughput or memory consumption of matchbox
Experiments performed with varying RAM buffer
E1 and E1’ correspond to 0 byte buffer, E2 and E2’ correspond to 32 byte buffer and so on
E1 has the whole bitmap stored in RAM whereas E1’ has only first 64 bytes stored in RAM
Sequential Write Throughput
Sequential Write Memory Consumption
Performance Results
Random Read Performance
Random Write Performance
Performance Results
Wear Leveling Performance
Conclusion
Provides complete,efficient and reliable file system for micro sensor nodes
Uses atomic write operations for operating with file metadata
Support for simple garbage collection Optional best effort crash recovery
mechanism Achieves wear leveling Allows random access of data
Limitations and Future Work
Cannot handle frequent occurrences of reboot, file open and creation
Loss of reliability due to write buffering
Energy and latency cost of ensuring reliability not explored
Using compression mechanisms to reduce memory usage
THANK YOU