value pairs in a dictionary. This results in fast encod-
ing and decoding times but does not address the space
constraints of embedded devices, as the dictionaries
can become very large.
The LZ77 algorithm encodes data using a dictio-
nary and sliding window (Ziv and Lempel, 1977) .
The algorithm works by sliding an expanding window
across the bytes stream. If the bytes in the window are
in the dictionary the algorithm reports the index of the
bytes. If the bytes in the window are not in the dic-
tionary the algorithm adds the bytes to the dictionary.
However, the LZ77 algorithm does not meet real-time
constraints as the entire data stream is needed in ad-
vance to construct the dictionary.
The LZW algorithm (Nelson, 1989) attempts to
address some of the real-time constraints of the LZ77
algorithm. The LZW algorithm is also a dictionary
coding algorithm and is a modification of LZ78 (Ziv
and Lempel, 1978), which is based on the LZ77 com-
pression algorithm. The LZW algorithm starts by ini-
tializing the dictionaries on the sender and receiver
with 256 entries. As the sender gets values it encodes
the values using the dictionary. If the sender gets a
value that is not in the dictionary it adds the value to
the dictionary and sends the value to the receiver so
that it can also add the value to its dictionary. This
is how the algorithm ensures that both the dictionar-
ies on the sender and the receiver are consistent while
still meeting the real-time constraints. However, this
algorithm fails if a single packet is lost. The loss of a
single packet corrupts the dictionaries. The algorithm
does not impose a size constraint on the dictionaries.
This means that the dictionaries can grow to be very
large. It is difficult to store large dictionaries on sen-
sor devices with limited memory.
The S-LZW (Sadler and Martonosi, 2006) algo-
rithm was introduced to address the memory con-
straints and packet loss constraints of the LZW algo-
rithm. The S-LZW algorithm restricts the dictionary
to 512 entries and divides the data stream into inde-
pendent blocks. A new dictionary is created for each
block. If the dictionary is filled, it is frozen, and no
new entries are added.
6 CONCLUSION
In this paper we present a real-time compression and
decompression algorithm for unreliable networks.
The algorithm compresses a data stream by exploiting
the stream’s temporal locality. Fewer bits are used to
represent elements that frequently recur in a tempo-
ral sequence. The sender and receiver automatically
agree upon the bits that will be used to encode the el-
ements. These bits are then stored in encoding tables
which are used to compress and decompress the data
in real-time.
REFERENCES
Gao, T., Greenspan, D., Welsh, M., Juang, R., and Alm,
A. (2005). Vital signs monitoring and patient tracking
over a wireless network. In Engineering in Medicine
and Biology Society, 2005. IEEE-EMBS 2005. 27th
Annual International Conference of the, pages 102–
105.
Gorlatova, M., Wallwater, A., and Zussman, G. (2011a).
Networking low-power energy harvesting devices:
Measurements and algorithms. In INFOCOM, 2011
Proceedings IEEE, pages 1602–1610. IEEE.
Gorlatova, M., Zapas, M., Xu, E., Bahlke, M., Kymissis,
I. J., and Zussman, G. (2011b). CRAWDAD data set
columbia/enhants (v. 2011-04-07). Downloaded from
http://crawdad.cs.dartmouth.edu/columbia/enhants.
Keally, M., Zhou, G., and Xing, G. (2010). Watchdog: Con-
fident event detection in heterogeneous sensor net-
works. In Real-Time and Embedded Technology and
Applications Symposium (RTAS), 2010 16th IEEE,
pages 279–288.
Kenney, J., Poole, D., Willden, G., Abbott, B., Morris, A.,
McGinnis, R., and Ferrill, D. (2009). Precise position-
ing with wireless sensor nodes: Monitoring natural
hazards in all terrains. In Systems, Man and Cybernet-
ics, 2009. SMC 2009. IEEE International Conference
on, pages 722–727.
Marcelloni, F. and Vecchio, M. (2008). A simple algo-
rithm for data compression in wireless sensor net-
works. Communications Letters, IEEE, 12(6):411–
413.
Nelson, M. R. (1989). Lzw data compression. Dr. Dobb’s
Journal, 14(10):29–36.
Polastre, J., Szewczyk, R., and Culler, D. (2005). Telos: en-
abling ultra-low power wireless research. In Informa-
tion Processing in Sensor Networks, 2005. IPSN 2005.
Fourth International Symposium on, pages 364–369.
IEEE.
Sadler, C. M. and Martonosi, M. (2006). Data compres-
sion algorithms for energy-constrained devices in de-
lay tolerant networks. In Proceedings of the 4th inter-
national conference on Embedded networked sensor
systems, pages 265–278. ACM.
Schmidt, D., Krämer, M., Kuhn, T., and Wehn, N. (2007).
Energy modelling in sensor networks. Advances in
Radio Science, 5(12):347–351.
Ziv, J. and Lempel, A. (1977). A universal algorithm for se-
quential data compression. Information Theory, IEEE
Transactions on, 23(3):337–343.
Ziv, J. and Lempel, A. (1978). Compression of individual
sequences via variable-rate coding. Information The-
ory, IEEE Transactions on, 24(5):530–536.
SENSORNETS 2019 - 8th International Conference on Sensor Networks
76