Skip to main content

pktgen scripts tool

Project description

pktperf Pylint Score

pktgen is very useful for network performance test, especially when we don't have multiple nics for dpdk in a vm.

It makes use of the sample scripts in linux kernel samples/pktgen

All cmds in networking/pktgen.txt


Pktperf is python scripts for pktgen (the kernel version). Also it provides a out of tree pktgen module (tested on kernel 5.4, but supposed to be compatible with 4.15 at mininum). During pip install, it will try builing the module and if not only the original pktgen function can be supported.

install

pip3 install pktperf

usage

A simple sample command would be

pktperf -i eth0 -s 64 -m 00:78:0a:fa:34:12 -t 12 -c 1200 -d 192.168.10.100 -n 0

By default, the flows contain packets with udp src port 9 to 1009. It means sending 1k flows. With -p you can specify udp dst port range. So if you want send 100k flows, put -p 200-300 into the parameters.

-d specifies the destination ip address, with 192.168.0.100/31, the pktgen will send packets to both 192.168.0.100 and 192.168.0.101. Or you can use range like port range above 192.168.0.100-192.168.0.101 instead.

Also, you can use a config file to set packet fields, see example.cfg

pktperf -i eth0 --file example.cfg -n 0 -c 10 -t 12

Also provide some scenario testcase

Internet mix test case:

imix_weights size_1:weight_1,size_2:weight_2,...size_n:weight_n

For example:

imix_weights 40:7,576:4,1500:1

The pkt_size "40" will account for 7 / (7 + 4 + 1) = ~58% of the total
packets sent.

micro burst test case:

microburst duration_poll,duration_idle

microburst 200,100

pktgen will be sending 200ms and then keep 100ms idle, loop follow the pattern

During pktgen running, all stats will be display with 1 sec interval

Core  0 send                 10894413 pkts: 904722 pps 463217664 bps 0 errors
Core  1 send                 10865308 pkts: 902305 pps 461980160 bps 0 errors
...
Core 11 send                 10907599 pkts: 905816 pps 463777792 bps 0 errors
Total   send                130439679 pkts: 10833488 pps 5546745856 bps  0 errors

pkts are exactly the number sent out the each queue, if you see any of them less than the others, there could be a rate limit for the port or the queue.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pktperf-0.5.8.tar.gz (55.9 kB view details)

Uploaded Source

File details

Details for the file pktperf-0.5.8.tar.gz.

File metadata

  • Download URL: pktperf-0.5.8.tar.gz
  • Upload date:
  • Size: 55.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for pktperf-0.5.8.tar.gz
Algorithm Hash digest
SHA256 d08da1d997b7efa0452f25c7ec0fcc37cd00dd99ac3261a0d068e2fc2a34fcd0
MD5 69845af433470ecc5c3b426ab73971ea
BLAKE2b-256 b6d69b5a07fbbfa4e1bb422355b18ca3da145d5209eaa4034451754616c27836

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page