Hi,
I have a Debian based NAT router. How can I manage upstream egress
bandwidth based on the LAN ipadress in the network below? My goal is
that host1 get a minumum of 10Mbit up/down and host2 gets a minimum of
90Mbit up/down, both max 100Mbit up/down?
targethost
172.16.255.254
|
|
172.16.0.1
natrouter
172.31.255.254
|
|
+ ----------------------+
| |
172.31.0.1 172.31.0.2
host1 host2
TIA
--
Groeten,
Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
e-mail: J.Kraaijeveld@Askesis.nl
web: www.askesis.nl
> Hi,Hi> > I have a Debian based NAT router. How can I manage upstream egress > bandwidth based on the LAN ipadress in the network below? My goal is > that host1 get a minumum of 10Mbit up/down and host2 gets a minimum > of 90Mbit up/down, both max 100Mbit up/down? >You can use iptables MARK target in PREROUTING or FORWARD chain of nat table in conjuction with a fw filter (see tc filter help). Marek Kierdelewicz KoBa ISP
Hi Joost, This sounds like a situation where you would probably use HTB to shape your bandwidth. You can search the archives for info on HTB, read the LARTC pages but you may find more specific information relating to your situation at the below links. http://luxik.cdi.cz/%7Edevik/qos/htb/ Or you can just use this ready made HTB script on your server which should suit your problem description without much extra work on your behalf. http://sourceforge.net/projects/htbinit/ Regards, Lee On Thu, 20 Oct 2005 03:45 pm, Joost Kraaijeveld wrote:> Hi, > > I have a Debian based NAT router. How can I manage upstream egress > bandwidth based on the LAN ipadress in the network below? My goal is > that host1 get a minumum of 10Mbit up/down and host2 gets a minimum of > 90Mbit up/down, both max 100Mbit up/down? > > targethost > 172.16.255.254 > > > 172.16.0.1 > natrouter > 172.31.255.254 > > > + ----------------------+ > > 172.31.0.1 172.31.0.2 > host1 host2 > > > TIA
Buddies, When I run my HTB script it says the below message with "dmesg" what does that mean ? -------------------------------------------------------- HTB: quantum of class 10001 is big. Consider r2q change. HTB: quantum of class 10002 is big. Consider r2q change. HTB: quantum of class 10030 is small. Consider r2q change. HTB: quantum of class 10031 is small. Consider r2q change.
James Lista ha scritto:> Buddies, > > When I run my HTB script it says the below message with "dmesg" > what does that mean ? > HTB: quantum of class 10001 is big. Consider r2q change.The kernel calculate the quantum using rate / r2q (rate to quantum) which have a default value of 10. If the calculated value is less than 1000 then the quantum will have a value of 1000 and you get the message you posted. You should have a quantum value bigger than your MTU. -- ********************************************************************** Marco Innocenti Gruppo Infrastruttura e Sicurezza CINECA phone:+39 0516171553 / fax:+39 0516132198 Via Magnanelli 6/3 e-mail: innocenti@cineca.it 40033 Casalecchio di Reno Bologna (Italia) **********************************************************************
You really should search the list archives. This question has been asked a
dozen times in the last year.
Google also turned this up quite quickly.
http://www.docum.org/docum.org/faq/cache/31.html
To copy and paste some previous answers from the list. You will need to sort
these yourself.
It is documented in HTB manual. The complaint was not displayed
before and sharing was silently wrong.
Quantum of leaf should be between 1500 and 60000 and it is computed
as rate/r2q (or can be supplied independly).
So that if your maximal leaf rate is 1Mbit (120000Bps) then r2q
should be 3. If max rate is 10kbit (1200Bps) then r2q should be 1.
It is warning only and will not affect functionality, only precision.
devik
Smallest rate : 16kbit = 2 kilobyt / r2q (=10) = 200. And this is < 1500.
So
you get warnings.
Biggest rate : 100mbit = 12.5 mbyte / r2q = 1.2 Mbyte > 60.000. So you get
warnings.
If you do
tc qdisc add dev eth0 root handle 1: htb default 10 r2q 1
Smallest rate : 16kbit = 2kilobyte / r2k = 2000. And this is > 1500. So no
warnings.
Biggest rate : 100mbit = 12.5 mbyte / r2q = 12.5 Mbyte > 60.000. So you get
warnings. But you can overrule the quantum :
tc class add dev eth0 parent 1:1 classid 1:11 htb rate 128kbit burst 2k
quantum 60000
Quantum is used when 2 classes are getting more bandwidth then the rate. So
it''s only important for sharing the remaining bandwidth. In that case,
each
class may send quantum bytes.
If I understand the source, that message occours when you have a leaf
class whose calculated quantum (rate/r2q) is less than 1000 byte and the
kernel set the quantum to 1000 byte.
I''ve read that the quantum should be bigger than the MTU so I
don''t
understand why the kernel don''t use a minimum quantum value bigger than
1500. Someone has a clue?
From kernel-source-2.6.10/net/sched/sch_htb.c
if (!hopt->quantum && cl->un.leaf.quantum < 1000) {
printk(KERN_WARNING "HTB: quantum of class %X is small. Consider r2q
change.\n", cl->classid);
cl->un.leaf.quantum = 1000;
I hope this helps.
Regards,
Lee
On Thu, 20 Oct 2005 10:12 pm, James Lista wrote:> nsider r2q change.
> HTB: quantum of class 10002 is big. Consider r2q change.
> HTB: quantum of class 10030 is small. Consider r2q change.
> HTB: quantum of class 10031 is small. Consider r2q change.