Skip to contentSkip to conversation

TBF algorithm/usage

LARTC Radu-Mihail Obada 2 participants 3 messages Dec 10, 2002

lore
Share & tools
lore
#0 lore raw

Hello everyone,
I have a (mini) Linux router, which goes "out" through eth0; eth0 is capable of almost 2Mbit of bandwith (well, actually it's like 10Mbit, but you wouldn't care less). Now, say I want to limit _everything_, like in every connection. So naturally, after carefully reading the man pages and that excellent HOWTO, I resort to TBF. I fiddle a lit with this, but after a couple of hours of intense experimentation, I find that it doesn't do what I really want it to.
Specifically, I want _every_ connection to use _at most_ (say) 16kbps, never more, even if there is some bandwidth to borrow from. But TBF doesn't seem to do just that (or I don't understand its inner working, which I kinda don't). And what does burst mean/do? tc-tbf(8) says that I would never need to modify this, but tc qdisc add ... root tbf always requires it.
Thanks in advance.

Signature · 5 lines
Radu-Mihail Obada

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#1 lore raw
Quoted 7 lines · Radu-Mihail Obada

Hello everyone,
I have a (mini) Linux router, which goes "out" through eth0; eth0 is capable of almost 2Mbit of bandwith (well, actually it's like 10Mbit, but you wouldn't care less). Now, say I want to limit _everything_, like in every connection. So naturally, after carefully reading the man pages and that excellent HOWTO, I resort to TBF. I fiddle a lit with this, but after a couple of hours of intense experimentation, I find that it

Quoted 8 lines

doesn't do what I really want it to.
Specifically, I want _every_ connection to use _at most_ (say) 16kbps, never more, even if there is some bandwidth to borrow from. But TBF doesn't seem to do just that (or I don't understand its inner working, which I kinda don't). And what does burst mean/do? tc-tbf(8) says that I would never need to modify this, but tc qdisc add ... root tbf always requires it.
Thanks in advance.

Tbf limits all bandwidth that leaves the NIC. What you want to do, limit each connection to a certain bandwidth, is not so easy to implement. If you want to do it per ip-address, or port, you can create a cbq or htb setup. So you can put each connection in a different class and limit the speed it can get. The filtering can be done on ports and/or ip-addresses. But if you want a class for each connection, you will need a lot of classes.

Stef

Signature · 8 lines
[email protected]
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#2 lore raw
In reply to Radu-Mihail Obada

Ok, I guess I got the point. And I think this is not exactly what I want to do. Thanks for your help.

Quoted 16 lines

Tbf limits all bandwidth that leaves the NIC. What you want to do, limit each connection to a certain bandwidth, is not so easy to implement. If you want to do it per ip-address, or port, you can create a cbq or htb setup. So you can put each connection in a different class and limit the speed it can get. The filtering can be done on ports and/or ip-addresses. But if you want a class for each connection, you will need a lot of classes.

Stef

Signature · 4 lines
[email protected]
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net
Signature · 7 lines
Radu-Mihail Obada
System administrator & web programmer,
Faculty of Mathematics and Computer Science,
University of Bucharest
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/