From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Yacine" Date: Sun, 13 Jun 2004 12:44:33 +0000 Subject: [LARTC] [Help] IMQ download traffic is duplicated !? Message-Id: <00bf01c45144$2dfd7db0$1002a8c0@windaube> MIME-Version: 1 Content-Type: multipart/mixed; boundary="----=_NextPart_000_00BC_01C45154.F13E6F40" List-Id: To: lartc@vger.kernel.org This is a multi-part message in MIME format. ------=_NextPart_000_00BC_01C45154.F13E6F40 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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=3D$[($D_LIMIT*1000/8)/5] RED_MIN=3D$[$RED_MAX/3] RED_LIMIT=3D$[$RED_MAX*8] RED_AVPKT=3D1000 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 IMQ all -- anywhere anywhere IMQ: 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 IMQ all -- anywhere anywhere IMQ: todev = 0 tcfor all -- anywhere anywhere Chain OUTPUT (policy ACCEPT) target prot opt source destination outtos all -- anywhere anywhere tcout all -- anywhere anywhere Chain POSTROUTING (policy ACCEPT) target prot opt source destination Chain outtos (1 references) target prot opt source destination Chain pretos (1 references) target prot opt source destination Chain tcfor (1 references) target prot opt source destination MARK udp -- anywhere anywhere udp = dpts:8000:30000 MARK set 0xa MARK udp -- anywhere anywhere udp = dpts:5060:5069 MARK set 0xa MARK udp -- anywhere anywhere udp = dpts:2427:2436 MARK set 0xa MARK tcp -- anywhere anywhere tcp dpt:ssh = MARK set 0x14 MARK tcp -- anywhere anywhere tcp = dpt:webmin MARK set 0x14 MARK icmp -- anywhere anywhere MARK set = 0x14 MARK tcp -- anywhere anywhere tcp = flags:!SYN,RST,ACK/ACK MARK set 0x14 MARK tcp -- anywhere anywhere tcp = flags:SYN,RST,ACK/ACK length 0:128 TOS match !Normal-Service MARK set = 0x14 MARK all -- anywhere anywhere MARK match = 0x0 MARK set 0x63 Chain tcout (1 references) target prot opt source destination Chain tcpre (1 references) target prot opt source destination MARK udp -- anywhere anywhere udp = dpts:8000:30000 MARK set 0xa MARK udp -- anywhere anywhere udp = dpts:5060:5069 MARK set 0xa MARK udp -- anywhere anywhere udp = dpts:2427:2436 MARK set 0xa MARK tcp -- anywhere anywhere tcp dpt:ssh = MARK set 0x14 MARK tcp -- anywhere anywhere tcp = dpt:webmin MARK set 0x14 MARK icmp -- anywhere anywhere MARK set = 0x14 MARK tcp -- anywhere anywhere tcp = flags:!SYN,RST,ACK/ACK MARK set 0x14 MARK tcp -- anywhere anywhere tcp = flags:SYN,RST,ACK/ACK length 0:64 TOS match !Normal-Service MARK set = 0x14 MARK all -- anywhere anywhere MARK match = 0x0 MARK set 0x63 # tc -V tc utility, iproute2-ss001007 # uname -r 2.4.26 # iptables --version iptables v1.2.9 Thank you, Yacine. ------=_NextPart_000_00BC_01C45154.F13E6F40 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
 
I have a default class for my un-marked = traffic=20 (prio 5) and a prio 0 class for the important stuff,
but I do not understand why my download = traffic=20 is duplicated in both.
 
It work fine for my upload traffic = (same setting=20 except the red class but I have the same
result if I create an esfq = instead).
 
Any comments/information will be=20 appreciated.
 
Below my config :
 
tc commands from my scirpt = :
# TC on my download link
tcdownload = ()=20 {
        tc qdisc add dev = $TC_D_INT root=20 handle 1: htb default 99 debug=20 $HTB_DEBUG
        tc class add = dev=20 $TC_D_INT parent 1: classid 1:1 htb rate ${D_LIMIT}kbit
 
        # VOIP=20 class have the highest = priority
        tc=20 class add dev $TC_D_INT parent 1:1 classid 1:10 htb=20 \
           &n= bsp;   =20 rate ${VOIP}kbit ceil ${D_LIMIT}kbit prio=20 0
        tc qdisc add dev = $TC_D_INT=20 parent 1:10 handle 10: esfq perturb 10 hash dst limit=20 8
        tc filter add dev = $TC_D_INT=20 parent 1: prio 0 protocol ip handle 10 fw flowid 1:10
 
        # shape=20 everything at $D_LIMIT minus=20 $VOIP speed
        tc class = add dev=20 $TC_D_INT parent 1: classid 1:2 htb=20 \
           &n= bsp;   =20 rate $[$D_LIMIT-$VOIP]kbit ceil ${D_LIMIT}kbit
 
        # high=20 prio class 1:20 to low prio class 1:99=20 (default)
        tc class add dev = $TC_D_INT parent 1:2 classid 1:20 htb rate $[D_LIMIT-$VOIP]kbit prio=20 1
        tc class add dev = $TC_D_INT=20 parent 1:2 classid 1:99 htb rate $[D_LIMIT-$VOIP]kbit prio = 5
 
        # all=20 get Enchanced Stochastic Fairness (depending on dst ip), excet the = default class=20 (red):
        tc qdisc add dev = $TC_D_INT=20 parent 1:20 handle 20: esfq perturb 10 hash=20 dst
        # Red setting /5 to = make=20 latency 200ms
       =20 RED_MAX=3D$[($D_LIMIT*1000/8)/5]
      &= nbsp;=20 RED_MIN=3D$[$RED_MAX/3]
       =20 RED_LIMIT=3D$[$RED_MAX*8]
       =20 RED_AVPKT=3D1000
        tc qdisc = add dev=20 $TC_D_INT parent 1:99 handle 99: red bandwidth ${D_LIMIT}=20 \
           &n= bsp;   =20 probability 0.02 limit ${RED_LIMIT} min ${RED_MIN} max ${RED_MAX}=20 \
           &n= bsp;   =20 avpkt ${RED_AVPKT} burst $[((2*$RED_MIN)+($RED_MAX))/(3*$RED_AVPKT)]=20 ecn
 
        # setup=20 $IPTABLES hooks
        tc filter = add dev=20 $TC_D_INT parent 1: prio 1 protocol ip handle 20 fw flowid=20 1:20
        tc filter add dev = $TC_D_INT=20 parent 1: prio 5 protocol ip handle 99 fw flowid = 1:99
}
 
#  tc -s -d class show dev = imq1
class htb=20 1:99 parent 1:2 leaf 99: prio 5 quantum = 1024 rate=20 80Kbit ceil 80Kbit burst 1701b/8 mpu 0b cburst 1701b/8 mpu 0b level=20 0
 Sent 114868 bytes 2209 pkts = (dropped 0,=20 overlimits 0)
 rate 2569bps 49pps
 lended: 2209 = borrowed: 0=20 giants: 0
 tokens: 132320 ctokens: 132320
 
class htb 1:1 root rate 192Kbit ceil = 192Kbit burst=20 1844b/8 mpu 0b cburst 1844b/8 mpu 0b level 7
 Sent 114857 bytes = 2209=20 pkts (dropped 0, overlimits 0)
 rate 2658bps = 51pps
 lended: 0=20 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=20 mpu 0b cburst 1844b/8 mpu 0b level 0
 Sent = 114857 bytes 2209 pkts (dropped 0, overlimits 0)
 rate = 2658bps=20 51pps
 lended: 2209 borrowed: 0 giants: 0
 tokens: 96857 = ctokens: 59900
 
class htb 1:2 root rate 80Kbit ceil = 192Kbit burst=20 1701b/8 mpu 0b cburst 1844b/8 mpu 0b level 7
 Sent 115684 bytes = 2218=20 pkts (dropped 0, overlimits 0)
 rate 2764bps = 53pps
 lended: 0=20 borrowed: 0 giants: 0
 tokens: 132320 ctokens: = 59900
 
class htb 1:20 parent 1:2 leaf 20: prio = 1 quantum=20 1024 rate 80Kbit ceil 80Kbit burst 1701b/8 mpu 0b cburst 1701b/8 mpu 0b = level=20 0
 Sent 816 bytes 9 pkts (dropped 0, overlimits 0)
 rate = 20bps
 lended: 9 borrowed: 0 giants: 0
 tokens: 127200 = ctokens:=20 127200
 
#  tc -s -d qdisc show dev = imq1
qdisc red=20 99: limit 38400b min 1600b max 4800b ecn ewma 1 Plog 18 Scell_log=20 22
 Sent 3612535 bytes 68768 pkts = (dropped 1,=20 overlimits 1)
  marked 0 early 1 pdrop 0 other 0
 
 qdisc esfq 20: quantum 1000b = limit 128p flows=20 128/1024 perturb 10sec hash: dst
 Sent 26055 bytes 300 pkts = (dropped 0,=20 overlimits 0)
 
 qdisc esfq 10: quantum 1000b = limit 8p flows=20 128/1024 perturb 10sec hash: dst
 Sent=20 3569131 bytes 68642 pkts (dropped 0, overlimits 0)
 
 qdisc htb 1: r2q 10 default 99=20 direct_packets_stat 24 ver 3.16
 Sent 7209229 bytes 137739 pkts = (dropped=20 1, overlimits 364)
 
#  iptables -t mangle -L
Chain = PREROUTING=20 (policy ACCEPT)
target     prot opt=20 source           &= nbsp;  =20 destination
IMQ        all  = -- =20 anywhere           = ; =20 anywhere           = ; IMQ:=20 todev 1
pretos     all  -- =20 anywhere           = ; =20 anywhere
tcpre      all  -- =20 anywhere           = ; =20 anywhere
 
Chain INPUT (policy=20 ACCEPT)
target     prot opt=20 source           &= nbsp;  =20 destination
 
Chain FORWARD (policy=20 ACCEPT)
target     prot opt=20 source           &= nbsp;  =20 destination
IMQ        all  = -- =20 anywhere           = ; =20 anywhere           = ; IMQ:=20 todev 0
tcfor      all  -- =20 anywhere           = ; =20 anywhere
 
Chain OUTPUT (policy=20 ACCEPT)
target     prot opt=20 source           &= nbsp;  =20 destination
outtos     all  -- =20 anywhere           = ; =20 anywhere
tcout      all  -- =20 anywhere           = ; =20 anywhere
 
Chain POSTROUTING (policy=20 ACCEPT)
target     prot opt=20 source           &= nbsp;  =20 destination
 
Chain outtos (1=20 references)
target     prot opt=20 source           &= nbsp;  =20 destination
 
Chain pretos (1=20 references)
target     prot opt=20 source           &= nbsp;  =20 destination
 
Chain tcfor (1=20 references)
target     prot opt=20 source           &= nbsp;  =20 destination
MARK       udp  = -- =20 anywhere           = ; =20 anywhere           = ; udp=20 dpts:8000:30000 MARK set 0xa
MARK       = udp  -- =20 anywhere           = ; =20 anywhere           = ; udp=20 dpts:5060:5069 MARK set 0xa
MARK      =20 udp  -- =20 anywhere           = ; =20 anywhere           = ; udp=20 dpts:2427:2436 MARK set 0xa
MARK      =20 tcp  -- =20 anywhere           = ; =20 anywhere           = ; tcp=20 dpt:ssh MARK set 0x14
MARK       = tcp =20 -- =20 anywhere           = ; =20 anywhere           = ; tcp=20 dpt:webmin MARK set 0x14
MARK       = icmp=20 -- =20 anywhere           = ; =20 anywhere           = ; MARK=20 set 0x14
MARK       tcp  -- =20 anywhere           = ; =20 anywhere           = ; tcp=20 flags:!SYN,RST,ACK/ACK MARK set = 0x14
MARK      =20 tcp  -- =20 anywhere           = ; =20 anywhere           = ; tcp=20 flags:SYN,RST,ACK/ACK length 0:128 TOS match !Normal-Service MARK set=20 0x14
MARK       all  -- =20 anywhere           = ; =20 anywhere           = ; MARK=20 match 0x0 MARK set 0x63
 
Chain tcout (1=20 references)
target     prot opt=20 source           &= nbsp;  =20 destination
 
Chain tcpre (1=20 references)
target     prot opt=20 source           &= nbsp;  =20 destination
MARK      =20 udp  -- =20 anywhere           = ; =20 anywhere           = ; udp=20 dpts:8000:30000 MARK set 0xa
MARK       = udp  -- =20 anywhere           = ; =20 anywhere           = ; udp=20 dpts:5060:5069 MARK set 0xa
MARK      =20 udp  -- =20 anywhere           = ; =20 anywhere           = ; udp=20 dpts:2427:2436 MARK set = 0xa
MARK      =20 tcp  -- =20 anywhere           = ; =20 anywhere           = ; tcp=20 dpt:ssh MARK set 0x14
MARK       = tcp =20 -- =20 anywhere           = ; =20 anywhere           = ; tcp=20 dpt:webmin MARK set 0x14
MARK       = icmp=20 -- =20 anywhere           = ; =20 anywhere           = ; MARK=20 set 0x14
MARK       tcp  -- =20 anywhere           = ; =20 anywhere           = ; tcp=20 flags:!SYN,RST,ACK/ACK MARK set = 0x14
MARK      =20 tcp  -- =20 anywhere           = ; =20 anywhere           = ; tcp=20 flags:SYN,RST,ACK/ACK length 0:64 TOS match !Normal-Service MARK set=20 0x14
MARK       all  -- =20 anywhere           = ; =20 anywhere           = ; MARK=20 match 0x0 MARK set 0x63
 
#  tc -V
tc utility,=20 iproute2-ss001007
 
#  uname = -r
2.4.26
 
#  iptables --version
iptables=20 v1.2.9

 
Thank you,
Yacine.
------=_NextPart_000_00BC_01C45154.F13E6F40-- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/