Giter Club home page Giter Club logo

FPCAP - A fast and lightweight PCAP file reading library

build

Features

  • Memory-mapping Pcap & PcapNG reading
  • Supported PcapNG block types:
    • Section Header Block
    • Interface Description Block
    • Enhanced Packet Block
    • Interface Statistics Block
  • Rudimentary support for block options
  • Zstd de-compression support (file-endings .zst or .zstd)

Build

mkdir build && cd build
cmake ..
cmake --build . --target fpcap example-simple -- -j 4

Requirements

Pre-install required

The following libraries need to be installed in the build environment:

Tests

Submodules

Benchmarks

Requirements

  • libpcap

Submodules

Disabling CPU Frequency Scaling

If you see this error:

***WARNING*** CPU scaling is enabled, the benchmark real time measurements may be noisy and will incur extra overhead.

you might want to disable the CPU frequency scaling while running the benchmark. Exactly how to do this depends on the Linux distribution, desktop environment, and installed programs.

One simple option is to use the cpupower program to change the performance governor to "performance". This tool is maintained along with the Linux kernel and provided by your distribution.

It must be run as root, like this:

sudo cpupower frequency-set --governor performance

After this you can verify that all CPUs are using the performance governor by running this command:

cpupower frequency-info -o proc

The benchmarks you subsequently run will have less variance.

Note that changing the governor in this way will not persist across reboots. To set the governor back, run the first command again with the governor your system usually runs with, which varies.

If you find yourself doing this often, there are probably better options than running the commands above. Some approaches allow you to do this without root access, or by using a GUI, etc. The Arch Wiki Cpu frequency scaling page is a good place to start looking for options.

Docker

cd docker/
docker build -t debian11-zstd-develop .

Benchmark results

25.09.2022

---------------------------------------------------------------------
Benchmark                           Time             CPU   Iterations
---------------------------------------------------------------------
fpcap (pcap)                  59666484 ns     12744900 ns           52
fpcap-fread (pcap)             9108406 ns      1318842 ns          457
fpcap (pcapng)                58144655 ns     12134124 ns           55
fpcap-fread (pcapng)           8729187 ns      1195401 ns          592
fpcap (pcapng.zst)             8381497 ns      1946854 ns          361
PcapPlusPlus (pcap)          56237054 ns     11692277 ns           60
PcapPlusPlus (pcapng)        58786941 ns     12942878 ns           51
PcapPlusPlus (pcapng.zstd)    9824016 ns      3027536 ns          235
libpcap (pcap)               56189614 ns     11405524 ns           59
libpcap (pcapng)             58584807 ns     11988455 ns           60

FPCAP's Projects

fpcap icon fpcap

A fast and lightweight PCAP file reading library

fpcap-benchmark icon fpcap-benchmark

Benchmark for fpcap - "A memory mapping PcapNg reader written in C++"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.