Setting a random delay on a point to point link

71 views
Skip to first unread message

PN

unread,
Jun 16, 2016, 8:11:57 PM6/16/16
to ns-3-users

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.

Tommaso Pecorella

unread,
Jun 16, 2016, 8:54:06 PM6/16/16
to ns-3-users
Hi,

having a random delay on a channel is a bad idea. if you randomize without particular care the delay you can end up with overlapping packets.
A solution is to randomizing the delay only when the channel is idle, i.e., between one packet and another, but you don't have to consider only the transmitter, as there's also the receiver.

In other terms, you need a special care, and just modifying the delay in the PointToPoint channel is not going to work.

T.

Rahul Singh Gulia

unread,
Apr 12, 2021, 10:38:51 AM4/12/21
to ns-3-users
Hi Tom,

Can we not specify this point-to-point delay, and generate the delays that will occur in a Data link layer for a wireless channel model?


-Rahul 

Reply all
Reply to author
Forward
0 new messages