https://github.com/vi/pktslow
Virtual network for slowing down or dropping packets selectively
https://github.com/vi/pktslow
Last synced: 11 months ago
JSON representation
Virtual network for slowing down or dropping packets selectively
- Host: GitHub
- URL: https://github.com/vi/pktslow
- Owner: vi
- License: mit
- Created: 2020-06-19T23:51:54.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-20T00:47:55.000Z (about 6 years ago)
- Last Synced: 2025-06-01T22:09:00.647Z (about 1 year ago)
- Language: Rust
- Size: 19.5 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pktslow
Virtual network for slowing down or dropping packets selectively
# Instructions
1. Build (or download pre-built version from Github releases) `pktslow`
2. Start it as root, specifying two interfaces
3. Move one of those interfaces into another [Linux network namespace](https://man7.org/linux/man-pages/man8/ip-netns.8.html)
4. Set up addresses and routing, like you typically do with [veth](https://man7.org/linux/man-pages/man4/veth.4.html)
5. Specify interactive commands to `pktslow`'s stdin. You may want to issue `delay 0` or `setup 0 1 0` to remove the default 50ms delay. Then you probably would use `mon` command to dump some bytes from packets (to find the byte you need). Then you'll `setup` the matcher (only one masked byte is supported). Then you'll `delay` or `drop` or `ramp`.
(I don't belive the program would be useful enough to warrant writing a proper manual for it)
# Usage messages
Main usage message:
```
Usage: pktslow
simple program that creates a veth-like pair of TUN interfaces and allows to selectively delay some packets Other options are specified as interactive stdin commands
Options:
--help display usage information
```
Interactive commands usage message:
```
> --help
Usage: []
interactive options
Options:
--help display usage information
Commands:
quit Exit from process
delay Adjust the delay
ramp Ramp the delay
mon Print packets content to stdout
stats Show statistics
setup Setup matcher that would decide whether to delay packets
drop Drop matching packets instead of delaying them. Reset with
`delay` command.
```