Skip to content

A tc command wrapper. Make it easy to set up traffic control of network bandwidth/latency/packet-loss/packet-corruption/etc. to a network-interface/Docker-container(veth).

License

Notifications You must be signed in to change notification settings

thombashi/tcconfig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tcconfig

https://travis-ci.org/thombashi/tcconfig.svg?branch=master

Simple tc command wrapper. Easy to setup traffic control of network bandwidth/latency/packet-loss to a network interface.

The following parameters can be set of network interfaces.

  • Network bandwidth [G/M/K bps]
  • Network latency [milliseconds]
  • Packet loss rate [%]

Traffic control can specify the IP network and port to apply to.

tcconfig canbe installed via pip (Python package manager).

sudo pip install tcconfig

tcset is a command to impose traffic control to a network interface (device).

usage: tcset [-h] [--version] [--logging] [--stacktrace] [--debug | --quiet]
             --device DEVICE [--rate RATE] [--delay DELAY] [--loss LOSS]
             [--network NETWORK] [--port PORT] [--overwrite]

optional arguments:
  -h, --help         show this help message and exit
  --version          show program's version number and exit
  --debug            for debug print.
  --quiet            suppress output of execution log message.

Miscellaneous:
  --logging          output execution log to a file (tcset.log).
  --stacktrace       display stack trace when an error occurred.

Traffic Control:
  --device DEVICE    network device name
  --rate RATE        network bandwidth to apply the limit [K|M|G bps]
  --delay DELAY      round trip network delay [ms] (default=0)
  --loss LOSS        round trip packet loss rate [%] (default=0)
  --network NETWORK  destination network of traffic control
  --port PORT        destination port of traffic control
  --overwrite        overwrite existing setting
# tcset --device eth0 --rate 100k
# tcset --device eth0 --delay 100
# tcset --device eth0 --loss 0.1
# tcset --device eth0 --rate 100k --delay 100 --loss 0.1
# tcset --device eth0 --delay 100 --network 192.168.0.10
# tcset --device eth0 --delay 100 --network 192.168.0.0/24 --port 80

tcdel is a command to delete traffic control from a network interface (device).

usage: tcdel [-h] [--version] [--logging] [--stacktrace] [--debug | --quiet]
             --device DEVICE

optional arguments:
  -h, --help       show this help message and exit
  --version        show program's version number and exit
  --debug          for debug print.
  --quiet          suppress output of execution log message.

Miscellaneous:
  --logging        output execution log to a file (tcdel.log).
  --stacktrace     display stack trace when an error occurred.

Traffic Control:
  --device DEVICE  network device name
# tcdel --device eth0
  • iproute2 (reqrequired for tc commandured)

Dependency python packages are automatically installed during AAA installation via pip.

About

A tc command wrapper. Make it easy to set up traffic control of network bandwidth/latency/packet-loss/packet-corruption/etc. to a network-interface/Docker-container(veth).

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published