Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to main content

Posts

Showing posts from 2011

Simulation of URDF, Gazebo and Rviz | ROS Noetic Tutorial 8

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 in great

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.h> #include <string.h> #include "agent.h" class TSPAgen

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

Installation of Network Simulator (NS2.35) in Mac OS

Installing NS2 in Mac OS is always a tougher task. Setting and configuring so many config files, etc. But the latest version of NS2 (ns-2.35) is easily installing under Mac OS OS Taken here is Mac OS 10.6 (Snow Leopard) NS Version is ns-2.35 RC8 Prerequisites: Mac OS should be installed with the developer pacakge called xcode with the help of Xcode only, all development modules can be handled. So, the first step is to install the xcode , Download Xcode from this link http://developer.apple.com/xcode/ Download the ns-allinone-2.35 rc8 for installation, Download from http://www.isi.edu/nsnam/dist/release/RC8/ 1. Install Xcode 2. Unzip or untar ns-2.35 using the command "tar zxvf ns-allinone-2.35-xxx.tar.gz" (without quotes) 3. The ns-2.35 configuration files contains  the path to xlibdir and xincdir, so you need not include the path for those directories. 4. kindly ensure that the path to xlibdir and xincdir are installed on your Mac OS(Xcode) 5. execute the

NS2.35 installation in Fedora 15 and Ubuntu 11.10

NS 2.35 can be installed successfully in Fedora 15 and Ubuntu 11.10 using the following steps In Fedora 15 Download ns-allinone-2.35 from the NS2 website. The recent version was RC8 select the folder /home/username, untar the file using the command " tar zxvf ns-allinone-xxx.tar.gz " (without quotes). Go to the folder /home/username/ns-allinone-2.35/ using the command cd  /home/username/ns-allinone-2.35 /  and execute the command ./install (dot /install) You may encounter an error in the file mac_80211Ext.h and correct the error given in the following line Open the file /home/username/ns-allinone-2.35/ns-2.35/mac/mac_80211Ext.h and include the following line in the header file area #include <cstddef> Go to step3 and type ./install   Once installation completed, set the path information in .bash_profile (dot bash_profile) you need to set two path variables PATH and LD_LIBRARY_PATH please see this link for setting the path  http://pradeepkumar.org/54/ins

C Interview Questions–to be solved

These programs were asked in various colleges/universities across India. These Questions were in my email dated 1999. So please let me know if any copyright information, so that I will remove it. But these questions are very much helpful for budding Student (engineers and interviewees). //  Carefully study the given program #include <stdio.h> #include <alloc.h> void main(void); typedef struct NType {     int i;     char c;     long x; }NewType; void main(void) {     NewType *c;     c=(NewType*)malloc(sizeof(NewType));     c->i=100;     c->c='C';     (*c).x=100l;     printf("%d,%c,%4ld",c->i,c->c,c->x); } /* What is the output of this program ? a)  It will produce a variable redefinition error b)  It will print some junk c)  It will print 100,C,100 d)  It will print 100,C,l100 */ // Carefully go through the following prog