The following Guide is also available at Getting-Starte-Guide.
This guide covers the following topics:
- What is PFQ?
- HW and SW Requirements.
- Haskell and Linux Distributions.
- Obtaining source codes.
- Satisfy library dependencies.
- Build the software.
- Software components.
PFQ is a multi-language network framework designed for the Linux Operating System and the Linux Kernel 3.x (or higher). 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, user-space libraries, for the C, C++11/14, Haskell languages and native support for the accelerated libpcap library with programmable fanout.
- A 32/64-bit Linux operating system (Intel/AMD architectures are supported).
- Linux Kernel 3.5 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), for user-space tools and libraries.
- The Haskell stack tool haskell-stack
- CMake, make, autoconf.
- Flex and bison.
We recommend you to install the stack Haskell tool following the instructions at Stackage site.
However, if you plan to install the Haskell platform from Haskell-Platform, you may encounter compilation problems if you have a system with PIE (position independent executables) enabled by default (such as Ubuntu, Debian etc.).
If it is your case, you have to edit the GHC settings file at:
/usr/local/haskell/ghc-___/lib/ghc-___/settings
and change the compiler supports -no-pie
flag from "NO" to "YES".
Clone the source codes of PFQ from the GitHub repository with the following command:
git clone https://github.com/pfq/PFQ.git
- To build and install the framework:
stack Build.hs --build-type=Release install
The command will configure, compile and install the framework satisfying the dependencies of the libraries and the correct order for building the 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:
stack Build.hs show
targets:
pfq.ko
pfq-clib
pfq-cpplib
pfq-haskell-lib
pfq-pcap-1.8.1-fanout
pfq-hcounters
pfq-lang
pfq-affinity
pfq-omatic
pfq-load
pfq-stress
pfqd
regression
h-regression
tools
For example, to install pfq.ko and pfqd:
stack Build.hs -j3 --build-type=Release install pfq.ko pfqd
The following components are currently part of the framework:
- pfq.ko
- pfq-clib
- pfq-cpplib
- pfq-haskell-lib
- pfq-pcap-1.8.1-fanout
- pfq-hcounters
- pfq-lang
- pfq-affinity
- pfq-omatic
- pfq-load
- pfq-stress
- pfqd
- regression
- h-regression
- tools