https://github.com/italiang0urmet/netlatencyinjector
A small C++ tool to inject artificial network delay using tc netem on Linux. Useful for testing, debugging, or trolling yourself.
https://github.com/italiang0urmet/netlatencyinjector
linux
Last synced: 9 months ago
JSON representation
A small C++ tool to inject artificial network delay using tc netem on Linux. Useful for testing, debugging, or trolling yourself.
- Host: GitHub
- URL: https://github.com/italiang0urmet/netlatencyinjector
- Owner: ItalianG0urmet
- Created: 2025-06-04T21:13:17.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-09-27T21:33:47.000Z (9 months ago)
- Last Synced: 2025-09-27T23:34:19.309Z (9 months ago)
- Topics: linux
- Language: C++
- Homepage:
- Size: 16.6 KB
- Stars: 16
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NetLatencyInjector 
**Lagger** is a lightweight Linux utility for injecting artificial network latency using `tc netem`. Designed for developers, testers, or anyone curious about how their apps behave under lag, it provides an intuitive interface for applying, checking, and removing delay on a selected network interface.
## Features
- Add custom network delay in milliseconds
- Remove existing delay rules
- Check current delay status
- Simple interface built in C++
## Prerequisites
- Linux system with `tc` (from the `iproute2` package)
- `sudo` privileges
- CMake & a C++ compiler (e.g., `g++`)
## Installation
```bash
# Clone the repository
git clone https://github.com/ItalianG0urmet/NetLatencyInjector.git
cd NetLatencyInjector
# Build the project
mkdir build
cd build
cmake ..
make
# Run the tool (requires sudo for tc commands)
sudo ./lagger
````
## 🛠Example commands used internally
Lagger internally wraps standard `tc` commands like:
```bash
tc qdisc add dev root netem delay 100ms
tc qdisc show dev
tc qdisc del dev root netem
```
---