View previous topic :: View next topic |
Author |
Message |
leviathan4444 n00b
Joined: 08 Oct 2006 Posts: 13 Location: Champaign, IL
|
Posted: Mon Nov 03, 2008 4:09 am Post subject: QOS tc and iptables - traffic always in default queue |
|
|
Hi,
I'm currently trying to setup a little QOS on my gentoo based home router. The idea is to use HTB such that ACKs and such TCP control traffic, and ICMP are in the first highest priority queue with a little slice of bandwidth at the top, everything else lands in the middle queue with most of the bandwidth, and then at the bottom is a que for large uploads, like FTP and P2P with the leftovers. I have decided to use the iptables firewall marking method to mark the packets, and use that criteria to place them in the queues. I have tried to test this out just with ICMP, and I can verify that my packets are hitting the iptables marking rule, as the counter goes up when I send pings, but the traffic still goes trough the default 2nd queue when it should be going through the 1st. I have tried multiple variations on this placing the iptables rule in the mangle postrouting, forward, and prerouting, as well as using hex values as the mark (0x1) instead of regular numbers. I have also played around with the flowid. Nothing makes a difference, same result. ethMB is the ethernet interface connected to my DSL. Here are the commands that I have been runing.
Setting up the queues:
tc qdisc del dev ethMB root
tc qdisc add dev ethMB root handle 1: htb default 20
tc class add dev ethMB parent 1: classid 1:1 htb rate 45kbps ceil 45kbps
tc class add dev ethMB parent 1:1 classid 1:10 htb rate 7kbps ceil 45kbps prio 0
tc class add dev ethMB parent 1:1 classid 1:20 htb rate 23kbps ceil 45kbps prio 1
tc class add dev ethMB parent 1:1 classid 1:30 htb rate 15kbps ceil 45kbps prio 2
tc qdisc add dev ethMB parent 1:10 handle 10 sfq perturb 2 quantum 1500
tc qdisc add dev ethMB parent 1:20 handle 20 sfq perturb 2 quantum 1500
tc qdisc add dev ethMB parent 1:30 handle 30 sfq perturb 2 quantum 1500
Iptables rule
iptables -t mangle -A POSTROUTING -p icmp -j MARK --set-mark 1
tc filter add dev ethMB protocol ip parent 1:0 prio 1 handle 1 fw flowid 1:10
Is there something that I'm missing here? I've googled around searching for answers, but haven't found any. Any help that you guys could offer would be wonderful. By the way, I based this off of the HTB manual, and a guide I found at: http://www.faqs.org/docs/Linux-HOWTO/ADSL-Bandwidth-Management-HOWTO.html
Thanks! |
|
Back to top |
|
|
frostschutz Advocate
Joined: 22 Feb 2005 Posts: 2977 Location: Germany
|
Posted: Sun Jan 25, 2009 12:28 am Post subject: |
|
|
not sure why that filter fails, do icmp packets not get marked?
filter parent should be 1: and not 1:0, for --set-mark and handle I use 0x1 not 1.
Other than that I don't see a problem except you're trying to prioritize icmp and HTB does not prioritize. The prio option of htb only affects lending/borrowing bandwidth between classes, not order in which packets are actually send. You'd need the PRIO qdisc for that.
sorry for the late reply |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|