Re: [LARTC] [Help] IMQ download traffic is duplicated !?

2004-06-14 Thread Andre Correa
What I can tell you for sure is that it is not related to IMQ at all. 
I've already experienced this traffic rate "duplication" behavior on 
"only egress" shapping machines but couldn't find its source.

Anybody else?
Andre
Yacine wrote:
Hi,
I have a default class for my un-marked traffic (prio 5) and a prio 0 class for the 
important stuff,
but I do not understand why my download traffic is duplicated in both.
It work fine for my upload traffic (same setting except the red class but I have the 
same
result if I create an esfq instead).
Any comments/information will be appreciated.
Below my config :
tc commands from my scirpt :
# TC on my download link
tcdownload () {
tc qdisc add dev $TC_D_INT root handle 1: htb default 99 debug $HTB_DEBUG
tc class add dev $TC_D_INT parent 1: classid 1:1 htb rate ${D_LIMIT}kbit
# VOIP class have the highest priority
tc class add dev $TC_D_INT parent 1:1 classid 1:10 htb \
rate ${VOIP}kbit ceil ${D_LIMIT}kbit prio 0
tc qdisc add dev $TC_D_INT parent 1:10 handle 10: esfq perturb 10 hash dst 
limit 8
tc filter add dev $TC_D_INT parent 1: prio 0 protocol ip handle 10 fw flowid 
1:10
# shape everything at $D_LIMIT minus $VOIP speed
tc class add dev $TC_D_INT parent 1: classid 1:2 htb \
rate $[$D_LIMIT-$VOIP]kbit ceil ${D_LIMIT}kbit
# high prio class 1:20 to low prio class 1:99 (default)
tc class add dev $TC_D_INT parent 1:2 classid 1:20 htb rate 
$[D_LIMIT-$VOIP]kbit prio 1
tc class add dev $TC_D_INT parent 1:2 classid 1:99 htb rate 
$[D_LIMIT-$VOIP]kbit prio 5
# all get Enchanced Stochastic Fairness (depending on dst ip), excet the 
default class (red):
tc qdisc add dev $TC_D_INT parent 1:20 handle 20: esfq perturb 10 hash dst
# Red setting /5 to make latency 200ms
RED_MAX=$[($D_LIMIT*1000/8)/5]
RED_MIN=$[$RED_MAX/3]
RED_LIMIT=$[$RED_MAX*8]
RED_AVPKT=1000
tc qdisc add dev $TC_D_INT parent 1:99 handle 99: red bandwidth ${D_LIMIT} \
probability 0.02 limit ${RED_LIMIT} min ${RED_MIN} max ${RED_MAX} \
avpkt ${RED_AVPKT} burst $[((2*$RED_MIN)+($RED_MAX))/(3*$RED_AVPKT)] 
ecn
# setup $IPTABLES hooks
tc filter add dev $TC_D_INT parent 1: prio 1 protocol ip handle 20 fw flowid 
1:20
tc filter add dev $TC_D_INT parent 1: prio 5 protocol ip handle 99 fw flowid 
1:99
}
#  tc -s -d class show dev imq1
class htb 1:99 parent 1:2 leaf 99: prio 5 quantum 1024 rate 80Kbit ceil 80Kbit burst 
1701b/8 mpu 0b cburst 1701b/8 mpu 0b level 0
 Sent 114868 bytes 2209 pkts (dropped 0, overlimits 0)
 rate 2569bps 49pps
 lended: 2209 borrowed: 0 giants: 0
 tokens: 132320 ctokens: 132320
class htb 1:1 root rate 192Kbit ceil 192Kbit burst 1844b/8 mpu 0b cburst 1844b/8 mpu 
0b level 7
 Sent 114857 bytes 2209 pkts (dropped 0, overlimits 0)
 rate 2658bps 51pps
 lended: 0 borrowed: 0 giants: 0
 tokens: 59900 ctokens: 59900
class htb 1:10 parent 1:1 leaf 10: prio 0 quantum 1433 rate 112Kbit ceil 192Kbit burst 
1742b/8 mpu 0b cburst 1844b/8 mpu 0b level 0
 Sent 114857 bytes 2209 pkts (dropped 0, overlimits 0)
 rate 2658bps 51pps
 lended: 2209 borrowed: 0 giants: 0
 tokens: 96857 ctokens: 59900
class htb 1:2 root rate 80Kbit ceil 192Kbit burst 1701b/8 mpu 0b cburst 1844b/8 mpu 0b 
level 7
 Sent 115684 bytes 2218 pkts (dropped 0, overlimits 0)
 rate 2764bps 53pps
 lended: 0 borrowed: 0 giants: 0
 tokens: 132320 ctokens: 59900
class htb 1:20 parent 1:2 leaf 20: prio 1 quantum 1024 rate 80Kbit ceil 80Kbit burst 
1701b/8 mpu 0b cburst 1701b/8 mpu 0b level 0
 Sent 816 bytes 9 pkts (dropped 0, overlimits 0)
 rate 20bps
 lended: 9 borrowed: 0 giants: 0
 tokens: 127200 ctokens: 127200
#  tc -s -d qdisc show dev imq1
qdisc red 99: limit 38400b min 1600b max 4800b ecn ewma 1 Plog 18 Scell_log 22
 Sent 3612535 bytes 68768 pkts (dropped 1, overlimits 1)
  marked 0 early 1 pdrop 0 other 0
 qdisc esfq 20: quantum 1000b limit 128p flows 128/1024 perturb 10sec hash: dst
 Sent 26055 bytes 300 pkts (dropped 0, overlimits 0)
 qdisc esfq 10: quantum 1000b limit 8p flows 128/1024 perturb 10sec hash: dst
 Sent 3569131 bytes 68642 pkts (dropped 0, overlimits 0)
 qdisc htb 1: r2q 10 default 99 direct_packets_stat 24 ver 3.16
 Sent 7209229 bytes 137739 pkts (dropped 1, overlimits 364)
#  iptables -t mangle -L
Chain PREROUTING (policy ACCEPT)
target prot opt source   destination
IMQall  --  anywhere anywhereIMQ: todev 1
pretos all  --  anywhere anywhere
tcpre  all  --  anywhere anywhere
Chain INPUT (policy ACCEPT)
target prot opt source   destination
Chain FORWARD (policy ACCEPT)
target prot opt source   destination
IMQall  --  anywhere anywhereIMQ: todev 0
tcfor  all  --  anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source 

[LARTC] [Help] IMQ download traffic is duplicated !?

2004-06-13 Thread Yacine




Hi,
 
I have a default class for my un-marked traffic 
(prio 5) and a prio 0 class for the important stuff,
but I do not understand why my download traffic 
is duplicated in both.
 
It work fine for my upload traffic (same setting 
except the red class but I have the same
result if I create an esfq instead).
 
Any comments/information will be 
appreciated.
 
Below my config :
 
tc commands from my scirpt :
# TC on my download linktcdownload () 
{    tc qdisc add dev $TC_D_INT root 
handle 1: htb default 99 debug 
$HTB_DEBUG    tc class add dev 
$TC_D_INT parent 1: classid 1:1 htb rate ${D_LIMIT}kbit
 
    # VOIP 
class have the highest priority    tc 
class add dev $TC_D_INT parent 1:1 classid 1:10 htb 
\    
rate ${VOIP}kbit ceil ${D_LIMIT}kbit prio 
0    tc qdisc add dev $TC_D_INT 
parent 1:10 handle 10: esfq perturb 10 hash dst limit 
8    tc filter add dev $TC_D_INT 
parent 1: prio 0 protocol ip handle 10 fw flowid 1:10
 
    # shape 
everything at $D_LIMIT minus 
$VOIP speed    tc class add dev 
$TC_D_INT parent 1: classid 1:2 htb 
\    
rate $[$D_LIMIT-$VOIP]kbit ceil ${D_LIMIT}kbit
 
    # high 
prio class 1:20 to low prio class 1:99 
(default)    tc class add dev 
$TC_D_INT parent 1:2 classid 1:20 htb rate $[D_LIMIT-$VOIP]kbit prio 
1    tc class add dev $TC_D_INT 
parent 1:2 classid 1:99 htb rate $[D_LIMIT-$VOIP]kbit prio 5
 
    # all 
get Enchanced Stochastic Fairness (depending on dst ip), excet the default class 
(red):    tc qdisc add dev $TC_D_INT 
parent 1:20 handle 20: esfq perturb 10 hash 
dst    # Red setting /5 to make 
latency 200ms    
RED_MAX=$[($D_LIMIT*1000/8)/5]    
RED_MIN=$[$RED_MAX/3]    
RED_LIMIT=$[$RED_MAX*8]    
RED_AVPKT=1000    tc qdisc add dev 
$TC_D_INT parent 1:99 handle 99: red bandwidth ${D_LIMIT} 
\    
probability 0.02 limit ${RED_LIMIT} min ${RED_MIN} max ${RED_MAX} 
\    
avpkt ${RED_AVPKT} burst $[((2*$RED_MIN)+($RED_MAX))/(3*$RED_AVPKT)] 
ecn
 
    # setup 
$IPTABLES hooks    tc filter add dev 
$TC_D_INT parent 1: prio 1 protocol ip handle 20 fw flowid 
1:20    tc filter add dev $TC_D_INT 
parent 1: prio 5 protocol ip handle 99 fw flowid 1:99}
 
#  tc -s -d class show dev imq1class htb 
1:99 parent 1:2 leaf 99: prio 5 quantum 1024 rate 
80Kbit ceil 80Kbit burst 1701b/8 mpu 0b cburst 1701b/8 mpu 0b level 
0 Sent 114868 bytes 2209 pkts (dropped 0, 
overlimits 0) rate 2569bps 49pps lended: 2209 borrowed: 0 
giants: 0 tokens: 132320 ctokens: 132320
 
class htb 1:1 root rate 192Kbit ceil 192Kbit burst 
1844b/8 mpu 0b cburst 1844b/8 mpu 0b level 7 Sent 114857 bytes 2209 
pkts (dropped 0, overlimits 0) rate 2658bps 51pps lended: 0 
borrowed: 0 giants: 0 tokens: 59900 ctokens: 59900
 
class htb 1:10 parent 1:1 leaf 10: prio 0 quantum 1433 rate 112Kbit ceil 192Kbit burst 1742b/8 
mpu 0b cburst 1844b/8 mpu 0b level 0 Sent 
114857 bytes 2209 pkts (dropped 0, overlimits 0) rate 2658bps 
51pps lended: 2209 borrowed: 0 giants: 0 tokens: 96857 
ctokens: 59900
 
class htb 1:2 root rate 80Kbit ceil 192Kbit burst 
1701b/8 mpu 0b cburst 1844b/8 mpu 0b level 7 Sent 115684 bytes 2218 
pkts (dropped 0, overlimits 0) rate 2764bps 53pps lended: 0 
borrowed: 0 giants: 0 tokens: 132320 ctokens: 59900
 
class htb 1:20 parent 1:2 leaf 20: prio 1 quantum 
1024 rate 80Kbit ceil 80Kbit burst 1701b/8 mpu 0b cburst 1701b/8 mpu 0b level 
0 Sent 816 bytes 9 pkts (dropped 0, overlimits 0) rate 
20bps lended: 9 borrowed: 0 giants: 0 tokens: 127200 ctokens: 
127200
 
#  tc -s -d qdisc show dev imq1qdisc red 
99: limit 38400b min 1600b max 4800b ecn ewma 1 Plog 18 Scell_log 
22 Sent 3612535 bytes 68768 pkts (dropped 1, 
overlimits 1)  marked 0 early 1 pdrop 0 other 0
 
 qdisc esfq 20: quantum 1000b limit 128p flows 
128/1024 perturb 10sec hash: dst Sent 26055 bytes 300 pkts (dropped 0, 
overlimits 0)
 
 qdisc esfq 10: quantum 1000b limit 8p flows 
128/1024 perturb 10sec hash: dst Sent 
3569131 bytes 68642 pkts (dropped 0, overlimits 0)
 
 qdisc htb 1: r2q 10 default 99 
direct_packets_stat 24 ver 3.16 Sent 7209229 bytes 137739 pkts (dropped 
1, overlimits 364)
 
#  iptables -t mangle -LChain PREROUTING 
(policy ACCEPT)target prot opt 
source   
destinationIMQ    all  --  
anywhere 
anywhere    IMQ: 
todev 1pretos all  --  
anywhere 
anywheretcpre  all  --  
anywhere 
anywhere
 
Chain INPUT (policy 
ACCEPT)target prot opt 
source   
destination
 
Chain FORWARD (policy 
ACCEPT)target prot opt 
source   
destinationIMQ    all  --  
anywhere 
anywhere    IMQ: 
todev 0tcfor  all  --  
anywhere 
anywhere
 
Chain OUTPUT (policy 
ACCEPT)target prot opt 
source   
destinationouttos all  --  
anywhere 
anywheretcout  all  --  
anywhere 
anywhere
 
Chain POSTROUTING (policy 
ACCEPT)ta