@dstohr, @jfornoff and I found two problems in the config function for changing the link bandwidth limits (TCIntf) at runtime:
1.The config function deletes the existing tc configuration and creates a new one. This hinders in-place modifications of tc and introduces measurement artefacts.
2.The config function uses a shortcut for performance reasons which obstructs setting the limit to “None” coming from a limit which is "not None”.
This pull request fixes both problems and provides an additional example file which illustrates the discussed aspects. Please see the attached sample output figure of the example which illustrates the measurement artefacts.
We will use these changes to provide further support for changing bandwidths as presented in “Capture and Replay: Reproducible Network Experiments in Mininet” (http://dl.acm.org/citation.cfm?id=2959076) soon.
Support for smooth bandwidth limit changes in TCIntf config method
Interesting. A few thoughts:
Thanks for the feedback.
The attached graph is just for illustration of the effect. I attached a second graph with a delay of 20ms. The delay increases the artefact, as TCP requires more time to recover from the deleted traffic shaper. Deleting the tc configuration implies, e.g., for the sched_hbt shaper that htb_delete and htb_destroy (http://lxr.free-electrons.com/source/net/sched/sch_htb.c#L1237) are called.
The proposed modification is especially important for recurrent bandwidth limit changes, as otherwise the artefacts build up.
Regarding the additional replay functionality, we plan to make a second pull request which provides a simple API for replaying bandwidth traces. Even though both pull requests are related, the first one is the more general and provides the basic functionality for the second one.
What are the next steps to decide if this pull request is worth it? Please let me know if I should provide you additional measurements and examples!
I think it's mostly OK although there are a bunch of minor changes I'd want to make to it, including cosmetic changes (e.g. matching the mininet python style), and also thinking about how the configuration caching should work if it is in fact necessary.