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 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] Limiting Bandwidth of an ppp interfaces

2004-10-29 Thread Leslie Patrick Polzer
Florian Taeger wrote:
Of course i read the docs, but I just don't know how exactly to generate the
shape-filter for this. I know i have to establish a root entry and make
another entry for every ppp device. but how do i connect the interfaces an
the traffic ?!? How would I generate this "hard limit" for the traffic ?
 

Like Andy Furniss wrote:
Mark each incoming packets on pppn so you know where it is coming from.
Then attach n HTB classes below eth0's root and stuff each packet in its
class.
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 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/


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