[LARTC] dscp marking

Linux Advanced Routing and Traffic Control

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

 



I want to set the DSCP field of the incoming packets. And then put them in the correct queues.

I can mark the packets:
iptables -A OUTPUT -t mangle -d 10.10.10.12 -j MARK --set-mark 1
tc qdisc add dev eth0 handle 1:0 dsmark indices 64 set_tc_index
tc class change dev eth0 classid 1:1 dsmark mask 0x3 value 0xb8
tc filter add dev eth0 parent 1:1 protocol ip prio 1 handle 1 fw classid 1:1

Or i can set up the queues:
#setting root DSMARK
#####################
echo Setting up DSMARK
$TC qdisc add dev $DEV root handle 1:0 dsmark indices 64 set_tc_index
$TC filter add dev $DEV protocol ip parent 1:0 prio 1 \
tcindex mask 0xfc shift 2 pass_on
#setting root CBQ
##################
echo Setting up root CBQ
$TC qdisc add dev $DEV parent 1:0 handle 2:0 cbq bandwidth $BANDWIDTH \
avpkt 1000 cell 8 mpu 64
$TC filter add dev $DEV parent 2:0 protocol ip prio 1 \
tcindex mask 0xf0 shift 4 pass_on
#setting EF
############
echo Setting up EF
$TC class add dev $DEV parent 2:0 classid 2:5 cbq bandwidth $BANDWIDTH \
rate $EF_RATE avpkt 1000 prio 1 bounded isolated allot 1514 \
maxburst 10
$TC qdisc add dev $DEV parent 2:5 pfifo limit 10
$TC filter add dev $DEV parent 1:0 protocol ip prio 1 \
handle 0x2e tcindex classid 1:51
$TC filter add dev $DEV parent 2:0 prio 1 handle 5 tcindex classid 2:5
#setting BE
############
echo Setting up BE
$TC class add dev $DEV parent 2:0 classid 2:6 cbq bandwidth $BANDWIDTH \
rate $BE_RATE avpkt 1000 prio 6 allot 1514 maxburst 21
$TC qdisc add dev $DEV parent 2:6 red limit 60KB min 15KB max 45KB \
burst 20 avpkt 1000 bandwidth $BANDWIDTH probability 0.4
$TC filter add dev $DEV parent 1:0 protocol ip prio 1 \
handle 0x0 tcindex classid 2:161
$TC filter add dev $DEV parent 2:0 protocol ip prio 1 \
handle 6 tcindex classid 2:6


But I can't combine the two. What do I have to do to combine these 2?
I tried to do the marking at the ingress but that didn't work.

Thanks,
Tom Aernoudt


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