{"id":13520205,"url":"https://github.com/path-network/bpf-echo","last_synced_at":"2025-06-25T09:03:52.033Z","repository":{"id":54463399,"uuid":"191975235","full_name":"path-network/bpf-echo","owner":"path-network","description":"A blazing fast TCP \u0026 UDP mock echo server using eBPF","archived":false,"fork":false,"pushed_at":"2019-06-14T16:33:22.000Z","size":4,"stargazers_count":50,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-25T09:02:33.223Z","etag":null,"topics":["bcc","bpf","echo","server","tcp","test","udp"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/path-network.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}},"created_at":"2019-06-14T16:31:19.000Z","updated_at":"2024-11-29T09:33:49.000Z","dependencies_parsed_at":"2022-08-13T16:20:51.702Z","dependency_job_id":null,"html_url":"https://github.com/path-network/bpf-echo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/path-network/bpf-echo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/path-network%2Fbpf-echo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/path-network%2Fbpf-echo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/path-network%2Fbpf-echo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/path-network%2Fbpf-echo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/path-network","download_url":"https://codeload.github.com/path-network/bpf-echo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/path-network%2Fbpf-echo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261841825,"owners_count":23217910,"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","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":["bcc","bpf","echo","server","tcp","test","udp"],"created_at":"2024-08-01T05:02:14.011Z","updated_at":"2025-06-25T09:03:51.978Z","avatar_url":"https://github.com/path-network.png","language":"Python","readme":"# eBPF Echo Server\n\nbpf-echo is a blazing fast TCP \u0026 UDP echo server that supports IPv4 and IPv6 traffic.\nIts implementation leverages [extended Berkeley Packet Filter](https://lwn.net/Articles/740157/) and [BPF Compiler Collection](https://github.com/iovisor/bcc) in order to redirect outgoing packets straight back to the sending socket's receive queue.\nIt's perfect for benchmarking proxy servers, or network libraries, where you want to make sure that the upstream server is not a bottleneck.\n\n## Requirements\n\nThe requirements for running `bpf-echo` are:\n\n- Python 3\n- pyroute2: `pip3 install pyroute2`\n- BPF Compiler Collection Python 3 libraries.\n  It's included in many distributions, e.g. as `python3-bpfcc` in Ubuntu package repositories.\n  Check out [bcc's INSTALL.md](https://github.com/iovisor/bcc/blob/master/INSTALL.md) for more details\n- new enough Linux kernel - at least version `4.1`\n- root access - required for loading eBPF classifier.\n\n## Example\n\n```\n$ sudo ./bpf-echo --ipv4 127.0.0.1 --port 1122 # run in different terminal\n$ echo \"hello\" | nc -W1 127.0.0.1 1122\nhello\n```\n\n## Usage\n\n```\nusage: bpf-echo.py [-h] [--ipv4 IPV4] [--ipv6 IPV6] [--port PORT]\n                   [--ifname IFNAME]\n\noptional arguments:\n  -h, --help       show this help message and exit\n  --ipv4 IPV4      IPv4 address that will reflect packets. Disabled if empty\n                   string. (default: 127.0.0.1)\n  --ipv6 IPV6      IPv6 address that will reflect packets. Disabled if empty\n                   string. (default: )\n  --port PORT      TCP/UDP destination port that will reflect packets.\n                   (default: 12345)\n  --ifname IFNAME  Interface the eBPF classifier will be loaded on. (default:\n                   lo)\n```\n\n## Caveats\n\nThe BPF implementation is rather simple, and thus it makes some compromises:\n\n- it doesn't handle TCP three-way handshake by itself, instead passing any packets with SYN, FIN or RST flags to an actual socket that's initialized in the Python code\n- otherwise, it reflects TCP and UDP packets _as is_, not touching anything else than IP addresses and ports\n- it doesn't support 802.1Q headers, IPv4 options or IPv6 extension headers\n- it has to be loaded on a loopback interface.\n  The reflecting IP addresses don't have to be local - as long as you set up routing rules that will route those packets to loopback.\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpath-network%2Fbpf-echo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpath-network%2Fbpf-echo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpath-network%2Fbpf-echo/lists"}