[LARTC] Re: LARTC] IFB & 802.1q

2007-06-01 Thread Afshin Tajvidi
Thank you so much Marek and Andy
Your solutions work great!

Now my complete configuration is setup by the following commands:

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
ceil2000kbit 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
ipsport 80 0x flowid 1:2

qdisc add dev eth0.10 root handle 1: htb
qdisc add dev eth0.20 root handle 1: htb

tc filter add dev eth0.10 parent 1: protocol ip priority 10 u32 match
u32 0 0 flowid 1: action mirred egress redirect dev ifb0
tc filter add dev eth0.20 parent 1: protocol ip priority 10 u32 match
u32 0 0 flowid 1: action mirred egress redirect dev ifb0

On Thu, 2007-05-31 at 16:41 +0200, Marek Kierdelewicz wrote:
> Hi,
> 
> >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
> 
> Try to add htb qdisc and attach your filter to qdisc instead of root. I
> think I used such configuration some time ago. As for filter rule,
> something like that worked for me:
> 
> tc filter add dev ethX.X protocol ip parent 1: prio 4 u32 match ip
> dst 0.0.0.0/0 flowid :1 action mirred egress redirect dev ifbX
> 
> cheers,
> Marek Kierdelewicz
> KoBa ISP
> ___
> LARTC mailing list
> LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
> 
-- 
Afshin Tajvidi
IT Technical Architect

___
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc


Re: [LARTC] IFB & 802.1q

2007-06-01 Thread Afshin Tajvidi
Thank you for you response Saioa
I've tried "protocol 802.1q" but this solution does not work...

Regards
Afshîn

On Thu, 2007-05-31 at 16:59 +0200, Saioa Arrizabalaga wrote:
> Hi,
> >
> > 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 0x flowid 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 0x flowid 1:2
> 
> I had a similar problem and that worked for me. These posts may be useful:
> http://www.mail-archive.com/lartc@mailman.ds9a.nl/msg10132.html
> http://www.mail-archive.com/lartc@mailman.ds9a.nl/msg15219.html
> http://www.mail-archive.com/lartc@mailman.ds9a.nl/msg10726.html
> 
> Regards,

___
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc


Re: [LARTC] IFB & 802.1q

2007-05-31 Thread Andy Furniss

Afshin Tajvidi wrote:


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.


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
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc


Re: [LARTC] IFB & 802.1q

2007-05-31 Thread Saioa Arrizabalaga

Hi,


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 0x flowid 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 0x flowid 1:2

I had a similar problem and that worked for me. These posts may be useful:
http://www.mail-archive.com/lartc@mailman.ds9a.nl/msg10132.html
http://www.mail-archive.com/lartc@mailman.ds9a.nl/msg15219.html
http://www.mail-archive.com/lartc@mailman.ds9a.nl/msg10726.html

Regards,
--
Saioa Arrizabalaga
Telecommunication Engineer
CEIT
San Sebastian, Spain
___
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc


Re: ***SPAM*** [LARTC] IFB & 802.1q

2007-05-31 Thread Marek Kierdelewicz
Hi,

>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

Try to add htb qdisc and attach your filter to qdisc instead of root. I
think I used such configuration some time ago. As for filter rule,
something like that worked for me:

tc filter add dev ethX.X protocol ip parent 1: prio 4 u32 match ip
dst 0.0.0.0/0 flowid :1 action mirred egress redirect dev ifbX

cheers,
Marek Kierdelewicz
KoBa ISP
___
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc


[LARTC] IFB & 802.1q

2007-05-31 Thread Afshin Tajvidi
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 0x 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

-- 
Afshin Tajvidi


___
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc