* [LARTC] IP based bandwith limit
@ 2004-10-18 9:17 Christoph Petersen
2004-10-18 10:00 ` Peter Huetmannsberger
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: Christoph Petersen @ 2004-10-18 9:17 UTC (permalink / raw)
To: lartc
Hi,
i've following problem. One of our gateway router, which connects some
of our customers should have bandwith limit.
So customer A with IP XX should have 2 Mbit, customer B with IP YY
should have 10 Mbit. There is no need of borrowing bandwith so no
fairness needed.
My simple question: with which technique should I manage this shaping?
Or is there any existing project which provides this allready?
Greets
Christoph
_______________________________________________
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] IP based bandwith limit
2004-10-18 9:17 [LARTC] IP based bandwith limit Christoph Petersen
@ 2004-10-18 10:00 ` Peter Huetmannsberger
2004-10-18 10:19 ` Christoph Petersen
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Peter Huetmannsberger @ 2004-10-18 10:00 UTC (permalink / raw)
To: lartc
Hi!
Again, beware, that I am new to this myself, but if there is no borrowing
necessary, does that mean you have more than 12 Mbit to hand out. If so, I
assume you have one interface per customer, in which case you could use
tbf on each interface. If both customers are behind the same interface you
could use htb and lower the ceiling per customer, which has the same
effect, with a filter rule for each customer --> class, based on ip
address.
Hope this helps, correct me if I am wrong.
.peter
On Mon, 18 Oct 2004, Christoph Petersen wrote:
> Hi,
>
> i've following problem. One of our gateway router, which connects some
> of our customers should have bandwith limit.
>
> So customer A with IP XX should have 2 Mbit, customer B with IP YY
> should have 10 Mbit. There is no need of borrowing bandwith so no
> fairness needed.
>
> My simple question: with which technique should I manage this shaping?
> Or is there any existing project which provides this allready?
>
> Greets
> Christoph
> _______________________________________________
> LARTC mailing list / LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
>
_______________________________________________
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] IP based bandwith limit
2004-10-18 9:17 [LARTC] IP based bandwith limit Christoph Petersen
2004-10-18 10:00 ` Peter Huetmannsberger
@ 2004-10-18 10:19 ` Christoph Petersen
2004-10-18 12:04 ` Peter Huetmannsberger
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Christoph Petersen @ 2004-10-18 10:19 UTC (permalink / raw)
To: lartc
Hi,
unfortunately there is only one interface for the customers. My problem
is to limit the up AND down speed in dependence to each other.
So customer A get a bandwith of 2Mbit this is up AND down so if he
downloads with 1Mbit he gets a max upload speed of 1Mbit.
I've tried it with htb like this:
#!/bin/sh
TC=/sbin/tc
DEV=eth0
$TC qdisc add dev $DEV root handle 1 htb default 90
$TC qdisc add dev $DEV handle ffff: ingress
$TC class add dev $DEV parent 1: classid 1:2 htb rate 100Mbit burst 6k
$TC class add dev $DEV parent 1:2 classid 1:10 htb rate 10kbps ceil 10kbps
$TC filter add dev $DEV parent 1:0 protocol ip prio 100 u32 \
match ip dst 192.168.1.19 \
classid 1:10
$TC filter add dev $DEV parent ffff: protocol ip prio 50 u32 \
match ip src 192.168.1.19 \
police rate 10kbps burst 10k drop flowid 1:10
this is my internal test. But it wouldn't work with dependence to each
other...
Greets
Christoph
Peter Huetmannsberger wrote:
>Hi!
>
>Again, beware, that I am new to this myself, but if there is no borrowing
>necessary, does that mean you have more than 12 Mbit to hand out. If so, I
>assume you have one interface per customer, in which case you could use
>tbf on each interface. If both customers are behind the same interface you
>could use htb and lower the ceiling per customer, which has the same
>effect, with a filter rule for each customer --> class, based on ip
>address.
>
>Hope this helps, correct me if I am wrong.
>
>.peter
>
>
>On Mon, 18 Oct 2004, Christoph Petersen wrote:
>
>
>
>>Hi,
>>
>>i've following problem. One of our gateway router, which connects some
>>of our customers should have bandwith limit.
>>
>>So customer A with IP XX should have 2 Mbit, customer B with IP YY
>>should have 10 Mbit. There is no need of borrowing bandwith so no
>>fairness needed.
>>
>>My simple question: with which technique should I manage this shaping?
>>Or is there any existing project which provides this allready?
>>
>>Greets
>>Christoph
>>_______________________________________________
>>LARTC mailing list / LARTC@mailman.ds9a.nl
>>http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
>>
>>
>>
>
>
>
>
>
_______________________________________________
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] IP based bandwith limit
2004-10-18 9:17 [LARTC] IP based bandwith limit Christoph Petersen
2004-10-18 10:00 ` Peter Huetmannsberger
2004-10-18 10:19 ` Christoph Petersen
@ 2004-10-18 12:04 ` Peter Huetmannsberger
2004-10-18 14:28 ` Christoph Petersen
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Peter Huetmannsberger @ 2004-10-18 12:04 UTC (permalink / raw)
To: lartc
Hi
like I said, I am new too, so take this with a grain of salt.
> unfortunately there is only one interface for the customers. My problem
> is to limit the up AND down speed in dependence to each other.
Downloads become uploads on your internal interface!
so if eth0 is your external interface a download would be INCOMING on eth0
but as it is going on to your internal interface (e.g. eth1) it becomes an
upload to your customer. So incoming traffic from the internet to your
customers is outgoing on eth1.
if you do this on eth1:
--------------
#!/bin/bash
tc qdisc add dev eth1 root handle 1: htb default 20
tc class add dev eth1 parent 1: classid 1:1 htb rate 90mbit burst 15k
tc class add dev eth1 parent 1:1 classid 1:10 htb rate 10mbit
prio 0 burst 15k
tc class add dev eth1 parent 1:1 classid 1:20 htb rate 1mbit ceil 1mbit
burst 6k prio 1
U32="tc filter add dev eth1 protocol ip parent 1:0 prio 0 u32"
$U32 match ip dst 192.168.1.19 flowid 1:10
---------------
Then you have split the traffic into two classes:
one for the preferred customer, who gets 10Mbit and a default for all the
other traffic, which gets 1Mbit. It still leaves a lot of bandwidth
unused! (79 Mbit)
I have made the experience (which cost me an awful lot of time) that
assuming the interface woudl produce excactly 100Mbit is a mistake and htb
does unexpected things. It is probably bets to lower the parent class
trafic 1: to something about 10% below your actual internet connection,
even on your internal interface. (Please correct me if I am completely
wrong!) I used iptraf to have a look on the throughput.
You would have to do something similar for actual uploads from your
customers to the internet on eth0, but as you probably nat the traffic I
am not certain what you would do there! Anyone else?
greetings,
.peter
_______________________________________________
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] IP based bandwith limit
2004-10-18 9:17 [LARTC] IP based bandwith limit Christoph Petersen
` (2 preceding siblings ...)
2004-10-18 12:04 ` Peter Huetmannsberger
@ 2004-10-18 14:28 ` Christoph Petersen
2004-10-18 15:09 ` Andreas Klauer
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Christoph Petersen @ 2004-10-18 14:28 UTC (permalink / raw)
To: lartc
Hi,
okay, but I think I have some problems understanding the interaction
between upload and download. How I have to define my traffic classes to
match upload and download depending on each other?
Greets
Christoph
Peter Huetmannsberger wrote:
>Hi
>
>like I said, I am new too, so take this with a grain of salt.
>
>
>
>>unfortunately there is only one interface for the customers. My problem
>>is to limit the up AND down speed in dependence to each other.
>>
>>
>
>Downloads become uploads on your internal interface!
>
>so if eth0 is your external interface a download would be INCOMING on eth0
>but as it is going on to your internal interface (e.g. eth1) it becomes an
>upload to your customer. So incoming traffic from the internet to your
>customers is outgoing on eth1.
>
>if you do this on eth1:
>--------------
>#!/bin/bash
>tc qdisc add dev eth1 root handle 1: htb default 20
>tc class add dev eth1 parent 1: classid 1:1 htb rate 90mbit burst 15k
>tc class add dev eth1 parent 1:1 classid 1:10 htb rate 10mbit
> prio 0 burst 15k
>tc class add dev eth1 parent 1:1 classid 1:20 htb rate 1mbit ceil 1mbit
> burst 6k prio 1
>U32="tc filter add dev eth1 protocol ip parent 1:0 prio 0 u32"
>$U32 match ip dst 192.168.1.19 flowid 1:10
>---------------
>
>Then you have split the traffic into two classes:
>
>one for the preferred customer, who gets 10Mbit and a default for all the
>other traffic, which gets 1Mbit. It still leaves a lot of bandwidth
>unused! (79 Mbit)
>
>I have made the experience (which cost me an awful lot of time) that
>assuming the interface woudl produce excactly 100Mbit is a mistake and htb
>does unexpected things. It is probably bets to lower the parent class
>trafic 1: to something about 10% below your actual internet connection,
>even on your internal interface. (Please correct me if I am completely
>wrong!) I used iptraf to have a look on the throughput.
>
>
>You would have to do something similar for actual uploads from your
>customers to the internet on eth0, but as you probably nat the traffic I
>am not certain what you would do there! Anyone else?
>
>greetings,
>
>.peter
>
>
>
>
>
_______________________________________________
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] IP based bandwith limit
2004-10-18 9:17 [LARTC] IP based bandwith limit Christoph Petersen
` (3 preceding siblings ...)
2004-10-18 14:28 ` Christoph Petersen
@ 2004-10-18 15:09 ` Andreas Klauer
2004-10-18 15:38 ` Christoph Petersen
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Andreas Klauer @ 2004-10-18 15:09 UTC (permalink / raw)
To: lartc
Am Monday 18 October 2004 16:28 schrieb Christoph Petersen:
> okay, but I think I have some problems understanding the interaction
> between upload and download. How I have to define my traffic classes to
> match upload and download depending on each other?
That's not easy to do at all. You'd have to use the one and the same class
to put both up- and download traffic in (both as outgoing traffic on the
same device). Usually this can't be done. Maybe it's possible with IMQ?
Andreas
_______________________________________________
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] IP based bandwith limit
2004-10-18 9:17 [LARTC] IP based bandwith limit Christoph Petersen
` (4 preceding siblings ...)
2004-10-18 15:09 ` Andreas Klauer
@ 2004-10-18 15:38 ` Christoph Petersen
2004-10-19 11:03 ` Cow
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Christoph Petersen @ 2004-10-18 15:38 UTC (permalink / raw)
To: lartc
Hi,
with htb and ingress I was been able to shape the bandwith to fit my
wishes. But it's the same problem: I couldn't clue download and upload
together so I was been able to shape upload to 10kbps and download too.
But when I download some file and upload in the same time I was getting
10kbps on each line...
Greets
Christoph
Andreas Klauer wrote:
>Am Monday 18 October 2004 16:28 schrieb Christoph Petersen:
>
>
>>okay, but I think I have some problems understanding the interaction
>>between upload and download. How I have to define my traffic classes to
>>match upload and download depending on each other?
>>
>>
>
>That's not easy to do at all. You'd have to use the one and the same class
>to put both up- and download traffic in (both as outgoing traffic on the
>same device). Usually this can't be done. Maybe it's possible with IMQ?
>
>Andreas
>_______________________________________________
>LARTC mailing list / LARTC@mailman.ds9a.nl
>http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
>
>
>
>
_______________________________________________
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] IP based bandwith limit
2004-10-18 9:17 [LARTC] IP based bandwith limit Christoph Petersen
` (5 preceding siblings ...)
2004-10-18 15:38 ` Christoph Petersen
@ 2004-10-19 11:03 ` Cow
2004-10-19 13:08 ` james jones
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Cow @ 2004-10-19 11:03 UTC (permalink / raw)
To: lartc
Try this page - might help:
http://omg.wp.gg/wshaper-howto/
Regards
Rune Johannesen
_______________________________________________
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] IP based bandwith limit
2004-10-18 9:17 [LARTC] IP based bandwith limit Christoph Petersen
` (6 preceding siblings ...)
2004-10-19 11:03 ` Cow
@ 2004-10-19 13:08 ` james jones
2004-10-19 13:42 ` [LARTC] " Christoph Petersen
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: james jones @ 2004-10-19 13:08 UTC (permalink / raw)
To: lartc
Check www.geocities.com/jame_sj
James
> Message: 2
> Date: Mon, 18 Oct 2004 11:17:41 +0200
> From: Christoph Petersen <lists@peterschen.de>
> To: lartc@mailman.ds9a.nl
> Subject: [LARTC] IP based bandwith limit
>
> Hi,
>
> i've following problem. One of our gateway router, which connects
> some
> of our customers should have bandwith limit.
>
> So customer A with IP XX should have 2 Mbit, customer B with IP YY
> should have 10 Mbit. There is no need of borrowing bandwith so no
> fairness needed.
>
> My simple question: with which technique should I manage this
> shaping?
> Or is there any existing project which provides this allready?
>
> Greets
> Christoph
>
> --__--__--
>
_______________________________________________
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] IP based bandwith limit
2004-10-18 9:17 [LARTC] IP based bandwith limit Christoph Petersen
` (7 preceding siblings ...)
2004-10-19 13:08 ` james jones
@ 2004-10-19 13:42 ` Christoph Petersen
2004-10-19 14:17 ` Peter Huetmannsberger
2004-10-19 14:17 ` [LARTC] " Christoph Petersen
10 siblings, 0 replies; 12+ messages in thread
From: Christoph Petersen @ 2004-10-19 13:42 UTC (permalink / raw)
To: lartc
Hi,
one question - whats the trick behind your marking "flags" (28, 56, ...).
Greets
Christoph
james jones wrote:
>Check www.geocities.com/jame_sj
>
>James
>
>
>>Message: 2
>>Date: Mon, 18 Oct 2004 11:17:41 +0200
>>From: Christoph Petersen <lists@peterschen.de>
>>To: lartc@mailman.ds9a.nl
>>Subject: [LARTC] IP based bandwith limit
>>
>>Hi,
>>
>>i've following problem. One of our gateway router, which connects
>>some
>>of our customers should have bandwith limit.
>>
>>So customer A with IP XX should have 2 Mbit, customer B with IP YY
>>should have 10 Mbit. There is no need of borrowing bandwith so no
>>fairness needed.
>>
>>My simple question: with which technique should I manage this
>>shaping?
>>Or is there any existing project which provides this allready?
>>
>>Greets
>>Christoph
>>
>>--__--__--
>>
>>
>>
>
>_______________________________________________
>LARTC mailing list / LARTC@mailman.ds9a.nl
>http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
>
>
>
>
_______________________________________________
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] IP based bandwith limit
2004-10-18 9:17 [LARTC] IP based bandwith limit Christoph Petersen
` (8 preceding siblings ...)
2004-10-19 13:42 ` [LARTC] " Christoph Petersen
@ 2004-10-19 14:17 ` Peter Huetmannsberger
2004-10-19 14:17 ` [LARTC] " Christoph Petersen
10 siblings, 0 replies; 12+ messages in thread
From: Peter Huetmannsberger @ 2004-10-19 14:17 UTC (permalink / raw)
To: lartc
Hi!
This is a nicely organized script, thank you. If I understand it correctly
it stilmeans that there is a bandwidth of 28k for both upload and download
though, and not 28k altogether. Or am I wrong?
many thanks,
.peter
On Tue, 19 Oct 2004, james jones wrote:
> Check www.geocities.com/jame_sj
>
> James
> > Message: 2
> > Date: Mon, 18 Oct 2004 11:17:41 +0200
> > From: Christoph Petersen <lists@peterschen.de>
> > To: lartc@mailman.ds9a.nl
> > Subject: [LARTC] IP based bandwith limit
> >
> > Hi,
> >
> > i've following problem. One of our gateway router, which connects
> > some
> > of our customers should have bandwith limit.
> >
> > So customer A with IP XX should have 2 Mbit, customer B with IP YY
> > should have 10 Mbit. There is no need of borrowing bandwith so no
> > fairness needed.
> >
> > My simple question: with which technique should I manage this
> > shaping?
> > Or is there any existing project which provides this allready?
> >
> > Greets
> > Christoph
> >
> > --__--__--
> >
>
> _______________________________________________
> LARTC mailing list / LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
>
_______________________________________________
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] IP based bandwith limit
2004-10-18 9:17 [LARTC] IP based bandwith limit Christoph Petersen
` (9 preceding siblings ...)
2004-10-19 14:17 ` Peter Huetmannsberger
@ 2004-10-19 14:17 ` Christoph Petersen
10 siblings, 0 replies; 12+ messages in thread
From: Christoph Petersen @ 2004-10-19 14:17 UTC (permalink / raw)
To: lartc
Hi,
some other question - with this setup there are two interfaces.
Each interface has two classes. So if I take 1:16 example I've
1.5Mbit for upload and other 1.5Mbit for download. But when I upload
with 1.5Mbit how many bandwith there is for download?
Greets
Christoph
james jones wrote:
>Check www.geocities.com/jame_sj
>
>James
>
>
>>Message: 2
>>Date: Mon, 18 Oct 2004 11:17:41 +0200
>>From: Christoph Petersen <lists@peterschen.de>
>>To: lartc@mailman.ds9a.nl
>>Subject: [LARTC] IP based bandwith limit
>>
>>Hi,
>>
>>i've following problem. One of our gateway router, which connects
>>some
>>of our customers should have bandwith limit.
>>
>>So customer A with IP XX should have 2 Mbit, customer B with IP YY
>>should have 10 Mbit. There is no need of borrowing bandwith so no
>>fairness needed.
>>
>>My simple question: with which technique should I manage this
>>shaping?
>>Or is there any existing project which provides this allready?
>>
>>Greets
>>Christoph
>>
>>--__--__--
>>
>>
>>
>
>_______________________________________________
>LARTC mailing list / LARTC@mailman.ds9a.nl
>http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
>
>
>
>
_______________________________________________
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
end of thread, other threads:[~2004-10-19 14:17 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-18 9:17 [LARTC] IP based bandwith limit Christoph Petersen
2004-10-18 10:00 ` Peter Huetmannsberger
2004-10-18 10:19 ` Christoph Petersen
2004-10-18 12:04 ` Peter Huetmannsberger
2004-10-18 14:28 ` Christoph Petersen
2004-10-18 15:09 ` Andreas Klauer
2004-10-18 15:38 ` Christoph Petersen
2004-10-19 11:03 ` Cow
2004-10-19 13:08 ` james jones
2004-10-19 13:42 ` [LARTC] " Christoph Petersen
2004-10-19 14:17 ` Peter Huetmannsberger
2004-10-19 14:17 ` [LARTC] " Christoph Petersen
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.