Hi there,

I have been trying out tcng and HTB on a loopback.

I wrote a tcng script like this:

#include "fields.tc"
#include "ports.tc"

#define ISCSI_IF lo

dev ISCSI_IF {
egress {
class (<$iperf_1>) if tcp_dport == 5001;
// class (<$iperf_2>) if tcp_dport == 5002;
// class (<$iperf_3>) if tcp_dport == 5003;

htb() {
class (rate 40 Mbps, ceil 40 Mbps) {
$iperf_1 = class (rate 40 Mbps, ceil 40 Mbps) {};
// $iperf_2 = class (rate 2 Mbps, ceil 2 Mbps) {};
// $iperf_3 = class (rate 7 Mbps, ceil 7 Mbps) {};
}
}
}
}

However, tcng generated the tc script like the following. Note that
the rate and ceil value is 5 Mbps instead of the 40 Mbps specified in
the tcng script. Anyone has any idea about that?

Another problem is that even if I modify the tc script manually
changing 5,000,000bps to 40,000,000bps, I still only get around
5,000,000bps from the test traffic, which is measured using Wireshark.
Is it a limit of HTB or I missed something?

Any help would be highly appreciated!

Thanks,
Jack

tc script generated:

# ================================= Device lo =================================

tc qdisc add dev lo handle 1:0 root dsmark indices 2 default_index 0
tc qdisc add dev lo handle 2:0 parent 1:0 htb
tc class add dev lo parent 2:0 classid 2:1 htb rate 5000000bps ceil 5000000bps
tc class add dev lo parent 2:1 classid 2:2 htb rate 5000000bps ceil 5000000bps
tc filter add dev lo parent 2:0 protocol all prio 1 tcindex mask 0x1 shift 0
tc filter add dev lo parent 2:0 protocol all prio 1 handle 1 tcindex classid 2:2
tc filter add dev lo parent 1:0 protocol all prio 1 handle 1:0:0 u32 divisor 1
tc filter add dev lo parent 1:0 protocol all prio 1 u32 match u8 0x6
0xff at 9 offset at 0 mask 0f00 shift 6 eat link 1:0:0
tc filter add dev lo parent 1:0 protocol all prio 1 handle 1:0:1 u32
ht 1:0:0 match u16 0x1389 0xffff at 2 classid 1:1