Problems with HTB shaping

Linux Advanced Routing and Traffic Control

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

 



  Hello,

  I have some strange problems with shaping. Now I'm testing Linux as
shaping bridge. Redhat Linux 7.3, kernel plain 2.4.23 with latest HTB patch
from devik and PSCHED_CLOCK_SOURCE changed to PSCHED_CPU.

  Some output is at the end of the message. What is strange that according
to interface statistics traffic is shaped more or less OK.
  48431590 - 48079196 = 352394 (~275kbps)
  But byte count reported by tc is lower.
  39061384 - 38778938 = 282446 (~220kbps)

  But when I try to look into packets with tcpdump:
# tcpdump -c 10000 | fgrep -v $ip | wc -l
tcpdump: listening on br0
      5

  So only 5 packets should go not through filter.

  What I'm doing wrong?

  Mindaugas

----------------------------------------------------------------------------
-
# for w in "qdisc" "class" "filter"; do ./tc -s -d $w show dev eth0; echo;
done
qdisc sfq 200: limit 128p quantum 1514b flows 128/1024 perturb 10sec
 Sent 59048002 bytes 942023 pkts (dropped 52103102, overlimits 0)
 backlog 126p
qdisc htb 1: r2q 10 default 1 direct_packets_stat 756 ver 3.14
 Sent 59211007 bytes 942778 pkts (dropped 52103102, overlimits 53038514)
 backlog 126p

class htb 1:200 root leaf 200: prio 0 quantum 3276 rate 256Kbit ceil 256Kbit
burst 1926b/8 mpu 0b overhead 0b cburst 1926b/8 mpu 0b overhead 0b level 0
 Sent 59049862 bytes 942054 pkts (dropped 52103123, overlimits 0)
 rate 30227bps 394pps backlog 126p
 lended: 941933 borrowed: 0 giants: 0
 tokens: -81030 ctokens: -81030


filter parent 1: protocol ip pref 1 u32
filter parent 1: protocol ip pref 1 u32 fh 800: ht divisor 1
filter parent 1: protocol ip pref 1 u32 fh 800::800 order 2048 key ht 800
bkt 0 flowid 1:200
  match d5e2a020/fffffffc at 12
----------------------------------------------------------------------------
-
  $TC qdisc del dev eth0 root
  $TC qdisc del dev eth1 root

  $TC qdisc add dev eth0 root handle 1: htb default 1
  $TC qdisc add dev eth1 root handle 1: htb default 1

  $TC filter add dev eth0 parent 1: protocol ip prio 1 u32 match u32
0x${ip_hex} 0x${netmask_hex} at 12 flowid 1:$num
  $TC filter add dev eth1 parent 1: protocol ip prio 1 u32 match u32
0x${ip_hex} 0x${netmask_hex} at 16 flowid 1:$num
----------------------------------------------------------------------------
-
export E=eth0;./tc -s qdisc show dev $E;cat /proc/net/dev | fgrep $E;sleep
10;./tc -s qdisc show dev $E;cat /proc/net/dev | fgrep $E
qdisc sfq 200: limit 128p quantum 1514b perturb 10sec
 Sent 38778938 bytes 621714 pkts (dropped 34927008, overlimits 0)
 backlog 126p
qdisc htb 1: r2q 10 default 1 direct_packets_stat 465
 Sent 38904418 bytes 622179 pkts (dropped 34927008, overlimits 35550074)
 backlog 126p
  eth0:1374508678 12363563    0    0    0     0          0       139
48079196  619053   37    0    0 42449       0          0
qdisc sfq 200: limit 128p quantum 1514b perturb 10sec
 Sent 39061384 bytes 626322 pkts (dropped 35202131, overlimits 0)
 backlog 126p
qdisc htb 1: r2q 10 default 1 direct_packets_stat 467
 Sent 39187428 bytes 626789 pkts (dropped 35202131, overlimits 35829953)
 backlog 126p
  eth0:1382616092 12439928    0    0    0     0          0       140
48431590  623540   37    0    0 42721       0          0

_______________________________________________
LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux