Data Compression Algorithms for Energy-Constrained Devices inDelay Tolerant Networks
Christopher SadlerMargaret Martonosi
Princeton University
2
1
10
100
1000
10000
100000
1000000
10000000
CC2420 CC1000 XTend
Radio
MSP
430
Clo
ck C
ycle
s fo
rSa
me
Ener
gy a
sO
ne B
yte
Tran
smitt
ed
Why do we care about Compression in Sensor Networks?
Short Range
125 m
Med. Range
300 m
Long Range
15 km
Success = Energy Savings
Energy = Compute Energy + Transmit Energy
~2 Million!
~32,000
~4,000
3
0
20
40
60
80
100
120
140
100% 75% 50% 25%
Percentage of Packets Received Correctly
Thou
sand
s of
MSP
430
Clo
ck
Cyc
les
for S
ame
Ener
gy a
s O
ne
Byt
e Tr
ansm
itted
Why do we care about Compression in Sensor Networks?
Unreliability:Retransmission Extra energy costEasier to amortize original energy cost of compression
Medium Range Radio (CC1000)
~128,000!
~32,000
4
Why do we care about Compression in Sensor Networks?Source
Local Energy Tradeoff:Transmit all data
vs.Compress dataStore dataTransmit compressed data
Sink
Downstream Energy Tradeoff:Relay all data
vs.Relay compressed data
Downstream Energy Tradeoff:Relay all data
vs.Relay compressed data
Savings Accumulate with Hop Count
5
This work Lossless compression algorithms tailored to static
and mobile sensors
Generally applicable for WSNs Aggregation Spatial-temporal correlation
Implementation and evaluation on the real data set Great Duck Island Monitoring, ZebraNet, …
6
Outline
Design Criteria and LZW Compression What we want in Sensor Compression? How do we adapt LZW to Sensors?
Using Compression to Conserve Energy Conclusions
7
Sensor Network Compression: Energy Savings for Everyone Need a general purpose, lossless compression
algorithm that can work across the design space
ZebraNet (Princeton): Outdoors, Mobile
Great Duck Island (UCB): Outdoors, Stationary
SensorScope (EPFL): Indoors, Stationary
8
Sensor Network Compression: What do we want? Low Transmission Overhead Computationally Simple
Compute energy of compression should not outweigh transmission energy savings
Bounded Memory Footprint To fit in small sensor node memories
Adaptive to general data sets Exploit repetition in general input data streams Work on small blocks of data
9
LZW Compression
LZW is a dictionary-based algorithm which encodes new strings based on previously encountered strings.
AAAABAAABCC (8bits * 11 = 88bits required) Standard Dic
A = 65 B = 66C = 67. . . Z = 90. . . ? = 255
Encoded String Output Stream New Dic entryA 65 AA = 256 AA 65 256 AAA = 257 A 65 256 65 AB = 258 B 65 256 65 66 BA = 259 AAA 65 256 65 66 257 AAAB = 260 B 65 256 65 66 257 66 BC = 261 C 65 256 65 66 257 66 67 CC = 262 C 65 256 65 66 257 66 67 67 66 bits required
10
Outline
Design Criteria and LZW Compression What we want in Sensor Compression? How do we adapt LZW to Sensors?
Using Compression to Conserve Energy Conclusions
11
S-LZW: LZW for Sensor Nodes Dictionary decisions
How large should we make the dictionary? What do we do if the dictionary fills?
Data decisions How much data should we compress at once? Can we shape the dictionary to improve compression? Can we shape the data to make it easier to compress?
12
S-LZW: LZW for Sensor Nodes Dictionary decisions
How large should we make the dictionary? What do we do if the dictionary fills?
Data decisions How much data should we compress at once?
Longer data streams => better compression learning But too long => high retransmit cost when packets dropped
Can we shape the dictionary to improve compression? Can we shape the data to make it easier to compress?
Examined by experiments
13
SENSOR DATA – N BYTES GENERATED OVER TIME
…528 B Block (2 Flash Pages)
COMP. ALGORITHM
COMP. ALGORITHM
COMP. ALGORITHM
Compressed Data
Compressed Data
Compressed Data
Independent groups of 10 or fewer dependent packets
… … …
………
528 B Block (2 Flash Pages)
528 B Block (2 Flash Pages)
S-LZW Idea 1: Data Size
14
S-LZW Idea 2: Mini-Caching
Dictionary Tree Mini-
Cache (N entries)
0 1
Escape Bit
9 Bit Entries10 Bit Entries (Log2 N)+1 Bit Entries
Exploit fine-grained locality even in short sensor data sequences Proposal: Mini-cache to tightly encode MRU entries
Hit => Saves multiple bits. Miss => Costs just 1 extra escape bit
15
S-LZW Idea 3: Data Transforms BWT – Reversible method of transforming
data used in bzip2 and applicable for all data Proposal: Structured Transform - Create a
matrix of readings and transpose it to create runs Simple, but effective
cb 4e 70 62 …d5 4e 46 62 …d8 4e 31 62 …db 4e 2b 62 …... ... ... ...
cb d5 d8 db …4e 4e 4e 4e …70 46 31 2b …62 62 62 62 …... ... ... ...
16
Outline
Design Criteria and LZW Compression Using Compression to Conserve Energy
Local and Downstream Energy The Influence of Unreliable Communications The Effects of Shaping the Data
Conclusions
17
Measurement Methodology:CPU and Radios Evaluation Platform:
TI microcontroller MSP430: 10 kB RAM, 48 kB ROM Off-Chip Flash: 4 Mbit Atmel 3 Radios: Short (CC2420), Medium (CC1000), and Long
(XTend) range 3 Real World Datasets…
SensorScope (SS) – Indoor, Stationary Great Duck Island (GDI) – Outdoor, Stationary ZebraNet (ZNet) – Outdoor, Mobile
… And one Compression Benchmark Geo from the Calgary Corpus (Calgeo)
18
Local Energy Savings
00.2
0.40.60.8
1
1.21.4
SS
GD
I
ZNet
Calgeo
Dataset
Nor
mal
ized
Ene
rgy
00.20.40.60.8
11.21.4
SS
GD
I
ZNet
Calgeo
Dataset
Nor
mal
ized
Ene
rgy
0
0.00
2
0.00
4
0.00
6
0.00
8
0.01
0.01
2
None
SS
GDI
ZNet
Calgeo
CPU
Flas
hR
adio
CC2420(Short Range)
XTend(Long Range)
Data Compressed with S-LZW with Mini-Cache
Model assumes 100% reliability
2.6X Gain
1.2X Gain1.7X
Gain
1% Loss
15+% Loss
Low
er is
bet
ter
19
Downstream EnergySavings
0
1
2
3
4
5
1 2 3 4 5 6 7 8 9 10
Hop Count
Ener
gy S
aved
(J)
0
1
2
3
4
5
1 2 3 4 5 6 7 8 9 10
Ener
gy S
aved
(J)
0
1
2
3
4
5
1 2 3 4 5 6 7 8 9 10
Hop Count
-0.005
0
0.005
0.01
0.015
0.02
1 2 3 4 5 6 7 8 9 10
Hop Count
Ener
gy S
aved
(J)
0
1
2
3
4
5
1 2 3 4 5 6 7 8 9 10
Hop Count
CC2420 (Short Range) XTend (Long Range)
ZNet data, Compressed with S-LZW with Mini-Cache
Model assumes 100% reliability
20
Coping with Unreliability1. Energy savings
increase linearly with hop count
GDI Data, Compressed with S-LZW with Mini-Cache
CC2420 (Short Range)
21
Coping with Unreliability1. Energy savings
increase linearly with hop count
GDI Data, Compressed with S-LZW with Mini-Cache
CC2420 (Short Range)
2. At a 90% success rate, we save energy locally
22
Transforms to Improve Performance BWT – Reversible method of transforming
data through sorting itXTend (Long Range)
We sort with an iterative quicksort algorithm, but this comes at a high computational cost
Normalized against sending the data without compression
3.4X Gain
2.4X Gain
7-8% ImprovementTop – Radio EnergyMiddle – Flash
EnergyBottom – CPU Energy
Model assumes 100% reliability
23
Radio Range?
Number ofHops?
Data Composition?
Number ofHops?
Structured General
Radio Range? S-LZW-MC8-ST~2.3X Savings
RLE-ST~1.9X Savings
S-LZW-MC8-ST~2.4X Savings
Few Many
Short Medium/Long
S-LZW-MC16-BWT~1.8X Savings
S-LZW-MC32~1.4X Savings
S-LZW-MC16-BWT~1.8X Savings
Few Many
Short Medium/Long
Algorithms Summary
MC – Mini-CacheST – Structured Transform
BWT – Unstructured Transform
24
Conclusions Existing techniques (LZW, Cache, BWT …) applied
to new application domains (WSNs) Less novelty and originality Incremental work Upper bound 4 points
Systematic solution with complete considerations Dictionary size, data size, local cache, data transformation
… Substantial merits proved by sound experiments
Different types of radio transceivers (CC2420, CC1000, XTend)
Real-world data set