From: Carl-Daniel Hailfinger Date: Sat, 04 Jun 2005 12:45:30 +0000 Subject: [LARTC] New HTB-derived qdisc for accounting? Message-Id: <42A1A26A.1010700@gmx.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org Hi, at my local university network, I have to make sure no student uploads more than x GB/day. So far, I give them unlimited bandwidth until they have more than y GB (yhtbq_squota)?((htbq_quota-alreadysent)/remtime):htbq_rate) htb_ceil=htbq_ceil //this is just passed on htb_burst=htbq_burst htb_cburst=htbq_cburst htb_prio=htbq_prio htb_quantum=htbq_quantum //should be set automatically htbq_interval seconds //time after which quota is reset htbq_starttime seconds //time when the first interval starts htbq_quota bytes //maximum allowed bytes htbq_squota bytes //unshaped quota htbq_rate is optional, unlimited if not set htbq_ceil is optional htbq_burst is optional htbq_cburst is optional htbq_prio is mandantory htbq_quantum is optional htbq_interval is mandantory htbq_starttime is optional, defaults to unixtime 0 htbq_quota is mandantory htbq_squota is optional, defaults to 0 (shape from beginning) Basic description: Case 1: already sent bytes are less than htbq_squota if htbq_{rate,ceil,burst,cburst,quantum} is set then do normal htb shaping with copied parameters else pass on packets directly to network device Case 2: already sent bytes are greater or equal than htbq_squota if htbq_{rate,ceil,burst,cburst,quantum} is set then do htb shaping with copied parameters except htb_rate=min(htbq_rate, (htbq_quota-alreadysent)/remtime) htb_ceil=min(htbq_ceil, (htbq_quota-alreadysent)/remtime) else do htb shaping with following parameters htb_rate=(htbq_quota-alreadysent)/remtime htb_ceil=(htbq_quota-alreadysent)/remtime This would surely be helpful for some admins who have to limit users to a certain quota without constantly shaping their network traffic or pulling the plug once the quota is full. Thoughts? Regards, Carl-Daniel -- http://www.hailfinger.org/ _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc