Skip to main content

Posts

Showing posts from March, 2015

VLAN implementation using NS2

Security Protocol (packet) in NS2

Security is not my area of work, but most of the places, I have been bombarded with questions like , is it possible to implement security protocol in ns2. The answer is yes, here is the solution for that.   Here is the document to read This work is done in 2005 and developed for ns version 2.26 or 2.27. I have done the compilation for ns-2.35 The files to be modified 1. Create a new agent called "Security_packet" and two files Security_packet.h and Security_packet.cc are created. 2. Add a new packet type in ~ns-2.35/common/packet.h 3. Add a new packet type in ~ns-2.35/tcl/lib/ns-default.tcl 4. Add a new packet type in ~ns-2.35/tcl/lib/ns-packet.tcl 5. modify the ~ns-2.35/Makefile.in Steps 1. Download the two files here 2. Copy the security.cc and security.h file in ~ns-2.35/security folder (create the security/ folder and paste both the files) 3. Open ~ns-2.35/Makefile.in and make an entry as shown below, OBJ_CC = ...... ...              security/security.o

Adding a New Agent and Application in Network Simulator 2 (NS2)

 This post is reproduced from this website http://nile.wpi.edu/NS/new_app_agent.html .  But the above code is compiled for older ns2 version. But nsnam.com showcases the code for ns-2.35 version. You can read the theory about the agent from this weblink.   A Simple theory about Application and Agent In Ns2, Nodes are individual entities where in... Nodes -> Agent -> Application Nodes is attached with an Agent and the Agent carries the Application. You can see the following image where Node is attached with the Agent and the Agent carries the FTP or CBR Application Here is an Agent and Application is implemented Agent - UDPmm Application - mmApp node -> Agent -> Application To compile it  Method 1: Easy method Please download the code here Copy the mm-app.cc/.h and udp-mm.cc/.h in the -ns-2.35/multimedia directory there is another folder called ns-modified-files/folder, copy the files which are there in to the corresponding location as specified belo

Tracegraph installation in Fedora 21

To install tracegraph (software that handles the tracing automatically by specifying the trace file generated from ns2) OS Used: Fedora 21 (64 bit) Tracegraph version: 2.02 Download the tracegraph software from this link Since tracegraph is a 32 bit software, you need to install all the 32bit libraries. The following packages that ends with .i686 are related to 32bit libraries Steps to install $] su and press the root password $] yum update $] yum install ld-linux.so.2 libXext.i686 libXt.i686 libXp-devel.i686   Still if trace graph is not working, install these software too (this will also help in installing ns-2.35) $]   yum install tcl tk gcc-c++ libX11-devel libXt-devel libXmu-devel To install Tracegraph untar the software after copying it to your home folder (/home/pradeepkumar) in my case. $] tar zxvf tracegraph202.tar.gz $] cd tracegraph202 After the above step, you need to set the LD_LIBRARY_PATH Open the file /home/pradeepkumar/.bash_profile and give thi

Ant Colony Algorithm (antnet) in NS-2.35

The source code of antnet is taken from this website. If anyone claims as the owner of this software, let me know so that I will give credits to him/her. (NB: This topic does not have any relevance to me and I have just reproduced what was available in the above website). And of Course, corrected some bugs.  Important: These codes will work well with fresh installation of ns-allinone-2.35. If you have already compiled any other simulation in ns-2.35, kindly take a back up before you proceed. These are the files to be modified. Download the entire folder here ...ns-2.35/tcl/lib/ns-default.tcl  ...ns-2.35/common/packet.h     rtable.txt (This file is created for my network with 2 nodes) ...ns-2.35/trace/cmu-trace.cc  ...ns-2.35/queue/drop-tail.h ...ns-2.35/tcl/lib/ns-lib.tcl       ...ns-2.35/queue/priqueue.cc   simpleant.tcl (This is the tcl file can be copied anywhere) ...ns-2.35/trace/cmu-trace.h   ...ns-2.35/Makefile.in ...ns-2.35/tcl/lib/ns-packet.tcl    ...ns-2.35