Networking Forums

Networking Forums > Computer Networking > Linux Networking > cbq+ppp0

Reply
 
 
Damir Galič
Guest
Posts: n/a

 
      08-27-2005, 02:56 AM
I have some questions about cbq. Why are transfers so radical when limiting
"korenje upload" to 512kbit. when watching with dumeter, the transfers are
sometimes 600kbit/s, sometimes 300kbit/s but average still around
480kbit/s... when I set limits to 256kbit the transfers are steady, I see
smooth line on du-meter.
second problem is, why limiting internet traffic sent to local linux won't
work? I can see packets being marked so it should work, but it doesn't.


$IPTABLES -t mangle -A INPUT -i $EXTINT -d $EXTIP -j MARK --set-mark 7
$IPTABLES -t mangle -A OUTPUT -o $EXTINT -s $EXTIP -j MARK --set-mark 8

$IPTABLES -t mangle -A FORWARD -d ${IPPC1} -j
MARK --set-mark 4 # pc1 download
$IPTABLES -t mangle -A FORWARD -p TCP -d ${IPPC1} --sport 80 -j
MARK --set-mark 11
$IPTABLES -t mangle -A FORWARD -p ICMP -d ${IPPC1} -j
MARK --set-mark 11
$IPTABLES -t mangle -A FORWARD -d ${IPPC1} -j RETURN
$IPTABLES -t mangle -A FORWARD -s ${IPPC1} -j
MARK --set-mark 3 # pc1 upload
$IPTABLES -t mangle -A FORWARD -p TCP -s ${IPPC1} --dport 80 -j
MARK --set-mark 10
$IPTABLES -t mangle -A FORWARD -p ICMP -s ${IPPC1} -j
MARK --set-mark 10
$IPTABLES -t mangle -A FORWARD -s ${IPPC1} -j RETURN
$IPTABLES -t mangle -A FORWARD -d ${IPPC2} -j
MARK --set-mark 1 # pc2 download
$IPTABLES -t mangle -A FORWARD -s ${IPPC2} -j
MARK --set-mark 2 # pc2 upload
$IPTABLES -t mangle -A FORWARD -d ${IPPC2} -j RETURN

/sbin/tc qdisc add dev eth1 root handle 1:0 cbq avpkt 1000 bandwidth
$INTSPEED
/sbin/tc class add dev eth1 parent 1:0 classid 1:10 cbq rate $INTSPEED
bandwidth $INTSPEED prio 6 allot 1492 cell 8 maxburst 200 avpkt 1000 bounded
/sbin/tc class add dev eth1 parent 1:0 classid 1:20 cbq rate 3300kbit
bandwidth $INTSPEED prio 1 allot 1492 cell 8 maxburst 200 avpkt 1000 bounded
/sbin/tc class add dev eth1 parent 1:20 classid 1:210 cbq rate 2500kbit
bandwidth 3300kbit prio 4 allot 1492 cell 8 maxburst 200 avpkt 1000 bounded
/sbin/tc class add dev eth1 parent 1:20 classid 1:220 cbq rate 2500kbit
bandwidth 3300kbit prio 5 allot 1492 cell 8 maxburst 200 avpkt 1000 bounded
/sbin/tc filter add dev eth1 parent 1:0 protocol ip prio 7 handle 4 fw
flowid 1:10 # 4 korenje download
/sbin/tc filter add dev eth1 parent 1:0 protocol ip prio 6 handle 11 fw
flowid 1:10 # 11 korenje download (port 80, icmp)
/sbin/tc filter add dev eth1 parent 1:0 protocol ip prio 4 handle 1 fw
flowid 1:210 # bitje download
/sbin/tc filter add dev eth1 parent 1:0 protocol ip prio 5 handle 6 fw
flowid 1:220 # ostali download

/sbin/tc qdisc add dev ppp0 root handle 1:0 cbq avpkt 1000 bandwidth
$INTSPEED
/sbin/tc class add dev ppp0 parent 1:0 classid 1:10 cbq rate $INTSPEED
bandwidth $INTSPEED prio 5 allot 1492 cell 8 maxburst 200 avpkt 1000 bounded
/sbin/tc class add dev ppp0 parent 1:0 classid 1:20 cbq rate 350kbit
bandwidth $INTSPEED prio 4 allot 1492 cell 8 maxburst 200 avpkt 1000 bounded
/sbin/tc class add dev ppp0 parent 1:20 classid 1:210 cbq rate 256kbit
bandwidth 350kbit prio 3 allot 1492 cell 8 maxburst 200 avpkt 1000 bounded
/sbin/tc class add dev ppp0 parent 1:20 classid 1:220 cbq rate 256kbit
bandwidth 350kbit prio 4 allot 1492 cell 8 maxburst 200 avpkt 1000 bounded
/sbin/tc class add dev ppp0 parent 1:0 classid 1:30 cbq rate 300kbit
bandwidth $INTSPEED prio 6 allot 1492 cell 8 maxburst 200 avpkt 1000 bounded
/sbin/tc class add dev ppp0 parent 1:30 classid 1:310 cbq rate 100kbit
bandwidth 300kbit prio 5 allot 1492 cell 8 maxburst 200 avpkt 1000 bounded
/sbin/tc class add dev ppp0 parent 1:30 classid 1:320 cbq rate 100kbit
bandwidth 300kbit prio 6 allot 1492 cell 8 maxburst 200 avpkt 1000 bounded
/sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 6 handle 3 fw
flowid 1:10 # 3 korenje upload
/sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 0 handle 10 fw
flowid 1:10 # 10 korenje upload (port 80, icmp)
/sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 3 handle 2 fw
flowid 1:210 # bitje upload
/sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 4 handle 5 fw
flowid 1:220 # ostali upload
/sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 1 handle 8 fw
flowid 1:310 # lin upload
/sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 2 handle 7 fw
flowid 1:320 # lin download


 
Reply With Quote
 
 
 
 
Andy Furniss
Guest
Posts: n/a

 
      08-28-2005, 08:39 PM
Damir Galič wrote:
> I have some questions about cbq.


I don't use cbq so can't say about it's behaviour.

Why are transfers so radical when limiting
> "korenje upload" to 512kbit. when watching with dumeter, the transfers are
> sometimes 600kbit/s, sometimes 300kbit/s but average still around
> 480kbit/s... when I set limits to 256kbit the transfers are steady, I see
> smooth line on du-meter.


Possibly because du meter sees the flow as it is sent to the queue at
lan speed - tcp can burst like this, it doesn't mean that cbq releases
the packets like this. Use pppstats to see that.

> second problem is, why limiting internet traffic sent to local linux won't
> work? I can see packets being marked so it should work, but it doesn't.


Without patching you can't have queues for incomming traffic on an
interface. You can use policers to measure rate and drop packets.

If you want a real queue you need to use imq - www.linuximw.net or a
modified dummy device.

Andy.
 
Reply With Quote
 
Damir Galic
Guest
Posts: n/a

 
      08-28-2005, 09:38 PM
I think that transfers are so radical because cbq is working on average
speeds while my isp for example is doing some ceil limiting (that's where I
see clean line on du-meter). So the question is, can cbq do souch limiting?
Like working on ceil limit instead average.

"Andy Furniss" <(E-Mail Removed)> wrote in message
news:43122105$0$6476$(E-Mail Removed)...
> Damir Galič wrote:
>> I have some questions about cbq.

>
> I don't use cbq so can't say about it's behaviour.
>
> Why are transfers so radical when limiting
>> "korenje upload" to 512kbit. when watching with dumeter, the transfers
>> are sometimes 600kbit/s, sometimes 300kbit/s but average still around
>> 480kbit/s... when I set limits to 256kbit the transfers are steady, I see
>> smooth line on du-meter.

>
> Possibly because du meter sees the flow as it is sent to the queue at lan
> speed - tcp can burst like this, it doesn't mean that cbq releases the
> packets like this. Use pppstats to see that.
>
>> second problem is, why limiting internet traffic sent to local linux
>> won't work? I can see packets being marked so it should work, but it
>> doesn't.

>
> Without patching you can't have queues for incomming traffic on an
> interface. You can use policers to measure rate and drop packets.
>
> If you want a real queue you need to use imq - www.linuximw.net or a
> modified dummy device.
>
> Andy.



 
Reply With Quote
 
Andy Furniss
Guest
Posts: n/a

 
      08-28-2005, 10:16 PM
Damir Galic wrote:
> I think that transfers are so radical because cbq is working on average
> speeds while my isp for example is doing some ceil limiting (that's where I
> see clean line on du-meter). So the question is, can cbq do souch limiting?
> Like working on ceil limit instead average.


If your isp gives you variable bandwidth then doing QOS is going to be
hard.

What sort of connection do you have, what bitrate is it sold as?

It could be as you say - I use htb which doesn't burst much unless you
tell it to.

Try looking at pppstats -w1 at the same time as dumeter.

>
> "Andy Furniss" <(E-Mail Removed)> wrote in message
> news:43122105$0$6476$(E-Mail Removed)...
>
>>Damir Galič wrote:
>>
>>>I have some questions about cbq.

>>
>>I don't use cbq so can't say about it's behaviour.
>>
>> Why are transfers so radical when limiting
>>
>>>"korenje upload" to 512kbit. when watching with dumeter, the transfers
>>>are sometimes 600kbit/s, sometimes 300kbit/s but average still around
>>>480kbit/s... when I set limits to 256kbit the transfers are steady, I see
>>>smooth line on du-meter.

>>
>>Possibly because du meter sees the flow as it is sent to the queue at lan
>>speed - tcp can burst like this, it doesn't mean that cbq releases the
>>packets like this. Use pppstats to see that.
>>
>>
>>>second problem is, why limiting internet traffic sent to local linux
>>>won't work? I can see packets being marked so it should work, but it
>>>doesn't.

>>
>>Without patching you can't have queues for incomming traffic on an
>>interface. You can use policers to measure rate and drop packets.
>>
>>If you want a real queue you need to use imq - www.linuximw.net or a
>>modified dummy device.
>>
>>Andy.

>
>
>

 
Reply With Quote
 
Damir Galic
Guest
Posts: n/a

 
      08-29-2005, 12:17 AM
look at http://freeweb.siol.net/korenj/limits.gif

first hill is from limiting done by my isp (600 kbit/s), second hill is
limiting by my cbq (450kbit/s).
tell me. will htb provide better or more steady stream?


 
Reply With Quote
 
Damir Galič
Guest
Posts: n/a

 
      08-29-2005, 05:55 AM
ahhh I was bothering for nothing. I added this lines:
/sbin/tc qdisc add dev ppp0 parent 1:10 handle 10: sfq perturb 10
now it works perfectly. except that cbq isn't that accurate but I like
it's sharing on classes which isn't included in htb.


 
Reply With Quote
 
Andy Furniss
Guest
Posts: n/a

 
      08-29-2005, 09:56 AM
Damir Galič wrote:
> ahhh I was bothering for nothing. I added this lines:
> /sbin/tc qdisc add dev ppp0 parent 1:10 handle 10: sfq perturb 10
> now it works perfectly. except that cbq isn't that accurate but I like
> it's sharing on classes which isn't included in htb.
>
>

Ahh, I think that if you don't specify a queue for the leaf classes cbq
may do the same as htb and use a default fifo whose length is taken from
the txqueuelen of the interface - 3 in the case of ppp and thats a bit
too short. Unless you use limit for sfq it's 128 remember sfq is really
best for bulk, perturb causes packet reordering ao it may be better to
use bfifo or seperate interactive from bulk and use another class.

Maybe cbq would be smoother if you reduced maxburst.

Andy.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
default route ignored when ppp0 up Don Linux Networking 10 05-01-2012 03:49 PM
When is ppp0 created? morleyc@gmail.com Linux Networking 1 07-01-2007 10:55 PM
pppd does not set ppp0 interface miguelk Linux Networking 12 10-02-2004 10:00 PM
PPP0 Problem beeman Linux Networking 0 12-09-2003 04:38 PM
Finding own ppp0 address Eduardo Linux Networking 6 10-02-2003 12:30 AM



1 2 3 4 5 6 7 8 9 10 11