README.rst 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. Sample and benchmark scripts for pktgen (packet generator)
  2. ==========================================================
  3. This directory contains some pktgen sample and benchmark scripts, that
  4. can easily be copied and adjusted for your own use-case.
  5. General doc is located in kernel: Documentation/networking/pktgen.rst
  6. Helper include files
  7. ====================
  8. This directory contains two helper shell files, that can be "included"
  9. by shell source'ing. Namely "functions.sh" and "parameters.sh".
  10. Common parameters
  11. -----------------
  12. The parameters.sh file support easy and consistant parameter parsing
  13. across the sample scripts. Usage example is printed on errors::
  14. Usage: ./pktgen_sample01_simple.sh [-vx] -i ethX
  15. -i : ($DEV) output interface/device (required)
  16. -s : ($PKT_SIZE) packet size
  17. -d : ($DEST_IP) destination IP. CIDR (e.g. 198.18.0.0/15) is also allowed
  18. -m : ($DST_MAC) destination MAC-addr
  19. -p : ($DST_PORT) destination PORT range (e.g. 433-444) is also allowed
  20. -t : ($THREADS) threads to start
  21. -f : ($F_THREAD) index of first thread (zero indexed CPU number)
  22. -c : ($SKB_CLONE) SKB clones send before alloc new SKB
  23. -n : ($COUNT) num messages to send per thread, 0 means indefinitely
  24. -b : ($BURST) HW level bursting of SKBs
  25. -v : ($VERBOSE) verbose
  26. -x : ($DEBUG) debug
  27. The global variable being set is also listed. E.g. the required
  28. interface/device parameter "-i" sets variable $DEV.
  29. Common functions
  30. ----------------
  31. The functions.sh file provides; Three different shell functions for
  32. configuring the different components of pktgen: pg_ctrl(), pg_thread()
  33. and pg_set().
  34. These functions correspond to pktgens different components.
  35. * pg_ctrl() control "pgctrl" (/proc/net/pktgen/pgctrl)
  36. * pg_thread() control the kernel threads and binding to devices
  37. * pg_set() control setup of individual devices
  38. See sample scripts for usage examples.