Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Add RED AQM. #122
@vsrinivas and I were working on experimenting with different congestion control schemes and wanted to try out our congestion control schemes w/ different queueing disciplines. We were particularly interested in RED, and wrote an implementation in mahimahi to try out.
Algorithm & Parameters
The general idea behind RED is that it drops packets probabilistically, where that probability is determined by an exponentially weighted average of the depth of the queue.
If the queue is empty, we decay the weighted average by the amount of time the queue has been empty to prevent the case where the queue is empty but the weighted average remains high because of the lower number of enqueues that happen (this is outlined in the paper as well).
There are three parameters:
The paper I link to above has a guide for how to tune these parameters.
Thanks for putting the simulator on github--it's been super helpful in learning how this congestion control stuff works, and let me know if you'd like to make any changes here.
@keithw awesome, thanks for looking at this & the feedback! I resolved most of your comments except for the argument parsing stuff, which I need to think about a little bit. min and max thresholds could certainly be read in as ints, but
Couple things I changed that are worth pointing out:
Thanks again for taking a look at this!
@keithw this is ready for another look! I updated the argument parsing to first convert the arguments into a
Note: I copied the
I tested this with this command:
$ mm-link 2.64mbps-poisson.trace 2.64mbps-poisson.trace --downlink-queue=red --downlink-queue-args=packets=1000,wq=0.002,minthresh=0.2,maxthresh=5,transmission_time=5
Messing with the args to not use "=" properly results in:
$ mm-link 2.64mbps-poisson.trace 2.64mbps-poisson.trace --downlink-queue=red --downlink-queue-args=packets1000,wq=0.002,minthresh=0.2,maxthresh=5,transmission_time=5 Died on std::runtime_error: Queue args passed in wrong format
Passing in an incorrect int results in:
$ mm-link 2.64mbps-poisson.trace 2.64mbps-poisson.trace --downlink-queue=red --downlink-queue-args=packets=x1000,wq=0.002,minthresh=0.2,maxthresh=5,transmission_time=5 Died on std::runtime_error: Invalid integer: x1000
And passing in an incorrect float results in:
$ mm-link 2.64mbps-poisson.trace 2.64mbps-poisson.trace --downlink-queue=red --downlink-queue-args=packets=1000,wq=x0.002,minthresh=0.2,maxthresh=5,transmission_time=5 Died on std::runtime_error: Invalid floating-point number: x0.002
Let me know what you think! Thanks again for looking at this
Looks really good! (And sorry for the delayed review...) This is almost ready pending:
Would you be willing to try the following:
a. Instead of returning the map, parse_queue_args returns a ParsedArguments class, and that class encapsulates the map (as a private member) and also exposes public accessors for get_int_arg and get_float_arg.
b. The call signature for get_int_arg and get_float_arg has an optional variable for the default value. If the argument was not provided, and no default value was provided at the call site, the method throws an exception for a missing required argument. If the argument was not provided, and a default value WAS provided, the method provides the default value but also logs a warning to stderr ("Note: Using default value of xxx for parameter yyy").
Other than that I think it's good to go. Thanks again for all your work on this.
Sorry again for being so late to get back on this--I just started a new job which has been crazy. I resolved the changes that you mentioned--the main file to look at in the diff is "parsed_arguments.hh". I put it in the
Besides that, I think this should be good to go. Sorry again for the long delay.