RATFAT: ReAl-Time FAT for Cooperative Multitasking Environments in - - PowerPoint PPT Presentation

ratfat real time fat for cooperative multitasking
SMART_READER_LITE
LIVE PREVIEW

RATFAT: ReAl-Time FAT for Cooperative Multitasking Environments in - - PowerPoint PPT Presentation

Platzhalter fr Bild, Bild auf Titelfolie hinter das Logo einsetzen RATFAT: ReAl-Time FAT for Cooperative Multitasking Environments in WSNs Sebastian Schildt, Wolf-Bastian Pttner, Felix Bsching, Lars Wolf PWSN, Boston - May 23, 2013 RAT +


slide-1
SLIDE 1

Platzhalter für Bild, Bild auf Titelfolie hinter das Logo einsetzen Sebastian Schildt, Wolf-Bastian Pöttner, Felix Büsching, Lars Wolf PWSN, Boston - May 23, 2013

RATFAT: ReAl-Time FAT for Cooperative Multitasking Environments in WSNs

slide-2
SLIDE 2

Wolf-Bastian Pöttner | RATFAT | Page 2 / 19

RAT + FAT?

+ ?

http://crunchall.com/wp-content/ uploads/2013/03/podgana.jpg http://5plus2.info/images/article/ article_small_33.jpg

slide-3
SLIDE 3

Wolf-Bastian Pöttner | RATFAT | Page 3 / 19

Motivation

  • Many WSN apps need persistent data storage
  • Some WSN apps want large-scale data storage
  • Often data is stored on nodes and processed on PC
  • Some WSN apps require real-time guarantees

We need a file system for WSN nodes that is “PC-compatible” and real-time capable!

SD Cards

slide-4
SLIDE 4

Wolf-Bastian Pöttner | RATFAT | Page 4 / 19

State of the Art in WSN file systems

COFFEE in Contiki

  • Unpredictable timing behavior (non real-time)
  • Bad performance on large (> a few MB) volumes
  • Not readable on standard PC Operating Systems
  • But: high memory efficiency

FatFs + tinyFAT

  • Unpredictable timing behavior (non real-time)
slide-5
SLIDE 5

Wolf-Bastian Pöttner | RATFAT | Page 5 / 19

State of the Art in WSN Operating Systems

TinyOS 2

  • Cooperative multitasking; no preemptions
  • Round-robin scheduler

Contiki

  • Cooperative multitasking; no preemptions
  • Round-robin scheduler
  • RTimers allow (certain) real-time tasks
  • Interrupting ongoing SPI operations may lead to undefined states
  • Concurrent access to (different) SPI devices is problematic
slide-6
SLIDE 6

Wolf-Bastian Pöttner | RATFAT | Page 6 / 19

Organization of a FAT Volume

#1 #2

Master Boot Record File Allocation Tables Root Directory Cluster Clusters SD Card

slide-7
SLIDE 7

Wolf-Bastian Pöttner | RATFAT | Page 7 / 19

RATFAT Features

Highlights

  • Fully compliant to FAT specification
  • Support for FAT16 and FAT32 volumes and 8.3 naming scheme
  • Runs on any* underlying flash memory (SD, SPI flash, etc.)
  • Single-Buffer design (512 Byte)
  • Compatible to Contiki File System API
  • Extended API for additional functionality

Limitations

  • No support for „long filenames“
  • Keeping FATs in sync is “expensive”
slide-8
SLIDE 8

Wolf-Bastian Pöttner | RATFAT | Page 8 / 19

RATFAT Architecture SPI Flash Driver SD Card driver Block IO Layer MBR Mgmt FAT16/32 Implementation Contiki CFS API FAT Extended API Application RT Management

slide-9
SLIDE 9

Wolf-Bastian Pöttner | RATFAT | Page 9 / 19

RATFAT RT Overview

API

  • Non-blocking API
  • Enqueue file system requests in constant time

File System Process (FSP)

  • Background process handling all file system requests
  • Separate Stack, allows to hand control back to scheduler
  • Splits up FS requests into multiple atomic operations
  • On INGA, atomic operations take up to 12 ms
  • Maximum execution time per invocation
  • Respects system timers, yields before
slide-10
SLIDE 10

Wolf-Bastian Pöttner | RATFAT | Page 10 / 19

RATFAT RT Concept

RT Process

Sampling interval T Write request Write request

RATFAT non-RT RATFAT RT

reschedule FSP reschedule FSP Deadline Miss

Write request

Deadline Miss

slide-11
SLIDE 11

Wolf-Bastian Pöttner | RATFAT | Page 11 / 19

Behavior of the file system process (FSP)

                        

slide-12
SLIDE 12

Wolf-Bastian Pöttner | RATFAT | Page 12 / 19

Evaluation Setup

INGA Sensor Node

  • Atmel ATmega 1284P: 128kb ROM, 16kb RAM

2GB Transcend Micro SD Card

Micro SD Card Slot

slide-13
SLIDE 13

Wolf-Bastian Pöttner | RATFAT | Page 13 / 19

Baseline: Writing n times 8 byte with COFFEE

2000 4000 6000 8000 10000 12000 14000 1000 2000 3000 4000 5000 6000 20000 40000 60000 80000 100000 120000 140000 time per write [ms] time cumulative [ms] n'th write Average write time Median write time Maximum write time : 21.5 ms : 19.1 ms : 5573.3 ms Writing time for 8 byte Cumulative writing time

slide-14
SLIDE 14

Wolf-Bastian Pöttner | RATFAT | Page 14 / 19

Writing n times 8 byte with RATFAT (non-RT)

10 20 30 40 50 60 70 80 90 1000 2000 3000 4000 5000 6000 500 1000 1500 2000 2500 3000 3500 4000 4500 time per write [ms] time cumulative [ms] n'th write Average write time Median write time Maximum write time : 0.72 ms : 0.38 ms : 71.3ms Writing time for 8 byte Cumulative writing time

slide-15
SLIDE 15

Wolf-Bastian Pöttner | RATFAT | Page 15 / 19

RATFAT RT Measurement Setup

RT Process

Sampling interval T Write request Write request

RATFAT non-RT RATFAT RT

reschedule FSP reschedule FSP Deadline Miss

Write request

Deadline Miss

slide-16
SLIDE 16

Wolf-Bastian Pöttner | RATFAT | Page 16 / 19

Maximum Sampling rate with RATFAT RT and non-RT

1 2 3 4 5 10 20 30 40 50 60 70 80 missed deadlines sampling rate [Hz] RATFAT-no-rt RATFAT-rt

slide-17
SLIDE 17

Wolf-Bastian Pöttner | RATFAT | Page 17 / 19

Comparison of COFFEE, RATFAT non-RT and RATFAT RT

2000 4000 6000 8000 10000 1000 2000 3000 4000 5000 6000 time cummulative [ms] n'th write COFFEE RATFAT-no-rt RATFAT-rt total RATFAT-rt queueing

slide-18
SLIDE 18

Wolf-Bastian Pöttner | RATFAT | Page 18 / 19

Memory Footprint Comparision

2000 4000 6000 8000 10000 12000 14000 16000 18000 20000 COFFEE RATFAT non-RT RATFAT RT Bytes ROM (.text) RAM (.data & .bss)

INGA: 128kb ROM, 16kb RAM

slide-19
SLIDE 19

Wolf-Bastian Pöttner | RATFAT | Page 19 / 19

Conclusion

Motivation

  • FAT on SD cards allows exchanging data between node and PC
  • Some applications require real-time operations on WSN nodes

RATFAT

  • FAT implementation for Contiki-based sensor nodes
  • (Optional) real-time support for cooperative multitasking env.

Results

  • RATFAT shows more predictable timing behavior than COFFEE
  • Supports real-time tasks up to 64 Hz invocation frequency

Sebastian Schildt schildt@ibr.cs.tu-bs.de Wolf-Bastian Pöttner poettner@ibr.cs.tu-bs.de

Code: http://goo.gl/Ky1Ns

slide-20
SLIDE 20

Wolf-Bastian Pöttner | RATFAT | Page 20 / 19

Maximum Sampling rate with RATFAT RT and non-RT

20 40 60 80 100 120 140 160 180 20 40 60 80 100 120 140 missed deadlines sampling rate [Hz] RATFAT-no-rt RATFAT-rt

slide-21
SLIDE 21

Wolf-Bastian Pöttner | RATFAT | Page 21 / 19

RATFAT Memory Footprint

ROM (.text) RAM (.data & .bss) COFFEE 10,748 Bytes 233 Bytes RATFAT non-RT 14,772 Bytes 907 Bytes RATFAT RT 19,786 Bytes 1,556 Bytes INGA (Atmega 1284p) 128,000 Bytes 16,000 Bytes

  • Measured on INGA (8 bit MCU)