Hostname: page-component-76fb5796d-wq484 Total loading time: 0 Render date: 2024-04-27T04:11:54.659Z Has data issue: false hasContentIssue false

Efficient manipulation of binary data using pattern matching

Published online by Cambridge University Press:  12 September 2005

PER GUSTAFSSON
Affiliation:
Department of Information Technology, Uppsala University, Sweden (e-mail: pergu@it.uu.se, kostis@it.uu.se)
KONSTANTINOS SAGONAS
Affiliation:
Department of Information Technology, Uppsala University, Sweden (e-mail: pergu@it.uu.se, kostis@it.uu.se)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

Pattern matching is an important operation in functional programs. So far, pattern matching has been investigated in the context of structured terms. This article presents an approach to extend pattern matching to terms without (much of a) structure such as binaries which is the kind of data format that network applications typically manipulate. After introducing the binary datatype and a notation for matching binary data against patterns, we present an algorithm that constructs a decision tree automaton from a set of binary patterns. We then show how the pattern matching using this tree automaton can be made adaptive, how redundant tests can be avoided, and how we can further reduce the size of the resulting automaton by taking interferences between patterns into account. Since the size of the tree automaton is exponential in the worst case, we also present an alternative new approach to compiling binary pattern matching which is conservative in space and analyze its complexity properties. The effectiveness of our techniques is evaluated using standard packet filter benchmarks and on implementations of network protocols taken from actual telecom applications.

Type
Article
Copyright
© 2005 Cambridge University Press

Footnotes

Research supported in part by grant #621-2003-3442 from the Swedish Research Council (Vetenskapsrådet) and by the Vinnova ASTEC (Advanced Software Technology) competence center with matching funds by Ericsson AB and T-Mobile, U.K.
Submit a response

Discussions

No Discussions have been published for this article.