I want to know how accurate I can bound a class with CBQ. So I created a bounded class 10:2 on root qdisc 10:0 and tried different rates.
To help, I used my monitor.pl script and 2 other scripts: bounded.sh and test.pl. I run the tests from 1 kbps up to 1250 kbps and I switch to the next rate if the average bandwidth didn't changed within the last 5 results.
- bounded.sh: takes one parameter and uses this to create a bounded class and qdisc.
- text.pl: will execute bounded.sh with different rates and each time it restarts monitor.pl. It reads
/tmp/monitor.plto know the last measured average bandwidth. When the average bandwidth didn't changed within the last 5 values, it changes to a new rate and logs the measured speed.
For the tests with 1 stream and 10 parallel streams, I waited until the average bandwidth did not changed for 10 seconds. For the tests with 5 parallel streams, I waited 5 seconds so these tests are more jumpy. But the tests takes to long when I waited 10 seconds.
Two logfiles together on one image (1 stream - 5 streams - 10 streams):
The results are good. You can bound to each bandwidth that you want, but you have to try some rates to get the bandwidth bounded to the bandwidth you want.
When you generate 10 parallel streams, the maximum bandwidth you can reach is higher. I still have to test with other traffic generators to see what happens. (TODO)
I also have to try some other options to see if the accuracy can be improved. Someone suggested that avpkt=500 gives better results. Test will prove if it does. (TODO)