Hi, I just saw a lot of mails asking about " how to set a node as sleeping in ns2? " Now I am going to explain more about this in this post. Normally when using certain functions like Sleep"() Function from SMAC,we get the Segmentation fault or Floating point as result and it was hard to solve that. Normally, a node has four state: on,off,idle and sleep. We can consider sleep and idle as same state. In off condition, node becomes off but it still broadcasts based on protocol used. As from the tcl script we can simply on/off the nodes. But to make a node sleep/idle, we have to make changes in its back end files(.cc files). Also we can do the same by using the command " set idle_time_ ". For Idle Condition $ cd ns-2.3x/tcl/ex/ $ grep -Rin idle_time * The simulation examples are ( grep will also list a lot of config files.tcl ) : realaudio/ramodel.tcl sat-aloha.tcl srm.tcl srm-session.tcl test-rcvr.tcl ( Copy namfilter.tcl to ex/ from nam-1.1x/bin/.) tcpsrm.tcl ...
When you’re curious, you find lots of interesting things to do.