An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          

# NetLatencyInjector ![Alpha](https://img.shields.io/badge/Status-Release-green)

**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
```

---