Re: TC/CBQ shaping problems

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thank you Denis. I modified my script to use "mbit" uniformly but I
still don't understand the results:

#!/bin/bash
RATE1=60mbit
RATE2=10mbit
PRIO1="prio 1"
PRIO2="prio 3"
OPTION="allot 1514 maxburst 20 avpkt 1000"
tc qdisc del dev $DEV root
tc qdisc add $DEV root handle 10: cbq bandwidth 100mbit avpkt 1000
tc class add $DEV parent 10:0 handle 10:1 cbq bandwidth 100mbit rate
$RATE1 $OPTION $PRIO1 borrow
tc class add $DEV parent 10:0 handle 10:2 cbq bandwidth 100mbit rate
$RATE2 $OPTION $PRIO2 borrow
tc filter add $DEV parent 10:0 protocol ip prio 1 handle 1 fw flowid 10:1
tc filter add $DEV parent 10:0 protocol ip prio 1 handle 2 fw flowid 10:2
iptables -A OUTPUT -t mangle -p tcp --dport 2000 -d 10.0.0.102 -j mark
--set-mark 1
iptables -A OUTPUT -t mangle -p tcp --dport 2001 -d 10.0.0.102 -j mark
--set-mark 2

OBSERVED RESULTS:

- With both 10:1 and 10:2 as "borrow"
Single iperf session to port 2000 reports 93.7 Mbits/s
Two simultaneous iperf sessions to ports 2000 and 2001 report 45.8 and
45.7 Mbits/s respectively
Single iperf session to port 2001 reports 89.1 Mbits/s

- With 10:2 as "bounded"
Single iperf session to port 2000 reports 88.9 Mbits/s
Two simultaneous iperf sessions to ports 2000 and 2001 report 72.8 and
19.3 Mbits/s respectively
Single iperf session to port 2001 reports 11.2 Mbits/s

QUESTIONS:

1. When 10:2 is "bounded", is the reported 19.3 Mbits/s usage within
acceptable limits for CBQ accuracy?
2. When both 10:1 and 10:2 are "borrow", why doesn't port 2001 receive
all bandwidth when it is the only session present?
3. When both 10:1 and 10:2 are "borrow", why do they share the
available bandwidth equally?
4. Is my goal of having port 2000 receive at least 60mbits all the
time AND port 2001 receiving all bandwidth when there is no port 2000
traffic not feasible?

I appreciate any help members can provide. Thanks!

Muthu

On 1/4/06, Denis Ovsienko <linux@xxxxxxxxxxxx> wrote:
> [...]
> > RATE1=614400000
> tc(8) manpage extract:
> UNITS
>        All  parameters  accept a floating point number, possibly
> followed by a       unit.
>
>        Bandwidths or rates can be specified in:
>
>        kbps   Kilobytes per second
>
>        mbps   Megabytes per second
>
>        kbit   Kilobits per second
>
>        mbit   Megabits per second
>
>        bps or a bare number
>               Bytes per second
>
>
> [...]
> > tc qdisc add $DEV root handle 10: cbq bandwidth 100mbit avpkt 1000
> Bandwidth is 100 Megabits per second.
>
> > # 60 Mbit/s class
> > tc class add $DEV parent 10:0 classid 10:1 cbq bandwidth 100mbit rate
> > $RATE1 $OPTION $PRIO borrow
> Rate is 614400000 Bytes per second, roughly about 6 Gigabits per second.
> I hope it helps.
>
> --
>     DO4-UANIC
> _______________________________________________
> LARTC mailing list
> LARTC@xxxxxxxxxxxxxxx
> http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
>
_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc


[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux