I’m doing some tests to try to understand the tc-htb arguments. I’m using VmWare Player (version 2.0.5) with Windows 7 as host and Ubuntu (version 4.4.0-93) as guest.
My plan is to use iperf to generate a known data stream(udp 100Mbits/sec) via localhost and then limit the bandwidth with tc-htb. Monitoring the result with Wireshark.
Iperf setup:
- server:
iperf –s –u –p 12345
- client:
perf –c 127.0.0.1 –u –p 12345 –t 30 –b 100m
Testing rate argument:
I start Wireshark and start sending data with iperf, after 10 sec I execute a script with the tc commands:
tc qdisc add dev lo root handle 1: htb
tc class add dev lo parent 1: classid 1:1 htb rate 50mbit ceil 75mbit
tc filter add dev lo protocol ip parent 1: prio 1 u 32 match ip dport 12345
0xffff flowid 1:1
The I/O Graph in Wireshark shows that the bandwidth drops from 100 Mbit/s to 50 Mbit/s. Ok.
Testing burst argument:
I’m starting with the same bandwidth limitation as above and after another 10 sec I run a script with the command:
tc class change dev lo parent 1: classid 1:1 htb rate 50mbit ceil 75mbit burst 15k
In the I/O Graph I’m expecting a peek from 50mbit (rate level) up to 75mbit (ceil level). The change command has no effect, the level is at 50mbit. I have also tested with larger burst values, no effect. What am I doing wrong?