{"id":22439389,"url":"https://github.com/junka/pktperf","last_synced_at":"2025-08-01T17:30:40.572Z","repository":{"id":57453248,"uuid":"389899218","full_name":"junka/pktperf","owner":"junka","description":"linux kernel pktgen extension and python helper scripts","archived":false,"fork":false,"pushed_at":"2024-08-08T09:01:53.000Z","size":415,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T04:01:55.994Z","etag":null,"topics":["network","networking","packet-generator","performance","pktgen","python3","stress-testing","test","vswitch"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/junka.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-27T08:06:30.000Z","updated_at":"2024-09-03T12:20:40.000Z","dependencies_parsed_at":"2024-08-08T11:18:07.992Z","dependency_job_id":null,"html_url":"https://github.com/junka/pktperf","commit_stats":{"total_commits":31,"total_committers":1,"mean_commits":31.0,"dds":0.0,"last_synced_commit":"df23bb2c3dbd88034e053dbebd43a41b6403d3dd"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/junka/pktperf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junka%2Fpktperf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junka%2Fpktperf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junka%2Fpktperf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junka%2Fpktperf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/junka","download_url":"https://codeload.github.com/junka/pktperf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junka%2Fpktperf/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268266023,"owners_count":24222553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["network","networking","packet-generator","performance","pktgen","python3","stress-testing","test","vswitch"],"created_at":"2024-12-06T01:13:59.381Z","updated_at":"2025-08-01T17:30:40.189Z","avatar_url":"https://github.com/junka.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pktperf  ![Pylint Score](https://github.com/junka/pktperf/workflows/Pylint/badge.svg)\npktgen is very useful for network performance test, especially when we don't have multiple nics for dpdk in a vm.\n\nIt makes use of the sample scripts in linux kernel [samples/pktgen](https://github.com/torvalds/linux/tree/master/samples/pktgen)\n\nAll ```cmds``` in [networking/pktgen.txt](https://www.kernel.org/doc/Documentation/networking/pktgen.txt)\n\n---\n\nPktperf is python scripts for pktgen (the kernel version).\nAlso 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.\n\n\n## install\n```pip3 install pktperf```\n\n## usage\nA simple sample command would be \n```\npktperf -i eth0 -s 64 -m 00:78:0a:fa:34:12 -t 12 -c 1200 -d 192.168.10.100 -n 0\n```\nBy default, the flows contain packets with udp src port 9 to 1009. It means sending\n1k flows. With ```-p``` you can specify udp dst port range. So if you want send 100k\nflows, put ```-p 200-300``` into the parameters.\n\n\n```-d``` specifies the destination ip address, with ```192.168.0.100/31```, the pktgen will\nsend packets to both 192.168.0.100 and 192.168.0.101. Or you can use range like port range \nabove ```192.168.0.100-192.168.0.101``` instead.\n\n\n\nAlso, you can use a config file to set packet fields, see ```example.cfg```\n```\npktperf -i eth0 --file example.cfg -n 0 -c 10 -t 12\n```\n\n\nAlso provide some scenario testcase\n\nInternet mix test case:\n\n```imix_weights size_1:weight_1,size_2:weight_2,...size_n:weight_n```\n\nFor example: \n```\nimix_weights 40:7,576:4,1500:1\n\nThe pkt_size \"40\" will account for 7 / (7 + 4 + 1) = ~58% of the total\npackets sent.\n\n```\n\n\nmicro burst test case:\n\n```microburst duration_poll,duration_idle```\n\n```\nmicroburst 200,100\n\npktgen will be sending 200ms and then keep 100ms idle, loop follow the pattern\n```\n\n\nDuring pktgen running, all stats will be display with 1 sec interval\n```\nCore  0 send                 10894413 pkts: 904722 pps 463217664 bps 0 errors\nCore  1 send                 10865308 pkts: 902305 pps 461980160 bps 0 errors\n...\nCore 11 send                 10907599 pkts: 905816 pps 463777792 bps 0 errors\nTotal   send                130439679 pkts: 10833488 pps 5546745856 bps  0 errors\n```\n\n\n```pkts``` are exactly the number sent out the each queue, if you see any of them less than\nthe others, there could be a rate limit for the port or the queue.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunka%2Fpktperf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjunka%2Fpktperf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunka%2Fpktperf/lists"}