[ns] rtmodel-at down seems to do nothing
Pedro Vale Estrela
pedro.estrela at gmail.com
Mon Aug 28 12:02:59 PDT 2006
A quick test showed that the problem is that is not possible to make a link
go down __at runtime__.
Eg, at configuration time this works:
...
$ns rtmodel-at 7.0 down $node_a $node_b
....
but the functionally equivalent at run-time will not work, and no error will
be produced:
proc my_test { op a b } {
set ns [Simulator instance]
set now [$ns now]
puts "Current time $now; trying to make link down..."
$ns rtmodel-at [expr $now + 0.000001] $op $a $b
}
<configuration time>
$ns at 7.0 "my_test down $node_a $node_b"
-----------------
this bug is probably related to this "manual" type of routing, as used below
(see /tcl/lib/rtglib/dynamics.tcl)
Simulator instproc rtmodel-at {at op args} {
set parms [list $op $at]
eval $self rtmodel Manual [list $parms] $args
}
if you need otcl debugging capabilities, check my page
http://tagus.inesc-id.pt/~pestrela/ns2/ns2_debugging2.html)
When you find the bug, please make a patch and report in the ns-developers
mailing list
Regards
Pedro Vale Estrela
> Hello,
>
> The Link Failure code from Marc Greis' Tutorial works fine for me.
> However, when I use almost the exact same code from my app, the code
> doesn't seem to do anything. There are no corresponding entries in the
> network trace or nam files, despite the fact that the code executes.
>
> I'm calling the code from C++ via:
>
> Tcl &tcl = Tcl::instance();
> tcl.evalf( "$ns rtmodel-at %f down $n(%d) $n(%d)",
> Scheduler::instance().clock() + 0.0001, ip1, ip2 );
This invocation is just fine;
>
> I know the code is executing, but nothing seems to happen.
Same symptoms here!
> There are a few posts on the ns2 listserv archive (e.g., "rtmodel-at
> doesn't work inside a procedure"), but unfortunately these posts don't
> have replies.
Probably these tried to do the same thing, eg at run-time
> Also, I'm not really running rtmodel-at from within a
> procedure, unless tcl.evalf counts.
Yes, it counts as an TCL procedure
> A few other helpful notes: I'm not using "$ns rtproto DV" because I
> don't want dynamic routing. I don't call "$ns rtproto" at all. Links
using "session" routing, it had the same problem
> are created using "$ns duplex-link".
No problem there
More information about the Ns-users
mailing list