Hi Everyone
I'm running Fedora Core 2 as a router and am having problems getting the
PRIO qdisc to work.
I'm using the Iperf utility to generate traffic flows between computers on
either side of the Fedora box. I want traffic destined to port 6001 to be
in band 0, traffic for port 6002 in band 1 and traffic for port 6003 in band
2.
I'm using HTB to restrict the overall bandwidth to 5000 kbit.
So far I've developed the following scripts, based on info I've picked up
from the LARTC mailing list archives, man pages and Google searches.
SCRIPT ONE...
tc qdisc del dev eth1 root
tc qdisc add dev eth1 root handle 1: htb default 1
tc class add dev eth1 parent 1: classid 1:1 htb rate 5000kbit
tc qdisc add dev eth1 parent 1:1 handle 10: prio
tc filter add dev eth1 parent 1:0 protocol ip handle 1 fw flowid 10:1
tc filter add dev eth1 parent 1:0 protocol ip handle 2 fw flowid 10:2
tc filter add dev eth1 parent 1:0 protocol ip handle 3 fw flowid 10:3
iptables -F --table mangle
iptables -t mangle -A POSTROUTING -o eth1 -p tcp --dport 6001 -j
MARK --set-mark 1
iptables -t mangle -A POSTROUTING -o eth1 -p tcp --dport 6002 -j
MARK --set-mark 2
iptables -t mangle -A POSTROUTING -o eth1 -p tcp --dport 6003 -j
MARK --set-mark 3
SCRIPT TWO...
tc qdisc del dev eth1 root
tc qdisc add dev eth1 root handle 1: htb default 1
tc class add dev eth1 parent 1: classid 1:1 htb rate 5000kbit
tc qdisc add dev eth1 parent 1:1 handle 10: prio
tc filter add dev eth1 parent 1: protocol ip prio 1 u32 match ip dport 6001
0xffff flowid 10:1
tc filter add dev eth1 parent 1: protocol ip prio 2 u32 match ip dport 6002
0xffff flowid 10:2
tc filter add dev eth1 parent 1: protocol ip prio 3 u32 match ip dport 6003
0xffff flowid 10:3
Neither of these seem to work as expected. I was hoping to starve the flows
in the lower bands (I'm interested to see the behaviour of TCP in this
situation) but the flows receive a roughly equal share of the available
bandwidth.
I'm obviously doing something wrong and would any help would be appreciated.
Tim.
--
email tpgoddard (at) hotmail.com
|