# Introducing PF_RING FT: nDPI-based Flow Classification and Filtering for PF_RING and DPDK | ntop

> Motivation Most network monitoring and security applications are based on flow processing, which is in practice the activity of grouping packets based on comm

[Blog](https://www.ntop.org/blog/)[ntop](https://www.ntop.org/category/ntop/)[PF\_RING](https://www.ntop.org/category/pf_ring/)

# Introducing PF\_RING FT: nDPI-based Flow Classification and Filtering for PF\_RING and DPDK

May 16, 20184 min read

## Motivation

Most network monitoring and security applications are based on flow processing, which is in practice the activity of grouping packets based on common attributes (e.g. source and destination IP, source and destination port, protocol, etc.) and do some analysis based on the collected information. What happens behind the scenes can be divided in a few major tasks:

-   capturing raw packets
-   decoding packet headers to extract flow attributes
-   classify the packets based on flow attributes
-   (optional) extracting also L7 protocol information.

### Introducing PF\_RING FT

With PF\_RING, and later on with [PF\_RING ZC](https://www.ntop.org/products/packet-capture/pf_ring-zc/) (Zero Copy), we created a packet processing framework able to provide 1/10/100 Gbit line-rate packet capture to the applications, based both on commodity NICs or specialized FPGA adapters. This dramatically reduced the overhead for the first major task a network monitor application has to cope with, which is the packet capture. PF\_RING also includes support for packet decoding, with the ability to leverage on metadata provided by the hardware to accelerate attributes extraction, first but not least the packet hash.

PF\_RING FT is taking one step further: it assists the application in the flow classification activity. PF\_RING FT implements a highly optimized flow table that can be used to keep track of flows and extract flow information up to L7. It provides many hooks to be able to customize and extend flow processing in order to build any type of application on top of it, including probes, IDSs, IPSs, L7 firewalls.

Although PF\_RING FT is distributed with PF\_RING, it is possible to use the library with any third-party packet capture framework such as Intel [DPDK](https://dpdk.org/), as its data-ingestion API is capture-agnostic.

The designing and implementation of a flow processing application on top of PF\_RING FT is quite straightforward. The code snippet below shows how to capture traffic and export flow information with PF\_RING FT in a few lines of code.

ft = pfring\_ft\_create\_table(0);

pfring\_ft\_set\_flow\_export\_callback(ft, processFlow, NULL);

while (1) {
  if (pfring\_recv(pd, &amp;packet, 0, &amp;header, 0) &gt; 0)
    action = pfring\_ft\_process(ft, packet, &amp;header);
}

void processFlow(pfring\_ft\_flow \*flow, void \*user){
  pfring\_ft\_flow\_key \*k = pfring\_ft\_flow\_get\_key(flow);
  pfring\_ft\_flow\_value \*v = pfring\_ft\_flow\_get\_value(flow);
  /\* flow export here with metadata in k and v \*/
}

The pfring\_ft\_set\_flow\_export\_callback() API in the code snippet above is just an example of hook provided by PF\_RING FT. Through this mechanism it is possible to get notified when a new flow is created, or a flow expired, or a packet has been successfully classified, or the L7 protocol has been identified.

PF\_RING FT provides common flow information, that can be extended with custom metadata defined by the application. Thanks to a native integration with the [nDPI](https://www.ntop.org/products/deep-packet-inspection/ndpi/) library, the built-in information include the L7 protocol out of the box. The application itself does not need to deal with the nDPI library directly.

[![](/images/2018/04/pf_ring-ft-ndpi.webp)](https://www.ntop.org/images/2018/04/pf_ring-ft-ndpi.webp)

### Suricata, Bro, Snort Acceleration

The PF\_RING FT library also features a filtering/shunting mechanism that can be used to automatically, or through custom code, mark flows for filtering traffic. This can be used for instance for accelerating CPU-bound applications such as IDS/IPSs including Suricata, Bro and Snort, shunting flows based on the application protocol. In fact, discarding elephant flows is becoming a common practice for reducing the amount of traffic such applications need to inspect (typically multimedia traffic), dramatically reducing packet loss and improving the system performance. PF\_RING FT is today used by PF\_RING to implement L7 flow shunting, this means that PF\_RING-based or Libpcap-based application can take advantage of this technology without changing a single line of application code.

### Performance

As we have seen this library provides high flexibility and customization, however we also really care about the performance. Developing this library we applied all the lessons learnt while implementing PF\_RING ZC and nProbe Cento, creating a highly optimized engine capable of processing 14.88 Mpps (10 Gbit line rate) on a single core of a Xeon E3-1230v5, and 130 Mpps on 12 cores of a Dual Xeon E5-2630v2 2.6Ghz (not the fastest CPU on the market), as you can se from the test results in the [product page](https://www.ntop.org/products/packet-capture/pf_ring-ft/).

### Learning PF\_RING FT

If you want to learn more about PF\_RING FT, you can go to the PF\_RING repository and [walk through our code examples](https://github.com/ntop/PF_RING/tree/dev/userland/examples_ft). You will see how to use this technology also with non PF\_RING packet processing libraries such as [libpcap](https://github.com/ntop/PF_RING/blob/dev/userland/examples_ft/ftflow_pcap.c) and [DPDK](https://github.com/ntop/PF_RING/blob/dev/userland/examples_ft/ftflow_dpdk.c). In essence you can now focus on solving your problem instead of addressing time-consuming tasks such as packet capture, decode and flow processing.

## Keep reading

centoMay 18, 2026

### [Post-Quantum Cryptography (PQC) Analysis](https://www.ntop.org/post-quantum-cryptography-pqc-analysis/)

Modern digital security relies on public-key encryption (like RSA and ECC) to protect global data. The future arrival of a Cryptographically Relevant Quantum Computer (CRQC) will completely break these mathematical foundations. To…

centoJan 25, 2026

### [nProbe Cento at Scale: Flow Offload Acceleration on Napatech](https://www.ntop.org/nprobe-cento-at-scale-flow-offload-acceleration-on-napatech/)

High-speed networks continue to push the limits of software-based monitoring and security applications. As link speeds grow and traffic patterns become more complex, efficiently analyzing packets while maintaining per-flow state, for updating…

ntopJul 11, 2025

### [New, Fast, Scalable ClickHouse Integration for High-Volume Networks](https://www.ntop.org/new-fast-scalable-clickhouse-integration-for-high-volume-networks/)

When it comes to monitoring very large networks and the flows’ cardinality reaches into the billions, the performance of historical data storage and query systems becomes a critical bottleneck. Network operators, analysts,…

## Try it on your own network

Download the free Community edition and see your first flows in five minutes.

[Download ntopng free](https://www.ntop.org/support/documentation/software-installation/)[Talk to an engineer](https://www.ntop.org/support/need-help/contacts/)
Source: https://www.ntop.org/introducing-pf_ring-ft-ndpi-based-flow-classification-and-filtering-for-pf_ring-and-dpdk/