[ns] node off doesn't work
Salvo Danilo Giuffrida
giuffsalvo at gmail.com
Tue Feb 17 12:14:54 PST 2009
I'm trying to set-up a simulation of a wireless network, where nodes
can go down during the course of an FTP transfer.
To achieve this, I schedule the shutdown of a node with
$ns_ at $time "$node_($i) off"
The problem is that, when I run the simulation, this is the error
message that NS-2 gives me
ns: _o90 reset-state:
(_o90 cmd line 1)
invoked from within
"_o90 cmd reset-state"
invoked from within
"catch "$self cmd $args" ret"
invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
(procedure "_o90" line 2)
(SplitObject unknown line 2)
invoked from within
"_o90 reset-state"
I looked into the file 'mobilenode.cc', in the method
MobileNode::command(....), and this is the C++ code called when the
Tcl command "off" is called
} else if (strcmp(argv[1], "off") == 0) {
energy_model()->node_on() = false;
tcl.evalf("%s set netif_(0)", name_);
const char *str = tcl.result();
tcl.evalf("%s NodeOff", str);
tcl.evalf("%s set ragent_", name_);
str = tcl.result();
tcl.evalf("%s reset-state", str);
God::instance()->ComputeRoute();
return TCL_OK;
So, I guess that the problem arises when the command "reset-state" is
called on the DSR routing agent, represented in Tcl by the node's
variable "ragent_". I looked into the file 'dsragent.cc', and
elsewhere in the C++ source of NS-2, but there's no mention of a
corresponsing method, it's like if this "reset-state" command is not
bound to any C++ method.
Do you have more information about this strange behaviour? I tried to
shutdown nodes using
"$node_($i) shutdown"
But that doesn't work, in fact if I visualize the nam trace, traffic
from/to the shutted down node continues...
Do you know if there would be "collateral effects" if I'd comment the line
tcl.evalf("%s reset-state", str) ?
Thanks a lot
More information about the Ns-users
mailing list