[LARTC] Ingress policing

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a multi-part message in MIME format.

------=_NextPart_000_0084_01C1C119.E7CA1BD0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi all,

I'm working on a script that measures the incoming bandwidth and devides =
the traffic into different classes. First I mark all the incoming =
traffic with a firewall rule (fwmark =3D 1), then I use an ingress qdisc =
with some policers/filters to devide the traffic by setting the =
tc_index. I use the following script:

tc qdisc add dev eth1 handle ffff: ingress
tc filter add dev eth1 parent ffff: handle 1 protocol ip prio 1 =
estimator 1 2 fw police rate 0 burst 0 avrate 500bps continue flowid :28
tc filter add dev eth1 parent ffff: handle 1 protocol ip prio 2 =
estimator 1 2 fw police rate 0 burst 0 avrate 300bps continue flowid :30
tc filter add dev eth1 parent ffff: handle 1 protocol ip prio 3 =
estimator 1 2 fw police rate 0 burst 0 avrate 1bps drop flowid :50

This is the way I think it "should" work ;-) If the incoming traffic is =
below 500bps the tc_index gets the value 28. If the traffic is between =
500bps and 800bps the tc_index gets the value of 30. Between 800bps and =
801bps the tc_index is 50, above 801bps, all packets are dropped.

The policing works just fine, all packets are sent to the correct =
filters. The only thing that does not work is the tc_index stuff. The =
tc_index is allways 0 instead of 28, 30 or (in some cases) 50. What's =
going wrong here?

thx,
Jan

------=_NextPart_000_0084_01C1C119.E7CA1BD0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.3315.2869" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi all,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I'm working on a script that measures =
the incoming=20
bandwidth and devides the traffic into different classes. First I mark =
all the=20
incoming traffic with a firewall rule (fwmark =3D 1), then I use an =
ingress qdisc=20
with some policers/filters to devide the traffic&nbsp;by setting the =
tc_index. I=20
use the following script:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>tc qdisc add dev eth1 handle ffff:=20
ingress</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>tc filter add dev eth1 parent ffff: =
handle 1=20
protocol ip prio 1 estimator 1 2 fw police rate 0 burst 0 avrate 500bps =
continue=20
flowid :28<BR>tc filter add dev eth1 parent ffff: handle 1 protocol ip =
prio 2=20
estimator 1 2 fw police rate 0 burst 0 avrate 300bps continue flowid =
:30<BR>tc=20
filter add dev eth1 parent ffff: handle 1 protocol ip prio 3 estimator 1 =
2 fw=20
police rate 0 burst 0 avrate 1bps drop flowid :50<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>This is the way I think it "should" =
work ;-) If the=20
incoming traffic is below 500bps the tc_index gets the value 28. If the =
traffic=20
is between 500bps and 800bps the tc_index gets the value of 30. Between =
800bps=20
and 801bps the tc_index is 50, above 801bps, all packets are=20
dropped.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The policing works just fine, all =
packets are sent=20
to the correct filters. The only thing that does not work is the =
tc_index stuff.=20
The tc_index is allways 0 instead of 28, 30 or (in some cases) 50. =
What's going=20
wrong here?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>thx,</FONT></DIV>
<DIV>Jan<FONT face=3DArial =
size=3D2></DIV></FONT></FONT></DIV></BODY></HTML>

------=_NextPart_000_0084_01C1C119.E7CA1BD0--



[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux