Re: htb + prio trouble

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

 



On Sun, 2011-11-20 at 12:44 -0600, Lloyd Standish wrote:
> Hello All,
> 
> While configuring a load-balancing router, I have run into trouble
>  setting up traffic shaping (at least the load-balancing is working!)
> 
> I am trying to:
> (1) limit total upload speed to somewhat below the interface bandwidth
> (2) do some traffic shaping, particularly avoid queuing of VOIP packets.
> 
> To accomplish this I am trying to create a HTB qdisc on each
>  outward-facing interface, each containing a PRIO qdisc with the
>  default 3 classes.  sfq qdiscs are created for each PRIO class.
> 
> Commands to set up qdiscs and filters for outward-facing interface eth0:
> 
> + tc qdisc del dev eth0 root handle 1
> + tc qdisc del dev eth0 ingress
> + tc qdisc add dev eth0 root handle 1:0 htb
> + tc class add dev eth0 parent 1:0 classid 1:1 htb rate 3200kbit ceil 3200kbit
> + tc qdisc add dev eth0 parent 1:1 handle 2: prio
> + tc qdisc add dev eth0 parent 2:1 handle 10: sfq perturb 10 limit 3000
> + tc qdisc add dev eth0 parent 2:2 handle 20: sfq perturb 10
> + tc qdisc add dev eth0 parent 2:3 handle 30: sfq perturb 10
> + tc filter add dev eth0 protocol ip parent 2: prio 1 u32 match ip dport 5060 0xffff flowid 2:1
> + tc filter add dev eth0 protocol ip parent 2: prio 1 u32 match ip sport 5060 0xffff flowid 2:1
> + tc filter add dev eth0 protocol ip parent 2: prio 1 u32 match ip dport 53 0xffff flowid 2:1
> + tc filter add dev eth0 protocol ip parent 2: prio 1 u32 match ip dport 80 0xffff flowid 2:1

I don't think you're filtering correctly. You've attached the filter to
the prio qdisc, which is below the htb qdisc. Therefore it won't see any
traffic, as there is no filter to send traffic into the prio qdisc
itself. In fact, there is no filter at all for the htb qdisc, hence the
reason you are seeing traffic in it but nowhere else.

The filter needs to sit the level above in order to filter into classes
below it, so you'll need to do something like

tc filter add dev eth0 protocol ip parent 1:0 prio 1 \
	u32 match ip dport 80 0xffff flowid 2:1

You may also need to change the flowid (I've never played with the prio
qdisc)

Andy


--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux