ANN: pyshaper - for easy traffic-shaping
David McNab
david at rebirthing.co.nz
Sat Mar 13 08:23:35 EST 2004
Hi,
I've released an alpha of 'pyshaper' - a python prog which makes
traffic-shaping (bandwidth allocation/management) a snap.
Requires python2.2 or later, a 2.4 or later Linux kernel with some QoS
options compiled in, the iproute2 suite (available on all proper linux
distros) and optionally GeoIP as well.
pyshaper periodically netstats the current TCP connections, matches them
against your rules, and dynamically calculates/generates/executes 'tc'
commands in the background to control both inbound and outbound traffic
to your general requirements.
Configuration file syntax is very simple, and eliminates 98% of the pain
one would have to go through if hand-writing 'tc' scripts. In fact, you
don't need to know tc at all to use it.
In the pyshaper config file, you provide simple python expressions for
matching connections against criteria such as:
- local/remote host/port
- local program on the local end of the connection, the username under
which it is running, and its invocation arguments (and its pid)
- country in which remote host resides
With this flexibility, it is possible to detect and traffic-shape
programs which are otherwise hard to police (eg certain p2p apps which
talk on different ports), and for which there are no adequate
protocol-detecting shaper plugins available.
Intended usage of pyshaper is home systems/networks, where bandwidth is
limited, traffic consumption is a concern (eg internet connections with
strict traffic caps), and where there is a desire to have potentially
bandwidth-guzzling programs (eg p2p apps like Freenet) running 24/7),
and where one wants to guarantee good bandwidth for critical
communications (eg web/mail server).
GPL (of course)
Info and downloads at http://www.freenet.org.nz/python/pyshaper
Caveats:
- it's in alpha - only tested on Debian sid with kernel 2.6.4
- worst-case scenario - no system damage, but possible bugs might
cause it to not work as well as desired.
Enjoy!
--
Kind regards
David
--
leave this line intact so your email gets through my junk mail filter
More information about the Python-list
mailing list