Setting max latency on classful qdiscs
Hi All,
I'm using HTB to shape traffic, a little like this:
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 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
tc class add dev eth2 parent 1:0 classid 1:1 htb rate 2000Kbit ceil 2000Kbit
tc class add dev eth3 parent 1:0 classid 1:1 htb rate 2000Kbit ceil 2000Kbit
tc qdisc add dev eth2 parent 1:1 handle 2: htb
tc qdisc add dev eth3 parent 1:1 handle 2: htb
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 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
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?
Regards,
Leigh
Leigh Sharpe
Network Systems Engineer
Pacific Wireless
Ph +61 3 9584 8966
Mob 0408 009 502
Helpdesk 1300 300 616
email [email protected]
<blocked::mailto:[email protected]>
web www.pacificwireless.com.au
<blocked::http://www.pacificwireless.com.au/>
Quoted 11 lines · Leigh Sharpe
Hi All,
I'm using HTB to shape traffic, a little like this:tc qdisc add dev eth2 root handle 1:0 htb
tc qdisc add dev eth3 root handle 1:0 htbtc filter add dev eth2 parent 1: protocol
0x8100prio 5 u32 match u16 30000x0fffat 0 flowid 1:1 action ipt -j MARK --or-mark0x01000000tc filter add dev eth3 parent 1: protocol0x8100prio 5 u32 match u16 30000x0fffat 0 flowid 1:1 action ipt -j MARK --or-mark0x01000000
Quoted 7 lines
tc class add dev eth2 parent 1:0 classid 1:1 htb rate 2000Kbit ceil 2000Kbit
tc class add dev eth3 parent 1:0 classid 1:1 htb rate 2000Kbit ceil 2000Kbittc qdisc add dev eth2 parent 1:1 handle 2: htb
tc qdisc add dev eth3 parent 1:1 handle 2: htb
Do you really need nested htb - I know it's allowed, but thought it was not really meant for normal use.
Quoted 9 lines
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
0x8100prio 2 u32 match u16 30000x0fffat 0 flowid 2:1 action ipt -j MARK --or-mark0x00100000tc filter add dev eth3 parent 2:0 protocol0x8100prio 2 u32 match u16 30000x0fffat 0 flowid 2:1 action ipt -j MARK --or-mark0x00100000
Quoted 8 lines
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?
The default pfifo length is picked up from the txqueuelen on the device.
If you want to control queuelengths per class just add sfq/[p|b]fifo and use the limit parameter.
As for latency - if you are shaping then you could consider trying to separate bulk from interactive and give interactive priority. You could just use qlen or sfq, but that's really meant for bulk.
Policing down will give the best latency. I am glad my ISP polices rather than buffers when it's peak time. The policers need to be per customer though.
Andy.
_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc