Commit f0b988f1 authored by Mike Hibler's avatar Mike Hibler

Revised version of "max delay" packet dropping in dummynet.

OLD:

 * Delay specified in ticks.
 * Drop performed as packets were leaving the delay queue (i.e., leaving
   dummynet).  This is more accurate in terms of calculating time spent
   in dummynet, and can be used with all strategies of BW/delay shaping
   (constant values, distributions, table lookup), but required that
   ultimately-dropped packets get put on the BW queue, changing the timing
   of things.

NEW:

 * Delay specified in milliseconds.
 * Drops perfromed as packets enter the bandwidth queue (i.e., arrive
   in dummynet).  Here drops are based on estimates of how long a packet
   would spend in dummynet and thus only works with constant delay/BW
   shaping characteristics, but does more accurately reflect queuing
   behavior.

The estimate is done by looking at the length in bytes of the bandwidth
queue (including the candidate packet) for the pipe, determining how long
it will take to transmit that many bytes, and then adding the delay value
for the pipe.
parent 0393e8e5
......@@ -268,11 +268,8 @@ def set_delay(milliseconds, dest):
def set_loss(probability, dest):
return set_link(this_ip, dest, 'plr=' + str(probability))
def set_max_delay(delay, dest):
hertz = 10000.0
milliseconds = 1000.0
return set_link(this_ip, dest, 'MAXINQ=' + str(int(
(hertz/milliseconds)*delay )))
def set_max_delay(milliseconds, dest):
return set_link(this_ip, dest, 'MAXINQ=' + str(milliseconds))
def set_link(source, dest, ending):
command = ('/usr/testbed/bin/tevc -e ' + this_experiment + ' now '
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment