IFB & 802.1q
Hello
What I'm looking for is how to configure the Linux QoS module to do global rate limitation for two (or more) 802.1q pseudo network devices. I naturally suppose there is a possibility with IFB. I don't want to use IMQ because it's not integrated to my kernel v2.6.21.1 and I didn't find IMQ patches for it nor for the iptables package I use (v1.3.7).
I've found some sample for ingress shaping with IFB. But my goal is to make global ´egress¡ shaping on an IFB device grouping my two 802.1q devices (let's say eth0.10 and eth0.20 redirected to ifb0). I'm using the following commands to create a QoS simple tree :
ip link set up dev ifb0
tc qdisc add dev ifb0 root handle 1: htb default 3
tc class add dev ifb0 parent 1: classid 1:1 htb rate 2000kbit quantum 1514
tc class add dev ifb0 parent 1:1 classid 1:2 htb rate 1000kbit ceil 2000kbit quantum 1514
tc class add dev ifb0 parent 1:1 classid 1:3 htb rate 1000kbit ceil 2000kbit quantum 1514
tc filter add dev ifb0 parent 1: protocol ip priority 10 u32 match ip sport 80 0xffff flowid 1:2
So more precisely my question is which commands are to be used to redirect flows outgoing from eth0.10 and eth0.20 to ifb0 ? (I don't want to create separate QoS trees for eth0.10 and eth0.20 because the borrowing feature of HTB interests me).
I've used :
tc filter add dev eth0.10 parent root protocol ip priority 10 u32 match u32 0 0 flowid 1: action mirred egress redirect dev ifb0
tc filter add dev eth0.20 parent root protocol ip priority 10 u32 match u32 0 0 flowid 1: action mirred egress redirect dev ifb0
But this do not work! (the ifb0 is always empty) Maybe I miss something or simply IFB does not allow to do global limitation as IMQ does.
Somebody has already set such a configuration ? Any advice ? Thanks in advance
Signature · 7 lines
Afshin Tajvidi _______________________________________________ LARTC mailing list [email protected] http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
Hi,
Quoted 11 lines
ip link set up dev ifb0
tc qdisc add dev ifb0 root handle 1: htb default 3
tc class add dev ifb0 parent 1: classid 1:1 htb rate 2000kbit quantum 1514
tc class add dev ifb0 parent 1:1 classid 1:2 htb rate 1000kbit ceil 2000kbit quantum 1514
tc class add dev ifb0 parent 1:1 classid 1:3 htb rate 1000kbit ceil 2000kbit quantum 1514
Quoted 2 lines
tc filter add dev ifb0 parent 1: protocol ip priority 10 u32 match ip sport 80
0xffffflowid 1:2
Try with "protocol 802.1q" instead of "protocol ip" in the filter:
tc filter add dev ifb0 parent 1: protocol 802.1q priority 10 u32 match ip sport 80 0xffff flowid 1:2
I had a similar problem and that worked for me. These posts may be useful:
http://www.mail-archive.com/[email protected]/msg10132.html
http://www.mail-archive.com/[email protected]/msg15219.html
http://www.mail-archive.com/[email protected]/msg10726.html
Regards,
Signature · 8 lines
Saioa Arrizabalaga Telecommunication Engineer CEIT San Sebastian, Spain _______________________________________________ LARTC mailing list [email protected] http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
Quoted 7 lines · Afshin Tajvidi
So more precisely my question is which commands are to be used to redirect flows outgoing from eth0.10 and eth0.20 to ifb0 ? (I don't want to create separate QoS trees for eth0.10 and eth0.20 because the borrowing feature of HTB interests me).
I've used :
Quoted 7 lines
tc filter add dev eth0.10 parent root protocol ip priority 10 u32 match u32 0 0 flowid 1: action mirred egress redirect dev ifb0
tc filter add dev eth0.20 parent root protocol ip priority 10 u32 match u32 0 0 flowid 1: action mirred egress redirect dev ifb0But this do not work! (the ifb0 is always empty) Maybe I miss something or simply IFB does not allow to do global limitation as IMQ does.
You need a classfull qdisc on the egress interface to get the redirect to work. If you redirect from eth0.X then protocol ip should be OK. Try -
tc qdisc add dev eth0.10 root handle 1:0 prio
tc filter add dev eth0.10 parent 1:0 protocol ip priority 10 u32 match u32 0 0 flowid 1: action mirred egress redirect dev ifb0
Andy.
_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
Thank you for you response Saioa
I've tried "protocol 802.1q" but this solution does not work...
Regards
Afshîn
Quoted 20 lines · Saioa Arrizabalaga
Hi,
Quoted 11 lines
ip link set up dev ifb0
tc qdisc add dev ifb0 root handle 1: htb default 3
tc class add dev ifb0 parent 1: classid 1:1 htb rate 2000kbit quantum 1514
tc class add dev ifb0 parent 1:1 classid 1:2 htb rate 1000kbit ceil 2000kbit quantum 1514
tc class add dev ifb0 parent 1:1 classid 1:3 htb rate 1000kbit ceil 2000kbit quantum 1514Quoted 2 lines
tc filter add dev ifb0 parent 1: protocol ip priority 10 u32 match ip sport 80
0xffffflowid 1:2Try with "protocol 802.1q" instead of "protocol ip" in the filter:
tc filter add dev ifb0 parent 1: protocol 802.1q priority 10 u32 match ip sport 80
0xffffflowid 1:2
Quoted 6 lines
I had a similar problem and that worked for me. These posts may be useful:
http://www.mail-archive.com/[email protected]/msg10132.html
http://www.mail-archive.com/[email protected]/msg15219.html
http://www.mail-archive.com/[email protected]/msg10726.htmlRegards,
_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc