From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Coppens" Date: Fri, 01 Mar 2002 11:09:15 +0000 Subject: [LARTC] Ingress policing MIME-Version: 1 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0084_01C1C119.E7CA1BD0" Message-Id: List-Id: To: lartc@vger.kernel.org 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
Hi all,
 
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 by setting the = tc_index. I=20 use the following script:
 
tc qdisc add dev eth1 handle ffff:=20 ingress
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
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
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
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.
 
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?
 
thx,
Jan
------=_NextPart_000_0084_01C1C119.E7CA1BD0-- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/