DPDK-Pktgen is a packet generator tool that is part of the Data Plane Development Kit (DPDK) software suite. It is designed to generate high-speed network traffic at line rate, allowing users to test and measure the performance of their network infrastructure.
However, The Pktgen does not have availabilty to save the results.
Thus, I had made a slight change on the Pktgen to save results on a .csv file.
This Change was made on Pktgen v.20.09
With the updated .c file given, overwrite the pktgen-stats.c at:
Pktgen-DPDK-pktgen-20.09.0/app/pktgen-stats.c
If designated pktgen version is not 20.09.0 simply add:
FILE *fp; fp = fopen("data.csv", "a"); // ADD TO CSV FILE fprintf(fp, "%d,%lu,%lu,%lu,%lu\n", (&info->seq_pkt[SINGLE_PKT])->pktSize + PG_ETHER_CRC_LEN, info->rate_stats.ipackets, iBitsTotal(info->rate_stats) / Million, info->rate_stats.opackets, oBitsTotal(info->rate_stats) / Million); // ADD TO CSV FILE fclose(fp);
Recompile Pktgen using meson and ninja:
sudo meson setup --wipe build
sudo ninja -C build install
Now, when running Pktgen, a file named data.csv
will be generated as below:
Each columns mean: Pkt Size / Rx Bytes / Rx Packets / Tx Bytes / Tx Packets
*This example was done on the Tx side, thus Tx byte/packet change as packet size change.
Lastly, We can analyze the data using the given python file via:
python3 average.py data.csv
This will result like:
For better results, it only takes into accoun the middle 50% of the data, and ignores data with value 0.
TBD
Throughly looking at the code, simple patch on