All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] HTB question
@ 2002-04-07 15:09 Omer suat
  2002-04-07 15:17 ` Martin Devera
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: Omer suat @ 2002-04-07 15:09 UTC (permalink / raw)
  To: lartc

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


Hi,

I am new to tc, please forgive me for simple question.

I have linux 2.4 in my routers, I would like to use HTB. I have downloaded binary code from http://luxik.cdi.cz/~devik/qos/htb/#source, (tc.gz), but I could not open the file. Is there any other place I can get binary code for HTB. Also if you can give some direction how to patch it, it will be really helpful.

Thanks in advance

Omer



---------------------------------
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax

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

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

* Re: [LARTC] HTB question
  2002-04-07 15:09 [LARTC] HTB question Omer suat
@ 2002-04-07 15:17 ` Martin Devera
  2002-04-07 15:21 ` Stef Coene
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Martin Devera @ 2002-04-07 15:17 UTC (permalink / raw)
  To: lartc

don;tknow other place. Try to download
with wget or lynx - netscappe | IE tries to be too
smart sometimes.
What says "file tc.gz" about downloaded file ?
What is the size of the file ?
devik

On Sun, 7 Apr 2002, Omer suat wrote:

> 
> Hi,
> 
> I am new to tc, please forgive me for simple question.
> 
> I have linux 2.4 in my routers, I would like to use HTB. I have
> downloaded binary code from
> http://luxik.cdi.cz/~devik/qos/htb/#source, (tc.gz), but I could not
> open the file. Is there any other place I can get binary code for HTB.
> Also if you can give some direction how to patch it, it will be really
> helpful.
> 
> Thanks in advance
> 
> Omer
> 
> 
> 
> ---------------------------------
> Do You Yahoo!?
> Yahoo! Tax Center - online filing with TurboTax

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

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

* Re: [LARTC] HTB question
  2002-04-07 15:09 [LARTC] HTB question Omer suat
  2002-04-07 15:17 ` Martin Devera
@ 2002-04-07 15:21 ` Stef Coene
  2002-05-13 17:30 ` Pavlos Parissis
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Stef Coene @ 2002-04-07 15:21 UTC (permalink / raw)
  To: lartc

On Sunday 07 April 2002 17:09, Omer suat wrote:
> Hi,
>
> I am new to tc, please forgive me for simple question.
>
> I have linux 2.4 in my routers, I would like to use HTB. I have downloaded
> binary code from http://luxik.cdi.cz/~devik/qos/htb/#source, (tc.gz), but I
> could not open the file. Is there any other place I can get binary code for
> HTB. Also if you can give some direction how to patch it, it will be really
> helpful.
You will have to download the source of iproute2 (see under links on 
www.docum.org) and the patch for htb.  Patch the source, compile and you will 
find the binary in directory tc.  I also have some mimimal info on how to 
patch it on www.docum.org under FAQ.

Stef

-- 

stef.coene@docum.org
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.openprojects.net
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

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

* [LARTC] HTB question
  2002-04-07 15:09 [LARTC] HTB question Omer suat
  2002-04-07 15:17 ` Martin Devera
  2002-04-07 15:21 ` Stef Coene
@ 2002-05-13 17:30 ` Pavlos Parissis
  2003-04-09 18:06 ` [LARTC] HTB Question Allan Gee
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Pavlos Parissis @ 2002-05-13 17:30 UTC (permalink / raw)
  To: lartc

Hello all,

I have a small problem with HTB which i would like to share with the list.
I have send tha same mail to Martin Devera and he replied but i would like to
post my problem here in order to have more information,because i am new in this
area of administration.

I have the simplest scenario that you can imagine.  I have a linux server which have internet
connection with 64Kbps ISDN line using an external modem and behind this server i have 5 WIN
clients. My linux server is RedHat 7.2 with kernel 2.4.17 patched with HTB and i used
the patched tc from Martin Devera site.

My clients use my server as a gateway to the internet. I need to ensure that one WIN client
have 5 kbytes/sec from the total bandwith of 8-9 kbytes when he wants!Why is that?
Because it use a VPN client which needs at least 4 kbytes in order to have useful connection.
As a result i have to devide my 8-9 kbytes/s bandwidth in 2 pieces, one with 5 kbytes and one
with 3-4 kbytes.i created the following script according your guide.

#!/bin/bash
tc="/root/QoS/QoS/tc" 
$tc qdisc del dev eth0 root
$tc qdisc add dev eth0 root handle 1: htb default 11

$tc class add dev eth0 parent 1: classid 1:1 htb rate 10kbps ceil 10kbps burst 12910b \
cburst 12910b
$tc class add dev eth0 parent 1:1 classid 1:10 htb rate 5kbps ceil 10kbps burst \
24910b cburst 12910b
$tc class add dev eth0 parent 1:1 classid 1:11 htb rate 2kbps ceil 10kbps burst \
12910b cburst 12910b

$tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dst 192.168.0.14 \
flowid 1:10
# 192.168.0.14 is the ip of my WIN clients which needs the 4kbytes

$tc qdisc add dev eth0 parent 1:10 handle 10: sfq perturb 10
$tc qdisc add dev eth0 parent 1:11 handle 11: sfq perturb 10

I run it and i did some tests.
I use 2 WIN clients which belong to defualt class and started to download 1 big file from each
one. They had 4kbytes/sec download speed when downloading the files.
Then i started to download a big file from my WINclient(192.168.0.14) and he didn't managed to
have more that 3 kbytes download speed.
I run several time tc -s class show dev eth0 and saw that the default class borrowed several
packets.

see what i mean:
class htb 1:11 parent 1:1 leaf 11: prio 0 quantum 1000 rate 16Kbit ceil 80Kbit burst 12909b/8
mpu 0b cburst 12909b/8 mpu 0b level 0 
 Sent 1401248 bytes 944 pkts (dropped 0, overlimits 0) 
 rate 4037bps 2pps 
 lended: 455 borrowed: 489 giants: 0
 tokens: -3184094 ctokens: 911840

class htb 1:1 root rate 80Kbit ceil 80Kbit burst 12909b/8 mpu 0b cburst 12909b/8 mpu 0b level 7
 Sent 2603364 bytes 1738 pkts (dropped 0, overlimits 0) 
 rate 7921bps 5pps 
 lended: 489 borrowed: 0 giants: 0
 tokens: 911840 ctokens: 911840

class htb 1:10 parent 1:1 leaf 10: prio 0 quantum 1000 rate 40Kbit ceil 80Kbit burst 24909b/8
mpu 0b cburst 12909b/8 mpu 0b level 0 
 Sent 1202116 bytes 794 pkts (dropped 0, overlimits 0) 
 rate 3816bps 2pps 
 lended: 794 borrowed: 0 giants: 0
 tokens: 3406788 ctokens: 911840



class htb 1:11 parent 1:1 leaf 11: prio 0 quantum 1000 rate 16Kbit ceil 80Kbit burst 12909b/8
mpu 0b cburst 12909b/8 mpu 0b level 0 
 Sent 1422444 bytes 958 pkts (dropped 0, overlimits 0) 
 rate 4037bps 2pps 
 lended: 461 borrowed: 497 giants: 0
 tokens: -1783000 ctokens: 911840

class htb 1:1 root rate 80Kbit ceil 80Kbit burst 12909b/8 mpu 0b cburst 12909b/8 mpu 0b level 7

 Sent 2644242 bytes 1765 pkts (dropped 0, overlimits 0) 
 rate 7921bps 5pps 
 lended: 497 borrowed: 0 giants: 0
 tokens: 911840 ctokens: 911840

class htb 1:10 parent 1:1 leaf 10: prio 0 quantum 1000 rate 40Kbit ceil 80Kbit burst 24909b/8
mpu 0b cburst 12909b/8 mpu 0b level 0 
 Sent 1221798 bytes 807 pkts (dropped 0, overlimits 0) 
 rate 3816bps 2pps 
 lended: 807 borrowed: 0 giants: 0
 tokens: 3320517 ctokens: 911840



class htb 1:11 parent 1:1 leaf 11: prio 0 quantum 1000 rate 16Kbit ceil 80Kbit burst 12909b/8
mpu 0b cburst 12909b/8 mpu 0b level 0 
 Sent 1430014 bytes 963 pkts (dropped 0, overlimits 0) 
 rate 4005bps 2pps 
 lended: 466 borrowed: 497 giants: 0
 tokens: -3078483 ctokens: 911840

class htb 1:1 root rate 80Kbit ceil 80Kbit burst 12909b/8 mpu 0b cburst 12909b/8 mpu 0b level 7

 Sent 2660896 bytes 1776 pkts (dropped 0, overlimits 0) 
 rate 7921bps 5pps 
 lended: 497 borrowed: 0 giants: 0
 tokens: 911840 ctokens: 911840

class htb 1:10 parent 1:1 leaf 10: prio 0 quantum 1000 rate 40Kbit ceil 80Kbit burst 24909b/8
mpu 0b cburst 12909b/8 mpu 0b level 0 
 Sent 1230882 bytes 813 pkts (dropped 0, overlimits 0) 
 rate 3816bps 2pps 
 lended: 813 borrowed: 0 giants: 0
 tokens: 3320517 ctokens: 911840



class htb 1:11 parent 1:1 leaf 11: prio 0 quantum 1000 rate 16Kbit ceil 80Kbit burst 12909b/8
mpu 0b cburst 12909b/8 mpu 0b level 0 
 Sent 1437584 bytes 968 pkts (dropped 0, overlimits 0) 
 rate 4005bps 2pps 
 lended: 471 borrowed: 497 giants: 0
 tokens: -5316046 ctokens: 911840

class htb 1:1 root rate 80Kbit ceil 80Kbit burst 12909b/8 mpu 0b cburst 12909b/8 mpu 0b level 7

 Sent 2676036 bytes 1786 pkts (dropped 0, overlimits 0) 
 rate 7887bps 5pps 
 lended: 497 borrowed: 0 giants: 0
 tokens: 911840 ctokens: 911840

class htb 1:10 parent 1:1 leaf 10: prio 0 quantum 1000 rate 40Kbit ceil 80Kbit burst 24909b/8
mpu 0b cburst 12909b/8 mpu 0b level 0 
 Sent 1238452 bytes 818 pkts (dropped 0, overlimits 0) 
 rate 3848bps 2pps 
 lended: 818 borrowed: 0 giants: 0
 tokens: 3406788 ctokens: 911840



class htb 1:11 parent 1:1 leaf 11: prio 0 quantum 1000 rate 16Kbit ceil 80Kbit burst 12909b/8
mpu 0b cburst 12909b/8 mpu 0b level 0 
 Sent 1448182 bytes 975 pkts (dropped 0, overlimits 0) 
 rate 4005bps 2pps 
 lended: 471 borrowed: 504 giants: 0
 tokens: -3276238 ctokens: 911840

class htb 1:1 root rate 80Kbit ceil 80Kbit burst 12909b/8 mpu 0b cburst 12909b/8 mpu 0b level 7

 Sent 2689662 bytes 1795 pkts (dropped 0, overlimits 0) 
 rate 7887bps 5pps 
 lended: 504 borrowed: 0 giants: 0
 tokens: 911840 ctokens: 911840

class htb 1:10 parent 1:1 leaf 10: prio 0 quantum 1000 rate 40Kbit ceil 80Kbit burst 24909b/8
mpu 0b cburst 12909b/8 mpu 0b level 0 
 Sent 1241480 bytes 820 pkts (dropped 0, overlimits 0) 
 rate 3848bps 2pps 
 lended: 820 borrowed: 0 giants: 0
 tokens: 3743680 ctokens: 911840

Then only way to ensure that my 192.168.0.14 client have 4-5 kbytes is when i change the ceil
for the default class to 2.
I also noticed that even i change the rate for default class to 1 they always have 2-3
kbytes/sec.
After several  tests i realized that my default class always borrowed packets from my 10 class
even when class 10 use tha bandwidth.As a result i couldn't ensure 4-5 kbytes for class 10.

Does anyone know a way to achive my goal.
I would be grateful if some can give me any hits about it.

Regards,
Pavlos


-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I love having the feeling of being in control
while i have the sensation of speed

The surfer of life
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

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

* [LARTC] HTB Question
  2002-04-07 15:09 [LARTC] HTB question Omer suat
                   ` (2 preceding siblings ...)
  2002-05-13 17:30 ` Pavlos Parissis
@ 2003-04-09 18:06 ` Allan Gee
  2003-05-23  9:56 ` [LARTC] HTB question Ruslan Spivak
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Allan Gee @ 2003-04-09 18:06 UTC (permalink / raw)
  To: lartc

Hi Stef,
	Sorry to write to you directly but my list membership is not working, I
receive the archive but cant send to the list, cant delete myself because I
don't exist and can't rejoin as they say I do exist, anyway hope you don't
mind

Can you tell me what the difference between these two scripts is please.

What I want to achieve is a high speed channel 1000kbit from port 3000 from
an application running on the box doing the shaping, while shaping the
traffic at 64kbit going thru the box to the network, WITHOUT affecting the
small 64kbit bandwidth.

In EXAMPLE 1 ALL traffic goes thru 1:1 but does not seem to affect the slow
channels 1:2,1:3 and 1:4
In EXAMPLE 2 the port 3000 traffic only goes thru 1:998 and 1:997 but it
shows "lended" packets in the "tc stats"
My feeling is EXAMPLE 2 is the right way but I would like your input



EXAMPLE 1:
tc qdisc del dev eth0 root handle 1: htb default 999
tc qdisc add dev eth0 root handle 1: htb default 999 r2q 1
tc class add dev eth0 parent 1: classid 1:1 htb rate 64kbit

tc class add dev eth0 parent 1: classid 1:998 htb rate 1000kbit
tc qdisc add dev eth0 parent 1:998 handle 1998: sfq perturb 10
tc class add dev eth0 parent 1:998 classid 1:997 htb rate 1000kbit ceil
1000kbit prio 0 quantum 15140
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip sport 3000
0xffff flowid 1:997

tc class add dev eth0 parent 1:1 classid 1:999 htb rate 6kbit ceil 64kbit
prio 0 quantum 1514
tc qdisc add dev eth0 parent 1:999 handle 1999: sfq perturb 10
tc class add dev eth0 parent 1:1 classid 1:2 htb rate 24kbit ceil 64kbit
prio 0 quantum 1514
tc class add dev eth0 parent 1:1 classid 1:3 htb rate 24kbit ceil 24kbit
prio 0 quantum 1514
tc class add dev eth0 parent 1:1 classid 1:4 htb rate 10kbit ceil 64kbit
prio 0 quantum 1514
tc qdisc add dev eth0 parent 1:2 handle 200: sfq perturb 2
tc qdisc add dev eth0 parent 1:3 handle 300: sfq perturb 2
tc qdisc add dev eth0 parent 1:4 handle 400: sfq perturb 2
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 80
0xffff flowid 1:2
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 25
0xffff flowid 1:3
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 53
0xffff flowid 1:4
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 53
0xffff match ip protocol 17 0xff flowid 1:4
END EXAMPLE 1

EXAMPLE 2:
tc qdisc del dev eth0 root handle 1: htb default 999
tc qdisc add dev eth0 root handle 1: htb default 999 r2q 1
tc class add dev eth0 parent 1: classid 1:1 htb rate 64kbit
tc class add dev eth0 parent 1:1 classid 1:999 htb rate 6kbit ceil 64kbit
prio 0 quantum 1514
tc qdisc add dev eth0 parent 1:999 handle 1999: sfq perturb 10
tc class add dev eth0 parent 1:1 classid 1:2 htb rate 24kbit ceil 64kbit
prio 0 quantum 1514
tc class add dev eth0 parent 1:1 classid 1:3 htb rate 24kbit ceil 24kbit
prio 0 quantum 1514
tc class add dev eth0 parent 1:1 classid 1:4 htb rate 10kbit ceil 64kbit
prio 0 quantum 1514
tc class add dev eth0 parent 1:1 classid 1:5 htb rate 1000kbit ceil 1000kbit
prio 0 quantum 15140
tc class add dev eth0 parent 1:5 classid 1:6 htb rate 1000kbit ceil 1000kbit
prio 0 quantum 15140
tc qdisc add dev eth0 parent 1:2 handle 200: sfq perturb 2
tc qdisc add dev eth0 parent 1:3 handle 300: sfq perturb 2
tc qdisc add dev eth0 parent 1:4 handle 400: sfq perturb 2
tc qdisc add dev eth0 parent 1:6 handle 600: sfq perturb 5
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 80
0xffff flowid 1:2
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 25
0xffff flowid 1:3
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 53
0xffff flowid 1:4
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 53
0xffff match ip protocol 17 0xff flowid 1:4
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip sport 3000
0xffff flowid 1:6
END EXAMPLE 2


Regards Allan Gee
Equation
021 4181777
www.equation.co.za

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

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

* [LARTC] HTB question
  2002-04-07 15:09 [LARTC] HTB question Omer suat
                   ` (3 preceding siblings ...)
  2003-04-09 18:06 ` [LARTC] HTB Question Allan Gee
@ 2003-05-23  9:56 ` Ruslan Spivak
  2003-06-28 11:58 ` Lars Landmark
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Ruslan Spivak @ 2003-05-23  9:56 UTC (permalink / raw)
  To: lartc

Hello!

I'm newbie to stuff that is discussed here, so i want to ask you to help 
me with decision. I have such situation:

1) linux server, with 1 ethernet interface with ip 193.220.70.33/27 
(contains file archive and web service)
2) cisco router, connected to internet (512 Kbit download and 64Kbit upload)
3) adsl hub with a lot of clients behind it(some clients have one real 
static ip address, and one client have network of class C with 32 real 
ip addresses). adsl hub gets and sends packets through linux server.
4) linux server, adsl hub and cisco router are connected to switch

i want to make so that all clients behind adsl hub if they download 
files from 193.220.70.33(our server) share 60Mbits of eth0 of linux 
server and to share 512 Kbit of internet.

Thanks to lartc howto and Stef Coene' docum.org things now more clear to 
me(i'm going to use htb), but could you suggest something about it?

Thanks in advance,
Ruslan

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

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

* [LARTC] HTB Question...
@ 2003-06-04 20:27 TeraHz
  2003-06-04 20:46 ` Stef Coene
  0 siblings, 1 reply; 12+ messages in thread
From: TeraHz @ 2003-06-04 20:27 UTC (permalink / raw)
  To: lartc

htb script:
#!/bin/bash
tc qdisc del dev eth1 root handle 1:
tc qdisc add dev eth1 root handle 1: htb default 12
tc class add dev eth1 parent 1: classid 1:1 htb rate 48kbps ceil 48kbps
tc class add dev eth1 parent 1:1 classid 1:10 htb rate 4kbps ceil 48kbps
tc class add dev eth1 parent 1:1 classid 1:11 htb rate 4kbps ceil 48kbps
tc class add dev eth1 parent 1:1 classid 1:12 htb rate 4kbps ceil 48kbps
tc class add dev eth1 parent 1:1 classid 1:13 htb rate 4kbps ceil 48kbps
tc class add dev eth1 parent 1:1 classid 1:14 htb rate 4kbps ceil 48kbps
tc class add dev eth1 parent 1:1 classid 1:15 htb rate 4kbps ceil 48kbps
tc class add dev eth1 parent 1:1 classid 1:16 htb rate 4kbps ceil 48kbps
tc class add dev eth1 parent 1:1 classid 1:17 htb rate 4kbps ceil 48kbps
tc class add dev eth1 parent 1:1 classid 1:18 htb rate 4kbps ceil 48kbps
tc class add dev eth1 parent 1:1 classid 1:19 htb rate 4kbps ceil 48kbps
tc class add dev eth1 parent 1:1 classid 1:20 htb rate 4kbps ceil 48kbps
tc class add dev eth1 parent 1:1 classid 1:21 htb rate 4kbps ceil 48kbps
tc class add dev eth1 parent 1:1 classid 1:22 htb rate 4kbps ceil 48kbps

tc filter add dev eth1 parent 1:1 protocol ip handle 10 fw classid 1:10
tc filter add dev eth1 parent 1:1 protocol ip handle 11 fw classid 1:12
tc filter add dev eth1 parent 1:1 protocol ip handle 13 fw classid 1:13
tc filter add dev eth1 parent 1:1 protocol ip handle 14 fw classid 1:14
tc filter add dev eth1 parent 1:1 protocol ip handle 15 fw classid 1:15
tc filter add dev eth1 parent 1:1 protocol ip handle 19 fw classid 1:16
tc filter add dev eth1 parent 1:1 protocol ip handle 20 fw classid 1:17
tc filter add dev eth1 parent 1:1 protocol ip handle 24 fw classid 1:18
tc filter add dev eth1 parent 1:1 protocol ip handle 29 fw classid 1:19
tc filter add dev eth1 parent 1:1 protocol ip handle 32 fw classid 1:20
tc filter add dev eth1 parent 1:1 protocol ip handle 33 fw classid 1:21
tc filter add dev eth1 parent 1:1 protocol ip handle 34 fw classid 1:22
iptables -F -t mangle
iptables -A FORWARD -i eth0 -t mangle -s 192.168.193.10 -j MARK --set-
mark 10
iptables -A FORWARD -i eth0 -t mangle -s 192.168.193.11 -j MARK --set-
mark 11
iptables -A FORWARD -i eth0 -t mangle -s 192.168.193.13 -j MARK --set-
mark 13
iptables -A FORWARD -i eth0 -t mangle -s 192.168.193.14 -j MARK --set-
mark 14
iptables -A FORWARD -i eth0 -t mangle -s 192.168.193.15 -j MARK --set-
mark 15
iptables -A FORWARD -i eth0 -t mangle -s 192.168.193.19 -j MARK --set-
mark 19
iptables -A FORWARD -i eth0 -t mangle -s 192.168.193.20 -j MARK --set-
mark 20
iptables -A FORWARD -i eth0 -t mangle -s 192.168.193.24 -j MARK --set-
mark 24
iptables -A FORWARD -i eth0 -t mangle -s 192.168.193.29 -j MARK --set-
mark 29
iptables -A FORWARD -i eth0 -t mangle -s 192.168.193.32 -j MARK --set-
mark 32
iptables -A FORWARD -i eth0 -t mangle -s 192.168.193.33 -j MARK --set-
mark 33
iptables -A FORWARD -i eth0 -t mangle -s 192.168.193.34 -j MARK --set-
mark 34



Firewall ans routing script:
#!/bin/sh
IPT=/usr/sbin/iptables
EXTIF="eth1"
INTIF="eth0"
echo "1" > /proc/sys/net/ipv4/ip_forward
echo "1" > /proc/sys/net/ipv4/ip_dynaddr
$IPT -P INPUT ACCEPT
$IPT -F INPUT
$IPT -P OUTPUT ACCEPT
$IPT -F OUTPUT
$IPT -P FORWARD DROP
$IPT -F FORWARD
$IPT -t nat -F
$IPT -A FORWARD -i $EXTIF -o $INTIF -m state --state 
ESTABLISHED,RELATED -j ACCEPT
#$IPT -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
$IPT -A FORWARD -j LOG
$IPT -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
#####THE FIREWALL PART######
$IPT -A INPUT -i $INTIF -j DROP
$IPT -A INPUT -i $INTIF -s 192.168.193.10 -j ACCEPT
$IPT -A INPUT -i $INTIF -s 192.168.193.11 -j ACCEPT
$IPT -A INPUT -i $INTIF -s 192.168.193.13 -j ACCEPT
$IPT -A INPUT -i $INTIF -s 192.168.193.14 -j ACCEPT
$IPT -A INPUT -i $INTIF -s 192.168.193.15 -j ACCEPT
$IPT -A INPUT -i $INTIF -s 192.168.193.19 -j ACCEPT
$IPT -A INPUT -i $INTIF -s 192.168.193.20 -j ACCEPT
$IPT -A INPUT -i $INTIF -s 192.168.193.24 -j ACCEPT
$IPT -A INPUT -i $INTIF -s 192.168.193.29 -j ACCEPT
$IPT -A INPUT -i $INTIF -s 192.168.193.32 -j ACCEPT
$IPT -A INPUT -i $INTIF -s 192.168.193.33 -j ACCEPT
$IPT -A INPUT -i $INTIF -s 192.168.193.34 -j ACCEPT
$IPT -A FORWARD -i $INTIF -s 192.168.193.10 -j ACCEPT
$IPT -A FORWARD -i $INTIF -s 192.168.193.11 -j ACCEPT
$IPT -A FORWARD -i $INTIF -s 192.168.193.13 -j ACCEPT
$IPT -A FORWARD -i $INTIF -s 192.168.193.14 -j ACCEPT
$IPT -A FORWARD -i $INTIF -s 192.168.193.15 -j ACCEPT
$IPT -A FORWARD -i $INTIF -s 192.168.193.19 -j ACCEPT
$IPT -A FORWARD -i $INTIF -s 192.168.193.20 -j ACCEPT
$IPT -A FORWARD -i $INTIF -s 192.168.193.24 -j ACCEPT
$IPT -A FORWARD -i $INTIF -s 192.168.193.29 -j ACCEPT
$IPT -A FORWARD -i $INTIF -s 192.168.193.32 -j ACCEPT
$IPT -A FORWARD -i $INTIF -s 192.168.193.33 -j ACCEPT
$IPT -A FORWARD -i $INTIF -s 192.168.193.34 -j ACCEPT
$IPT -A FORWARD -i $INTIF -j DROP



this are the latest scripts. I've made a LOT of changes.

the packets are marking:

iptables -L -n -v -t mangle
Chain PREROUTING (policy ACCEPT 113K packets, 79M bytes)
 pkts bytes target     prot opt in     out     source               
destination

Chain INPUT (policy ACCEPT 4001 packets, 587K bytes)
 pkts bytes target     prot opt in     out     source               
destination

Chain FORWARD (policy ACCEPT 109K packets, 79M bytes)
 pkts bytes target     prot opt in     out     source               
destination
    6   507 MARK       all  --  eth0   *       192.168.193.10       
0.0.0.0/0          MARK set 0xa
  392 26685 MARK       all  --  eth0   *       192.168.193.11       
0.0.0.0/0          MARK set 0xb
  167 10011 MARK       all  --  eth0   *       192.168.193.13       
0.0.0.0/0          MARK set 0xd
    0     0 MARK       all  --  eth0   *       192.168.193.14       
0.0.0.0/0          MARK set 0xe
    0     0 MARK       all  --  eth0   *       192.168.193.15       
0.0.0.0/0          MARK set 0xf
    0     0 MARK       all  --  eth0   *       192.168.193.19       
0.0.0.0/0          MARK set 0x13
    0     0 MARK       all  --  eth0   *       192.168.193.20       
0.0.0.0/0          MARK set 0x14
  924 37625 MARK       all  --  eth0   *       192.168.193.24       
0.0.0.0/0          MARK set 0x18
    0     0 MARK       all  --  eth0   *       192.168.193.29       
0.0.0.0/0          MARK set 0x1d
    0     0 MARK       all  --  eth0   *       192.168.193.32       
0.0.0.0/0          MARK set 0x20
 1951 82564 MARK       all  --  eth0   *       192.168.193.33       
0.0.0.0/0          MARK set 0x21
    0     0 MARK       all  --  eth0   *       192.168.193.34       
0.0.0.0/0          MARK set 0x22

Chain OUTPUT (policy ACCEPT 414 packets, 112K bytes)
 pkts bytes target     prot opt in     out     source               
destination

Chain POSTROUTING (policy ACCEPT 109K packets, 79M bytes)
 pkts bytes target     prot opt in     out     source               
destination

The filters are not working:

 tc -s -d class show dev eth1
class htb 1:11 parent 1:1 prio 0 quantum 1000 rate 32Kbit ceil 384Kbit 
burst 1639b/8 mpu 0b cburst 2090b/8 mpu 0b level 0
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
 lended: 0 borrowed: 0 giants: 0
 tokens: 327999 ctokens: 34849

class htb 1:22 parent 1:1 prio 0 quantum 1000 rate 32Kbit ceil 384Kbit 
burst 1639b/8 mpu 0b cburst 2090b/8 mpu 0b level 0
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
 lended: 0 borrowed: 0 giants: 0
 tokens: 327999 ctokens: 34849

class htb 1:1 root rate 384Kbit ceil 384Kbit burst 2090b/8 mpu 0b cburst 
2090b/8 mpu 0b level 7
 Sent 279228 bytes 4454 pkts (dropped 0, overlimits 0)
 rate 2099bps 29pps
 lended: 38 borrowed: 0 giants: 0
 tokens: 29519 ctokens: 29519

class htb 1:10 parent 1:1 prio 0 quantum 1000 rate 32Kbit ceil 384Kbit 
burst 1639b/8 mpu 0b cburst 2090b/8 mpu 0b level 0
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
 lended: 0 borrowed: 0 giants: 0
 tokens: 327999 ctokens: 34849

class htb 1:13 parent 1:1 prio 0 quantum 1000 rate 32Kbit ceil 384Kbit 
burst 1639b/8 mpu 0b cburst 2090b/8 mpu 0b level 0
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
 lended: 0 borrowed: 0 giants: 0
 tokens: 327999 ctokens: 34849

class htb 1:20 parent 1:1 prio 0 quantum 1000 rate 32Kbit ceil 384Kbit 
burst 1639b/8 mpu 0b cburst 2090b/8 mpu 0b level 0
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
 lended: 0 borrowed: 0 giants: 0
 tokens: 327999 ctokens: 34849

class htb 1:12 parent 1:1 prio 0 quantum 1000 rate 32Kbit ceil 384Kbit 
burst 1639b/8 mpu 0b cburst 2090b/8 mpu 0b level 0
 Sent 279228 bytes 4454 pkts (dropped 0, overlimits 0)
 rate 2101bps 29pps
 lended: 4416 borrowed: 38 giants: 0
 tokens: 264002 ctokens: 29519

class htb 1:21 parent 1:1 prio 0 quantum 1000 rate 32Kbit ceil 384Kbit 
burst 1639b/8 mpu 0b cburst 2090b/8 mpu 0b level 0
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
 lended: 0 borrowed: 0 giants: 0
 tokens: 327999 ctokens: 34849

class htb 1:15 parent 1:1 prio 0 quantum 1000 rate 32Kbit ceil 384Kbit 
burst 1639b/8 mpu 0b cburst 2090b/8 mpu 0b level 0
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
 lended: 0 borrowed: 0 giants: 0
 tokens: 327999 ctokens: 34849

class htb 1:14 parent 1:1 prio 0 quantum 1000 rate 32Kbit ceil 384Kbit 
burst 1639b/8 mpu 0b cburst 2090b/8 mpu 0b level 0
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
 lended: 0 borrowed: 0 giants: 0
 tokens: 327999 ctokens: 34849

class htb 1:17 parent 1:1 prio 0 quantum 1000 rate 32Kbit ceil 384Kbit 
burst 1639b/8 mpu 0b cburst 2090b/8 mpu 0b level 0
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
 lended: 0 borrowed: 0 giants: 0
 tokens: 327999 ctokens: 34849

class htb 1:16 parent 1:1 prio 0 quantum 1000 rate 32Kbit ceil 384Kbit 
burst 1639b/8 mpu 0b cburst 2090b/8 mpu 0b level 0
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
 lended: 0 borrowed: 0 giants: 0
 tokens: 327999 ctokens: 34849

class htb 1:19 parent 1:1 prio 0 quantum 1000 rate 32Kbit ceil 384Kbit 
burst 1639b/8 mpu 0b cburst 2090b/8 mpu 0b level 0
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
 lended: 0 borrowed: 0 giants: 0
 tokens: 327999 ctokens: 34849

class htb 1:18 parent 1:1 prio 0 quantum 1000 rate 32Kbit ceil 384Kbit 
burst 1639b/8 mpu 0b cburst 2090b/8 mpu 0b level 0
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
 lended: 0 borrowed: 0 giants: 0
 tokens: 327999 ctokens: 34849

If I change the parent of the filters from 1:1 to 1: -> nothing happens!
Please tell me where is the problem!!!
Играй и спечели с Автомобилен Салон София 2003 - http://auto.dir.bg
-------------------------------------------------------------------
Направи си адрес в mail.bG - http://mail.bg/new/
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

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

* Re: [LARTC] HTB Question...
  2003-06-04 20:27 [LARTC] HTB Question TeraHz
@ 2003-06-04 20:46 ` Stef Coene
  0 siblings, 0 replies; 12+ messages in thread
From: Stef Coene @ 2003-06-04 20:46 UTC (permalink / raw)
  To: lartc

I deleted some parts of your previous mail.

> tc filter add dev eth1 parent 1:1 protocol ip handle 10 fw classid 1:10
> iptables -A FORWARD -i eth0 -t mangle -s 192.168.193.10 -j MARK --set-

> Chain FORWARD (policy ACCEPT 109K packets, 79M bytes)
>  pkts bytes target     prot opt in     out     source
> destination
>     6   507 MARK       all  --  eth0   *       192.168.193.10
> 0.0.0.0/0          MARK set 0xa
Marking is in hex.  So you have to check the filters.  If you execute
tc -s -d fiter show dev eth0
you should see your filter statemens and the handle should also be in hex.  If 
it's not, you can change your commands so you specify the handle in hex :

tc filter add dev eth1 parent 1:1 protocol ip handle 0x10 fw classid 1:10

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] 12+ messages in thread

* [LARTC] HTB question
  2002-04-07 15:09 [LARTC] HTB question Omer suat
                   ` (4 preceding siblings ...)
  2003-05-23  9:56 ` [LARTC] HTB question Ruslan Spivak
@ 2003-06-28 11:58 ` Lars Landmark
  2003-06-28 16:09 ` Stoilis Giannis
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Lars Landmark @ 2003-06-28 11:58 UTC (permalink / raw)
  To: lartc


I have a question regarding how HTB choose to send a package when the rate 
is almost reached.  

What I would like to know, is how HTB solve this;

The class rate has not yet been reached. When htb now 
dequeue the next package, rate would be crossed.  
The next package is smaller than the quantum parameter. 

Would HTB delay this package,  or just send it?


If latter, then HTB is able to cross its configured class rate 
without any borrowing.. Hence send at its full speed until 
the bucket is emptied. 

Does HTB has any bucket containing unused tokens like token bucket?
Or does HTB only accumulate tokens at its configured rate, while unused 
token are dropped?? 



Thanks in advance 

Lars

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

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

* Re: [LARTC] HTB question
  2002-04-07 15:09 [LARTC] HTB question Omer suat
                   ` (5 preceding siblings ...)
  2003-06-28 11:58 ` Lars Landmark
@ 2003-06-28 16:09 ` Stoilis Giannis
  2004-01-15 11:07 ` [LARTC] HTB Question hare ram
  2006-09-13 14:47 ` [LARTC] HTB question doudouyam
  8 siblings, 0 replies; 12+ messages in thread
From: Stoilis Giannis @ 2003-06-28 16:09 UTC (permalink / raw)
  To: lartc

Lars Landmark wrote:
> I have a question regarding how HTB choose to send a package when the rate 
> is almost reached.  
> 
> What I would like to know, is how HTB solve this;
> 
> The class rate has not yet been reached. When htb now 
> dequeue the next package, rate would be crossed.  
> The next package is smaller than the quantum parameter. 
> 
> Would HTB delay this package,  or just send it?

As far as I know, and correct me if I'm wrong, ÇÔÂ will SEND this 
packet. All it cares about, is whether the limit is exceeded or not. It 
is not, so off it goes... There isn't much difference in such small 
number of bytes...

Regards
- Giannis Stoilis
giannis@stoilis.gr


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

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

* [LARTC] HTB Question
  2002-04-07 15:09 [LARTC] HTB question Omer suat
                   ` (6 preceding siblings ...)
  2003-06-28 16:09 ` Stoilis Giannis
@ 2004-01-15 11:07 ` hare ram
  2006-09-13 14:47 ` [LARTC] HTB question doudouyam
  8 siblings, 0 replies; 12+ messages in thread
From: hare ram @ 2004-01-15 11:07 UTC (permalink / raw)
  To: lartc

Hi all

i have installed the FEDORA
and i saw the fedora ships with latest IP and TC and HTB too
when i add the with TC Script with HTB

iam getting that HTB version.
HTB init, kernel part version 3.12

and iam comparing with my old version which is installed and patched with TC
3.6 patch
that is on RH 9.0 with  TC and HTB patch shows

HTB init, kernel part version 3.7


so which one is latest , iam concused
could some one recomend me..

hare

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

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

* [LARTC] HTB question
  2002-04-07 15:09 [LARTC] HTB question Omer suat
                   ` (7 preceding siblings ...)
  2004-01-15 11:07 ` [LARTC] HTB Question hare ram
@ 2006-09-13 14:47 ` doudouyam
  8 siblings, 0 replies; 12+ messages in thread
From: doudouyam @ 2006-09-13 14:47 UTC (permalink / raw)
  To: lartc


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

Hi,

I try to configure 3 HTB class with a rate near to zero and the ceil equal
to the max of the bandwith. And I put prio parameter for each class.
In this configuration, HTB is equivalent with Weighted Round Robin
algorithm.

Is it more correct to put the good rate for each class or to play with the
prio parameter, knowing that it's more difficult to know the correct rate
for  each class ?

Do you know the min value possible to put for the rate parameter ?

Thanks,
doude.

[-- Attachment #1.2: Type: text/html, Size: 521 bytes --]

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

_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

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

end of thread, other threads:[~2006-09-13 14:47 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-07 15:09 [LARTC] HTB question Omer suat
2002-04-07 15:17 ` Martin Devera
2002-04-07 15:21 ` Stef Coene
2002-05-13 17:30 ` Pavlos Parissis
2003-04-09 18:06 ` [LARTC] HTB Question Allan Gee
2003-05-23  9:56 ` [LARTC] HTB question Ruslan Spivak
2003-06-28 11:58 ` Lars Landmark
2003-06-28 16:09 ` Stoilis Giannis
2004-01-15 11:07 ` [LARTC] HTB Question hare ram
2006-09-13 14:47 ` [LARTC] HTB question doudouyam
  -- strict thread matches above, loose matches on Subject: below --
2003-06-04 20:27 [LARTC] HTB Question TeraHz
2003-06-04 20:46 ` 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.