{"id":34741754,"url":"https://github.com/takehaya/xdperf","last_synced_at":"2026-04-12T00:30:57.219Z","repository":{"id":322152395,"uuid":"1074154485","full_name":"takehaya/xdperf","owner":"takehaya","description":"xdperf is a high-performance network traffic generation tool that leverages XDP (eXpress Data Path).","archived":false,"fork":false,"pushed_at":"2026-04-03T21:34:41.000Z","size":8361,"stargazers_count":71,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-03T23:27:00.852Z","etag":null,"topics":["ebpf","golang","wasm","xdp"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/takehaya.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-11T08:42:20.000Z","updated_at":"2026-04-03T21:34:35.000Z","dependencies_parsed_at":"2025-12-03T01:07:50.758Z","dependency_job_id":null,"html_url":"https://github.com/takehaya/xdperf","commit_stats":null,"previous_names":["takehaya/xdperf"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/takehaya/xdperf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takehaya%2Fxdperf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takehaya%2Fxdperf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takehaya%2Fxdperf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takehaya%2Fxdperf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/takehaya","download_url":"https://codeload.github.com/takehaya/xdperf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takehaya%2Fxdperf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31700129,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T21:17:31.016Z","status":"ssl_error","status_checked_at":"2026-04-11T21:17:24.556Z","response_time":54,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["ebpf","golang","wasm","xdp"],"created_at":"2025-12-25T04:15:39.678Z","updated_at":"2026-04-12T00:30:56.766Z","avatar_url":"https://github.com/takehaya.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# XDPerf\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./docs/imgs/logo.png\" alt=\"XDPerf image\" width=\"300\"\u003e\n\u003c/p\u003e\n\nXDPerf is a high-performance network traffic generation tool that leverages XDP (eXpress Data Path). It can operate in both client and server modes, enabling measurement of network throughput and packet rate.\n\nIn addition, XDPerf provides a flexible mechanism for transmitting arbitrary packets. This functionality is implemented through a plugin system based on WASM, which eliminates the dependency issues often encountered with Python-based tools like Trex. Another major advantage is that it does not rely on DPDK.\n\nFurthermore, since XDPerf is implemented in Go, it runs as a single binary, making deployment simple and convenient.\n\nYou can find the project explanation slides at [./docs/xdperf.pdf](https://github.com/takehaya/xdperf/tree/main/docs/xdperf.pdf).\n\n## Install\n\nNote: You need to install `jq` beforehand.\n```shell\n# latest install\ncurl -fsSL https://raw.githubusercontent.com/takehaya/xdperf/main/scripts/install_xdperf.sh | sudo bash\n\n# extra: select version mode\ncurl -fsSL https://raw.githubusercontent.com/takehaya/xdperf/main/scripts/install_xdperf.sh | sudo bash -s -- --version v0.5.3\n```\n\n## Usage\n### Commands\n\nxdperf has two main commands\n| Command | Description |\n|---------|-------------|\n| `run` | Run the traffic generator (send or receive mode) |\n| `probe` | Probe XDP capabilities of a network device |\n\n### Basic Syntax\n\n```shell\n# Traffic generation\nsudo xdperf run --device \u003cinterface\u003e [options]\n\n# Probe XDP support\nsudo xdperf probe --device \u003cinterface\u003e [--json]\n```\n\nBy default, `simpleudp.tinygo` plugin is used (installed at `/usr/local/share/xdperf/plugins`).\nFor custom plugin development, see [Plugin Development Guide](./plugins/README.md).\n\n### Basic Examples\n\n```shell\n# Send 10,000 packets with default settings\nsudo xdperf run --device eth0 --count 10k\n\n# Send packets for 30 seconds at 100k pps\nsudo xdperf run --device eth0 --duration 30s --pps 100k\n```\n\n### High-Performance Traffic Generation\n\n```shell\n# High-throughput: 1M packets with 8 parallel threads at max speed\nsudo xdperf run --device eth0 --count 1m --parallelism 8\n\n# Rate-limited: 10 seconds at 500k pps with 4 threads\nsudo xdperf run --device eth0 --duration 10s --pps 500k --parallelism 4\n```\n\n### Custom Packet Configuration\n\n```shell\n# Small packets for PPS testing\nsudo xdperf run --device eth0 --count 1m --parallelism 4 \\\n    --cfg '{\"dst_port\": 10001, \"src_ip\": \"192.168.1.1\", \"dst_ip\": \"192.168.1.2\", \"payload_size\": 64}'\n\n# Large packets for throughput testing\nsudo xdperf run --device eth0 --count 100k \\\n    --cfg '{\"payload_size\": 1400}'\n\n\nsudo xdperf run --device ens4 --count 100k --parallelism 10 \\\n    --cfg '{\"dst_port\": 10001, \"src_ip\": \"192.168.1.1\", \"dst_ip\": \"192.168.1.2\", \"payload_size\": 64}'\n```\n\n### Server Mode (Receive Only)\n\n```shell\n# Receive only (server mode)\nsudo xdperf run --device eth0 --send=false --recv\n\n# Echo server with swap\nsudo xdperf run --device eth0 --send=false --recv --swap-resp\n```\n\n### Development and Debugging\n\n```shell\n# Local build with verbose debugging\nsudo ./out/bin/xdperf run \\\n    --plugin simpleudp.go \\\n    --plugin-path ./out/bin \\\n    --device eth0 \\\n    --count 100 \\\n    --debugmode 1\n\n# With NIC statistics\nsudo xdperf run --device eth0 --count 1m --show-nic-stats\n```\n\n### Probe Command\n\nCheck if your device supports XDP and live frame mode:\n\n```shell\n# Check XDP capabilities\nsudo xdperf probe --device eth0\n\n# Output in JSON format\nsudo xdperf probe --device eth0 --json\n```\n\nExample output:\n```\nINFO    Probing XDP capabilities        {\"device\": \"eth0\"}\nINFO    Device  {\"name\": \"eth0\"}\nINFO    XDP Support     {\"supported\": true, \"driver_mode\": true, \"generic_mode\": true, \"offload_mode\": false}\nINFO    BPF_PROG_RUN Support    {\"live_frame_mode\": true}\nINFO    Summary: This device is fully compatible with xdperf\n```\n\n## For Developers\n\nThe following information describes what is required to build the project.\n\n### Prepare\n\nOn a Debian-based Linux environment, make sure the following tools are installed:\n* make\n* [mise](https://github.com/jdx/mise)\n* docker\n\n### Development Setup\n\n```shell\nmake install-dev-pkg\nmake install-dev-tools\nmake install-build-tools\n\n# Used by lefthook (explained later)\nmake install-lint-tools\n\n# Equivalent to pre-commit\nlefthook install\n```\n\n### Go Binary Build\n\n```shell\n# Development build (includes xdperf binary and plugins)\nmake build\n\n# Build plugins only\nmake build-plugins\n\n# Build a specific plugin\nmake simpleudp.tinygo  # TinyGo version\nmake simpleudp.go      # Go version\n\n# Build release snapshot with goreleaser\nmake goreleaser\n\n# Run build test (check for panics)\nmake test-runnable\n```\n\n### BPF Binary Build\n\n```shell\nmake bpf-gen\n# debug pattern\n# CEXTRA_FLAGS=\"-DXDPERF_DEBUG\" make bpf-gen\n```\n\n### Multi kernel version test\n```shell\n# Prerequisite: install vimto with static linking (once)\nCGO_ENABLED=0 go install lmb.io/vimto@v0.4.0\n\n# Enable KVM access (once, resets on reboot)\nsudo chmod 0666 /dev/kvm\n\n# Run tests on a specific kernel version\nvimto -kernel :6.1 -- go test -v -count 1 -timeout 5m ./pkg/coreelf/ -run TestBpf\nvimto -kernel :6.6 -- go test -v -count 1 -timeout 5m ./pkg/coreelf/ -run TestBpf\nvimto -kernel :6.12 -- go test -v -count 1 -timeout 5m ./pkg/coreelf/ -run TestBpf\nvimto -kernel :6.18 -- go test -v -count 1 -timeout 5m ./pkg/coreelf/ -run TestBpf\n```\n\n## Inspired by\n- We implemented the packet transmission mechanism with reference to [xdp-trafficgen](https://github.com/xdp-project/xdp-tools/tree/main/xdp-trafficgen). I think elements such as its probe implementation are excellent.\n- We adopted the name xdperf simply because we thought it was a good name. See also [https://github.com/higebu/xdperf](https://github.com/higebu/xdperf)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakehaya%2Fxdperf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftakehaya%2Fxdperf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakehaya%2Fxdperf/lists"}