I'm trying to create a point to point link that has a random delay. Specifically the delay is exponentially distributed with a certain mean.
I checked the point to point module in ns 3's src folder. It has a function called GetDelay() which returns m_delay which is of type Time. This value gets set when we write our top level script in the scratch folder: the one where all the netdevices and other network properties are specified.
However, in the top level scripts, most examples that I saw set the delay as a fixed value by using the following line:
pointToPoint.SetChannelAttribute("Delay", StringValue ("2ms"));
where pointToPoint is a pointToPoint helper object (apologies if I'm using the tems incorrectly)
Is there a way of setting this delay to be a random variable from the top level script itself. Has anyone tried this before and if so can you please share the corresponding code with me: just the part that sets the delay to a random variable.
I was unable to find an example code which did this. If someone knows an example code which shows this, can you please point me in the right direction.
One way of doing this is to modify the GetDelay() function in the point to point scr module but I'm trying to avoid doing that since it might create more errors and require some debugging.