NS3 Delay Variance

549 views
Skip to first unread message

Richard

unread,
Feb 24, 2015, 8:35:58 AM2/24/15
to ns-3-...@googlegroups.com
I'n my simulation, I have three nodes, a client, a gateway and the server. The nodes are linked using the PointToPointHelper.

I can set a constant delay on any of these links using the setChannelAttribute() method, is it possible to add variable delay to these links? 

Ideally I want to replicate the delay properties I have set in a real world testbed, using netem; 
tc qdisc change dev eth0 root netem delay 80ms 15ms distribution normal
Should I be looking at using a queue? Or a different type of link to achieve this?
Thanks in advance,
Richard

Nat P

unread,
Feb 24, 2015, 8:47:30 AM2/24/15
to ns-3-...@googlegroups.com

With the actual model of point-to-point link and queues it is not possible.

Anyway, it would be a nice addition for both p2p and csma, IMHO.

Nat

Tommaso Pecorella

unread,
Feb 24, 2015, 11:04:29 AM2/24/15
to ns-3-...@googlegroups.com
Hi,

it depends. Channels are usually meant to model the physical effects of the channel. As a result, the delay is more or less a constant. It could vary slightly due to reflections or changes in the medium, but the differences are totally negligible.
A varying-delay channel makes sense for far-away, fast moving objects (e.g., satellites), but that's another model altogether.
A varying-delay model for a "channel" is interesting to model composite-like channels, as in a delay box. For the delay box I'd rather use a special node tho...
Anyway, this is not The Truth, it's just my own point of view. Mileage may differ.

Cheers,

T.

Richard

unread,
Feb 24, 2015, 11:57:35 AM2/24/15
to ns-3-...@googlegroups.com
Thanks for the reply,

I completely agree with you, Tommaso. As it isn't the medium that causes the delay variance in this scenario, including it into the model doesn't make much sense. A 'delay box' node does seem like the best approach, or if adding it to a NetDevice

I've done a little more digging, one quick/temporary solution was to add the delay into ns3::Ipv4L3Protocol::Receive(), I imagine getting this to work as desired with individual nodes and links may be a little more difficult. 

I'm going to try a few different approaches now, and see if I can come up with something workable. 

Best,

Richard

Richard

unread,
Feb 24, 2015, 3:35:28 PM2/24/15
to ns-3-...@googlegroups.com
Just an update with a working solution. I'm fairly new to NS3, so please let me know if this is problematic, or if there is a better approach. 

Basically I set NetDevice::ReceiveCallback, to then schedule the nodes NonPromiscReceiveFromDevice, so the packet gets handed on as normal after being delayed for a period of time. For this to work node.h needs to be modified, to make the NonPromiscReceiveFromDevice function public as a temporary solution. I've attached the code, apologies for basing it on DCE. 

Is there a way to easily waste a specific amount of simulator time? Which would allow me to use the promiscuous call back instead, removing the need to modify node.h

Best,

Richard
dce-delay-test.cc

Tom Henderson

unread,
Feb 24, 2015, 7:20:03 PM2/24/15
to ns-3-...@googlegroups.com
On 02/24/2015 05:47 AM, Nat P wrote:
>
>
> Il giorno martedì 24 febbraio 2015 14:35:58 UTC+1, Richard ha scritto:
>
> I'n my simulation, I have three nodes, a client, a gateway and the
> server. The nodes are linked using the PointToPointHelper.
>
> I can set a constant delay on any of these links using the
> setChannelAttribute() method, is it possible to add variable delay
> to these links?
>
> Ideally I want to replicate the delay properties I have set in a
> real world testbed, using netem;
>
> |
> tc qdisc change dev eth0 root netem delay 80ms15msdistribution normal
> |
>
> Should I be looking at using a queue? Or a different type of link to achieve this?
>
> Thanks in advance,
>
> Richard
>

There is a capability that provides this kind of delay variance in ns-2
called DelayBox:
http://www.isi.edu/nsnam/ns/doc/node247.html

A while ago, Matt Crinklaw worked on porting this to ns-3. Michele
Weigle's group was maintaining this until recently:
https://code.google.com/p/tmix-ns3/

It should work with ns-3.21 or later (probably). However, I haven't
tested or used the DelayBox aspect of this, only Tmix; I don't know how
ready it is.

If you try to use this and learn anything about it, can you report back
what you find?

One idea that I had a while back was to move the DelayBox into the
device instead of being a separate node in the simulation; then it would
be more like netem. This might make a good Google Summer of Code
project idea.

- Tom



Felipe Fideles

unread,
Jul 26, 2015, 12:01:24 PM7/26/15
to ns-3-users, to...@tomh.org
What if I want to apply the delays over LTE nodes? Is there a solution close to Richard's one to be used in LTE?

Regards,
Reply all
Reply to author
Forward
0 new messages