Kernel module for packet generator and packet receiver with statistics.
Switch branches/tags
Nothing to show
Clone or download
danieltt Update
Add URL in the README file
Latest commit 444f2d8 Mar 7, 2014
Failed to load latest commit information.
examples Adding examples Feb 28, 2014
.gitignore Adding gitignore Feb 20, 2014
Makefile Initial commit Feb 20, 2014 Update Mar 7, 2014
pktgen.c Add correct jitter calculation Feb 27, 2014


Kernel module for packet generator and packet receiver with statistics. Source based from Linux Kernel pktgen 3.11.0

To compile the headers of the running kernel are required.

sudo apt-get install linux-headers-$(uname -r)

Current version for kernel 3.11.0. It uses netfilter hooks to process incomming packets.

To compile and load the module:


insmod ./pktgen.ko

it is necessary to map each interrupt with a different core. You can use [eth-affinity] ( to set up automaticaly.


to start the receiver, you need to be root

sudo su

echo rx eth1 > /proc/net/pktgen/pgrx

Some options for the receiver:

  • rx [device] to enable the receiver part for a specific device. If it is wrong, all the devices are used. (all versions)
  • rx_reset: to reset the counters
  • rx_disable: to disable the receiver
  • display [human or script]
  • statistics [counter, basic, or time]

to read the results

cat /proc/net/pktgen/pgrx

and change output format:

echo display script > /proc/net/pktgen/pgrx

examples for transmitting can be found at the examples folder. For more details look at the pktgen documetation in the linux kernel Documentation/networking/pktgen.txt

More information can be found at