{"id":19732878,"url":"https://github.com/riptl/docker-netem","last_synced_at":"2025-04-30T02:33:04.988Z","repository":{"id":46818931,"uuid":"228205109","full_name":"riptl/docker-netem","owner":"riptl","description":"Easy netem delays for Docker networks","archived":false,"fork":false,"pushed_at":"2021-09-23T17:19:33.000Z","size":15,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-01-31T03:10:16.851Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/riptl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-15T15:18:28.000Z","updated_at":"2022-03-18T08:50:42.000Z","dependencies_parsed_at":"2022-09-21T06:02:51.261Z","dependency_job_id":null,"html_url":"https://github.com/riptl/docker-netem","commit_stats":null,"previous_names":["riptl/docker-netem"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riptl%2Fdocker-netem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riptl%2Fdocker-netem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riptl%2Fdocker-netem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riptl%2Fdocker-netem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/riptl","download_url":"https://codeload.github.com/riptl/docker-netem/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224195709,"owners_count":17271702,"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":[],"created_at":"2024-11-12T00:28:17.153Z","updated_at":"2024-11-12T00:28:17.726Z","avatar_url":"https://github.com/riptl.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# Docker netem agent\n\n`netem-agent` is a container that artificially slows down a Docker network.\nI use it to test the behavior of distributed systems when exposed to real-world networking conditions.\n\n- Easily emulate properties of WANs in a Docker network via\n  [`netem`](http://man7.org/linux/man-pages/man8/tc-netem.8.html)\n  - Delay packets with jitter\n  - Introduce packet loss, reordering, etc.\n- Works in Swarm mode, Requires no special preparation of the target containers\n  - Unlike e.g. [`pumba`](https://github.com/alexei-led/pumba), a powerful chaos-testing tool\n    which needs the `iproute2` package in the target containers.\n- Relies on standard Linux tooling\n\n### How does it work?\n\nIt uses [dockerveth](https://github.com/micahculpepper/dockerveth/tree/develop)\nin the host network context to map all selected containers to their `veth` interfaces.\n\nThen, it activates the NetEm traffic control facilities on those interfaces.\n\n## Configuration\n\nRequirements:\n- Linux machine\n- Preparation of target containers _not_ required\n- Access to the Docker daemon\n- `NET_ADMIN` capability on agent and elevated privileges\n  (TODO Make it work with less privileges)\n- Access to Docker network namespaces\n- Host networking enabled on agent\n- Running as regular Docker container, not Swarm service\n\nExample:\n```shell\ndocker run -it --rm \\\n  --name netem-agent \\\n  --cap-add=NET_ADMIN \\\n  --privileged \\\n  --net=host \\\n  -v /var/run/docker.sock:/var/run/docker.sock:ro \\\n  -v /var/run/docker/netns:/var/run/netns:ro \\\n  terorie/netem-agent \\\n  --name='^dummy.*' \\\n  --delay=100ms \\\n  --jitter=50ms\n```\n\n### Options\n\n- `--interval` Update interval\n- `--name` Container name regex filters\n  (optional, by default delaying all containers)\n- `--delay` Outgoing packets delay\n- `--jitter` Delay jitter\n- `--delete` Delete all delays and exit\n\n## Attributions\n\n- [dockerveth](https://github.com/micahculpepper/dockerveth/tree/develop)\n  for getting the `veth` interfaces of containers\n- [miller](https://github.com/johnkerl/miller) for crafting with CSV\n- Developed at Nimiq for testing of the [Albatross network](https://github.com/nimiq/core-rs-albatross)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friptl%2Fdocker-netem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Friptl%2Fdocker-netem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friptl%2Fdocker-netem/lists"}