{"id":20115497,"url":"https://github.com/asphaltt/ping-latency-injector","last_synced_at":"2026-05-18T19:02:22.482Z","repository":{"id":234014704,"uuid":"613432224","full_name":"Asphaltt/ping-latency-injector","owner":"Asphaltt","description":"Inject latency to ping on server side. BSD-3 License","archived":false,"fork":false,"pushed_at":"2023-03-13T15:06:53.000Z","size":734,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-13T06:26:30.259Z","etag":null,"topics":["ebpf","ebpf-co-re","icmp","ping","ping-latency-injector"],"latest_commit_sha":null,"homepage":"","language":"C","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/Asphaltt.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}},"created_at":"2023-03-13T14:59:46.000Z","updated_at":"2024-02-07T00:06:03.000Z","dependencies_parsed_at":"2024-04-17T23:59:10.699Z","dependency_job_id":"5012f1b3-53e1-478e-bc39-a1b88aa6c705","html_url":"https://github.com/Asphaltt/ping-latency-injector","commit_stats":null,"previous_names":["asphaltt/ping-latency-injector"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Asphaltt%2Fping-latency-injector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Asphaltt%2Fping-latency-injector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Asphaltt%2Fping-latency-injector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Asphaltt%2Fping-latency-injector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Asphaltt","download_url":"https://codeload.github.com/Asphaltt/ping-latency-injector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241557454,"owners_count":19981918,"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":["ebpf","ebpf-co-re","icmp","ping","ping-latency-injector"],"created_at":"2024-11-13T18:35:27.912Z","updated_at":"2025-10-24T17:32:39.240Z","avatar_url":"https://github.com/Asphaltt.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ping-latency-injector\n\n`ping-latency-injector` is a latency injector for `ping` on server side.\n\nOn server, if it receives an ECHOREQUEST ICMPv4 packet, `ping-latency-injector` is able to\ndelay to reply the ECHOREPLY ICMPv4 packet.\n\n## Goody\n\nIt's really interesting to hide the network distance on server, which is detect\nby `ping`.\n\nIn hence, bad guys are unable to detect the real network distance between\nservers by `ping`.\n\nHowever, it's easy to calculate the real latency by subtracting the specified\ninjected latency.\n\n## How it works?\n\nIt works with XDP and AF_XDP.\n\n1. XDP program check the packet whether it's an ECHOREQUEST ICMPv4 packet.\n2. XDP redirects the packet to AF_XDP.\n3. AF_XDP sends the packet to user-space application.\n4. After the specified latency, application transforms the packet to an\n   ECHOREPLY one.\n5. Application sends the transformed packets by AF_XDP.\n\n## Build and run\n\n```bash\n# git clone git@github.com:Asphaltt/ping-latency-injector.git\n# cd ping-latency-injector\n# go generate \u0026\u0026 go build\n# ./ping-latency-injector -h\nUsage of ./ping-latency-injector:\n  -D, --dev string   device to inject latency to ping\n  -L, --lat string   latency to delay, 1ms \u003c= latency \u003c= 10s (default \"1ms\")\npflag: help requested\n# ./ping-latency-injector -D enp0s8 -L 600ms\n2023/03/12 16:01:37 Attached XDP to enp0s8\n\n# echo On other host terminal\n# ping -s 1400 -c3 192.168.1.138\nPING 192.168.1.138 (192.168.1.138): 1400 data bytes\n1408 bytes from 192.168.1.138: icmp_seq=0 ttl=64 time=600.888 ms\n1408 bytes from 192.168.1.138: icmp_seq=1 ttl=64 time=0.661 ms  # Cancel suddenly\n1408 bytes from 192.168.1.138: icmp_seq=2 ttl=64 time=0.495 ms\n\n--- 192.168.1.138 ping statistics ---\n3 packets transmitted, 3 packets received, 0.0% packet loss\nround-trip min/avg/max/stddev = 0.495/200.681/600.888/282.989 ms\n```\n\n## License\n\nBSD-3 License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasphaltt%2Fping-latency-injector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasphaltt%2Fping-latency-injector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasphaltt%2Fping-latency-injector/lists"}