Multiple Pattern Matching for Network Security Applications: Acceleration through Vectorization

Charalampos Stylianopoulos, Magnus Almgren, Olaf Landsiedel, Marina Papatriantafilou

Introduction

Deep Packet Inspection (DPI) is a critical component of modern Network Intrusion Detection Systems (NIDS), requiring the comparison of incoming traffic against thousands of known malicious signatures. However, this process often accounts for over 70% of total processing time in security appliances. Traditional algorithms like Aho-Corasick suffer from the "memory wall" problem, where large state machines exceed CPU cache capacities, leading to frequent, high-latency RAM accesses. This paper presents V-PATCH, a high-performance pattern-matching algorithm that leverages cache-aware data structures and modern SIMD (Single Instruction, Multiple Data) instructions to overcome these bottlenecks.

Methodology

The researchers developed a two-stage approach to optimize pattern matching: S-PATCH (Scalar) and V-PATCH (Vectorized).

S-PATCH: Cache-Aware Filtering

S-PATCH refines the Direct Filter Classification (DFC) algorithm by utilizing three small bit-array filters designed to fit within the L1 cache (8KB).

  • Filter 1 targets short patterns (1-3 bytes).
  • Filters 2 and 3 use multiplicative hashing to identify potential starts of longer patterns. By keeping these filters in local cache, the algorithm significantly reduces memory latency during the initial screening of traffic.
Overview of the multi-stage filtering process in S-PATCH.

V-PATCH: SIMD Acceleration

V-PATCH introduces vectorization to the filtering process using Intel’s SIMD gather instructions. This allows the system to fetch multiple non-contiguous filter bits simultaneously. Key innovations include:

  • Input Transformation: Using shuffle instructions to convert character streams into vectors of sliding windows.
  • Filter Merging: Interleaving Filter 1 and Filter 2 data in memory to allow a single gather operation to retrieve information for both filters at once.
  • Speculative Execution: Processing entire vectors and masking irrelevant results, avoiding costly conditional branches that stall CPU pipelines.

Experimental Evaluation

The performance of V-PATCH was evaluated using two pattern sets: S1 (~2,500 Snort patterns) and S2 (~20,000 Emerging Threats patterns). Testing was conducted on real-world traces (ISCX, DARPA 2000) and synthetic random data across Intel Haswell and Xeon Phi architectures.

Results and Discussion

V-PATCH demonstrated significant throughput improvements over existing methods. On the Intel Haswell architecture, it achieved a 1.8x speedup over the original DFC, while the Intel Xeon Phi architecture saw a 3.6x improvement due to its wider 512-bit registers.

Throughput (Gbps) comparison across various datasets and configurations.

Compared to the industry-standard Aho-Corasick algorithm, V-PATCH was more than 2.3x faster. Notably, V-PATCH maintained stable performance as the ruleset size increased to 20,000 patterns, whereas Aho-Corasick performance typically degrades due to state machine expansion and cache misses.

Conclusion

V-PATCH successfully addresses the computational bottlenecks of DPI by combining cache-locality with SIMD parallelism. While the final verification stage remains a scalar bottleneck in high-match scenarios, the vectorized filtering stage provides a substantial performance leap for typical network traffic. Future work may focus on vectorizing the verification phase and optimizing filters for specific protocols.

Summary updated

BibTeX
@inproceedings{stylianopoulos2017multiple,
  author = {Charalampos Stylianopoulos and Magnus Almgren and Olaf Landsiedel and Marina Papatriantafilou},
  title = {{Multiple Pattern Matching for Network Security Applications: Acceleration through Vectorization}},
  booktitle = {ICPP},
  year = {2017},
  doi = {10.1109/icpp.2017.56},
}
Figure