All Projects → tum-lkn → tcgui

tum-lkn / tcgui

Licence: MIT license
A lightweight Python-based Web-GUI for Linux traffic control (tc) to set, view and delete traffic shaping rules.

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to tcgui

pbft
Implementation of the Practical Byzantine Fault Tolerant Algorithm (pbft)
Stars: ✭ 114 (+34.12%)
Mutual labels:  web-gui
Stairspeedtest Reborn
Proxy performance batch tester based on Shadowsocks(R) and V2Ray
Stars: ✭ 2,501 (+2842.35%)
Mutual labels:  web-gui
const-tweaker
🤪 Tweak constant variables live when running a program
Stars: ✭ 65 (-23.53%)
Mutual labels:  web-gui
stockfish-chess-web-gui
Responsive chess web GUI to play against the Stockfish 10 chess engine. Multiple web GUI implementations have also been included.
Stars: ✭ 21 (-75.29%)
Mutual labels:  web-gui
roxy-wi
Web interface for managing Haproxy, Nginx, Apache and Keepalived servers
Stars: ✭ 1,109 (+1204.71%)
Mutual labels:  web-gui
Manba
HTTP API Gateway
Stars: ✭ 3,000 (+3429.41%)
Mutual labels:  traffic-control
SmartTrafficIntersection
Another AI toy project, of a traffic intersection controlled by a Reinforcement Learning AI agent to optimize traffic flow in an intersection of vehicles or pedestrians
Stars: ✭ 30 (-64.71%)
Mutual labels:  traffic-control
Appactive
AppActive: A middleware to build an application with multiple active architectures(阿里巴巴开源的一款标准通用且功能强大的构建应用多活架构的开源中间件)
Stars: ✭ 241 (+183.53%)
Mutual labels:  traffic-control
polaris-go
Lightweight Go SDK as Data Plane of Proxyless Service Governance Solution
Stars: ✭ 35 (-58.82%)
Mutual labels:  traffic-control
polaris
Service Governance Center for Distributed and Microservice Architecture
Stars: ✭ 1,062 (+1149.41%)
Mutual labels:  traffic-control
polaris-cpp
Lightweight C/C++ SDK used as Proxyless Service Governance Solution
Stars: ✭ 14 (-83.53%)
Mutual labels:  traffic-control
go-tc
traffic control in pure go - it allows to read and alter queues, filters and classes
Stars: ✭ 245 (+188.24%)
Mutual labels:  traffic-control
polaris-java
Lightweight Java SDK used as Proxyless Service Governance Solution
Stars: ✭ 84 (-1.18%)
Mutual labels:  traffic-control

tcgui

Actions Status Actions Status Code style: black

A lightweight Python-based Web-GUI for Linux traffic control (tc) to set, view and delete traffic shaping rules. The Web-GUI is intended for short-term isolated testbeds or classroom scenarios and does not contain any security mechanisms.

tcgui screenshot

Requirements

  • netem tools & python3-flask are required
    • Ubuntu 18.04 : Install with sudo apt install iproute2 python3-flask
    • Ubuntu 20.04 : Install with sudo apt install iproute2 python3-flask
    • Ubuntu 22.04 : Install with sudo apt install iproute2 python3-flask
  • More information:

Usage

Execute the main.py file and go to http://localhost:5000:

sudo python3 main.py

--ip IP               The IP where the server is listening
--port PORT           The port where the server is listening
--dev [DEV [DEV ...]] The interfaces to restrict to
--regex REGEX         A regex to match interfaces
--debug               Run Flask in debug mode

The tool will read your interfaces and the current setup every time the site is reloaded

Docker

You can use docker to run this application. Run with host network (--network host) and network admin capabilities (--cap-add=NET_ADMIN). Site will be available on default port Ex: http://dockerhost:5000

docker run -dit --restart unless-stopped --network host --cap-add=NET_ADMIN ncareau/tcgui:latest

You can change the configuration using these Environment Variables:

  • TCGUI_IP - Default 0.0.0.0 - Use to change listening address
  • TCGUI_PORT - Default 5000 - Use to change the listening port
  • TCGUI_DEV - The interfaces to restrict to
  • TCGUI_REGEX - A regex to match interfaces

If using an interface bridge, docker might cause issue with the bridge. (askubunut) To fix this, create a file /etc/docker/daemon.json with the following contents:

{
    "iptables" : false
}

Test & Develop

You can use the supplied Vagrantfile to test tcgui quickly. Vagrant will setup two machines, sender (192.168.210.2) and a receiver (192.168.210.3):

vagrant up

Afterwards connect to the sender and start the GUI:

vagrant ssh sender
cd /vagrant
sudo python3 main.py --ip 0.0.0.0 --debug

Start a receiver in the receiving VM:

vagrant ssh receiver
iperf3 -s

Send a packet stream from the sender to the receiver:

vagrant ssh sender
iperf3 -c 192.168.210.3 -t 300

Now access the GUI at http://192.168.210.2:5000/ and change the rate of interface eth1. You should see the sending/receiving rate to decrease to the set amount.

pre-commit git hooks

Setup

We use pre-commit to manage our git pre-commit hooks. pre-commit is automatically installed from requirements.txt. To set it up, call

git config --unset-all core.hooksPath  # may fail if you don't have any hooks set, but that's ok
pre-commit install --overwrite

Usage

With pre-commit, you don't use your linters/formatters directly anymore, but through pre-commit:

pre-commit run --file path/to/file1.cpp tools/second_file.py  # run on specific file(s)
pre-commit run --all-files  # run on all files tracked by git
pre-commit run --from-ref origin/master --to-ref HEAD  # run on all files changed on current branch, compared to master
pre-commit run <hook_id> --file <path_to_file>  # run specific hook on specific file
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].