Skip to main content

Posts

Showing posts with the label node

SETTING A NODE TO SLEEP IN NS2

  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 ...

SCRIPT TO FIND DESTINATION AND ENERGY OF NODES

 Here we created a script to print final position of node and energy of nodes in your terminal.We hope it is useful for you all....!!!!!! For script and details,  Click here  Screenshot:

VARIABLE BIT RATE [VBR] IMPLEMENTATION IN NS2

 We just made a VBR application that randomly change rate or bursts depending on parameters set. In order to use it in ns you have to follow: Include  vbr_traffic.o  in  Makefile.in   Preferrably set the default values in /home/user/Desktop/ns-allinone-2.35/ns-2.35/tcl/lib  Run ./configure in your ns-allinone-2.35 directory  Run make depend in ns-allinone-2.35 Run make Now your  VBR  is ready. Default values in ns-default.tcl: Application/Traffic/VBR set rate_ 448Kb ;# corresponds to interval of 3.75ms  Application/Traffic/VBR set rate_dev_ 0.25;  Application/Traffic/VBR set rate_time_ 2.0;  Application/Traffic/VBR set burst_time_ 1.0;  Application/Traffic/VBR set n_o_changes_ 10;  Application/Traffic/VBR set time_dev_ 0.5;  Application/Traffic/VBR set constant_ false;  Application/Traffic/VBR set maxrate_ 648Kb;  Application/Traffic/VBR set packetSize_ 210;  Application/Traffic/VBR set maxpkts_ 26...

DIFFERENT TRANSMISSION RANGE FOR NODES IN ONE SIMULATION

 Most of my online friends asked me that "is any way to increase transmission range of nodes in one simulation??".Here, we are showing a simple scenario and test sample script for this. Scenario: Two wireless nodes n0 and n1 are placed into a flat area and have distance of 200m. Both nodes send packets with the same transmission power, but have different receiving range. I set n0's receiving range to 250m, and its carrier sensing range to 550m. n1's receiving range is 160m, and its carrier sensing range is 400m. EXPLANATION OF RESULT: Both nodes try to send exactly one packet to the other using DSR. Because there is no bi-directional connection exist, the actual data connection could not be be established (DSR needs a bi-directional connection for route discovery). However, we can verify the difference of two transmission ranges by observing the reachability of DSR RREQ packets broadcast by each node. The first connection starts at the 1st second, from n0 to n1. The s...