Skip to main content

Posts

Finding the Node Position, speed and Velocity of a Node while using AODV

Finding the Node Position, speed and Velocity of a Node while using AODV Steps 1. ~ns-2.34/aodv/aodv.h include the following header line in aodv.h 1: #include<mobilenode.h> 2.In protected scope declare the variables you would be using to store the node parameters. 1: double xpos; 2: double ypos; 3: double zpos; 4: double iEnergy; 5: int node_speed; 6: MobileNode *iNode; 7: FILE *fp; 3.In aodv.cc initialize the declared variables. 1: xpos = 0.0; 2: ypos = 0.0; 3: zpos = 0.0; 4: node_speed = 0; 5: iEnergy=0.0; 6: fp=fopen( "pradeep.csv" , "w" ); 7: MobileNode *iNode; 4.Finally access the required functions from mobilenode.h . Paste the following lines in the AODV::forward() function //Code by pradeepkumar /***This code retrieves node position*****/ fprintf(fp, "Position is, X, Y, Z, Velocity is, X, Y, Z, Velocity, Node Speed, Energy \n" ); iNode = (MobileNode*) (Node::get_node_by_...

Promiscuous Mode in AODV (ns 2.34)

In a network, promiscuous mode allows a network device to intercept and read each network packet that arrives in its entirety. This mode of operation is sometimes given to a network snoop server that captures and saves all packets for analysis (for example, for monitoring network usage). Its often used to monitor network activity Files to be changed 1. ~ns-2.34/aodv/aodv.h 2. ~ns-2.34/aodv/aodv.cc 3. ~ns-2.34/lib/tcl/ns-mobilenode.tcl 1. Make AODV agent a child class of Tap (you should have a member function tap), and define the Mac variable 1: #include <mac.h> 2: class AODV: public Tap, public Agent { 3: public : 4: void tap( const Packet *p); 5: ...... 6: protected : 7: Mac *mac_; 8: ...... 9: } 2. Modify aodv/aodv.cc Define TCL command "install-tap" and implement AODV::tap() 1: int AODV::command( int argc, const char * const * argv) { 2:   3: ...... 4:   5: else if (argc == 3) { 6:   7: .....

Network Simulators for Education and Research

There are various real hardware tools and emulators are available in the market for measuring the performance of a network, wireless network. But one cannot invest much in terms of money and time. Hence there should be some tools that helps the researchers to do their research to measure the performance and find the results. Here are some of the tools that are free and easily avaialble to everyone at the cost of Time (you need to invest time thats what a researcher is supposed to do) 1. Network Simulator 2 (NS2) Link : http://www.isi.edu/nsnam/ns/ Ns is a discrete event simulator targeting for networking research. This simulator provides support for simulation of Wired networks like TCP, routing, and multicast protocols over wired and wireless  networks. In short it is called as NS2. Languages Used: Tcl, OTcl, C++, Simple AWK Script to analyze the results (freely available in the web) Pros: It is free and Open Source  Simulate almost any type of networks which are ...

Creating a New Agent in Network Simulator 2

How to create a new agent in NS2. You can use any version of the Simulator. The following codes will make you to understand the writing of a sample agent. Requirements: NS2 Simulator A tcl file to test the compiled agent If any two values are supplied from the TCL file, the agent computes the Surface area of the Cylinder which is nothing but (2* PI * r * h).  The supplied values from TCL file are r and h. How to do that. 1. Copy the newagent.cc (given below ) file in ~ns-allinone-2.34/ns-2.34/newfolder 2. Make an entry in the ~ns-2.34/Makefile.in     Make an entry in the OBJ_CC =             newfolder/newagent.o \ 3. in the shell prompt, go to ~ns-2.34 and give the command ./configure make 4. run the file agent_new.tcl (given below) you can see the output Here is the C++ code to be written and compiled //Name of the file is newagent.cc and put it in a folder inside ~ns-2.34/newfolder/ #include <stdio....

NS2 (NS-2.35) Installation in Fedora 16

This post will help you in installing Network Simulator 2 version NS2.35 in Fedora 16 Steps:' Install Fedora using a DVD ISO (if you go for a CD iso, then you need to download lot of packages) Download NS-2.35 from this website . Unzip or untar it to any folder (recommended is /home/ loginname) using the following commands one by one tar zxvf ns-allinone-2.35.tar.gz cd ns-allinone-2.35 ./install Once installed the PATH information will be shown in the screen. Copy the PATH and LD_LIBRARY_PATH Variable to .bash_profile (see a dot in the beginning) Input the path information in .bash_profile like this There will be a PATH Variable already available in the .bash_profile file, just copy the PATH information from the NS2 installation and append it over the existing PATH variable (but put a separator : between each path) export PATH=$HOME/bin:<Put a colon and Place your paths here> export LD_LIBRARY_PATH=<place the LD_LIBRARY_PATHS> here. Once done, save the ...

NS2 (NS-2.35) Installation in Ubuntu 11.10

This post will help you in installing Network Simulator 2 version NS2.35 in Ubuntu 11.10 Instructions Install Ubuntu Download NS-2.35 ( http://sourceforge.net/projects/nsnam/files/allinone/ns-allinone-2.35/ns-allinone-2.35.tar.gz/download ) Unzip or untar it to any folder (recommended is /home/ loginname) using the following commands one by one sudo apt-get update sudo apt-get install build-essential autoconf automake libxmu-dev tar zxvf ns-allinone-2.35.tar.gz cd ns-allinone-2.35 ./install Once installed the PATH information will be provided to you. Copy the PATH and LD_LIBRARY_PATH Variable to .bashrc (see a dot in the beginning) Input the path information in .bashrc file like this export PATH=$PATH:<Place your paths here> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH: <place the LD_LIBRARY_PATHS> here. Once done, save the file and close execute the command source .bashrc try ns or nam to see whether your installation succeeded.

Network Simulator 2 (NS2.35) is released

Nearly more than 2 years of gap, Network Simulator 2.35 is released on 4th November 2011 and its worth to work with. Lot of updates in the wireless domain and easier installation when compared with the earlier versions. To download the new version follow this link http://sourceforge.net/projects/nsnam/files/allinone/ns-allinone-2.35/ns-allinone-2.35.tar.gz/download Shortly wait for the installation instructions for NS 2.35 under Ubuntu, Mac OS and Fedora. Till that time, refer the following posts, http://www.nsnam.com/2011/11/installation-of-network-simulator-ns235.html http://www.nsnam.com/2011/10/ns235-installation-in-fedora-15-and.html