[LARTC] question about ingress police

Linux Advanced Routing and Traffic Control

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

 



Hi stef and all

I want measure the policy perfomance for video traffic on mpls diffserv
network. there are two different polices for video packet
1.      Video packets that are marked that are over the limit are to be
rejected at the edge router.
2.    Video packets that are marked that are over the limit are to be
downgraded as best effort and are sent through.

Before video enter my mpls diffserv backbone, I already mark to EF class.
when video come to edge router, if its rate over limit, either dropped , or
downgraded to BE taffic
I plan use the ingress qdisc, but confused something parmeter

For policy 1,  a part of script follow
#! /bin/sh -x

TC=/usr/local/bin/tc
INDEV=eth0
EGDEV="dev eth1"

# tag video traffic from 172.16.40.3 to value 1, tag other traffic from
# 172.16.40.5 to value 2
iptables -A input -i $INDEV -s 172.16.40.3 -m 1
iptables -A input -i $INDEV -s 172.16.40.5 -m 2

# install the ingress qdisc on the ingress interface
$TC qdisc add dev $INDEV handle ffff: ingress

# police for video traffic
$TC filter add dev $INDEV parent ffff: protocol ip prio 50 handle 1 fw \
 police rate 4Mbit  burst 200k drop  flowid :1


######################## Egress side ########################

# attach a dsmarker
$TC qdisc add $EGDEV handle 1:0 root dsmark indices 64

#EF
$TC class change $EGDEV classid 1:1 dsmark mask 0x3 \
       value 0xb8

#BE
$TC class change $EGDEV classid 1:2 dsmark mask 0x3 \
       value 0x0
#
#
# The class mapping using fwmark
#
$TC filter add $EGDEV parent 1:0 protocol ip prio 1 handle 1 fw classid 1:1
$TC filter add $EGDEV parent 1:0 protocol ip prio 1 handle 2 fw classid 1:2

Question for this line
"$TC filter add dev $INDEV parent ffff: protocol ip prio 50 handle 1 fw \
 police rate 4Mbit  burst 200k drop  flowid :1"
does it mean if video traffic rate over 4Mbit, will be dropped. and normal
video traffic (not exceed limit) will be put into flow, flowid :1(1  meas
tcindex), am I right?

For policy 2 ,how can I remark overlimited packet to BE, I try

#
$TC filter add dev $INDEV parent ffff: protocol ip prio 50 handle 1 fw \
 police rate 4Mbit  burst 200k continue  flowid :2  (assume BE)

$TC filter add dev $INDEV parent ffff: protocol ip prio 50 handle 1 fw \
 police rate 4Mbit  burst 200k drop  flowid :1  (asume EF)

# map to classing using tcindex

$TC filter add $EGDEV parent 1:0 protocol ip prio 1 handle 1 tcindex classid
1:1
$TC filter add $EGDEV parent 1:0 protocol ip prio 1 handle 2 tcindex classid
1:2

Question for this line
"$TC filter add dev $INDEV parent ffff: protocol ip prio 50 handle 1 fw \
 police rate 4Mbit  burst 200k continue  flowid :2  "
does it mean if packet over limit will pass througn to tcindex 2 (later map
to BE)???

Thanks for help

yuxiao





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