How to change the PointertoPointer channel parameter during the simulation

96 views
Skip to first unread message

Ren Liu

unread,
Jun 15, 2015, 4:54:53 PM6/15/15
to ns-3-...@googlegroups.com
Hello Everyone,

I am trying to dynamically change the PointertoPointer channel parameter during the simulation?
For example,:


PointToPointHelper pointToPoint;
pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));

At time==1 seconds
pointToPoint.SetChannelAttribute ("Delay", StringValue ("3ms"));

At time==5 seconds
pointToPoint.SetChannelAttribute ("Delay", StringValue ("10ms"));

At time==10 seconds
pointToPoint.SetChannelAttribute ("Delay", StringValue ("5ms"));


Is there anyone who can help me?
I appreciate any help.
Thank you very much


Tommaso Pecorella

unread,
Jun 15, 2015, 6:27:20 PM6/15/15
to ns-3-...@googlegroups.com
Hi,

two things. The fist is: it has been discussed previously (how to change a modes parameter with a scheduled unction). The second is: don't do that, it will not work.
The point is: if you change (suddenly) the channel's propagation delay, you'll have a message overlap (at best) or a message taking a looong time to finish (at worst).
The only way to change the propagation delay saely is to be sure that the channel is completely idle when you change the delay, and P2P doesn't have any failsafe mechanism to prevent mid-air packet being "stretched".
Shortly put: P2P isn't meant to be a wireless channel, changing its delay at run-time is not foreseen or supported.
of course, feel free to amend the model and submit a patch.

Have fun,

T.

Ren Liu

unread,
Jun 15, 2015, 6:54:32 PM6/15/15
to ns-3-...@googlegroups.com
Hi Tommaso,

Thanks very much for your reply. May I ask if I set the connection as wireless channel, could I change its delay at run-time? Thank you very much.

Tommaso Pecorella

unread,
Jun 15, 2015, 7:03:42 PM6/15/15
to ns-3-...@googlegroups.com
Hi,

wireless channel delay depends on the node's mutual position (distance), and the difference is usually negligible.

Cheers,

T.

pdbarnes

unread,
Jun 16, 2015, 1:39:58 AM6/16/15
to ns-3-...@googlegroups.com
The other thing to realize is that your pointToPoint variable is a PointToPointHelper. Helpers are used to create and install new channels and net devices, so changing the delay in the helper will have no effect on existing channels.

Peter
Reply all
Reply to author
Forward
0 new messages