Hi Gang,
I'm still experiencing some bandwidth starvation with my script (below), so I
decided to look at the statistics by using:
tc -s qdisc show dev eth0 (where eth0 is the interface I'm trying to
rate-limit outbound packets)
I get, for example:
qdisc sfq 21: quantum 1514b perturb 10sec
Sent 133527926 bytes 413260 pkts (dropped 0, overlimits 0)
qdisc sfq 20: quantum 1514b perturb 10sec
Sent 42622473 bytes 184396 pkts (dropped 0, overlimits 0)
qdisc htb 1: r2q 10 default 21 direct_packets_stat 0
Sent 176150399 bytes 597656 pkts (dropped 0, overlimits 137379)
On first appearance, I would think this is telling me that the overall
limiting is kicking in, and I'm not limiting specifically in the class 21
(which is where I want the limiting).
Here's my script:
tc qdisc del dev eth0 root
tc qdisc add dev eth0 root handle 1: htb default 21
tc class add dev eth0 parent 1: classid 1:1 htb rate 370kbit
tc class add dev eth0 parent 1:1 classid 1:20 htb prio 0 rate 100kbit
tc class add dev eth0 parent 1:1 classid 1:21 htb prio 1 rate 200kbit ceil
370kbit
tc qdisc add dev eth0 parent 1:20 handle 20: sfq perturb 10
tc qdisc add dev eth0 parent 1:21 handle 21: sfq perturb 10
# Set high priority for a certain destination IP address:
tc filter add dev eth0 parent 1:0 protocol ip prio 0 u32 \
match ip dst 147.135.2.0/24 flowid 1:20
# Set high priority for <64 byte packets:
tc filter add dev eth0 parent 1:0 protocol ip prio 0 u32 \
match ip protocol 6 0xff \
match u8 0x05 0x0f at 0 \
match u16 0x0000 0xffc0 at 2 \
match u8 0x10 0xff at 33 \
flowid 1:20
# Set high priority for ICMP packets:
tc filter add dev eth0 parent 1:0 protocol ip prio 0 u32 \
match ip protocol 1 0xff \
flowid 1:20
# Set high priority for UDP packets (hopefully all VOIP!):
tc filter add dev eth0 parent 1:0 protocol ip prio 0 u32 \
match ip protocol 17 0xff \
flowid 1:20
Am I reading this incorrectly?
Bob
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
|