David Blomberg
2005-Nov-25 15:42 UTC
Difference between snmp traffic rate, and rate from tc
Hello, I use rrdtool to graph the traffic in the different classes on an interface, eth1. Basically, I use the output from tc -s qdisc ls dev eth1 my tc script (which is only for testing the graphing) looks like this: /sbin/tc qdisc add dev eth1 root handle 1: htb default 20 r2q 1 /sbin/tc class add dev eth1 parent 1: classid 1:1 htb rate 200kbit burst 15k /sbin/tc class add dev eth1 parent 1:1 classid 1:10 htb rate 100kbit ceil 200kbit burst 15k /sbin/tc class add dev eth1 parent 1:1 classid 1:20 htb rate 50kbit ceil 200kbit burst 15k /sbin/tc class add dev eth1 parent 1:1 classid 1:30 htb rate 50kbit ceil 200kbit burst 15k /sbin/tc qdisc add dev eth1 parent 1:10 handle 10: sfq perturb 10 /sbin/tc qdisc add dev eth1 parent 1:20 handle 20: sfq perturb 10 /sbin/tc qdisc add dev eth1 parent 1:30 handle 30: sfq perturb 10 /sbin/iptables -F /sbin/iptables -A OUTPUT -t mangle -o eth1 -j MARK --set-mark 1 /sbin/tc filter add dev eth1 protocol ip parent 1:0 prio 1 handle 1 fw flowid 1:10 # Filter arp packets to class 1:30. /sbin/tc filter add dev eth1 protocol arp u32 match u32 0 0 flowid 1:30 When I with the help of snmp, I also graph the rate of packets going out on the interface. My problem is that the rate I get from snmp is not the same as the rate I get from the root class of my queue. In both cases, the rate is calculated by rrdtool, I submit the number of bytes that have been transmitted. Shouldn''t the rate of packets leaving the root class be the same as the rate given by snmp? Thank you for the help, regards, David Blomberg
David Blomberg
2005-Nov-28 12:18 UTC
RE: Difference between snmp traffic rate, and rate from tc
Hi, I guess I''ll answer my own question myself. I was on a wireless interface, so the difference seems to have been due to physical layer overhead. I switched to wire and did not notice any difference, regards David Blomberg> Hello, > > I use rrdtool to graph the traffic in the different classes on an > interface, eth1. Basically, I use the output from > > tc -s qdisc ls dev eth1 > > my tc script (which is only for testing the graphing) looks like this: > > /sbin/tc qdisc add dev eth1 root handle 1: htb default 20 r2q 1 > /sbin/tc class add dev eth1 parent 1: classid 1:1 htb rate 200kbit burst > 15k > > /sbin/tc class add dev eth1 parent 1:1 classid 1:10 htb rate 100kbit ceil > 200kbit burst 15k > /sbin/tc class add dev eth1 parent 1:1 classid 1:20 htb rate 50kbit ceil > 200kbit burst 15k > /sbin/tc class add dev eth1 parent 1:1 classid 1:30 htb rate 50kbit ceil > 200kbit burst 15k > > /sbin/tc qdisc add dev eth1 parent 1:10 handle 10: sfq perturb 10 > /sbin/tc qdisc add dev eth1 parent 1:20 handle 20: sfq perturb 10 > /sbin/tc qdisc add dev eth1 parent 1:30 handle 30: sfq perturb 10 > > /sbin/iptables -F > /sbin/iptables -A OUTPUT -t mangle -o eth1 -j MARK --set-mark 1 > > /sbin/tc filter add dev eth1 protocol ip parent 1:0 prio 1 handle 1 fw > flowid 1:10 > # Filter arp packets to class 1:30. > /sbin/tc filter add dev eth1 protocol arp u32 match u32 0 0 flowid 1:30 > > When I with the help of snmp, I also graph the rate of packets going out > on the interface. My problem is that the rate I get from snmp is not the > same as the rate I get from the root class of my queue. In both cases, the > rate is calculated by rrdtool, I submit the number of bytes that have been > transmitted. Shouldn''t the rate of packets leaving the root class be the > same as the rate given by snmp? > > Thank you for the help, > > regards, > > David Blomberg