Re: [LARTC] HTB problem running on VLAN, not working

2005-10-08 Thread Andy Furniss

Samuel Koscelansky / SUBNET wrote:

I tested shaping on vlan and it seems OK for me (even though my switch 
doesn't do vlan it doesn't seem to block oversize frames). I noticed a 
few things with your setup -




#classes for download
/sbin/tc class add dev eth0.100 parent 100: classid 100:1 htb rate 4000kbit 
quantum 6000

/sbin/tc class add dev eth0.100 parent 100:1 classid 100:2 htb rate 1000kbit 
quantum 6000
/sbin/tc qdisc add dev eth0.100 parent 100:2 handle 1002 pfifo limit 10


You attach pfifo as if 100:2 is a leaf class here



#my pc testing class
#down
/sbin/tc class add dev eth0.100 parent 100:2 classid 100:2828 htb rate 1000kbit 
quantum 6000
/sbin/tc filter add dev eth0.100 parent 100: protocol ip prio 1 u32 match ip 
dst 217.67.28.28 classid 100:2828
/sbin/tc qdisc add dev eth0.100 parent 100:2828 handle 1002828 sfq perturb 10


But have it as a parent here, also I think the handle on sfq is too big 
and if eth0.100 is to your ISP then dst should be changed src in the match.


Andy.

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


[LARTC] HTB problem running on VLAN, not working

2005-10-06 Thread Samuel Koscelansky / \SUBNET\



Hello.

I'm running linux box with Slackware 9.1 and 
compiled kernel 2.4.31 with "yes" to VLANs and "yes" to all QoS.
On this box i have more ethernet 
interfaces:

eth0
eth1
eth2

and so as more vlan interfaces:

eth0.100
eth1.3
eth1.4

This is entrace(uplink) router to our whole network 
and my goal is to shape users on this machine.
I want for this purpose use HTB so I write little 
test script, which is shaping all users as default traffic and my computer as 
unique class.
This script is olny for testing, if it all works 
well, but I caught on some problems.
Here is my test script:

#!/bin/bash
#
/sbin/tc qdisc del dev eth0 root
/sbin/tc qdisc add dev eth0 root handle 1: htb r2q 
1/sbin/tc qdisc del dev eth1 root/sbin/tc 
qdisc add dev eth1 root handle 2: htb r2q 1/sbin/tc qdisc del dev eth2 
root/sbin/tc qdisc add dev eth2 root handle 3: htb r2q 1/sbin/tc qdisc 
del dev eth0.100 root/sbin/tc qdisc add dev eth0.100 root handle 100: htb 
default 10 r2q 1/sbin/tc qdisc del dev eth1.3 root/sbin/tc qdisc add dev 
eth1.3 root handle 13: htb r2q 1/sbin/tc qdisc del dev eth1.4 
root/sbin/tc qdisc add dev eth1.4 root handle 14: htb default 20 r2q 
1

#classesfor download/sbin/tc class add 
dev eth0.100 parent 100: classid 100:1 htb rate 4000kbit quantum 
6000

/sbin/tc class add dev eth0.100 parent 100:1 
classid 100:2 htb rate 1000kbit quantum 6000/sbin/tc qdisc add dev eth0.100 
parent 100:2 handle 1002 pfifo limit 10/sbin/tc class add dev eth0.100 
parent 100:1 classid 100:3 htb rate 3000kbit quantum 6000/sbin/tc qdisc add 
dev eth0.100 parent 100:3 handle 1003 pfifo limit 10

#classes forupload/sbin/tc class add dev 
eth1.4 parent 14: classid 14:4 htb rate 4000kbit quantum 6000

/sbin/tc class add dev eth1.4 parent 14:4 classid 
14:5 htb rate 1000kbit quantum 6000/sbin/tc qdisc add dev eth1.4 parent 14:5 
handle 145 pfifo limit 10/sbin/tc class add dev eth1.4 parent 14:4 classid 
14:6 htb rate 3000kbit quantum 6000/sbin/tc qdisc add dev eth1.4 parent 14:6 
handle 146 pfifo limit 10

#my pc testing class
#down/sbin/tc class add dev eth0.100 parent 
100:2 classid 100:2828 htb rate 1000kbit quantum 6000/sbin/tc filter add dev 
eth0.100 parent 100: protocol ip prio 1 u32 match ip dst 217.67.28.28 classid 
100:2828/sbin/tc qdisc add dev eth0.100 parent 100:2828 handle 1002828 sfq 
perturb 10#up/sbin/tc class add dev eth1.4 parent 14:5 classid 14:2828 
htb rate 1000kbit quantum 6000/sbin/tc filter add dev eth1.4 parent 14: 
protocol ip prio 1 u32 match ip src 217.67.28.28 classid 14:2828/sbin/tc 
qdisc add dev eth1.4 parent 14:2828 handle 142828 sfq perturb 10

#default classes
#down/sbin/tc class add dev eth0.100 parent 
100:1 classid 100:10 htb rate 3000kbit quantum 6000/sbin/tc qdisc add dev 
eth0.100 parent 100:10 handle 10010 sfq perturb 10#up/sbin/tc class add 
dev eth1.4 parent 14:4 classid 14:20 htb rate 3000kbit quantum 6000/sbin/tc 
qdisc add dev eth1.4 parent 14:20 handle 1420 sfq perturb 10
As you can see traffic goes throught eth0.100 (this 
is uplink interface to our ISP) and throught eth1.4 which belogns to interface 
to one part of our network and where my testing PC is situated. Other interfaces 
in this script are not used for now, this is due to simplify testing 
purposes.

When I run this script I get no errors and 
everything seems to be fine, but is not. My PC is served as default traffic and 
not as uniqe class. When I'd removed default from root classes then all traffic, 
including my PCwas served as root class traffic.

Here is dump from 
statistics:

### eth0: queueing 
disciplines

qdisc htb 1: r2q 1 default 0 
direct_packets_stat 9500Sent 4585808 bytes 9500 pkts (dropped 0, 
overlimits 0)

### eth1: queueing disciplines

qdisc htb 2: r2q 1 default 0 direct_packets_stat 9782Sent 7806825 
bytes 9782 pkts (dropped 0, overlimits 0)backlog 3p

### eth2: queueing disciplines

qdisc htb 3: r2q 1 default 0 direct_packets_stat 1Sent 78 bytes 1 
pkts (dropped 0, overlimits 0)

### eth0.100: queueing disciplines

qdisc htb 100: r2q 1 default 10 direct_packets_stat 122Sent 
4685336 bytes 9630 pkts (dropped 360, overlimits 9606)backlog 
69p

qdisc pfifo 1003: parent 100:3 limit 10pSent 0 bytes 0 pkts 
(dropped 0, overlimits 0)

qdisc sfq 2828: parent 100:2828 quantum 1514b perturb 
10secSent 0 bytes 0 pkts (dropped 0, overlimits 0)

qdisc sfq 10: parent 100:10 quantum 1514b perturb 10secSent 
4631802 bytes 9501 pkts (dropped 360, overlimits 0)backlog 69p

### eth0.100: traffic classes

class htb 100:2828 parent 100:2 leaf 2828: prio 0 rate 1000Kbit ceil 
1000Kbit burst 2879b cburst 2879bSent 0 bytes 0 pkts (dropped 0, 
overlimits 0)lended: 0 borrowed: 0 giants: 0tokens: 18432 
ctokens: 18432
class htb 100:1 root rate 4000Kbit ceil 4000Kbit burst 6719b cburst 
6719bSent 4570697 bytes 9445 pkts (dropped 0, overlimits 
0)rate 9078bps 22ppslended: 0 borrowed: 0 giants: 
0tokens: 423 ctokens: 423

class htb 100:10 parent 100:1 leaf 10: prio 0 rate 3000Kbit ceil 3000Kbit 
burst 5439b cburst 

Re: [LARTC] HTB: Problem with excess bandwidth distribution

2004-10-31 Thread Andy Furniss
Andy Furniss wrote:
Saying that I did notice that HTB was dropping - 
maybe the default queue length is shorter now? It does seem a bit 
strange though, I see drops where I expect the queue to be long enough 
for my rwin and a class with two tcps on the go had less drops than one 
with one - strange.
I took another look at this and it's because the default queue length of 
the default class is shorter than the default for a normal class.

Andy.
___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


Re: [LARTC] HTB: Problem with excess bandwidth distribution

2004-10-29 Thread Leslie Patrick Polzer
Andy Furniss wrote:
Leslie Patrick Polzer wrote:
Hello,
I have a serious problem with HTB which I wasn't able to solve myself.
I run a masquerading router with ppp0 as interface to the Internet.
Three clients need to share a downstream of 1 MBit, which I want
to divide with tc.
When I see a packet being forwarded to one of these clients, I give
it the appropriate unique mark:
iptables -t mangle -A FORWARD -d 192.168.34.141 -j MARK --set-mark 1
iptables -t mangle -A FORWARD -d 192.168.34.140 -j MARK --set-mark 2
iptables -t mangle -A FORWARD -d 192.168.1.2 -j MARK --set-mark 3
Because it might be of interest: 192.168.34.0/24 is on network A
with 10 MBit, 192.168.1.0/24 is on network B with 100 MBit.
I then attach an IMQ device imq0 to the FORWARD table:

You can't use IMQ in forward AFAIK, see
http://www.docum.org/docum.org/kptd/
Hmmm, really?
I mean, all intended packets are going through it, no errors
whatsoever. They are being marked correctly by iptables
and tc filter classifies according to mark. The only problem
seems to be the excess bandwidth distribution, which
leaves me to the question:
How could the hooks of IMQ and the excess bandwidth
distribution of HTB relate in this setup?
I hope you are understanding that I do not question your
knowledge. I'm just not fully persuaded of this yet, so I'd
like to discuss it a bit more.
And thanks a lot for the additional information you gave me!
Kind regards,
Leslie
___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


Re: [LARTC] HTB: Problem with excess bandwidth distribution

2004-10-29 Thread Leslie Patrick Polzer
Andy Furniss wrote:
Shaping from the narrow end of the bottleneck is a bit of a kludge, 
you have to set your rates/ceils lower than link speed or you won't 
have a queue to shape with.

Could you also elaborate this a bit further?
Many thanks so far!
Leslie
___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


Re: [LARTC] HTB: Problem with excess bandwidth distribution

2004-10-29 Thread Andy Furniss
Leslie Patrick Polzer wrote:
Andy Furniss wrote:
Leslie Patrick Polzer wrote:
Hello,
I have a serious problem with HTB which I wasn't able to solve myself.
I run a masquerading router with ppp0 as interface to the Internet.
Three clients need to share a downstream of 1 MBit, which I want
to divide with tc.
When I see a packet being forwarded to one of these clients, I give
it the appropriate unique mark:
iptables -t mangle -A FORWARD -d 192.168.34.141 -j MARK --set-mark 1
iptables -t mangle -A FORWARD -d 192.168.34.140 -j MARK --set-mark 2
iptables -t mangle -A FORWARD -d 192.168.1.2 -j MARK --set-mark 3
Because it might be of interest: 192.168.34.0/24 is on network A
with 10 MBit, 192.168.1.0/24 is on network B with 100 MBit.
I then attach an IMQ device imq0 to the FORWARD table:

You can't use IMQ in forward AFAIK, see
http://www.docum.org/docum.org/kptd/

Hmmm, really?
I mean, all intended packets are going through it, no errors
whatsoever. They are being marked correctly by iptables
and tc filter classifies according to mark. The only problem
seems to be the excess bandwidth distribution, which
leaves me to the question:
How could the hooks of IMQ and the excess bandwidth
distribution of HTB relate in this setup?
I hope you are understanding that I do not question your
knowledge. I'm just not fully persuaded of this yet, so I'd
like to discuss it a bit more.
You are right to question me :-) - I was thinking a bit too much about 
my setup (At least I know that works). I use IMQ on ppp so I can shape 
traffic headed for local processes as well as forwarded. If you don't 
need to do this then you don't need to do it in prerouting anyway.

I am guessing that calling IMQ from forward uses postrouting which is OK 
for your needs. I know from a test I did in prerouting that IMQ doesn't 
respect where in a table it gets called from. You could test by seeing 
if you can shape locally generated traffic marked in output I suppose.

Wherever it hooks you need to set a rate less than link speed and if you 
use an old kernel, patch HTB. I said shaping from the wrong end of the 
bottleneck is a kludge because if I shape from the fat end then I 
control exactly what happens - I can arrange for my latency never to be 
increased by more than the time it takes for a packet my MTU long to be 
sent at my bitrate. As long as I tweak for link overheads I can use 
nearly 100% bandwidth.

Incoming traffic from my ISP has already been through a 600ms fifo - 
it's never going to arrive at more than my link speed, so I need to set 
the ceils/rate totals to less than link speed - how much less will 
determine how fast the queue fills. The behavior of various types of 
queues is probably not the same as if they were at the other end of the 
bottleneck.

There are also factors out of my control - TCP can get bursty when acks 
get buffered elsewhere. There may be packets in long buffers (mainly 
P2P) headed for me which are unstoppable, and my queue may not have any 
packets from active connections at any given time. The queue also reacts 
 too late when the bandwidth changes - A new connection will be in TCP 
slowstart, which quite quickly will increase rate causing a temporary 
filling of ISP buffer - which hurts latency. It doesn't fill enough to 
cause drops, though, so as far as bandwidth allocation goes it's OK.
My queues also drop a bit too much when this happens - causing TCP to 
resync which can be bursty.

Andy.

And thanks a lot for the additional information you gave me!
Kind regards,
Leslie


___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


Re: [LARTC] HTB: Problem with excess bandwidth distribution

2004-10-29 Thread Leslie Patrick Polzer
Still problems :(
I upgraded to kernel 2.6.9 now, configured IMQ to hook itself up after 
NAT, called it
from prerouting, used u32 (matching works), set the root class to a rate 
of 800kBit
(which is 200 less than my link speed) - and the behavior gets even worse :(

Unfortunately, I cannot shape on the outgoing interfaces either, because 
there are two.

I really don't know what to do now... I haven't dug deep into CBQ yet - 
should I try it?

Leslie
___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


Re: [LARTC] HTB: Problem with excess bandwidth distribution

2004-10-29 Thread Jason Boxman
On Friday 29 October 2004 11:36, Leslie Patrick Polzer wrote:
 Still problems :(

 I upgraded to kernel 2.6.9 now, configured IMQ to hook itself up after
 NAT, called it
 from prerouting, used u32 (matching works), set the root class to a rate
 of 800kBit
 (which is 200 less than my link speed) - and the behavior gets even worse
 :(

Define worse?  What metric are you using to measure the behavior?

 Unfortunately, I cannot shape on the outgoing interfaces either, because
 there are two.

Wouldn't IMQ work for this too?

 I really don't know what to do now... I haven't dug deep into CBQ yet -
 should I try it?

CBQ won't magically work over multiple interfaces without something like IMQ, 
just like HTB.

-- 

Jason Boxman
Perl Programmer / *NIX Systems Administrator
Shimberg Center for Affordable Housing | University of Florida
http://edseek.com/ - Linux and FOSS stuff

___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


Re: [LARTC] HTB: Problem with excess bandwidth distribution

2004-10-29 Thread Francisco Pereira
Quoting Leslie Patrick Polzer [EMAIL PROTECTED]:

 Still problems :(
 
 I upgraded to kernel 2.6.9 now, configured IMQ to hook itself up after 
 NAT, called it
 from prerouting, used u32 (matching works), set the root class to a rate 
 of 800kBit
 (which is 200 less than my link speed) - and the behavior gets even worse :(
 
 Unfortunately, I cannot shape on the outgoing interfaces either, because 
 there are two.

Have you tried putting another machine as a bridge? (You dont need the IMQ in
this case)


-
Elecciones Nacionales 2004
Consulte en el Portal donde votar
http://www.montevideo.com.uy/elecciones2004
-

___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


Re: [LARTC] HTB: Problem with excess bandwidth distribution

2004-10-29 Thread Andy Furniss
Leslie Patrick Polzer wrote:
Still problems :(
I upgraded to kernel 2.6.9 now, configured IMQ to hook itself up after 
NAT, called it
from prerouting, used u32 (matching works), set the root class to a rate 
of 800kBit
(which is 200 less than my link speed) - and the behavior gets even 
worse :(

Unfortunately, I cannot shape on the outgoing interfaces either, because 
there are two.

I really don't know what to do now... I haven't dug deep into CBQ yet - 
should I try it?
Hmm - this should work. I just cobbled together a test - It's not very 
elegant because it's based on a slightly different setup, but it works 
for me. I use default as my local traffic has a dynamic IP - you don't 
need to . Note the U32 filters are attached to 1:0 if I attached them to 
1:1 than I would need a rule to send traffic to 1:1.

I wouldn't trust the output of apps for bandwidth tests - their 
averaging can be confusing - also if it weren't just a test I would add 
queues to the classes. Saying that I did notice that HTB was dropping - 
maybe the default queue length is shorter now? It does seem a bit 
strange though, I see drops where I expect the queue to be long enough 
for my rwin and a class with two tcps on the go had less drops than one 
with one - strange.

It did work though use tc -s class ls dev imq0 to see rates (which for 
me using the new TC seem to be shown in the wrong units).

You may need to unwrap the lines if you copy n paste this:
set -x
IPTABLES=/usr/local/sbin/iptables
MODPROBE=/sbin/modprobe
IP=/sbin/ip
TC=/sbin/tc
$IPTABLES -t mangle -D PREROUTING -i ppp0 -j IMQ --todev 0  /dev/null
$IP link set imq0 down  /dev/null
$MODPROBE -r imq  /dev/null
if [ $1 = stop ]
then
echo stopping
exit
fi
$MODPROBE imq numdevs=1
$IPTABLES -t mangle -I PREROUTING -i ppp0 -j IMQ --todev 0
$IP link set imq0 up
$TC qdisc add dev imq0 root handle 1:0 htb default 34
$TC class add dev imq0 parent 1:0 classid 1:1 htb rate 400kbit ceil 
400kbit burst 6k

 1 
$TC class add dev imq0 parent 1:1 classid 1:32 htb rate 133kbit ceil 
400kbit prio 1

$TC filter add dev imq0 protocol ip parent 1:0 prio 1 u32 match ip dst 
192.168.0.2 flowid 1:32

 2 
$TC class add dev imq0 parent 1:1 classid 1:33 htb rate 133kbit ceil 400kbit
$TC filter add dev imq0 protocol ip parent 1:0 prio 1 u32 match ip dst 
192.168.0.3 flowid 1:33

 Default = traffic for local process 
$TC class add dev imq0 parent 1:1 classid 1:34 htb rate 133kbit ceil 400kbit

Andy.

___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


Re: [LARTC] HTB: Problem with excess bandwidth distribution

2004-10-29 Thread Andy Furniss
Andy Furniss wrote:
 1 
$TC class add dev imq0 parent 1:1 classid 1:32 htb rate 133kbit ceil 
400kbit prio 1
I meant to delete the prio 1 - I don't know if it matters  - I tested 
with the other two.

Andy.
___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


[LARTC] HTB: Problem with excess bandwidth distribution

2004-10-28 Thread Leslie Patrick Polzer
Hello,
I have a serious problem with HTB which I wasn't able to solve myself.
I run a masquerading router with ppp0 as interface to the Internet.
Three clients need to share a downstream of 1 MBit, which I want
to divide with tc.
When I see a packet being forwarded to one of these clients, I give
it the appropriate unique mark:
iptables -t mangle -A FORWARD -d 192.168.34.141 -j MARK --set-mark 1
iptables -t mangle -A FORWARD -d 192.168.34.140 -j MARK --set-mark 2
iptables -t mangle -A FORWARD -d 192.168.1.2 -j MARK --set-mark 3
Because it might be of interest: 192.168.34.0/24 is on network A
with 10 MBit, 192.168.1.0/24 is on network B with 100 MBit.
I then attach an IMQ device imq0 to the FORWARD table:
# delegate all incoming on ppp+ to imq0
iptables -t mangle -A FORWARD -i ppp+ -j IMQ --todev 0
After all this I create the actual tc setup:
# --- snip ---
# clear root qdisc
tc qdisc del dev imq0 root
# add root qdisc (htb)
tc qdisc add dev imq0 root handle 1: htb default 40
# add root class (needed for bandwidth borrowing)
tc class add dev imq0 parent 1: classid 1:1 htb rate 1mbit ceil 1mbit
# set classes for users
tc class add dev imq0 parent 1:1 classid 1:10 htb rate 333kbit ceil 1mbit \
   burst 15k
tc class add dev imq0 parent 1:1 classid 1:20 htb rate 333kbit ceil 1mbit \
   burst 15k
tc class add dev imq0 parent 1:1 classid 1:30 htb rate 333kbit ceil 1mbit \
   burst 15k
tc class add dev imq0 parent 1:1 classid 1:40 htb rate 5kbps
# set filters to direct ips to their classes
tc filter add dev imq0 protocol ip parent 1: prio 1 handle 1 fw flowid 1:10
tc filter add dev imq0 protocol ip parent 1: prio 1 handle 2 fw flowid 1:20
tc filter add dev imq0 protocol ip parent 1: prio 1 handle 3 fw flowid 1:30
# --- snap ---
1:40 is just for testing.
The 'rate'-argument gets applied correctly if I don't use ceil - but I 
do, of
course, want to let the classes borrow free bandwidth, so I use a ceiling
of 1 MBit. And herein lies the problem:

If 1:10 and 1:30 both download a file with full speed, 1:10 gets about
20kb/s (which is under its guaranteed bandwidth!) and 1:30 gets
90 kb/s. What is going wrong here? The shortened output of tc:
class htb 1:1 root rate 1Mbit ceil 1Mbit burst 2909b/8 mpu 0b cburst 
2909b/8 mpu 0b level 7
class htb 1:10 parent 1:1 prio 0 quantum 4262 rate 333Kbit ceil 1Mbit 
burst 15Kb/8 mpu 0b cburst
class htb 1:20 parent 1:1 prio 0 quantum 4262 rate 333Kbit ceil 1Mbit 
burst 15Kb/8 mpu 0b cburst
class htb 1:30 parent 1:1 prio 0 quantum 4262 rate 333Kbit ceil 1Mbit 
burst 15Kb/8 mpu 0b cburst
class htb 1:40 parent 1:1 prio 0 quantum 1000 rate 40Kbit ceil 40Kbit 
burst 1650b/8 mpu 0b cburst

...shows that each class is configured equal.
Any clues? I'd be very, very grateful if anyone could point out errors.
If more output is needed, just tell me.
Kind regards,
Leslie
___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


Re: [LARTC] HTB: Problem with excess bandwidth distribution

2004-10-28 Thread Saad S. B. Faruque
did u try it with sfq ?



On Thu, 28 Oct 2004 18:55:00 +0200, Leslie Patrick Polzer
[EMAIL PROTECTED] wrote:
 Hello,
 
 I have a serious problem with HTB which I wasn't able to solve myself.
 
 I run a masquerading router with ppp0 as interface to the Internet.
 Three clients need to share a downstream of 1 MBit, which I want
 to divide with tc.
 When I see a packet being forwarded to one of these clients, I give
 it the appropriate unique mark:
 
 iptables -t mangle -A FORWARD -d 192.168.34.141 -j MARK --set-mark 1
 iptables -t mangle -A FORWARD -d 192.168.34.140 -j MARK --set-mark 2
 iptables -t mangle -A FORWARD -d 192.168.1.2 -j MARK --set-mark 3
 
 Because it might be of interest: 192.168.34.0/24 is on network A
 with 10 MBit, 192.168.1.0/24 is on network B with 100 MBit.
 
 I then attach an IMQ device imq0 to the FORWARD table:
 
 # delegate all incoming on ppp+ to imq0
 iptables -t mangle -A FORWARD -i ppp+ -j IMQ --todev 0
 
 After all this I create the actual tc setup:
 
 # --- snip ---
 # clear root qdisc
  tc qdisc del dev imq0 root
 
 # add root qdisc (htb)
  tc qdisc add dev imq0 root handle 1: htb default 40
 
 # add root class (needed for bandwidth borrowing)
  tc class add dev imq0 parent 1: classid 1:1 htb rate 1mbit ceil 1mbit
 
 # set classes for users
  tc class add dev imq0 parent 1:1 classid 1:10 htb rate 333kbit ceil 1mbit \
 burst 15k
  tc class add dev imq0 parent 1:1 classid 1:20 htb rate 333kbit ceil 1mbit \
 burst 15k
  tc class add dev imq0 parent 1:1 classid 1:30 htb rate 333kbit ceil 1mbit \
 burst 15k
  tc class add dev imq0 parent 1:1 classid 1:40 htb rate 5kbps
 
 # set filters to direct ips to their classes
  tc filter add dev imq0 protocol ip parent 1: prio 1 handle 1 fw flowid 1:10
  tc filter add dev imq0 protocol ip parent 1: prio 1 handle 2 fw flowid 1:20
  tc filter add dev imq0 protocol ip parent 1: prio 1 handle 3 fw flowid 1:30
 
 # --- snap ---
 
 1:40 is just for testing.
 
 The 'rate'-argument gets applied correctly if I don't use ceil - but I
 do, of
 course, want to let the classes borrow free bandwidth, so I use a ceiling
 of 1 MBit. And herein lies the problem:
 
 If 1:10 and 1:30 both download a file with full speed, 1:10 gets about
 20kb/s (which is under its guaranteed bandwidth!) and 1:30 gets
 90 kb/s. What is going wrong here? The shortened output of tc:
 
 class htb 1:1 root rate 1Mbit ceil 1Mbit burst 2909b/8 mpu 0b cburst
 2909b/8 mpu 0b level 7
 class htb 1:10 parent 1:1 prio 0 quantum 4262 rate 333Kbit ceil 1Mbit
 burst 15Kb/8 mpu 0b cburst
 class htb 1:20 parent 1:1 prio 0 quantum 4262 rate 333Kbit ceil 1Mbit
 burst 15Kb/8 mpu 0b cburst
 class htb 1:30 parent 1:1 prio 0 quantum 4262 rate 333Kbit ceil 1Mbit
 burst 15Kb/8 mpu 0b cburst
 class htb 1:40 parent 1:1 prio 0 quantum 1000 rate 40Kbit ceil 40Kbit
 burst 1650b/8 mpu 0b cburst
 
 ...shows that each class is configured equal.
 
 Any clues? I'd be very, very grateful if anyone could point out errors.
 If more output is needed, just tell me.
 
 Kind regards,
 
 Leslie
 
 ___
 LARTC mailing list / [EMAIL PROTECTED]
 http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
 


-- 
Saad S. B. Faruque
MCSE, RHCT, CCNA
Head of NOC
MTL BD Ltd.
___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


Re: [LARTC] HTB: Problem with excess bandwidth distribution

2004-10-28 Thread Zviad O. Giorgadze
Hello Leslie,
 
I had the same problem for kernel 2.4.27 and it was related to bug in HTB.
Use kernel =2.6.8.1 or apply patch from Devik's site
http://luxik.cdi.cz/~devik/qos/htb/v3/htbfair.diff.  

Best regards, 

Zviad
 
Hello,

I have a serious problem with HTB which I wasn't able to solve myself.

I run a masquerading router with ppp0 as interface to the Internet.
Three clients need to share a downstream of 1 MBit, which I want
to divide with tc.
When I see a packet being forwarded to one of these clients, I give
it the appropriate unique mark:

iptables -t mangle -A FORWARD -d 192.168.34.141 -j MARK --set-mark 1
iptables -t mangle -A FORWARD -d 192.168.34.140 -j MARK --set-mark 2
iptables -t mangle -A FORWARD -d 192.168.1.2 -j MARK --set-mark 3

Because it might be of interest: 192.168.34.0/24 is on network A
with 10 MBit, 192.168.1.0/24 is on network B with 100 MBit.

I then attach an IMQ device imq0 to the FORWARD table:

# delegate all incoming on ppp+ to imq0
iptables -t mangle -A FORWARD -i ppp+ -j IMQ --todev 0

After all this I create the actual tc setup:

# --- snip ---
# clear root qdisc
 tc qdisc del dev imq0 root

# add root qdisc (htb)
 tc qdisc add dev imq0 root handle 1: htb default 40

# add root class (needed for bandwidth borrowing)
 tc class add dev imq0 parent 1: classid 1:1 htb rate 1mbit ceil 1mbit

# set classes for users
 tc class add dev imq0 parent 1:1 classid 1:10 htb rate 333kbit ceil 1mbit \
burst 15k
 tc class add dev imq0 parent 1:1 classid 1:20 htb rate 333kbit ceil 1mbit \
burst 15k
 tc class add dev imq0 parent 1:1 classid 1:30 htb rate 333kbit ceil 1mbit \
burst 15k
 tc class add dev imq0 parent 1:1 classid 1:40 htb rate 5kbps

# set filters to direct ips to their classes
 tc filter add dev imq0 protocol ip parent 1: prio 1 handle 1 fw flowid 1:10
 tc filter add dev imq0 protocol ip parent 1: prio 1 handle 2 fw flowid 1:20
 tc filter add dev imq0 protocol ip parent 1: prio 1 handle 3 fw flowid 1:30

# --- snap ---

1:40 is just for testing.

The 'rate'-argument gets applied correctly if I don't use ceil - but I 
do, of
course, want to let the classes borrow free bandwidth, so I use a ceiling
of 1 MBit. And herein lies the problem:

If 1:10 and 1:30 both download a file with full speed, 1:10 gets about
20kb/s (which is under its guaranteed bandwidth!) and 1:30 gets
90 kb/s. What is going wrong here? The shortened output of tc:

class htb 1:1 root rate 1Mbit ceil 1Mbit burst 2909b/8 mpu 0b cburst 
2909b/8 mpu 0b level 7
class htb 1:10 parent 1:1 prio 0 quantum 4262 rate 333Kbit ceil 1Mbit 
burst 15Kb/8 mpu 0b cburst
class htb 1:20 parent 1:1 prio 0 quantum 4262 rate 333Kbit ceil 1Mbit 
burst 15Kb/8 mpu 0b cburst
class htb 1:30 parent 1:1 prio 0 quantum 4262 rate 333Kbit ceil 1Mbit 
burst 15Kb/8 mpu 0b cburst
class htb 1:40 parent 1:1 prio 0 quantum 1000 rate 40Kbit ceil 40Kbit 
burst 1650b/8 mpu 0b cburst

...shows that each class is configured equal.

Any clues? I'd be very, very grateful if anyone could point out errors.
If more output is needed, just tell me.


Kind regards,

Leslie

___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


Re: [LARTC] HTB: Problem with excess bandwidth distribution

2004-10-28 Thread Andy Furniss
Leslie Patrick Polzer wrote:
Hello,
I have a serious problem with HTB which I wasn't able to solve myself.
I run a masquerading router with ppp0 as interface to the Internet.
Three clients need to share a downstream of 1 MBit, which I want
to divide with tc.
When I see a packet being forwarded to one of these clients, I give
it the appropriate unique mark:
iptables -t mangle -A FORWARD -d 192.168.34.141 -j MARK --set-mark 1
iptables -t mangle -A FORWARD -d 192.168.34.140 -j MARK --set-mark 2
iptables -t mangle -A FORWARD -d 192.168.1.2 -j MARK --set-mark 3
Because it might be of interest: 192.168.34.0/24 is on network A
with 10 MBit, 192.168.1.0/24 is on network B with 100 MBit.
I then attach an IMQ device imq0 to the FORWARD table:
You can't use IMQ in forward AFAIK, see
http://www.docum.org/docum.org/kptd/
You can use it in prerouting, but because you are doing NAT you will 
need to select for after NAT in the new IMQ from www.linuximq.net or 
patch for NAT if you want to use an older IMQ. You can't mark on de 
natted IPs in prerouting so you need to use u32.

Shaping from the narrow end of the bottleneck is a bit of a kludge, you 
have to set your rates/ceils lower than link speed or you won't have a 
queue to shape with.

If you don't want to have a more complicated script to mark interactive 
packets/use prio etc. I would add 30K bfifos to each class - or if you 
don't mind patching/tweaking use esfq/sfq with a queue length of about 
20, not that these figures are set in stone - but the defaults for htb 
with no queue added or untweaked sfq are alot longer.

Andy.

# delegate all incoming on ppp+ to imq0
iptables -t mangle -A FORWARD -i ppp+ -j IMQ --todev 0
After all this I create the actual tc setup:
# --- snip ---
# clear root qdisc
tc qdisc del dev imq0 root
# add root qdisc (htb)
tc qdisc add dev imq0 root handle 1: htb default 40
# add root class (needed for bandwidth borrowing)
tc class add dev imq0 parent 1: classid 1:1 htb rate 1mbit ceil 1mbit
# set classes for users
tc class add dev imq0 parent 1:1 classid 1:10 htb rate 333kbit ceil 1mbit \
   burst 15k
tc class add dev imq0 parent 1:1 classid 1:20 htb rate 333kbit ceil 1mbit \
   burst 15k
tc class add dev imq0 parent 1:1 classid 1:30 htb rate 333kbit ceil 1mbit \
   burst 15k
tc class add dev imq0 parent 1:1 classid 1:40 htb rate 5kbps
# set filters to direct ips to their classes
tc filter add dev imq0 protocol ip parent 1: prio 1 handle 1 fw flowid 1:10
tc filter add dev imq0 protocol ip parent 1: prio 1 handle 2 fw flowid 1:20
tc filter add dev imq0 protocol ip parent 1: prio 1 handle 3 fw flowid 1:30
# --- snap ---
1:40 is just for testing.
The 'rate'-argument gets applied correctly if I don't use ceil - but I 
do, of
course, want to let the classes borrow free bandwidth, so I use a ceiling
of 1 MBit. And herein lies the problem:

If 1:10 and 1:30 both download a file with full speed, 1:10 gets about
20kb/s (which is under its guaranteed bandwidth!) and 1:30 gets
90 kb/s. What is going wrong here? The shortened output of tc:
class htb 1:1 root rate 1Mbit ceil 1Mbit burst 2909b/8 mpu 0b cburst 
2909b/8 mpu 0b level 7
class htb 1:10 parent 1:1 prio 0 quantum 4262 rate 333Kbit ceil 1Mbit 
burst 15Kb/8 mpu 0b cburst
class htb 1:20 parent 1:1 prio 0 quantum 4262 rate 333Kbit ceil 1Mbit 
burst 15Kb/8 mpu 0b cburst
class htb 1:30 parent 1:1 prio 0 quantum 4262 rate 333Kbit ceil 1Mbit 
burst 15Kb/8 mpu 0b cburst
class htb 1:40 parent 1:1 prio 0 quantum 1000 rate 40Kbit ceil 40Kbit 
burst 1650b/8 mpu 0b cburst

...shows that each class is configured equal.
Any clues? I'd be very, very grateful if anyone could point out errors.
If more output is needed, just tell me.
Kind regards,
Leslie
___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


Re: [LARTC] HTB problem...

2004-09-07 Thread zytek
Dnia poniedziaek 06 wrzesie 2004 23:56, Cow napisa:
 Hi folks.

 Let's say I would like to make some bandwidth control on my network
 using HTB. I have 2 clients:
[...]
 I think a script as i described, could be very complex to write,
 therefore i ask, whoever is here, for help.
 Thank you all in advance.


Hello all, my first post here, maybe even I will help someone;)

I assume that you want somethink like:
data from server to LAN (PC1,PC2) unshaped (full 100mbit)
data from Internet to LAN shaped

Then all you need to do is make classes with source 192.168.0.1 and 
destination 192.168.0.2(3) and 100mbit rate and then make classes with 
destination 192.168.0.2(3) with download rate. I believe that you understand 
what I am thinkig of.

Or you can use iptables and mark traffic going from server to LAN, and other 
mark for traffic in FORWARD chain. (iptables -t mangle -A FORWARD -j MARK 
--set-mark SOME_MARK)
When using iptables you will be able to shape upload speed, just mark traffic 
in forward going from PC1/2 with output interface eth2 (-o eth2) - it will be 
hosts upload.

I won't write you full script, make it yourself, visit LARTC and firstly try 
htb.init for simple class creation. Good fun!


-- 
.: Jakub Gazik (zytek)
.: email:[EMAIL PROTECTED]
.: JID:[EMAIL PROTECTED]
.: http://www.misiaj.sie.pl [obsolete]
___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


[LARTC] HTB problem...

2004-09-07 Thread Cow
I've tryed to make a script, some of you, who thinks it looks ok?

DEV=eth2
DOWNLINK=1024
UPLINK=512

DOWN1=768
UP1=384

DOWN2=256
UP2=128

tc qdisc add dev $DEV root handle 1: htb default 20

tc class add dev $DEV parent 1: classid 1:1 htb rate ${UPLINK}kbit burst
6k
tc class add dev $DEV parent 1:1 classid 1:10 htb rate ${UPLINK}kbit \
burst 6k prio 1
tc class add dev $DEV parent 1:1 classid 1:20 htb rate ${UP1}kbit \
   burst 6k prio 2
tc class add dev $DEV parent 1:1 classid 1:30 htb rate ${UP2}kbit \
   burst 6k prio 2

tc qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10
tc qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10
tc qdisc add dev $DEV parent 1:30 handle 30: sfq perturb 10

tc filter add dev $DEV parent 1: protocol ip prio 16 u32 \
   match ip src 192.168.0.2 flowid 1:20
tc filter add dev $DEV parent 1: protocol ip prio 16 u32 \
   match ip src 192.168.0.3 flowid 1:30

Not tested yet...
If it works, feel free to letting me know, how to make something like
this, just for download rate.
If it doesn't work, please let me know, what you think is wrong.

- Rune Johannesen

___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


[LARTC] HTB Problem...

2004-09-07 Thread Cow
 You might want to check out this script
 http://www.geocities.com/jame_sj I just noticed a bug (that I need to
 figure out...) in it but this should give a start..

Looks nice, want to share the bug with me? :-)

 
 James


___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


[LARTC] HTB problem...

2004-09-07 Thread Cow
by zytek
Hello all, my first post here, maybe even I will help someone;)

I assume that you want somethink like:
data from server to LAN (PC1,PC2) unshaped (full 100mbit)
data from Internet to LAN shaped

Correct.

Then all you need to do is make classes with source 192.168.0.1 and
destination 192.168.0.2(3) and 100mbit rate and then make classes with
destination 192.168.0.2(3) with download rate. I believe that you
understand
what I am thinkig of.

I do, but could you write an example please, so i have something to make
it from? :-)

Or you can use iptables and mark traffic going from server to LAN, and
other
mark for traffic in FORWARD chain. (iptables -t mangle -A FORWARD -j
MARK
--set-mark SOME_MARK)
When using iptables you will be able to shape upload speed, just mark
traffic
in forward going from PC1/2 with output interface eth2 (-o eth2) - it
will be
hosts upload.

Again, an example would be nice.. i have no idea on how to use MARK
command with iptables, even i know a great deal about iptables in
general.

I won't write you full script, make it yourself, visit LARTC and
firstly try
htb.init for simple class creation. Good fun!

Fair enough, i wouldn't exspect anyone to write a full script for me,
but i would exspect someone to make me an example for instance, how i
can shape PC1's download/upload rate to 256/128 KBit, so i atleast have
something to help me going.

___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


Re: [LARTC] HTB problem...

2004-09-07 Thread Andreas Klauer
Am Tuesday 07 September 2004 23:18 schrieb Cow:
 zytec: (?)
  I assume that you want somethink like:
  data from server to LAN (PC1,PC2) unshaped (full 100mbit)
  data from Internet to LAN shaped

 Correct.

Not really an example, but you may have a look at my script [1].

It solves the 100Mbit LAN vs internet traffic by using a class setup which 
looks like [2], which reminds me that I did a modification to wondershaper 
once [3] that does the same. I think this modification was reported to 
work, however I haven't tested it nor do I support it. Maybe it serves as 
an example...

I'm using a fat HTB class which knows the true interface bandwidth (100MBit 
isn't actually right, you should measure what rates you really get). Then 
there's a child class for the internet traffic and one for the actual LAN 
traffic. If HTB works correctly, this way you get full speed for LAN-only 
transfers, without letting them interfere with the internet traffic.

The script [1] is the one I'm (more or less) actively working on; it 
doesn't support custom rates per user yet, but that's something that'll be 
added for sure in one of the next releases.

HTH
Andreas

[1] http://www.metamorpher.de/fairnat/
[2] http://www.metamorpher.de/files/wshaper-over-lan.png
[3] http://www.metamorpher.de/files/wshaper-over-lan.htb
___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


[LARTC] HTB problem...

2004-09-06 Thread Cow
Hi folks.

Let's say I would like to make some bandwidth control on my network
using HTB. I have 2 clients:

PC1: 192.168.100.2
PC2: 192.168.100.3

Server:
192.168.100.1
This has 2 NIC's eth1 is local and eth2 is connected to the internet.

It could be nice to have a script, where you could specify, how much
bandwidth you want for a specific host on a network, like, PC1 has
10/100 MBit network, but only has 256/128, when surfing the net. PC2 has
the same network ofc, but 768/384 when surfing/downloading assuming the
shared connection is 1024/512.

I am currently running wondershaper1.1a which works prefectly, but i
wish, it could be more specific.
Could also be nice, if it would be someway possible to check on the
clients IP or MAC address to verify, if it's really them. Like it's
only PC1 and PC2 who have access to the server in the 192.168.*.*
segment. Hope i make myself clear.

My server runs redhat 9 in cmd mode/no GUI.
Iptables installed script, as firewall.

I think a script as i described, could be very complex to write,
therefore i ask, whoever is here, for help.
Thank you all in advance.

Regards
Rune Johannesen
Denmark


___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


Re: [LARTC] HTB problem

2003-12-04 Thread Catalin BOIE
  Hello,
 
  I'm having some problems using HTB to prioritize traffic on my linux
  router.
  The main problem is as follows:
  I have a 6Mbits channel on the metropolitan network and a 64kbps link
  for the sites outside my country.
 
  These 64kbps are dynamically allocated by my ISP so I usually get
  something like 128kbps , sometimes 512kbps and even 1 Mbit; it varies
  all the time.
 
  Because of this I don't know how to automatically adjust my HTB script
  depending on the total bandwidth available on the external link
  (without specifying the maximum to 64kbps thus limitting every
  connection even if my ISP grants me more than this bandwidth).
 
  Anyone got any ideas ?

You cannot have a variable bandwidth with htb.
Count on the minimum bandwidth.

 
 
 
  ___
  LARTC mailing list / [EMAIL PROTECTED]
  http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


 ___
 LARTC mailing list / [EMAIL PROTECTED]
 http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


---
Catalin(ux) BOIE
[EMAIL PROTECTED]
___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


Re: [LARTC] HTB problem

2003-12-03 Thread Mihai Tanasescu
Doesn't anyone have any ideas regarding  my problem ?

Mihai Tanasescu wrote:

Hello,

I'm having some problems using HTB to prioritize traffic on my linux 
router.
The main problem is as follows:
I have a 6Mbits channel on the metropolitan network and a 64kbps link 
for the sites outside my country.

These 64kbps are dynamically allocated by my ISP so I usually get 
something like 128kbps , sometimes 512kbps and even 1 Mbit; it varies 
all the time.

Because of this I don't know how to automatically adjust my HTB script 
depending on the total bandwidth available on the external link 
(without specifying the maximum to 64kbps thus limitting every 
connection even if my ISP grants me more than this bandwidth).

Anyone got any ideas ?



___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


[LARTC] HTB problem

2003-12-02 Thread Mihai Tanasescu
Hello,

I'm having some problems using HTB to prioritize traffic on my linux router.
The main problem is as follows:
I have a 6Mbits channel on the metropolitan network and a 64kbps link 
for the sites outside my country.

These 64kbps are dynamically allocated by my ISP so I usually get 
something like 128kbps , sometimes 512kbps and even 1 Mbit; it varies 
all the time.

Because of this I don't know how to automatically adjust my HTB script 
depending on the total bandwidth available on the external link (without 
specifying the maximum to 64kbps thus limitting every connection even if 
my ISP grants me more than this bandwidth).

Anyone got any ideas ?



___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


[LARTC] HTB Problem

2003-09-30 Thread Guilherme Benkenstein
Hi all!!

I'm new in the list.

I'm using Slackware 9.0 with 2.4.21

HTB 0.8.3 

eth0 

DEFAULT=30

eth0-2:30.dfl

RATE=256Kbit
BURST=32Kb
LEAF=sfq

This is my configuration, but, the shaper dosen't works in 32Kbps... 

Anybody can help me?

Thanks

Guilherme
___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


Re: [LARTC] HTB Problem

2003-09-30 Thread Stef Coene
On Tuesday 30 September 2003 15:44, Guilherme Benkenstein wrote:
 Hi all!!

 I'm new in the list.

 I'm using Slackware 9.0 with 2.4.21

 HTB 0.8.3

 eth0

 DEFAULT=30

 eth0-2:30.dfl

 RATE=256Kbit
 BURST=32Kb
 LEAF=sfq

 This is my configuration, but, the shaper dosen't works in 32Kbps...

 Anybody can help me?
Yes and no.
I think you are using htb.init and this is not the htb.init mailing list.

Stef

-- 
[EMAIL PROTECTED]
 Using Linux as bandwidth manager
 http://www.docum.org/
 #lartc @ irc.openprojects.net

___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


Re: [LARTC] htb problem

2003-07-28 Thread Stef Coene
On Thursday 24 July 2003 16:26, Delcho wrote:
 Hello,
 I have a problem with my htb in linux gateway machine.
 Wana make this borrow to and from internet:
 every user must be shaped to 32Kbit,max number of users are 6 in one
 subnet /29
 and all subnet must be shaped to 92Kbit,e.i every user  will download
 with 32Kbit,but when
 all 6 user download do not over 92Kbit! I make some classes /attache
 them/ but every user download with 32Kbit and over many up 92Kbit.
 The script:

 tc qdisc add dev eth1 root handle 1: htb default 2
  tc class add dev eth1 parent 1: classid 1:2 htb rate 100Mbit
 ceil 100Mbit burst 1k
  tc class add dev eth1 parent 1:2 classid 1:11 htb rate
 92Kbit ceil 92Kbit burst 1k
 tc qdisc add dev eth1 parent 1:11 handle 11 sfq perturb 10
  tc class add dev eth1 parent 1:11 classid 1:30 htb rate
 32Kbit ceil 32Kbit burst 1k
 tc qdisc add dev eth1 parent 1:30 handle 30 sfq perturb 10
  tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32
 match ip dst 192.168.1.17 classid 1:30
  tc class add dev eth1 parent 1:11 classid 1:40 htb rate
 32Kbit ceil 32Kbit burst 1k
 tc qdisc add dev eth1 parent 1:40 handle 40 sfq perturb 10
  tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32
 match ip dst 192.168.1.18 classid 1:40
 
  tc class add dev eth1 parent 1:11 classid 1:80 htb rate
 32Kbit ceil 32Kbit burst 1k
 tc qdisc add dev eth1 parent 1:80 handle 80 sfq perturb 10
  tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32
 match ip dst 192.168.1.22 classid 1:80

 May be there is mistake but where.?
Take a look at the faq pages on docum.org.  There is a section with htb rules.  
The problem is that the rate is a minium and the parent ceil is not respected 
if the child classes are asking more then the ceil.

Stef

-- 

[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/


Re: [LARTC] htb problem

2003-06-25 Thread Ratel
Thx a lot for help , I finally managed to rebuild my firewall script,

for people who have same problem as I had, I can say that
the problem lies in propper packet marking (iptables) , sample lines from my
firewall script :

iptables -t mangle -I PREROUTING -i eth0 -p tcp --dport 21 -j
MARK --set-mark 2
iptables -t mangle -I PREROUTING -i eth0 -p tcp --dport 443 -j
MARK --set-mark 3

it's ofcourse not the only way to mark them,
http://www.docum.org/stef.coene/qos/kptd/ is very useful with that.

regards, Ratel [EMAIL PROTECTED]


- Original Message -
From: Stef Coene [EMAIL PROTECTED]
To: Ratel [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, June 12, 2003 9:35 PM
Subject: Re: [LARTC] htb problem


 On Thursday 12 June 2003 21:21, Ratel wrote:
  Hi,
 
  I have some interesting problem with htb , I set up root class and
  sub-classess:
 
  $TC qdisc add dev eth0 root handle 1: htb
  $TC class add dev eth0 parent 1: classid 1:1 htb rate 1990kbit ceil
  2000kbit $TC class add dev eth0 parent 1:1 classid 1:10 htb rate 190kbit
  ceil 200kbit $TC class add dev eth0 parent 1:1 classid 1:11 htb rate
  1400kbit ceil 1600kbit
  $TC class add dev eth0 parent 1:1 classid 1:12 htb rate 1000kbit ceil
  1500kbit
  $TC class add dev eth0 parent 1:1 classid 1:13 htb rate 1000kbit ceil
  1500kbit
  $TC class add dev eth0 parent 1:1 classid 1:14 htb rate 1000kbit ceil
  1200kbit
 The sum of the rates of the childs should be = rate of parent.  In your
case
 1400 + 1000 + 1000 + 1000 = 4400 and your parent rate is 1990.  It's not
 needed, but I recommend it.

  , filters and queuing disciplines :
  #filter
  $TC filter add dev eth0 protocol ip parent 1:0 prio 1 handle 2 fw flowid
  1:10 classid 1:10
  $TC filter add dev eth0 protocol ip parent 1:0 prio 1 handle 3 fw flowid
  1:11 classid 1:11
  $TC filter add dev eth0 protocol ip parent 1:0 prio 2 handle 4 fw flowid
  1:12 classid 1:12
  $TC filter add dev eth0 protocol ip parent 1:0 prio 3 handle 5 fw flowid
  1:13 classid 1:13
  $TC filter add dev eth0 protocol ip parent 1:0 prio 1 handle 6 fw flowid
  1:14 classid 1:14
  (note the packet marking classifier)
 And I also note the different prios.  That's not needed.  Prio determines
the
 order the filters are checked.  In your case it doesn't matter.

  adequate lines from firewall script :
  [...]
  # ftp
  $IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 21 -m state --state
  NEW,ESTABLISHED -t mangle -j MARK --set-mark 3
  # ssh
  $$IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 22 -m state --state
  NEW,ESTABLISHED -t mangle -j MARK --set-mark 2
  # smtp
  $IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 25 -m state --state
  NEW,ESTABLISHED -t mangle -j MARK --set-mark 4
  [...]
 Mhh.  Can you check with iptables -L -v -n that your packets are marked?
And
 can you tell us what's your setup ?  I mean wich nic is connected to the
 internet, what do you want to shape, is this also a firewall?  And try
 marking in the PREROUTING tables.


 Stef

 --

 [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/



___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


RV: [LARTC] htb problem

2003-06-20 Thread Miguel A. Novo



I have the same problem using tc and iptables. All traffic goes to
default.

I tried using tcng too: (eth0 as local NIC, eth1 as Inet nic, eth1
masquerading via iptables and bridged to DSL -I have the internet IP on NIC
2-)


#include fields.tc
#include ports.tc

dev eth1 {
egress {

class ( $ssh )if tcp_sport ==  22;
class ( $smtp )   if tcp_dport ==  25;
class ( $other )  if 1 ;

htb {
class ( rate 298kbps, ceil 298kbps ) {
$ssh   = class ( rate 32kbps, ceil 64kbps ) { sfq; }
;
$smtp  = class ( rate 32kbps, ceil 290kbps ) {
sfq; } ;
$other = class ( rate 192kbps, ceil 298kbps ) {
sfq; } ;
}
}
}
}



But it didn't work (in this last case, I'm afraid my tcng-ing is very
incomplete. :(

--Miguel

Hey I hve the same problem. My packets are marked, my classes are OK
my filters are set OK
and all packets are passing through the root class!!
I think that this is a big problem. A know 1 more person that has the same
problem!brbr

___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


Re: [LARTC] htb problem

2003-06-15 Thread Stef Coene
On Saturday 14 June 2003 23:46, [EMAIL PROTECTED] wrote:
 Hey I hve the same problem. My packets are marked, my classes are OK
 my filters are set OK
 and all packets are passing through the root class!!
 I think that this is a big problem. A know 1 more person that has the same
 problem!
Ok.  I don't understand.  I do all my test using iptables and fw filter.  This 
works for me :
tc filter add dev eth0 parent 1: protocol ip handle 1 fw classid 1:100
iptables -A OUTPUT -t mangle -p tcp --dport 2000 -j MARK --set-mark 1

This is on a simple pc.  No router, no bridge, no firewall.  It's only used to 
shape outgoing locally bandwidth.

Stef

-- 

[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/


Re: [LARTC] htb problem

2003-06-14 Thread terahz

Hey I hve the same problem. My packets are marked, my classes are OK
my filters are set OK
and all packets are passing through the root class!!
I think that this is a big problem. A know 1 more person that has the same
problem!brbr
---mail.bGbr
li - 
li12MB   
liSMS   e!
liPOP3/WAP br
_br
a target='_blank' 
href=/ads/adclick.php?bannerid=671amp;zoneid=13amp;source=amp;dest=http%3A%2F%2Fmail.bg%2Famp;ismap=HOB
 EATEH APEC/a

___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


[LARTC] htb problem

2003-06-12 Thread Ratel
Hi,

I have some interesting problem with htb , I set up root class and
sub-classess:

$TC qdisc add dev eth0 root handle 1: htb
$TC class add dev eth0 parent 1: classid 1:1 htb rate 1990kbit ceil 2000kbit
$TC class add dev eth0 parent 1:1 classid 1:10 htb rate 190kbit ceil 200kbit
$TC class add dev eth0 parent 1:1 classid 1:11 htb rate 1400kbit ceil
1600kbit
$TC class add dev eth0 parent 1:1 classid 1:12 htb rate 1000kbit ceil
1500kbit
$TC class add dev eth0 parent 1:1 classid 1:13 htb rate 1000kbit ceil
1500kbit
$TC class add dev eth0 parent 1:1 classid 1:14 htb rate 1000kbit ceil
1200kbit

, filters and queuing disciplines :
#filter
$TC filter add dev eth0 protocol ip parent 1:0 prio 1 handle 2 fw flowid
1:10 classid 1:10
$TC filter add dev eth0 protocol ip parent 1:0 prio 1 handle 3 fw flowid
1:11 classid 1:11
$TC filter add dev eth0 protocol ip parent 1:0 prio 2 handle 4 fw flowid
1:12 classid 1:12
$TC filter add dev eth0 protocol ip parent 1:0 prio 3 handle 5 fw flowid
1:13 classid 1:13
$TC filter add dev eth0 protocol ip parent 1:0 prio 1 handle 6 fw flowid
1:14 classid 1:14
(note the packet marking classifier)

adequate lines from firewall script :
[...]
# ftp
$IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 21 -m state --state
NEW,ESTABLISHED -t mangle -j MARK --set-mark 3
# ssh
$$IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 22 -m state --state
NEW,ESTABLISHED -t mangle -j MARK --set-mark 2
# smtp
$IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 25 -m state --state
NEW,ESTABLISHED -t mangle -j MARK --set-mark 4
[...]

#qdisc
$TC qdisc add dev eth0 parent 1:10 handle 20: sfq perturb 10
$TC qdisc add dev eth0 parent 1:11 handle 30: sfq perturb 10
$TC qdisc add dev eth0 parent 1:12 handle 40: sfq perturb 10
$TC qdisc add dev eth0 parent 1:13 handle 50: sfq perturb 10
$TC qdisc add dev eth0 parent 1:14 handle 60: sfq perturb 10

the problem is - all the traffic goes only through root class '1:'

#tc -s qdisc ls dev eth0
qdisc sfq 60: quantum 1514b perturb 10sec
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0)

 qdisc pfifo 50: limit 5p
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0)

 qdisc pfifo 40: limit 5p
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0)

 qdisc pfifo 30: limit 5p
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0)

 qdisc pfifo 20: limit 5p
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0)

 qdisc htb 1: r2q 10 default 0 direct_packets_stat 671
 Sent 392890 bytes 671 pkts (dropped 0, overlimits 0)


I'd be very grateful , if you could help me with this.

thanks in advance.

Ratel .at. aonet.pl


___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


Re: [LARTC] htb problem

2003-06-12 Thread Esteban
do you have two nics? the 2megas internet is eth0 right? so you are tc'ing packets 
going out of interface eth0.

paquets are comming from eth1 for example? 
in such case you coutlf -t mangle -I PREROUTING -i eth1 -j MARK --set-mark {1|2|4|}
??

so packets going from internal (eth1) going out (eth0) are previusly marked.
im pretty sure about this.
hope it helps, good luck.


Quoting Ratel [EMAIL PROTECTED]:

 Hi,
 
 I have some interesting problem with htb , I set up root class and
 sub-classess:
 
 $TC qdisc add dev eth0 root handle 1: htb
 $TC class add dev eth0 parent 1: classid 1:1 htb rate 1990kbit ceil 2000kbit
 $TC class add dev eth0 parent 1:1 classid 1:10 htb rate 190kbit ceil 200kbit
 $TC class add dev eth0 parent 1:1 classid 1:11 htb rate 1400kbit ceil
 1600kbit
 $TC class add dev eth0 parent 1:1 classid 1:12 htb rate 1000kbit ceil
 1500kbit
 $TC class add dev eth0 parent 1:1 classid 1:13 htb rate 1000kbit ceil
 1500kbit
 $TC class add dev eth0 parent 1:1 classid 1:14 htb rate 1000kbit ceil
 1200kbit
 
 , filters and queuing disciplines :
 #filter
 $TC filter add dev eth0 protocol ip parent 1:0 prio 1 handle 2 fw flowid
 1:10 classid 1:10
 $TC filter add dev eth0 protocol ip parent 1:0 prio 1 handle 3 fw flowid
 1:11 classid 1:11
 $TC filter add dev eth0 protocol ip parent 1:0 prio 2 handle 4 fw flowid
 1:12 classid 1:12
 $TC filter add dev eth0 protocol ip parent 1:0 prio 3 handle 5 fw flowid
 1:13 classid 1:13
 $TC filter add dev eth0 protocol ip parent 1:0 prio 1 handle 6 fw flowid
 1:14 classid 1:14
 (note the packet marking classifier)
 
 adequate lines from firewall script :
 [...]
 # ftp
 $IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 21 -m state --state
 NEW,ESTABLISHED -t mangle -j MARK --set-mark 3
 # ssh
 $$IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 22 -m state --state
 NEW,ESTABLISHED -t mangle -j MARK --set-mark 2
 # smtp
 $IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 25 -m state --state
 NEW,ESTABLISHED -t mangle -j MARK --set-mark 4
 [...]
 
 #qdisc
 $TC qdisc add dev eth0 parent 1:10 handle 20: sfq perturb 10
 $TC qdisc add dev eth0 parent 1:11 handle 30: sfq perturb 10
 $TC qdisc add dev eth0 parent 1:12 handle 40: sfq perturb 10
 $TC qdisc add dev eth0 parent 1:13 handle 50: sfq perturb 10
 $TC qdisc add dev eth0 parent 1:14 handle 60: sfq perturb 10
 
 the problem is - all the traffic goes only through root class '1:'
 
 #tc -s qdisc ls dev eth0
 qdisc sfq 60: quantum 1514b perturb 10sec
  Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
 
  qdisc pfifo 50: limit 5p
  Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
 
  qdisc pfifo 40: limit 5p
  Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
 
  qdisc pfifo 30: limit 5p
  Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
 
  qdisc pfifo 20: limit 5p
  Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
 
  qdisc htb 1: r2q 10 default 0 direct_packets_stat 671
  Sent 392890 bytes 671 pkts (dropped 0, overlimits 0)
 
 
 I'd be very grateful , if you could help me with this.
 
 thanks in advance.
 
 Ratel .at. aonet.pl
 
 
 ___
 LARTC mailing list / [EMAIL PROTECTED]
 http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
 


___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


RE: [LARTC] htb problem

2003-06-12 Thread Morten Isaksen

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
 Behalf Of Stef Coene
 Sent: 12. juni 2003 21:35
 To: Ratel; [EMAIL PROTECTED]
 Subject: Re: [LARTC] htb problem
 
  adequate lines from firewall script :
  [...]
  # ftp
  $IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 21 -m state --state
  NEW,ESTABLISHED -t mangle -j MARK --set-mark 3
  # ssh
  $$IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 22 -m state --state
  NEW,ESTABLISHED -t mangle -j MARK --set-mark 2
  # smtp
  $IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 25 -m state --state
  NEW,ESTABLISHED -t mangle -j MARK --set-mark 4
  [...]
 Mhh.  Can you check with iptables -L -v -n that your packets are marked?
 And
 can you tell us what's your setup ?  I mean wich nic is connected to the
 internet, what do you want to shape, is this also a firewall?  And try
 marking in the PREROUTING tables.

I have the same problem. According to iptables the packets are marked but
all the traffic goes to the root htb class.

--
Morten Isaksen
[EMAIL PROTECTED] - http://www.aub.dk/~misak


___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


Re: [LARTC] htb problem

2003-06-12 Thread Stef Coene
On Thursday 12 June 2003 22:04, Morten Isaksen wrote:
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
  Behalf Of Stef Coene
  Sent: 12. juni 2003 21:35
  To: Ratel; [EMAIL PROTECTED]
  Subject: Re: [LARTC] htb problem
 
   adequate lines from firewall script :
   [...]
   # ftp
   $IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 21 -m state --state
   NEW,ESTABLISHED -t mangle -j MARK --set-mark 3
   # ssh
   $$IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 22 -m state --state
   NEW,ESTABLISHED -t mangle -j MARK --set-mark 2
   # smtp
   $IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 25 -m state --state
   NEW,ESTABLISHED -t mangle -j MARK --set-mark 4
   [...]
 
  Mhh.  Can you check with iptables -L -v -n that your packets are marked?
  And
  can you tell us what's your setup ?  I mean wich nic is connected to the
  internet, what do you want to shape, is this also a firewall?  And try
  marking in the PREROUTING tables.

 I have the same problem. According to iptables the packets are marked but
 all the traffic goes to the root htb class.
Mhh.  Some commands that works for me :

tc filter add dev eth0 parent 1: protocol ip handle 1 fw classid 1:100
iptables -A OUTPUT -t mangle -p tcp --dport 2000 -j MARK --set-mark 1


Stef

-- 

[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/


Re: [LARTC] htb problem

2003-06-12 Thread Stef Coene
On Thursday 12 June 2003 21:46, Esteban wrote:
 Stef! please explain me this:
 When i use traffic shaper, i apply the root to the innterface i want to
 controll the packets that are leaving right? 
Yes.

 The sum of classes should
 not be greater than the root one.
 Supossing i have 2 nics. One for internal (eth1) and other for internet
 (eth0). i can mangle packets:
 -t mangle -I PREROUTING -i eth1 -j MARK --set-mark 1

 and then filter them all on the eth0 device with:
 tc filter add dev $DEV protocol ip parent 1:0 prio 1 handle 0x1 fw flowid
 1:20 is this okay?
Yes.

 Cause for me, is not working.
 jeje..i see packets accounting on the right class, but they dont go to the
 speed i want (i see that in that class are much packets lended)..that
 might be that that class is asking for BW to greater classes? if you can
 would be a great help to clear out this doubts!
So your filters are working.  The lended packets are not important.
For your htb setup, have you read the docs I collected on www.docum.org ?

Stef

-- 

[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/


[LARTC] HTB problem

2003-01-23 Thread Jay Wineinger
Hi,
Ive been looking at tinkering with the linux traffic control stuff
lately and decided to try out the htb qdisc.  My setup is as follows:

2 interfaces: eth0 goes to internet, and eth1 goes to a NAT'd subnet. eth0
has a 7mbit link, but only a 4.5 mbit link to the internet while eth1 is a
100 mbit link to the internal subnet.  The box that is doing the routing
(and tc soon, hopefully) acts as webserver,dhcp,firewall,NAT,and fileserver
for the internal subnet.  The internal network (at a college) has heavy
kazaa and other filesharing usage over the internet.   I want to use the
lartc utilities to make the bulk traffic from filesharing,etc to be the
lowest priority and have interactive (ssh), mail, and http be higher prios
(in that order).

Anyway, I dont want to limit the traffic that is going TO the server only,
ie. people taking files off my server, and I dont really care who is
creating the traffic, I just want priorities  on types of traffic.  That
being the case, I decided to do the shaping on the eth0 interface.  Ive
setup rules in iptables to mark the different kinds of traffic.

With that done, I created the root htb qdisc  with the following:
$TC qdisc add dev eth0 root handle 1: htb default 20

However, I get an error about illegal rate when I try to create a class
with:
$TC class add dev eth0 parent 1:1 classid 1:10 htb rate 30kpbs burst 2k
prio 1 ceil 100kbps

I wondered if my tc version wasnt up-to date enough to work with htb, but it
was the one downloaded from the htb homepage at
http://luxik.cdi.cz/~devik/qos/htb/v3/htb3.6-020525.tgz

# ./tc -V
tc utility, iproute2-ss991023

is there anything else that might need updating, or is my syntax wrong?  any
suggestions about my setup would be welcome as well, since this is my first
attempt at this

thanks,
jay

___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/



Re: [LARTC] HTB problem

2003-01-23 Thread mingching.tiew
You have a typo :-  kpbs

Also, it seems that the parent 1:1 is not created yet.

- Original Message -
From: Jay Wineinger [EMAIL PROTECTED]

 However, I get an error about illegal rate when I try to create a class
 with:
 $TC class add dev eth0 parent 1:1 classid 1:10 htb rate 30kpbs burst
2k
 prio 1 ceil 100kbps




___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/



Re: [LARTC] HTB problem

2003-01-23 Thread Jay Wineinger
grr, I thought i had checked everything close.  Thanks =)

___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/



Re: [LARTC] HTB Problem

2002-12-09 Thread Stef Coene
On Monday 09 December 2002 19:19, [EMAIL PROTECTED] wrote:
 Hello,

  I am shaping traffic for ~250 users and i have noticed something is wrong:
  Each user is being shaped from 32kbit/s to 2mbit/s.

  When i run the script which creates the classes the following error is
 printed to syslog: Dec  9 19:53:34 p1 kernel: HTB: quantum of class 10009
 is small. Consider r2q change.4HTB: quantum of class 10055 is small.
 Consider r2q change.4HTB: quantum of class 10082 is small. Consider r2q
 change.4HTB: quantum of class 10103 is small. Consider r2q change.4HTB:
 quantum of class 10106 is small. Consider r2q change.4HTB: quantum of
 class 10109 is small. Consider r2q change.
 ... etc etc.

 I searched google and found some posts on this error, they said to change
 the r1q quantum value, tho it wasnt clearly said how big the value should
 be.

 Could anyone tell me what r2q value to set if thaffic is shaped to 32kbit,
 64 kbit and 128kbit/s?
Quantum = rate / r2q.  Quantum should be  1500 and smaller then 60.000.
I have some more info on www.docum.org on the faq page.

 I read the manual of HTB and it says:
 'Normaly you don't need to specify quantums manualy as HTB chooses
 precomputed values. It computes classe's quantum (when you add or change
 it) as its rate divided by r2q global parameter. Its default value is 10
 and because typical MTU is 1500 the default is good for rates from 15 kBps
 (120 kbit). For smaller minimal rates specify r2q 1 when creating qdisc -
 it is good from 12 kbit which should be enough'

 So, is
 'r2q 3' enough for 32kbit/s
 'r2q 6' enough for 64kbit/s
 and
 'r2q 10' (default) enough for 128kbit/s+?


 Soon after the 'HTB: quantum of class class is small' messages in syslog
 i get the following errors from HTB:
 (around 10 minutes after the warnings of 'quantum of class class is
 small':

 Dec  9 20:04:43 p1 kernel: HTB: bad diff in events, cl=10345 diff=46CE
 now=1187872768 then=4294934528 j=10106476
 Dec  9 20:04:48 p1 kernel: NET: 189 messages suppressed.
 Dec  9 20:04:48 p1 kernel: HTB: bad diff in events, cl=10054 diff=470D
 now=1191976960 then=4294909952 j=10106977
 Dec  9 20:04:53 p1 kernel: NET: 190 messages suppressed.
 Dec  9 20:04:53 p1 kernel: HTB: bad diff in events, cl=10054 diff=474C
 now=1196105728 then=4294909952 j=10107481

 And it seems the classes start dying one after other, cause the clients
 start calling me and screaming 'internet doesnt work'.
 as soon as i flush qdisc, everything works perfect again.
 So for now i have put the traffic script in crontab flushing and adding
 classes every 15 minutes.

 Any suggestions?

 I am using HTB 3.6 and Linux 2.4.19

 I tried Linux 2.4.20 with HTB included, tho the results were much more poor
 - if i shaped traffic to 256kbit/s on 2.4.19 the ping was around 200ms
 (constant), tho on 2.4.20 it was increasing and decreasing dramatically -
 from 6000ms to 80ms.
2.4.20 has htb 3.6.  So it's the same version.  It's strange that you have 
different results.

Stef

-- 

[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/



Re: [LARTC] HTB - problem with one thread

2002-08-29 Thread Ciprian Nica


On Wednesday 28 August 2002 20:45, Stef Coene wrote:

  The problem is that clients can have their bandwidths at maximum only if
  they use a download accelerating software like DAP with multiple
  symultanous threads. Using only one thread, a single download can reach
  about 60% of the allocated bandwidth.

 Quantum is used if 2 or more classes with the same parent are fighting for
 bandwidth.  First, they are allowed to get the rate you gave them.  For the
 remaining bandwidth, quantum is used.  Each class may send quantum bytes.
 You have to make sure quantum  MTU (typical 1500 bytes for ethernet).

 What if you use no sfq qdiscs?

 Stef

I have tried with pfifo queues and it's the same. I made many tests changing 
quantum, queueing for leaf but in no case I could reach the allocated 
bandwidth with a single download thread. The same limit set on cisco router 
with traffic-shape, worked fine. 

Could there be a problem when there are many qdiscs ? Are there many 
calculations to be done, so the packets get delayed and the TCP transfer rate 
is lowered. 

Ciprian

___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/



[LARTC] HTB - problem with one thread

2002-08-28 Thread Ciprian Nica

Hello, 

Besides a very good functionality, I have a small, yet stressing, problem. 

Let's say I have a bandwidth of N bits. 

I have X clients, everyone with his fixed bandwidth. 

I create htb qdsics for each client. Each leaf has sfq queueing 
discipline. 

A sample config would be like this :

tc class add dev eth0 parent 1:2 classid 1:346 htb rate 32Kbit ceil 32Kbit 
   burst 4k cburst 2k prio 4
tc qdisc add dev eth0 parent 1:346 handle 346 sfq perturb 10

AND 

tc class add dev eth0 parent 1:2 classid 1:161 htb rate 256Kbit ceil 
   256Kbit burst 32k cburst 2k prio 4
tc qdisc add dev eth0 parent 1:161 handle 161 sfq perturb 10


The filters are like :
tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip dst 1.2.3.128/25 
classid 1:346
tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip dst 1.2.3.4/30 
classid 1:161

The problem is that clients can have their bandwidths at maximum only if 
they use a download accelerating software like DAP with multiple 
symultanous threads. Using only one thread, a single download can reach 
about 60% of the allocated bandwidth. 

I have tested a download without any limits and it was working well, so 
there's no problem with the remote site. 

I have searched thorugh messages posted on this mailing list but I didn't 
find a similar problem.


Maybe I need to set quantum manually. I have tested with r2q default value 
(10) and also with 2 (raising quantum). 

Another question would be: if quantum is bigger, the client can exceed his 
limit by that value ? Is that possible all the time or at bursty intervals 
? 


Thank you very much,
Ciprian Nica
 



___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/



[LARTC] HTB problem (yet another one?)

2002-08-21 Thread Yans van Horn

Hello

I have a small (maybe typical?) problem with HTB. Present configuration is:

Kernel: 2.4.20-pre4 (with HTB, IMQ)

endeavour:/var/log# tc -V
tc utility, iproute2-ss010824

Which should support HTB because writes help for it ;-)

endeavour:~# tc qdisc add dev imq0 root handle 1 htb ttt
What is ttt?
Usage: ... qdisc add ... htb [default N] [r2q N]
 default  number of class to which unclassified packets are sent {1}
and so on

endeavour:~# ip link show
1: lo: LOOPBACK,UP mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: BROADCAST,MULTICAST,ALLMULTI,UP mtu 1500 qdisc pfifo_fast qlen 100
link/ether 00:50:ba:d4:9d:50 brd ff:ff:ff:ff:ff:ff
3: eth1: BROADCAST,MULTICAST,UP mtu 1500 qdisc pfifo_fast qlen 100
link/ether 00:48:54:55:54:d1 brd ff:ff:ff:ff:ff:ff
4: eth2: BROADCAST,MULTICAST,ALLMULTI,UP mtu 1500 qdisc pfifo_fast qlen 100
link/ether 00:a0:24:d5:ae:33 brd ff:ff:ff:ff:ff:ff
5: ppp0: POINTOPOINT,MULTICAST,NOARP,UP mtu 1656 qdisc pfifo_fast qlen 3
link/ppp
6: ppp1: POINTOPOINT,MULTICAST,NOARP,UP mtu 1656 qdisc pfifo_fast qlen 3
link/ppp
7: imq0: NOARP,UP mtu 1500 qdisc pfifo_fast qlen 30
link/void

I should have all the needed modules also:

endeavour:~# lsmod
Module  Size  Used byNot tainted
ipt_IMQ  760   1  (autoclean)
sch_htb18048   0  (autoclean) (unused)
imq 1864   1
cls_route   4088   0  (unused)
cls_u32 4540   0
cls_fw  2360   0  (unused)
sch_prio2368   0  (unused)
sch_sfq 3520   0  (unused)
sch_tbf 2432   0
sch_cbq11744   0
ipt_MARK 792  73  (autoclean)
iptable_mangle  2196   1  (autoclean)
ipt_REDIRECT 824   3  (autoclean)
ipt_nth 1280   2  (autoclean)
ipt_REJECT  2840   2  (autoclean)
iptable_filter  1672   1  (autoclean)
ppp_deflate 2904   2  (autoclean)
zlib_inflate   18436   0  (autoclean) [ppp_deflate]
zlib_deflate   17720   0  (autoclean) [ppp_deflate]
bsd_comp3992   0  (autoclean)
3c59x  24560   1
ip_nat_ftp  2864   0  (unused)
iptable_nat14040   2  [ipt_REDIRECT ip_nat_ftp]
ip_conntrack_ftp3760   1
ip_conntrack   16448   2  [ipt_REDIRECT ip_nat_ftp iptable_nat
ip_conntrack_ftp]
ip_tables  10552  10  [ipt_IMQ ipt_MARK iptable_mangle ipt_REDIRECT
ipt_nth ipt_REJECT iptable_filter iptable_nat]

-
And the PROBLEM:

When i try to add qdisc to the imq device.. a get:

endeavour:~# tc qdisc add dev imq0 root handle 1 htb default 20 r2q 10
RTNETLINK answers: Invalid argument
-

BTW: Adding CBQ qdisc to imq0 works fine... Any suggestions ?

--
regards,

Marcin 'Yans' Bazarnik
[EMAIL PROTECTED]

___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/



Re: [LARTC] HTB problem (yet another one?)

2002-08-21 Thread Stef Coene

 endeavour:~# tc qdisc add dev imq0 root handle 1 htb ttt
 What is ttt?
 Usage: ... qdisc add ... htb [default N] [r2q N]
  default  number of class to which unclassified packets are sent {1}
 and so on
Why do you have that ttt option?  If you remove ttt from the command, does 
it work?

 -
 And the PROBLEM:

 When i try to add qdisc to the imq device.. a get:

 endeavour:~# tc qdisc add dev imq0 root handle 1 htb default 20 r2q 10
 RTNETLINK answers: Invalid argument
 -

 BTW: Adding CBQ qdisc to imq0 works fine... Any suggestions ?
What if you add a htb qdisc with no options ?
tc qdisc add dev imq0 root handle 1 htb

Stef

-- 

[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/



Re: [LARTC] HTB problem !

2002-05-14 Thread Stef Coene

On Tuesday 14 May 2002 08:22, Arindam Haldar wrote:
 hi all

 After patching  compiling htb3_2.4.17; imq-2.4.18; sch_geberic with
 kernal 2.4.18 and  iptables-1.2.6a-imq with iptables-1.2.7-20020423 i
 faced the folowing problem patching htb3_tc with
 iproute2-2.4.7-now-ss010824---

 [root@test iproute2]# patch -p1  ../htb3_tc.diff
 patching file tc/q_htb.c
 patching file tc/Makefile
 Hunk #1 FAILED at 13.
 1 out of 1 hunk FAILED -- saving rejects to file tc/Makefile.rej
 [root@test iproute2]#


 pls i need help for u gurus is solving it.
The latest release of htb3 fixes this.

Stef

-- 

[EMAIL PROTECTED]
 Using Linux as bandwidth manager
 http://www.docum.org/
 #lartc @ irc.openprojects.net
___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/



[LARTC] HTB problem !

2002-05-13 Thread Arindam Haldar

hi all

After patching  compiling htb3_2.4.17; imq-2.4.18; sch_geberic with 
kernal 2.4.18 and  iptables-1.2.6a-imq with iptables-1.2.7-20020423 i 
faced the folowing problem patching htb3_tc with 
iproute2-2.4.7-now-ss010824---

[root@test iproute2]# patch -p1  ../htb3_tc.diff
patching file tc/q_htb.c
patching file tc/Makefile
Hunk #1 FAILED at 13.
1 out of 1 hunk FAILED -- saving rejects to file tc/Makefile.rej
[root@test iproute2]#


pls i need help for u gurus is solving it.
thanking in anticipation
A.H

___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/