如何更改 NS2 模拟中链路的延迟?
我需要运行 NS2 模拟,链路的延迟会发生变化 在运行时,我在 tcl 脚本中使用以下过程:
$ns delay $node3 $node4 $delay_time
更改 $node3 和 $node4 之间链接的延迟。
但只有在模拟开始之前设置它才有效。
如果我想改变某个时间的延迟,例如
$ns at 1.0 "$ns delay $node3 $node4 10ms"
它不起作用。那么如何改变运行时链接的延迟呢?
感谢您的任何帮助。
I need to run a NS2 simulation that the delay of a link will change
during the runtime, and I use following procedure in tcl script:
$ns delay $node3 $node4 $delay_time
to change the delay in a link between $node3 and $node4.
But it only works when it's set before the simulation starts.
If I want to change the delay in a certain time, e.g.
$ns at 1.0 "$ns delay $node3 $node4 10ms"
It doesn't work.So how to change the delay of a link during runtime?
Thanks for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我自己断断续续地寻找这个答案已经有一段时间了。我一直在不断地回到这个令人沮丧的未解答的问题。这里是。
如上所述,您有 $node3 和 $node4。
要获取链接,请使用
注意,这不仅仅是链接,它是链接中的 link_ (手册第 68 页 http://www.isi.edu/nsnam/ns/doc/ns_doc.pdf 或 html 版本 http://www.isi.edu/nsnam/ns/doc/node63.html)。这是管理链路延迟的部分。为了改变链接延迟,使用
这部分在ns-2.35/tcl/lib/ns-link.tcl中找到
I have been looking for this answer on and off for quite some time myself. I have been constantly making my way back here to this depressingly unanswered question. Here it is.
Say as above, you have $node3 and $node4.
To get your link, use
Note that this is not just the link, it is the link_ within the Link (manual page 68 http://www.isi.edu/nsnam/ns/doc/ns_doc.pdf or html version http://www.isi.edu/nsnam/ns/doc/node63.html). This is the part that manages the link delay. In order to change the link delay, use
This part was found in ns-2.35/tcl/lib/ns-link.tcl