All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] Problem with HTB accurancy
@ 2003-02-27 22:10 Alexandra Alvarado
  2003-02-28  7:44 ` Stef Coene
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Alexandra Alvarado @ 2003-02-27 22:10 UTC (permalink / raw)
  To: lartc

[-- Attachment #1: Type: text/plain, Size: 10230 bytes --]

>> Hello, I'm Alexandra Alvarado
>>
>> I've been working with linux and CBQ with a long time, but know  I
>> want to migrate to HTB, and I'm testing it in a linux with the next
>> features:
>>
>> - Pentium IV 1.7 Ghz
>> - 256 MB
>> - 1 3Com 3C905B
>> - 1 3Com 3C905C
>> - Red Hat 8.0
>> - Kernel 2.4.20
>> - iproute-2.4.7-7
>> - Squid - Transparent Proxy
>> - VPN
>> - Named
>> - Reiserfs
>> - SNMP
>> - HTB (The configuration is in the attached file)
>>
>> My problem is that rrdtool graph shows :
>>
>>     ETH0 IN:        596.99Kbps
>>     ETH0 OUT:    100.71Kbps
>>
>>     ETH1 IN:        74.44Kbps
>>     ETH1 OUT:    150.13Kbps
>>
>> And the configuration has a ceil of 384Kbit
>>
>> What I'm doing wrong??
>>
>> I suppose that it could be with Squid Transparent Proxy, but in HTB
>> I have a default classid 20,
>> that is where must go any not specified traffic, how can I solve my
>> problem?
>>
>> Thanks
>>
>> Alexandra Alvarado
>>
>>
>>
>>     --------------------------------------------------------------
>> #!/bin/sh
>>
>> iptables -F -t mangle
>>
>> # ===>> Control de Trafico de Salida << === #
>>
>> # ===>> PC1 <<=== #
>> iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.194 -j MARK --set-mark 1
>> iptables -A PREROUTING -t mangle -p udp -s 207.100.136.194 -j MARK --set-mark 1
>>
>> # ===>> PC2 <<=== #
>> iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.199 -j MARK --set-mark 3
>> iptables -A PREROUTING -t mangle -p udp -s 207.100.136.199 -j MARK --set-mark 3
>>
>> # ===>> PC3 <<=== #
>> iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.201 -j MARK --set-mark 5
>> iptables -A PREROUTING -t mangle -p udp -s 207.100.136.201 -j MARK --set-mark 5
>>
>> # ===>> Resto de la Red Privada <<=== #
>> iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.0/25 -j MARK --set-mark 7
>> iptables -A PREROUTING -t mangle -p udp -s 207.100.136.0/25 -j MARK --set-mark 7
>>
>> iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.128/26 -j MARK --set-mark 7
>> iptables -A PREROUTING -t mangle -p udp -s 207.100.136.128/26 -j MARK --set-mark 7
>>
>> iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.192 -j MARK --set-mark 7
>> iptables -A PREROUTING -t mangle -p udp -s 207.100.136.192 -j MARK --set-mark 7
>>
>> iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.193 -j MARK --set-mark 7
>> iptables -A PREROUTING -t mangle -p udp -s 207.100.136.193 -j MARK --set-mark 7
>>
>> iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.195 -j MARK --set-mark 7
>> iptables -A PREROUTING -t mangle -p udp -s 207.100.136.195 -j MARK --set-mark 7
>>
>> iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.196 -j MARK --set-mark 7
>> iptables -A PREROUTING -t mangle -p udp -s 207.100.136.196 -j MARK --set-mark 7
>>
>> iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.197 -j MARK --set-mark 7
>> iptables -A PREROUTING -t mangle -p udp -s 207.100.136.197 -j MARK --set-mark 7
>>
>> iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.198 -j MARK --set-mark 7
>> iptables -A PREROUTING -t mangle -p udp -s 207.100.136.198 -j MARK --set-mark 7
>>
>> iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.200 -j MARK --set-mark 7
>> iptables -A PREROUTING -t mangle -p udp -s 207.100.136.200 -j MARK --set-mark 7
>>
>> iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.202 -j MARK --set-mark 7
>> iptables -A PREROUTING -t mangle -p udp -s 207.100.136.202 -j MARK --set-mark 7
>>
>> iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.203 -j MARK --set-mark 7
>> iptables -A PREROUTING -t mangle -p udp -s 207.100.136.203 -j MARK --set-mark 7
>>
>> iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.204 -j MARK --set-mark 7
>> iptables -A PREROUTING -t mangle -p udp -s 207.100.136.204 -j MARK --set-mark 7
>>
>> iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.205 -j MARK --set-mark 7
>> iptables -A PREROUTING -t mangle -p udp -s 207.100.136.205 -j MARK --set-mark 7
>>
>> iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.206 -j MARK --set-mark 7
>> iptables -A PREROUTING -t mangle -p udp -s 207.100.136.206 -j MARK --set-mark 7
>>
>> iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.207 -j MARK --set-mark 7
>> iptables -A PREROUTING -t mangle -p udp -s 207.100.136.207 -j MARK --set-mark 7
>>
>> iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.208/28 -j MARK --set-mark 7
>> iptables -A PREROUTING -t mangle -p udp -s 207.100.136.208/28 -j MARK --set-mark 7
>>
>> iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.224/27 -j MARK --set-mark 7
>> iptables -A PREROUTING -t mangle -p udp -s 207.100.136.224/27 -j MARK --set-mark 7
>>
>> tc qdisc del dev eth0 root handle 1:
>>
>> tc qdisc add dev eth0 root handle 1: htb default 20
>> tc class add dev eth0 parent 1: classid 1:1 htb rate 100mbit ceil 384kbit burst 2k
>> tc class add dev eth0 parent 1:1 classid 1:10 htb rate 56kbit ceil 64kbit burst 2k
>> tc class add dev eth0 parent 1:1 classid 1:11 htb rate 56kbit ceil 64kbit burst 2k
>> tc class add dev eth0 parent 1:1 classid 1:12 htb rate 56kbit ceil 64kbit burst 2k
>> tc class add dev eth0 parent 1:1 classid 1:13 htb rate 56kbit ceil 64kbit burst 2k
>> tc class add dev eth0 parent 1:1 classid 1:14 htb rate 56kbit ceil 64kbit burst 2k
>> tc class add dev eth0 parent 1:1 classid 1:20 htb rate 100kbit ceil 128kbit burst 2k
>>
>> tc filter add dev eth0 parent 1: protocol ip prio 1 handle 1 fw classid 1:10
>> tc filter add dev eth0 parent 1: protocol ip prio 3 handle 3 fw classid 1:11
>> tc filter add dev eth0 parent 1: protocol ip prio 3 handle 5 fw classid 1:12
>> tc filter add dev eth0 parent 1: protocol ip prio 3 handle 7 fw classid 1:13
>>
>> # ===>> Control de Trafico de Entrada << === #
>>
>> # ===>> PC1 <<=== #
>> iptables -A POSTROUTING -t mangle -p tcp -d 207.100.136.194 -j MARK --set-mark 2
>> iptables -A POSTROUTING -t mangle -p udp -d 207.100.136.194 -j MARK --set-mark 2
>>
>> # ===>> PC2 <<=== #
>> iptables -A POSTROUTING -t mangle -p tcp -d 207.100.136.199 -j MARK --set-mark 4
>> iptables -A POSTROUTING -t mangle -p udp -d 207.100.136.199 -j MARK --set-mark 4
>>
>> # ===>> PC3 <<=== #
>> iptables -A POSTROUTING -t mangle -p tcp -d 207.100.136.201 -j MARK --set-mark 6
>> iptables -A POSTROUTING -t mangle -p udp -d 207.100.136.201 -j MARK --set-mark 6
>>
>> # ===>> Resto de la Red Privada <<=== #
>> iptables -A POSTROUTING -t mangle -p tcp -d 207.100.136.0/25 -j MARK --set-mark 8
>> iptables -A POSTROUTING -t mangle -p udp -d 207.100.136.0/25 -j MARK --set-mark 8
>>
>> iptables -A POSTROUTING -t mangle -p tcp -d 207.100.136.128/26 -j MARK --set-mark 8
>> iptables -A POSTROUTING -t mangle -p udp -d 207.100.136.128/26 -j MARK --set-mark 8
>>
>> iptables -A POSTROUTING -t mangle -p tcp -d 207.100.136.192 -j MARK --set-mark 8
>> iptables -A POSTROUTING -t mangle -p udp -d 207.100.136.192 -j MARK --set-mark 8
>>
>> iptables -A POSTROUTING -t mangle -p tcp -d 207.100.136.193 -j MARK --set-mark 8
>> iptables -A POSTROUTING -t mangle -p udp -d 207.100.136.193 -j MARK --set-mark 8
>>
>> iptables -A POSTROUTING -t mangle -p tcp -d 207.100.136.195 -j MARK --set-mark 8
>> iptables -A POSTROUTING -t mangle -p udp -d 207.100.136.195 -j MARK --set-mark 8
>>
>> iptables -A POSTROUTING -t mangle -p tcp -d 207.100.136.196 -j MARK --set-mark 8
>> iptables -A POSTROUTING -t mangle -p udp -d 207.100.136.196 -j MARK --set-mark 8
>>
>> iptables -A POSTROUTING -t mangle -p tcp -d 207.100.136.197 -j MARK --set-mark 8
>> iptables -A POSTROUTING -t mangle -p udp -d 207.100.136.197 -j MARK --set-mark 8
>>
>> iptables -A POSTROUTING -t mangle -p tcp -d 207.100.136.198 -j MARK --set-mark 8
>> iptables -A POSTROUTING -t mangle -p udp -d 207.100.136.198 -j MARK --set-mark 8
>>
>> iptables -A POSTROUTING -t mangle -p tcp -d 207.100.136.200 -j MARK --set-mark 8
>> iptables -A POSTROUTING -t mangle -p udp -d 207.100.136.200 -j MARK --set-mark 8
>>
>> iptables -A POSTROUTING -t mangle -p tcp -d 207.100.136.202 -j MARK --set-mark 8
>> iptables -A POSTROUTING -t mangle -p udp -d 207.100.136.202 -j MARK --set-mark 8
>>
>> iptables -A POSTROUTING -t mangle -p tcp -d 207.100.136.203 -j MARK --set-mark 8
>> iptables -A POSTROUTING -t mangle -p udp -d 207.100.136.203 -j MARK --set-mark 8
>>
>> iptables -A POSTROUTING -t mangle -p tcp -d 207.100.136.204 -j MARK --set-mark 8
>> iptables -A POSTROUTING -t mangle -p udp -d 207.100.136.204 -j MARK --set-mark 8
>>
>> iptables -A POSTROUTING -t mangle -p tcp -d 207.100.136.205 -j MARK --set-mark 8
>> iptables -A POSTROUTING -t mangle -p udp -d 207.100.136.205 -j MARK --set-mark 8
>>
>> iptables -A POSTROUTING -t mangle -p tcp -d 207.100.136.206 -j MARK --set-mark 8
>> iptables -A POSTROUTING -t mangle -p udp -d 207.100.136.206 -j MARK --set-mark 8
>>
>> iptables -A POSTROUTING -t mangle -p tcp -d 207.100.136.207 -j MARK --set-mark 8
>> iptables -A POSTROUTING -t mangle -p udp -d 207.100.136.207 -j MARK --set-mark 8
>>
>> iptables -A POSTROUTING -t mangle -p tcp -d 207.100.136.208/28 -j MARK --set-mark 8
>> iptables -A POSTROUTING -t mangle -p udp -d 207.100.136.208/28 -j MARK --set-mark 8
>>
>> iptables -A POSTROUTING -t mangle -p tcp -d 207.100.136.224/27 -j MARK --set-mark 8
>> iptables -A POSTROUTING -t mangle -p udp -d 207.100.136.224/27 -j MARK --set-mark 8
>>
>> tc qdisc del dev eth1 root handle 1:
>>
>> tc qdisc add dev eth1 root handle 1: htb default 20
>> tc class add dev eth1 parent 1: classid 1:1 htb rate 100mbit ceil 384kbit burst 2k
>> tc class add dev eth1 parent 1:1 classid 1:10 htb rate 56kbit ceil 64kbit burst 2k
>> tc class add dev eth1 parent 1:1 classid 1:11 htb rate 56kbit ceil 64kbit burst 2k
>> tc class add dev eth1 parent 1:1 classid 1:12 htb rate 56kbit ceil 64kbit burst 2k
>> tc class add dev eth1 parent 1:1 classid 1:13 htb rate 56kbit ceil 64kbit burst 2k
>> tc class add dev eth1 parent 1:1 classid 1:20 htb rate 100kbit ceil 128kbit burst 2k
>>
>> tc filter add dev eth1 parent 1: protocol ip prio 1 handle 2 fw classid 1:10
>> tc filter add dev eth1 parent 1: protocol ip prio 3 handle 4 fw classid 1:11
>> tc filter add dev eth1 parent 1: protocol ip prio 3 handle 6 fw classid 1:13
>> tc filter add dev eth1 parent 1: protocol ip prio 3 handle 8 fw classid 1:14
>>
>> # === >> Fin << === #
>>

[-- Attachment #2: Type: text/html, Size: 10149 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [LARTC] Problem with HTB accurancy
  2003-02-27 22:10 [LARTC] Problem with HTB accurancy Alexandra Alvarado
@ 2003-02-28  7:44 ` Stef Coene
  2003-03-06 16:34 ` Alexandra Alvarado
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Stef Coene @ 2003-02-28  7:44 UTC (permalink / raw)
  To: lartc


> >> My problem is that rrdtool graph shows :
> >>
> >>     ETH0 IN:        596.99Kbps
> >>     ETH0 OUT:    100.71Kbps
> >>
> >>     ETH1 IN:        74.44Kbps
> >>     ETH1 OUT:    150.13Kbps
> >>
> >> And the configuration has a ceil of 384Kbit
> >>
> >> What I'm doing wrong??
> >>
> >> I suppose that it could be with Squid Transparent Proxy, but in HTB
> >> I have a default classid 20,
> >> that is where must go any not specified traffic, how can I solve my
> >> problem?

> >> tc qdisc add dev eth0 root handle 1: htb default 20
> >> tc class add dev eth0 parent 1: classid 1:1 htb rate 100mbit ceil
> >> 384kbit burst 2k tc class add dev eth0 parent 1:1 classid 1:10 htb rate
> >> 56kbit ceil 64kbit burst 2k tc class add dev eth0 parent 1:1 classid
> >> 1:11 htb rate 56kbit ceil 64kbit burst 2k tc class add dev eth0 parent
> >> 1:1 classid 1:12 htb rate 56kbit ceil 64kbit burst 2k tc class add dev
> >> eth0 parent 1:1 classid 1:13 htb rate 56kbit ceil 64kbit burst 2k tc
> >> class add dev eth0 parent 1:1 classid 1:14 htb rate 56kbit ceil 64kbit
> >> burst 2k tc class add dev eth0 parent 1:1 classid 1:20 htb rate 100kbit
> >> ceil 128kbit burst 2k
My reply messed up the layout.  But 2kbit is too low for the burst.  Remove 
the burst parameter and htb will calculate the best burst for you.

> >> tc filter add dev eth0 parent 1: protocol ip prio 1 handle 1 fw classid
> >> 1:10 tc filter add dev eth0 parent 1: protocol ip prio 3 handle 3 fw
> >> classid 1:11 tc filter add dev eth0 parent 1: protocol ip prio 3 handle
> >> 5 fw classid 1:12 tc filter add dev eth0 parent 1: protocol ip prio 3
> >> handle 7 fw classid 1:13
You can give each filter the same prio.

If you go to http://www.docum.org/stef.coene/qos/monitor/ you can download my 
monitor_tc.pl script.  It will calculate the bandwidth but it will use the tc 
counters.  So you know exactly how much each class is sending.

Stef

-- 

stef.coene@docum.org
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [LARTC] Problem with HTB accurancy
  2003-02-27 22:10 [LARTC] Problem with HTB accurancy Alexandra Alvarado
  2003-02-28  7:44 ` Stef Coene
@ 2003-03-06 16:34 ` Alexandra Alvarado
  2003-03-07 17:15 ` Alexandra Alvarado
  2003-03-08 20:34 ` Stef Coene
  3 siblings, 0 replies; 5+ messages in thread
From: Alexandra Alvarado @ 2003-03-06 16:34 UTC (permalink / raw)
  To: lartc

[-- Attachment #1: Type: text/plain, Size: 2491 bytes --]

Hello,

I've tested removing de burst parameter in the htb config, and
I have de next results: [Attached File]

Is the HTB exact or not?

Now I've changed bw to 448Kbps or 56KBps, but in the graph
I have a maximum of 77.5KBps. Why???

Thanks!!!

Alexandra Alvarado

PD:  I can't use monitor_tc.pl, because iptables chain doesn't work
with PREROUTING : (


Stef Coene wrote:

> > >> My problem is that rrdtool graph shows :
> > >>
> > >>     ETH0 IN:        596.99Kbps
> > >>     ETH0 OUT:    100.71Kbps
> > >>
> > >>     ETH1 IN:        74.44Kbps
> > >>     ETH1 OUT:    150.13Kbps
> > >>
> > >> And the configuration has a ceil of 384Kbit
> > >>
> > >> What I'm doing wrong??
> > >>
> > >> I suppose that it could be with Squid Transparent Proxy, but in HTB
> > >> I have a default classid 20,
> > >> that is where must go any not specified traffic, how can I solve my
> > >> problem?
>
> > >> tc qdisc add dev eth0 root handle 1: htb default 20
> > >> tc class add dev eth0 parent 1: classid 1:1 htb rate 100mbit ceil
> > >> 384kbit burst 2k tc class add dev eth0 parent 1:1 classid 1:10 htb rate
> > >> 56kbit ceil 64kbit burst 2k tc class add dev eth0 parent 1:1 classid
> > >> 1:11 htb rate 56kbit ceil 64kbit burst 2k tc class add dev eth0 parent
> > >> 1:1 classid 1:12 htb rate 56kbit ceil 64kbit burst 2k tc class add dev
> > >> eth0 parent 1:1 classid 1:13 htb rate 56kbit ceil 64kbit burst 2k tc
> > >> class add dev eth0 parent 1:1 classid 1:14 htb rate 56kbit ceil 64kbit
> > >> burst 2k tc class add dev eth0 parent 1:1 classid 1:20 htb rate 100kbit
> > >> ceil 128kbit burst 2k
> My reply messed up the layout.  But 2kbit is too low for the burst.  Remove
> the burst parameter and htb will calculate the best burst for you.
>
> > >> tc filter add dev eth0 parent 1: protocol ip prio 1 handle 1 fw classid
> > >> 1:10 tc filter add dev eth0 parent 1: protocol ip prio 3 handle 3 fw
> > >> classid 1:11 tc filter add dev eth0 parent 1: protocol ip prio 3 handle
> > >> 5 fw classid 1:12 tc filter add dev eth0 parent 1: protocol ip prio 3
> > >> handle 7 fw classid 1:13
> You can give each filter the same prio.
>
> If you go to http://www.docum.org/stef.coene/qos/monitor/ you can download my
> monitor_tc.pl script.  It will calculate the bandwidth but it will use the tc
> counters.  So you know exactly how much each class is sending.
>
> Stef
>
> --
>
> stef.coene@docum.org
>  "Using Linux as bandwidth manager"
>      http://www.docum.org/
>      #lartc @ irc.oftc.net

[-- Attachment #2: proxytelco.telconet.net.2-day.gif --]
[-- Type: image/gif, Size: 12256 bytes --]

[-- Attachment #3: htb.init --]
[-- Type: text/plain, Size: 6058 bytes --]

#!/bin/sh

# ================================ #
# ===>>  Alexandra Alvarado << === #
# ===>> Febrero 24 del 2003 << === #
# ================================ #

iptables -F -t mangle
iptables -X

# ===>> Control de Trafico de Salida << === #

# ===>> 1 <<=== #
iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.194 -j MARK --set-mark 1
iptables -A PREROUTING -t mangle -p udp -s 207.100.136.194 -j MARK --set-mark 1

# ===>> 2 <<=== #
iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.199 -j MARK --set-mark 3
iptables -A PREROUTING -t mangle -p udp -s 207.100.136.199 -j MARK --set-mark 3

# ===>> 3 <<=== #
iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.201 -j MARK --set-mark 5
iptables -A PREROUTING -t mangle -p udp -s 207.100.136.201 -j MARK --set-mark 5

# ===>> 4 <<=== #
iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.230/28 -j MARK --set-mark 7
iptables -A PREROUTING -t mangle -p udp -s 207.100.136.230/28 -j MARK --set-mark 7

# ===>> 5 <<=== #
iptables -A PREROUTING -t mangle -p tcp -s 200.81.91.195 -j MARK --set-mark 9 
iptables -A PREROUTING -t mangle -p udp -s 200.81.91.195 -j MARK --set-mark 9 

iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.248 -j MARK --set-mark 9 
iptables -A PREROUTING -t mangle -p udp -s 207.100.136.248 -j MARK --set-mark 9 

# ===>> 6 <<=== #
iptables -A PREROUTING -t mangle -p tcp -s 200.81.91.188 -j MARK --set-mark 11
iptables -A PREROUTING -t mangle -p udp -s 200.81.91.188 -j MARK --set-mark 11

iptables -A PREROUTING -t mangle -p tcp -s 200.81.91.189 -j MARK --set-mark 11 
iptables -A PREROUTING -t mangle -p udp -s 200.81.91.189 -j MARK --set-mark 11 

iptables -A PREROUTING -t mangle -p tcp -s 200.81.91.200 -j MARK --set-mark 11 
iptables -A PREROUTING -t mangle -p udp -s 200.81.91.200 -j MARK --set-mark 11 

iptables -A PREROUTING -t mangle -p tcp -s 200.81.91.201 -j MARK --set-mark 11 
iptables -A PREROUTING -t mangle -p udp -s 200.81.91.201 -j MARK --set-mark 11

tc qdisc del dev eth0 root handle 1:

tc qdisc add dev eth0 root handle 1: htb default 20
tc class add dev eth0 parent 1: classid 1:1 htb rate 100mbit ceil 448kbit
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 56kbit ceil 64kbit
tc class add dev eth0 parent 1:1 classid 1:11 htb rate 56kbit ceil 64kbit
tc class add dev eth0 parent 1:1 classid 1:12 htb rate 56kbit ceil 64kbit
tc class add dev eth0 parent 1:1 classid 1:13 htb rate 56kbit ceil 64kbit
tc class add dev eth0 parent 1:1 classid 1:14 htb rate 56kbit ceil 64kbit
tc class add dev eth0 parent 1:1 classid 1:15 htb rate 56kbit ceil 64kbit
tc class add dev eth0 parent 1:1 classid 1:20 htb rate 56kbit ceil 64kbit

tc filter add dev eth0 parent 1: protocol ip prio 1 handle 1 fw classid 1:10
tc filter add dev eth0 parent 1: protocol ip prio 3 handle 3 fw classid 1:11
tc filter add dev eth0 parent 1: protocol ip prio 3 handle 5 fw classid 1:12
tc filter add dev eth0 parent 1: protocol ip prio 3 handle 7 fw classid 1:13
tc filter add dev eth0 parent 1: protocol ip prio 3 handle 9 fw classid 1:14
tc filter add dev eth0 parent 1: protocol ip prio 3 handle 11 fw classid 1:15

# ===>> Control de Trafico de Entrada << === # 

# ===>> 1 <<=== #
iptables -A POSTROUTING -t mangle -p tcp -d 207.100.136.194 -j MARK --set-mark 2
iptables -A POSTROUTING -t mangle -p udp -d 207.100.136.194 -j MARK --set-mark 2

# ===>> 2 <<=== #
iptables -A POSTROUTING -t mangle -p tcp -d 207.100.136.199 -j MARK --set-mark 4
iptables -A POSTROUTING -t mangle -p udp -d 207.100.136.199 -j MARK --set-mark 4

# ===>> 3 <<=== #
iptables -A POSTROUTING -t mangle -p tcp -d 207.100.136.201 -j MARK --set-mark 6
iptables -A POSTROUTING -t mangle -p udp -d 207.100.136.201 -j MARK --set-mark 6

# ===>> 4 <<=== #
iptables -A PREROUTING -t mangle -p tcp -d 207.100.136.230/28 -j MARK --set-mark 8
iptables -A PREROUTING -t mangle -p udp -d 207.100.136.230/28 -j MARK --set-mark 8

# ===>> 5 <<=== #
iptables -A PREROUTING -t mangle -p tcp -d 200.81.91.195 -j MARK --set-mark 10 
iptables -A PREROUTING -t mangle -p udp -d 200.81.91.195 -j MARK --set-mark 10 

iptables -A PREROUTING -t mangle -p tcp -d 207.100.136.248 -j MARK --set-mark 10
iptables -A PREROUTING -t mangle -p udp -d 207.100.136.248 -j MARK --set-mark 10

# ===>> 6 <<=== #
iptables -A PREROUTING -t mangle -p tcp -d 200.81.91.188 -j MARK --set-mark 12
iptables -A PREROUTING -t mangle -p udp -d 200.81.91.188 -j MARK --set-mark 12

iptables -A PREROUTING -t mangle -p tcp -d 200.81.91.189 -j MARK --set-mark 12 
iptables -A PREROUTING -t mangle -p udp -d 200.81.91.189 -j MARK --set-mark 12 

iptables -A PREROUTING -t mangle -p tcp -d 200.81.91.200 -j MARK --set-mark 12 
iptables -A PREROUTING -t mangle -p udp -d 200.81.91.200 -j MARK --set-mark 12 

iptables -A PREROUTING -t mangle -p tcp -d 200.81.91.201 -j MARK --set-mark 12 
iptables -A PREROUTING -t mangle -p udp -d 200.81.91.201 -j MARK --set-mark 12

tc qdisc del dev eth1 root handle 1:

tc qdisc add dev eth1 root handle 1: htb default 20
tc class add dev eth1 parent 1: classid 1:1 htb rate 100mbit ceil 448kbit
tc class add dev eth1 parent 1:1 classid 1:10 htb rate 56kbit ceil 64kbit
tc class add dev eth1 parent 1:1 classid 1:11 htb rate 56kbit ceil 64kbit
tc class add dev eth1 parent 1:1 classid 1:12 htb rate 56kbit ceil 64kbit
tc class add dev eth1 parent 1:1 classid 1:13 htb rate 56kbit ceil 64kbit
tc class add dev eth1 parent 1:1 classid 1:14 htb rate 56kbit ceil 64kbit
tc class add dev eth1 parent 1:1 classid 1:15 htb rate 56kbit ceil 64kbit
tc class add dev eth1 parent 1:1 classid 1:20 htb rate 56kbit ceil 64kbit

tc filter add dev eth1 parent 1: protocol ip prio 1 handle 2 fw classid 1:10
tc filter add dev eth1 parent 1: protocol ip prio 3 handle 4 fw classid 1:11
tc filter add dev eth1 parent 1: protocol ip prio 3 handle 6 fw classid 1:12
tc filter add dev eth1 parent 1: protocol ip prio 3 handle 8 fw classid 1:13
tc filter add dev eth1 parent 1: protocol ip prio 3 handle 10 fw classid 1:14
tc filter add dev eth1 parent 1: protocol ip prio 3 handle 12 fw classid 1:15

# === >> Fin << === #

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [LARTC] Problem with HTB accurancy
  2003-02-27 22:10 [LARTC] Problem with HTB accurancy Alexandra Alvarado
  2003-02-28  7:44 ` Stef Coene
  2003-03-06 16:34 ` Alexandra Alvarado
@ 2003-03-07 17:15 ` Alexandra Alvarado
  2003-03-08 20:34 ` Stef Coene
  3 siblings, 0 replies; 5+ messages in thread
From: Alexandra Alvarado @ 2003-03-07 17:15 UTC (permalink / raw)
  To: lartc

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: Type: message/rfc822, Size: 27923 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 2491 bytes --]

Hello,

I've tested removing de burst parameter in the htb config, and
I have de next results: [Attached File]

Is the HTB exact or not?

Now I've changed bw to 448Kbps or 56KBps, but in the graph
I have a maximum of 77.5KBps. Why???

Thanks!!!

Alexandra Alvarado

PD:  I can't use monitor_tc.pl, because iptables chain doesn't work
with PREROUTING : (


Stef Coene wrote:

> > >> My problem is that rrdtool graph shows :
> > >>
> > >>     ETH0 IN:        596.99Kbps
> > >>     ETH0 OUT:    100.71Kbps
> > >>
> > >>     ETH1 IN:        74.44Kbps
> > >>     ETH1 OUT:    150.13Kbps
> > >>
> > >> And the configuration has a ceil of 384Kbit
> > >>
> > >> What I'm doing wrong??
> > >>
> > >> I suppose that it could be with Squid Transparent Proxy, but in HTB
> > >> I have a default classid 20,
> > >> that is where must go any not specified traffic, how can I solve my
> > >> problem?
>
> > >> tc qdisc add dev eth0 root handle 1: htb default 20
> > >> tc class add dev eth0 parent 1: classid 1:1 htb rate 100mbit ceil
> > >> 384kbit burst 2k tc class add dev eth0 parent 1:1 classid 1:10 htb rate
> > >> 56kbit ceil 64kbit burst 2k tc class add dev eth0 parent 1:1 classid
> > >> 1:11 htb rate 56kbit ceil 64kbit burst 2k tc class add dev eth0 parent
> > >> 1:1 classid 1:12 htb rate 56kbit ceil 64kbit burst 2k tc class add dev
> > >> eth0 parent 1:1 classid 1:13 htb rate 56kbit ceil 64kbit burst 2k tc
> > >> class add dev eth0 parent 1:1 classid 1:14 htb rate 56kbit ceil 64kbit
> > >> burst 2k tc class add dev eth0 parent 1:1 classid 1:20 htb rate 100kbit
> > >> ceil 128kbit burst 2k
> My reply messed up the layout.  But 2kbit is too low for the burst.  Remove
> the burst parameter and htb will calculate the best burst for you.
>
> > >> tc filter add dev eth0 parent 1: protocol ip prio 1 handle 1 fw classid
> > >> 1:10 tc filter add dev eth0 parent 1: protocol ip prio 3 handle 3 fw
> > >> classid 1:11 tc filter add dev eth0 parent 1: protocol ip prio 3 handle
> > >> 5 fw classid 1:12 tc filter add dev eth0 parent 1: protocol ip prio 3
> > >> handle 7 fw classid 1:13
> You can give each filter the same prio.
>
> If you go to http://www.docum.org/stef.coene/qos/monitor/ you can download my
> monitor_tc.pl script.  It will calculate the bandwidth but it will use the tc
> counters.  So you know exactly how much each class is sending.
>
> Stef
>
> --
>
> stef.coene@docum.org
>  "Using Linux as bandwidth manager"
>      http://www.docum.org/
>      #lartc @ irc.oftc.net

[-- Attachment #2.1.2: proxytelco.telconet.net.2-day.gif --]
[-- Type: image/gif, Size: 12256 bytes --]

[-- Attachment #2.1.3: htb.init --]
[-- Type: text/plain, Size: 6058 bytes --]

#!/bin/sh

# ================================ #
# ===>>  Alexandra Alvarado << === #
# ===>> Febrero 24 del 2003 << === #
# ================================ #

iptables -F -t mangle
iptables -X

# ===>> Control de Trafico de Salida << === #

# ===>> 1 <<=== #
iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.194 -j MARK --set-mark 1
iptables -A PREROUTING -t mangle -p udp -s 207.100.136.194 -j MARK --set-mark 1

# ===>> 2 <<=== #
iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.199 -j MARK --set-mark 3
iptables -A PREROUTING -t mangle -p udp -s 207.100.136.199 -j MARK --set-mark 3

# ===>> 3 <<=== #
iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.201 -j MARK --set-mark 5
iptables -A PREROUTING -t mangle -p udp -s 207.100.136.201 -j MARK --set-mark 5

# ===>> 4 <<=== #
iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.230/28 -j MARK --set-mark 7
iptables -A PREROUTING -t mangle -p udp -s 207.100.136.230/28 -j MARK --set-mark 7

# ===>> 5 <<=== #
iptables -A PREROUTING -t mangle -p tcp -s 200.81.91.195 -j MARK --set-mark 9 
iptables -A PREROUTING -t mangle -p udp -s 200.81.91.195 -j MARK --set-mark 9 

iptables -A PREROUTING -t mangle -p tcp -s 207.100.136.248 -j MARK --set-mark 9 
iptables -A PREROUTING -t mangle -p udp -s 207.100.136.248 -j MARK --set-mark 9 

# ===>> 6 <<=== #
iptables -A PREROUTING -t mangle -p tcp -s 200.81.91.188 -j MARK --set-mark 11
iptables -A PREROUTING -t mangle -p udp -s 200.81.91.188 -j MARK --set-mark 11

iptables -A PREROUTING -t mangle -p tcp -s 200.81.91.189 -j MARK --set-mark 11 
iptables -A PREROUTING -t mangle -p udp -s 200.81.91.189 -j MARK --set-mark 11 

iptables -A PREROUTING -t mangle -p tcp -s 200.81.91.200 -j MARK --set-mark 11 
iptables -A PREROUTING -t mangle -p udp -s 200.81.91.200 -j MARK --set-mark 11 

iptables -A PREROUTING -t mangle -p tcp -s 200.81.91.201 -j MARK --set-mark 11 
iptables -A PREROUTING -t mangle -p udp -s 200.81.91.201 -j MARK --set-mark 11

tc qdisc del dev eth0 root handle 1:

tc qdisc add dev eth0 root handle 1: htb default 20
tc class add dev eth0 parent 1: classid 1:1 htb rate 100mbit ceil 448kbit
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 56kbit ceil 64kbit
tc class add dev eth0 parent 1:1 classid 1:11 htb rate 56kbit ceil 64kbit
tc class add dev eth0 parent 1:1 classid 1:12 htb rate 56kbit ceil 64kbit
tc class add dev eth0 parent 1:1 classid 1:13 htb rate 56kbit ceil 64kbit
tc class add dev eth0 parent 1:1 classid 1:14 htb rate 56kbit ceil 64kbit
tc class add dev eth0 parent 1:1 classid 1:15 htb rate 56kbit ceil 64kbit
tc class add dev eth0 parent 1:1 classid 1:20 htb rate 56kbit ceil 64kbit

tc filter add dev eth0 parent 1: protocol ip prio 1 handle 1 fw classid 1:10
tc filter add dev eth0 parent 1: protocol ip prio 3 handle 3 fw classid 1:11
tc filter add dev eth0 parent 1: protocol ip prio 3 handle 5 fw classid 1:12
tc filter add dev eth0 parent 1: protocol ip prio 3 handle 7 fw classid 1:13
tc filter add dev eth0 parent 1: protocol ip prio 3 handle 9 fw classid 1:14
tc filter add dev eth0 parent 1: protocol ip prio 3 handle 11 fw classid 1:15

# ===>> Control de Trafico de Entrada << === # 

# ===>> 1 <<=== #
iptables -A POSTROUTING -t mangle -p tcp -d 207.100.136.194 -j MARK --set-mark 2
iptables -A POSTROUTING -t mangle -p udp -d 207.100.136.194 -j MARK --set-mark 2

# ===>> 2 <<=== #
iptables -A POSTROUTING -t mangle -p tcp -d 207.100.136.199 -j MARK --set-mark 4
iptables -A POSTROUTING -t mangle -p udp -d 207.100.136.199 -j MARK --set-mark 4

# ===>> 3 <<=== #
iptables -A POSTROUTING -t mangle -p tcp -d 207.100.136.201 -j MARK --set-mark 6
iptables -A POSTROUTING -t mangle -p udp -d 207.100.136.201 -j MARK --set-mark 6

# ===>> 4 <<=== #
iptables -A PREROUTING -t mangle -p tcp -d 207.100.136.230/28 -j MARK --set-mark 8
iptables -A PREROUTING -t mangle -p udp -d 207.100.136.230/28 -j MARK --set-mark 8

# ===>> 5 <<=== #
iptables -A PREROUTING -t mangle -p tcp -d 200.81.91.195 -j MARK --set-mark 10 
iptables -A PREROUTING -t mangle -p udp -d 200.81.91.195 -j MARK --set-mark 10 

iptables -A PREROUTING -t mangle -p tcp -d 207.100.136.248 -j MARK --set-mark 10
iptables -A PREROUTING -t mangle -p udp -d 207.100.136.248 -j MARK --set-mark 10

# ===>> 6 <<=== #
iptables -A PREROUTING -t mangle -p tcp -d 200.81.91.188 -j MARK --set-mark 12
iptables -A PREROUTING -t mangle -p udp -d 200.81.91.188 -j MARK --set-mark 12

iptables -A PREROUTING -t mangle -p tcp -d 200.81.91.189 -j MARK --set-mark 12 
iptables -A PREROUTING -t mangle -p udp -d 200.81.91.189 -j MARK --set-mark 12 

iptables -A PREROUTING -t mangle -p tcp -d 200.81.91.200 -j MARK --set-mark 12 
iptables -A PREROUTING -t mangle -p udp -d 200.81.91.200 -j MARK --set-mark 12 

iptables -A PREROUTING -t mangle -p tcp -d 200.81.91.201 -j MARK --set-mark 12 
iptables -A PREROUTING -t mangle -p udp -d 200.81.91.201 -j MARK --set-mark 12

tc qdisc del dev eth1 root handle 1:

tc qdisc add dev eth1 root handle 1: htb default 20
tc class add dev eth1 parent 1: classid 1:1 htb rate 100mbit ceil 448kbit
tc class add dev eth1 parent 1:1 classid 1:10 htb rate 56kbit ceil 64kbit
tc class add dev eth1 parent 1:1 classid 1:11 htb rate 56kbit ceil 64kbit
tc class add dev eth1 parent 1:1 classid 1:12 htb rate 56kbit ceil 64kbit
tc class add dev eth1 parent 1:1 classid 1:13 htb rate 56kbit ceil 64kbit
tc class add dev eth1 parent 1:1 classid 1:14 htb rate 56kbit ceil 64kbit
tc class add dev eth1 parent 1:1 classid 1:15 htb rate 56kbit ceil 64kbit
tc class add dev eth1 parent 1:1 classid 1:20 htb rate 56kbit ceil 64kbit

tc filter add dev eth1 parent 1: protocol ip prio 1 handle 2 fw classid 1:10
tc filter add dev eth1 parent 1: protocol ip prio 3 handle 4 fw classid 1:11
tc filter add dev eth1 parent 1: protocol ip prio 3 handle 6 fw classid 1:12
tc filter add dev eth1 parent 1: protocol ip prio 3 handle 8 fw classid 1:13
tc filter add dev eth1 parent 1: protocol ip prio 3 handle 10 fw classid 1:14
tc filter add dev eth1 parent 1: protocol ip prio 3 handle 12 fw classid 1:15

# === >> Fin << === #

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [LARTC] Problem with HTB accurancy
  2003-02-27 22:10 [LARTC] Problem with HTB accurancy Alexandra Alvarado
                   ` (2 preceding siblings ...)
  2003-03-07 17:15 ` Alexandra Alvarado
@ 2003-03-08 20:34 ` Stef Coene
  3 siblings, 0 replies; 5+ messages in thread
From: Stef Coene @ 2003-03-08 20:34 UTC (permalink / raw)
  To: lartc

On Friday 07 March 2003 18:15, Alexandra Alvarado wrote:
> Hello,
>
> I've tested removing de burst parameter in the htb config, and
> I have de next results: [Attached File]
>
> Is the HTB exact or not?
>
> Now I've changed bw to 448Kbps or 56KBps, but in the graph
> I have a maximum of 77.5KBps. Why???
I have no idea. Can you check out if any of the tokens/ctokens are < 0 for the 
1:1 class?  (tc -s -d class show dev eth1).
And can you try to download a big file and record the speed you get?

> PD:  I can't use monitor_tc.pl, because iptables chain doesn't work
> with PREROUTING : (
monitor_tc.pl uses the tc counters (remark the _tc in the name :)

Stef

-- 

stef.coene@docum.org
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-03-08 20:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-27 22:10 [LARTC] Problem with HTB accurancy Alexandra Alvarado
2003-02-28  7:44 ` Stef Coene
2003-03-06 16:34 ` Alexandra Alvarado
2003-03-07 17:15 ` Alexandra Alvarado
2003-03-08 20:34 ` Stef Coene

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.