Fast packet classification for Snort by native compilation of rules

  • Authors:
  • Alok Tongaonkar;Sreenaath Vasudevan;R. Sekar

  • Affiliations:
  • Stony Brook University;Stony Brook University;Stony Brook University

  • Venue:
  • LISA'08 Proceedings of the 22nd conference on Large installation system administration conference
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

Signature matching, which includes packet classification and content matching, is the most expensive operation of a signature-based network intrusion detection system (NIDS). In this paper, we present a technique to improve the performance of packet classification of Snort, a popular open-source NIDS, based on generating native code from Snort signatures. An obvious way to generate native code for packet classification is to use a low-level language like C to access the contents of a packet by treating it as a sequence of bytes. Generating such low-level code manually can be cumbersome and error prone. Use of a high-level specification language can simplify the task of writing packet classification code. Such a language needs features that minimize the likelihood of common errors as errors in the packet processing code can crash the intrusion detection system, which may leave it open to attacks. To overcome these problems, we use a rule-based specification language with a type system for specifying the structure and contents of packets. The compiler for the specification language generates C code for packet classification. This code can be compiled into native code using a C-compiler and loaded into Snort as shared library. Our experiments using real and synthetic traces show that the use of native code results in a speedup of the packet classification of Snort up to a factor of five.