High performance Deep Packet Inspection on multi-core platform

Cong Wang, Joe Morris, Xiaojun Wang2009

Abstract

Deep packet inspection (DPI) provides the ability to perform quality of service (QoS) and Intrusion Detection on network packets. But since the explosive growth of Internet, performance and scalability issues have been raised due to the gap between network and end-system speeds. This article describes how a desirable DPI system with multi-gigabits throughput and good scalability should be like by exploiting parallelism on network interface card, network stack and user applications. Connection-based parallelism, affinity-based scheduling and lock-free data structure are the main technologies introduced to alleviate the performance and scalability issues. A common DPI application L7-Filter is used as an example to illustrate the application level parallelism.

The DPI Performance Bottleneck

Deep Packet Inspection (DPI) represents a significant computational challenge in modern networking. Unlike standard routing, which only examines packet headers, DPI inspects both headers and payloads to identify threats or manage Quality of Service (QoS). As network speeds approach 10Gbps and beyond, a "speed gap" has emerged: network throughput is increasing much faster than the clock speeds of individual CPU cores.

While multi-core processors offer a potential solution, simply increasing core counts does not guarantee linear performance gains. In many cases, a "scalability wall" is reached due to overhead in the operating system, inefficient packet distribution by Network Interface Cards (NICs), and the high cost of synchronization locks when multiple threads access shared data. Research indicates that without optimization, a web server might only achieve a 4.8x speedup on an 8-core system, far below the theoretical maximum.

A Multi-Layered Strategy for Parallelism

To overcome these bottlenecks, a holistic approach is required that synchronizes parallelism across hardware, the operating system, and the application layer.

1. Hardware Level: Connection-based Parallelism

Traditional NICs often interrupt a single CPU core for every incoming packet, creating a massive bottleneck. The proposed solution is Receive-Side Scaling (RSS). RSS uses a hardware-based hash function—typically based on the packet's 5-tuple (source/destination IP, source/destination port, and protocol)—to distribute packets. Crucially, this ensures that all packets belonging to the same connection are routed to the same CPU core. This preserves cache locality and prevents different cores from contending for the same connection state.

2. OS Level: Affinity-based Scheduling

Standard operating system schedulers prioritize load balancing, often migrating threads between cores. In high-performance DPI, this migration is detrimental as it causes frequent L2 cache misses; data must be reloaded into the new core's local memory. By utilizing CPU Affinity (e.g., via the sched_setaffinity system call in Linux), processing threads are bound to specific cores. This minimizes migration overhead and ensures that the data processed by a thread remains in the local cache of its assigned core.

3. Application Level: Lock-free Data Structures

In multi-threaded DPI applications like L7-Filter, traditional mutexes (locks) protect shared data but often lead to deadlocks and idle CPU cycles. The authors advocate for Lock-free Data Structures that leverage atomic Compare-and-Set (CAS) hardware instructions. CAS allows threads to update shared data simultaneously without the blocking overhead of traditional locks, significantly improving scalability in high-core-count environments.

Empirical Results and Analysis

The effectiveness of these strategies was evaluated using industry-standard benchmarks like SPECweb2005 and Web Bench, with L7-Filter serving as the primary DPI case study.

RSS Throughput Scaling

Benchmarks using Web Bench demonstrate that RSS is essential for high-connection environments. As shown in the performance data, systems with RSS enabled maintain a steady increase in "Requests Per Second" as connection counts rise. In contrast, systems with RSS disabled hit a performance ceiling much earlier, unable to handle the interrupt load on a single core.

Figure 1: Throughput comparison between RSS enabled and disabled systems.

Cache Efficiency and Affinity

The impact of CPU affinity is most visible in cache performance. By binding matching threads to specific cores within the L7-Filter application, the L2 cache miss rate is significantly reduced.

Figure 2: Impact of affinity-based scheduling on cache miss rates.

As the number of matching threads increases, the cache miss rate remains lower and more stable compared to systems where threads migrate freely. This stability is critical for maintaining predictable multi-gigabit throughput.

Conclusion and Future Work

The research highlights that high-performance DPI is a "weakest link" problem; parallelism must be implemented at every layer of the stack to be effective. While individual optimizations in NIC drivers or application logic are beneficial, a unified platform integrating hardware, OS, and application-level parallelism is necessary for 10Gbps+ environments. Future work involves building such integrated systems and exploring further accelerations through advanced algorithms and hardware offloading like FPGAs.

Summary updated

BibTeX
@misc{wang2009high,
  author = {Cong Wang and Joe Morris and Xiaojun Wang},
  title = {{High performance Deep Packet Inspection on multi-core platform}},
  year = {2009},
  doi = {10.1109/icbnmt.2009.5347845},
}
Figure