From: "Leigh Sharpe" Date: Thu, 06 Dec 2007 23:27:51 +0000 Subject: [LARTC] Setting max latency on classful qdiscs Message-Id: <96CF49BD8B56384395D698BA99007FA32DC3@exchange.pacwire.local> MIME-Version: 1 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C8385F.9ECF3800" List-Id: To: lartc@vger.kernel.org This is a multi-part message in MIME format. --===============2082696971== Content-class: urn:content-classes:message Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C8385F.9ECF3800" This is a multi-part message in MIME format. ------_=_NextPart_001_01C8385F.9ECF3800 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Hi All, I'm using HTB to shape traffic, a little like this: =20 tc qdisc add dev eth2 root handle 1:0 htb tc qdisc add dev eth3 root handle 1:0 htb tc filter add dev eth2 parent 1: protocol 0x8100 prio 5 u32 match u16 3000 0x0fff at 0 flowid 1:1 action ipt -j MARK --or-mark 0x01000000=20 tc filter add dev eth3 parent 1: protocol 0x8100 prio 5 u32 match u16 3000 0x0fff at 0 flowid 1:1 action ipt -j MARK --or-mark 0x01000000=20 =20 tc class add dev eth2 parent 1:0 classid 1:1 htb rate 2000Kbit ceil 2000Kbit =20 tc class add dev eth3 parent 1:0 classid 1:1 htb rate 2000Kbit ceil 2000Kbit =20 tc qdisc add dev eth2 parent 1:1 handle 2: htb tc qdisc add dev eth3 parent 1:1 handle 2: htb =20 tc class add dev eth2 parent 2:0 classid 2:1 htb rate 2000Kbit tc class add dev eth3 parent 2:0 classid 2:1 htb rate 2000Kbit tc filter add dev eth2 parent 2:0 protocol 0x8100 prio 2 u32 match u16 3000 0x0fff at 0 flowid 2:1 action ipt -j MARK --or-mark 0x00100000=20 tc filter add dev eth3 parent 2:0 protocol 0x8100 prio 2 u32 match u16 3000 0x0fff at 0 flowid 2:1 action ipt -j MARK --or-mark 0x00100000=20 =20 This essentially provides a 2mbit/s rate limit on each of eth2 and eth3. However, when I attempt to put more than 2mbps through it, It gets quite latent (I end up with >1second latency at times). Is there any way of specifying the maximum latency on a HTB class or qdisc? Or CBQ, for that matter? I need to use a classful qdisc, so tbf is out of the question. Ideally, I want to be able to specify that packets get dropped if they are in the queue for any longer than a specified period of time. Any ideas? =20 Regards, Leigh =20 Leigh Sharpe Network Systems Engineer Pacific Wireless Ph +61 3 9584 8966 Mob 0408 009 502 Helpdesk 1300 300 616 email lsharpe@pacificwireless.com.au =20 web www.pacificwireless.com.au =20 =20 ------_=_NextPart_001_01C8385F.9ECF3800 Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable
Hi=20 All,
 I'm using HTB=20 to shape traffic, a little like this:
 
tc = qdisc add dev=20 eth2 root handle 1:0 htb
tc qdisc add dev eth3 root handle 1:0=20 htb
tc = filter add dev=20 eth2 parent 1: protocol 0x8100 prio 5 u32 match u16 3000 0x0fff at 0 = flowid 1:1=20 action ipt -j MARK --or-mark 0x01000000
tc = filter add dev=20 eth3 parent 1: protocol 0x8100 prio 5 u32 match u16 3000 0x0fff at 0 = flowid 1:1=20 action ipt -j MARK --or-mark 0x01000000
 
tc = class add dev=20 eth2 parent 1:0 classid 1:1 htb rate 2000Kbit ceil = 2000Kbit   =20
tc class add dev eth3 parent 1:0 classid 1:1 htb rate 2000Kbit ceil=20 2000Kbit   
tc = qdisc add dev=20 eth2 parent 1:1 handle 2: htb
tc qdisc add dev eth3 parent 1:1 handle = 2:=20 htb
 
tc class add dev = eth2 parent=20 2:0 classid 2:1 htb rate 2000Kbit
tc class add dev eth3 parent 2:0 classid 2:1 htb = rate=20 2000Kbit
tc = filter add dev=20 eth2 parent 2:0 protocol 0x8100 prio 2 u32 match u16 3000 0x0fff at 0 = flowid 2:1=20 action ipt -j MARK --or-mark 0x00100000=20
tc = filter add dev=20 eth3 parent 2:0 protocol 0x8100 prio 2 u32 match u16 3000 0x0fff at 0 = flowid 2:1=20 action ipt -j MARK --or-mark 0x00100000=20
 
This = essentially=20 provides a 2mbit/s rate limit on each of eth2 and = eth3.
However, when I=20 attempt to put more than 2mbps through it, It gets quite latent (I end = up with=20 >1second latency at times). Is there any way of specifying the = maximum=20 latency on a HTB class or qdisc? Or CBQ, for that matter? I need to use = a=20 classful qdisc, so tbf is out of the question. Ideally, I want to be = able to=20 specify that packets get dropped if they are in the queue for any longer = than a=20 specified period of time.
Any=20 ideas?
 
Regards,
        &nbs= p;   =20 Leigh
 
Leigh Sharpe
Network Systems = Engineer
Pacific=20 Wireless
Ph +61 3 9584 8966
Mob 0408 009 502
Helpdesk 1300 300 616
email lsharpe@pacificwi= reless.com.au
web=20 www.pacificwireless.= com.au
 
------_=_NextPart_001_01C8385F.9ECF3800-- --===============2082696971== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc --===============2082696971==--