Skip to content

Getting Started Guide

Nicola Bonelli edited this page Apr 22, 2015 · 80 revisions

This guide covers the following topics:

  1. What is PFQ.
  2. HW and SW Requirements.
  3. Linux Distributions.
  4. Obtaining source codes.
  5. Satisfy library dependencies.
  6. Build the software.
  7. Software components.

What is PFQ

PFQ is a multi-language network monitoring framework designed for the Linux Kernel 3.x. It is highly optimized for multi-core processors, as well as for network devices equipped with multiple hardware queues (i.e. Intel 82599 10G).

PFQ consists in a Linux Kernel module and user-space libraries, for the C, C++11/14 and Haskell languages.

HW and SW Requirements

  • A 32/64-bit Linux operating system (Intel/AMD architectures are currently supported).
  • Linux kernel 3.0 or higher.
  • Kernel headers, required to compile modules for your kernel.
  • A gcc compiler, the one used to compile the kernel in use.
  • A g++ compiler (g++-4.8/clang-3.4 or higher), required to compile user-space tools and libraries.
  • GHC Glasgow Haskell Compiler 7.8 or higher.
  • Alex and happy tool.
  • CMake and make.

Linux distributions

PFQ is developed and tested on Linux Debian Jessie.

Debian Jessie

To install GHC 7.8 on Debian Jessie the APT pinning is required. Pinning allows to install packages from one version (stable, testing, unstable) without the necessity of upgrading the entire system. More information is available on Debian site.

GHC 7.8 is currently available from the experimental distribution.

  • Add the following line to apt source file (/etc/apt/sources.list)
deb http://ftp.debian.org/debian/ experimental main non-free contrib
  • Update the list of packages
apt-get update
  • Install GHC 7.8
apt-get install ghc/experimental 

Ubuntu 14.04.1 LTS (Trusty Tahr)

Use Hebert's PPA to install GHC and cabal-install as described at Stackage:

sudo apt-get update
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:hvr/ghc
sudo apt-get update
sudo apt-get install -y cabal-install-1.20 ghc-7.8.4
cat >> ~/.bashrc <<EOF
export PATH=~/.cabal/bin:/opt/cabal/1.20/bin:/opt/ghc/7.8.4/bin:$PATH
EOF
export PATH=~/.cabal/bin:/opt/cabal/1.20/bin:/opt/ghc/7.8.4/bin:$PATH
cabal update
cabal install alex happy

Other Linux distributions

Follow the instructions at Stackage site.

Obtaining Source Codes

Clone the source codes from the GitHub repository with The following line:

git clone https://github.com/pfq/PFQ.git

master is the stable branch, while experimental is the branch of the most recent version (possibly untested).

Satisfy Library Dependencies

Before installing the framework, ensure the following Haskell libraries are installed:

  • filepath
  • directory
  • unix
  • clock
  • process
  • daemons
  • network
  • cmdargs
  • hslogger
  • ansi-terminal
  • storable-tuple
  • storablevector
  • data-default
  • semigroups
  • mtl
  • regex-posix
  • bytestring
  • split

You can use the cabal tool to install them. From the base directory launch the command:

cabal install --only-dep

Build the software

  • To build and install the framework:

runhaskell Build.hs install --build Release

The command configures, compiles and installs the framework satisfying the dependencies and the correct order to build of various components.

  • Alternatively, you can specify the list of components you want to build from the command line. The following command shows the targets available:

runhaskell Build.hs show

Example:

runhaskell Build.hs install pfq.ko pfqd --build Release

Software Components

The following components are currently part of the framework:

  • pfq.ko
  • pfq-clib
  • pfq-cpplib
  • pfq-haskell-lib
  • pfq-counters-hs
  • irq-affinity
  • pfq-omatic
  • pfq-load
  • pfq-stress
  • pfqd
  • test
  • tool
Clone this wiki locally