https://github.com/danieldin95/pktgen
Sample and benchmark scripts for pktgen (packet generator)
https://github.com/danieldin95/pktgen
perf pktgen
Last synced: 11 months ago
JSON representation
Sample and benchmark scripts for pktgen (packet generator)
- Host: GitHub
- URL: https://github.com/danieldin95/pktgen
- Owner: danieldin95
- License: apache-2.0
- Created: 2022-04-01T02:57:26.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-12-12T07:30:49.000Z (over 1 year ago)
- Last Synced: 2025-05-07T07:48:59.429Z (about 1 year ago)
- Topics: perf, pktgen
- Language: Shell
- Homepage:
- Size: 28.3 KB
- Stars: 4
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Building from source
=====================
1. Prepare kernel source code from source rpm.
```
$ rpm -i http://vault.centos.org/7.9.2009/updates/Source/SPackages/kernel-3.10.0-1160.95.1.el7.src.rpm
$ yum-builddep ~/rpmbuild/SPECS/kernel.spec
$ rpmbuild -bp ~/rpmbuild/SPECS/kernel.spec
```
2. Go to linux source directory and compile pktgen modules.
```
$ cd ~/rpmbuild/BUILD/kernel-3.10.0/linux-3.10.0-957.x86_64
$ make -C /lib/modules/$(uname -r)/build M=$(pwd)/net/core modules
```
3. Install pktgen modules.
```
$ insmod ./net/core/pktgen.ko
$ dmesg | grep pktgen
[83003.544038] pktgen: Packet Generator for packet performance testing. Version: 2.75
```
Helper include files
====================
This directory contains two helper shell files, that can be "included"
by shell source'ing. Namely "functions.sh" and "parameters.sh".
Common parameters
-----------------
The parameters.sh file support easy and consistant parameter parsing
across the sample scripts. Usage example is printed on errors::
```
Usage: ./pktgen_sample01_simple.sh [-vx] -i ethX
-i : ($DEV) output interface/device (required)
-s : ($PKT_SIZE) packet size
-d : ($DEST_IP) destination IP
-m : ($DST_MAC) destination MAC-addr
-t : ($THREADS) threads to start
-f : ($F_THREAD) index of first thread (zero indexed CPU number)
-c : ($SKB_CLONE) SKB clones send before alloc new SKB
-n : ($COUNT) num messages to send per thread, 0 means indefinitely
-b : ($BURST) HW level bursting of SKBs
-v : ($VERBOSE) verbose
-x : ($DEBUG) debug
```
The global variable being set is also listed. E.g.the required interface/device parameter "-i" sets variable $DEV.