Mesh/Bandwidth Quotas

From Sudo Room
Jump to navigation Jump to search

See Also: Technical Documentation, Monitoring

notes about bandwidth monitoring and quotas

The system can apportion the shareable bandwidth to a percentage of total bandwidth available. The goal is to find a way to cap bandwidth usage, in and out. Here we research how this can be done.

monitoring

to track bandwidth we need a way to quantify it. Here are some likely candidates:

  • bandwidthd - very popular, but apparently it is resource heavy
  • bmon - download it
  • iftop, man page - "iftop does for network usage what top(1) does for CPU usage. It listens to network traffic on a named interface and displays a table of current bandwidth usage by pairs of hosts."

monthly quota

ipt-account is an iptables module capable of recording e.g. traffic usage on different interfaces and subnets. This is what the EFF open wireless router uses. They currently use a python script that calls the iptaccount command to get usage info and display it in the browser.

The EFF wireless firmware probably intermittently calls this script which accumulates bytes used in a UCI config file. We could do something similar but with a lua script called by a cron job that simply takes down the tunnel when the quota is reached.

There is also an iptables module called quota which can automatically enable/disable iptable rules when a quota is reached. It is not clear if it can be used to count both upstream and downstream bandwidth towards one total quota and it also has no built-in mechanism to persist the usage count between reboots.

tc − show / manipulate traffic control settings

Tc is used to configure Traffic Control in the Linux kernel.

QOS

Quality of Service (qos-scripts) configuration

Once we have the monitoring in hand we can then handle the bandwidth caps. We might want to cut off access once the limit has been reached.

ubus

OpenWrt micro bus architecture - there is a Lua module for ubus...