Linux.com

Feature

ns-2 network simulator: Free, yes; friendly, no

By Nauman Afzal on July 18, 2006 (8:00:00 AM)

Share    Print    Comments   

The open source network simulation tool ns-2 is an invaluable tool for researchers working on wired or wireless networks. I came across ns-2 while working on my thesis. I needed a network simulator, and since my college lacked the brand-name heavyweights, I had to look for an alternative that was free but could do the job. While ns-2 is free, it's also pretty unfriendly.

ns-2 is a variant of the REAL network simulator. Over the past few years it has been evolving, and it is still far from complete. Several organizations have been involved in its development, including DARPA, Xerox, UCB, and Sun Microsystems. The objective has been to make a network simulation tool to study and analyze new ideas in detail before implementation.

The software has been designed to work on Linux, but it can be made to run on Windows XP by using the Cygwin tool. For the current version ns-2.29, Fedora Core 2 is recommended, although ns-2 may work on Red Hat 9 or even FC4. Though there are no stringent hardware requirements, using a fast PC will result in less wasted time when you're running large simulations.

Installing ns-2 shouldn't be difficult for anyone familiar with unzipping source code, which can be downloaded for free from the ns-2 Web site. ns-2 runs from the command line; there is little GUI or drag-and-drop functionality.

The simulator structure uses two languages: OTcl scripting on the front end, and C++ on the back end. You use OTcl scripting to make a simulation scenario, which may include network components like nodes, routers, and link bandwidth. When using Windows-based simulators like Opnet and OMNeT, making a simulation scenario is as easy as dragging and dropping the required network components onto a workspace. In order to make a simulation scenario with ns-2, however, one has to learn OTcl in some detail, and that means the learning curve to use ns-2 can be quite steep.

Then, on the back end, there is C++. If, for instance, you are making a Mobile IP-based simulation, you have to enable the relevant Mobile IP C++ files in the OTcl code. The OTcl code links to the C++ files, so when the OTcl code runs, it calls the relevant C++ code to execute a particular task.

Results of the simulations are shown in a tabular form in what ns-2 calls trace files. One line in a trace file is produced for each data packet that travels from the initiating node to the terminating node. Since the trace files record every parameter of a data packet, including its size, start time, type, time to live, starting node, and ending node, ns-2 generates huge trace files. For example, in a Mobile IP simulation run of 120 seconds involving two nodes, the relevant trace file generated takes up a hefty 100MB. Run on a Pentium III client, the simulation could take more than 45 minutes to finish.

Filtering out required data from the trace files presents another issue. The data in trace files is in tabular form, with each column separated by a white space. You need to employ a programming language to filter out the required data. I have found that Perl or awk can handle the white space issue well.

ns-2 comes bundled with Xgraph to plot the data on a graph for analysis. You can also use a spreadsheet to make relevant plots and curves.

Though ns-2 provides limited ability to view the animations after the simulation, its sister program Network Animator (NAM) makes it possible. NAM also can record the animation in the form of graphics as the simulation progresses. These graphics can then be converted to GIF or AVI format for later viewing. NAM also provides options for adjusting the step size of the animation in milliseconds, zooming in and out, and pausing the animation.

In addition to being a research tool, ns-2 is also an excellent educational tool. The built-in tutorials provide an in-depth understanding of networks, their different protocols, and layer functions. For research, you will have to tinker with the C++ files that work in the background, and that can be mind-boggling at times. However, user support via mailing lists is excellent. Posted questions are usually answered in 24 hours, and that is one of the reasons why I chose ns-2 instead of OMNeT.

I advise anyone planning to try ns-2 to have patience and be ready for a lot of experimentation and tinkering.

Share    Print    Comments   

Comments

on ns-2 network simulator: Free, yes; friendly, no

Note: Comments are owned by the poster. We are not responsible for their content.

GloMoSim is free

Posted by: Anonymous Coward on July 19, 2006 01:31 AM
Do check it out:
>> <a href="http://pcl.cs.ucla.edu/projects/glomosim/" title="ucla.edu">http://pcl.cs.ucla.edu/projects/glomosim/</a ucla.edu>

#

Link?

Posted by: Anonymous Coward on July 19, 2006 03:14 AM
You might consider adding a link to the ns-2 project.

#

Good article that contributes mind share...

Posted by: Anonymous Coward on July 19, 2006 03:46 AM
... however, some things are not mentioned. NS-2 trace files are not that big if you opt not to include all available trace levels. (you can for instance trace only transport-layer segments).

It is not exactly fair to say NS-2 is incomplete<nobr> <wbr></nobr>.. it is being improved upon all the time and reflects ongoing networks research which means that by definition it will never be "complete".

As a note to novice users: If you find that the traces give you a lot of headache just remember that you can collect statistics at the agent itself and output that during/at the end of the simulation. you don't have to rely on the built-in traces; in fact for the most part you shouldn't as it is inefficient..

#

Re:Good article that contributes mind share...

Posted by: Anonymous Coward on July 19, 2006 04:46 PM
I'll be extremely sincere: ns-2 is not at all a good piece of software. I've been using it in the latest months and it revealed to be a big uncontrolled set of features added by different people and most of them incompatible among each other.
It is still widely used becouse there is a big community and becouse there is a lot of software ready to be used, but there is no planning, no review of code, no maintainers (example? <a href="http://mailman.isi.edu/pipermail/ns-developers/2006-July/002324.html" title="isi.edu">http://mailman.isi.edu/pipermail/ns-developers/20<nobr>0<wbr></nobr> 6-July/002324.html</a isi.edu> here it is said that there is no maintainer for 802.11 code, which is one of the most used part of the code).
Then, is OTCL still used or maintained outside ns2?

The project has just announced that a new simulator called ns3 has been planned for next year, that should address all these problems.

my 2.c
l.

#

Re:Good article that contributes mind share...

Posted by: Anonymous Coward on July 20, 2006 10:33 PM
If you want to use ns2 is the way you want, you should have the balls to look into code and modify it. Though it has a STEEP learning curve, once you understant the software architecture of ns2 it is EXTREMELY easy to modify it to suit your needs.

#

Link

Posted by: Anonymous Coward on July 19, 2006 04:52 AM
link pointing to their site doesn't work? or there's no url?
---
Pixel image editor - <a href="http://www.kanzelsberger.com/" title="kanzelsberger.com">http://www.kanzelsberger.com/</a kanzelsberger.com>

#

Link to the wiki

Posted by: Anonymous Coward on July 21, 2006 09:17 PM
<a href="http://nsnam.isi.edu/nsnam/index.php/Main_Page" title="isi.edu">http://nsnam.isi.edu/nsnam/index.php/Main_Page</a isi.edu>

#

ns-2 network simulator: Free, yes; friendly, no

Posted by: Anonymous [ip: 10.18.1.102] on August 27, 2007 05:35 AM
Respected Sir / Madam,
I am Geetha Arumugam, persuing my M.E Communication systems II year in Thiagarajar college of Engineering at Madurai, TamilNadu. I am doing my project in Network Routing area, so I want the NS2 simulator software download format to install in my system. Kindly send the software in download form as soon as possible.

Thanking You

Yours faithfully
Geetha Arumugam

#

Re: ns-2 network simulator: Free, yes; friendly, no

Posted by: Anonymous [ip: 192.168.10.75] on August 31, 2007 06:41 AM
http://www.isi.edu/nsnam/ns/ns-build.html#allinone

use this link to collect the simulator's zip format .....unzip it in linux then run the script called ./install it will be loaded in ur machine then set the path and run ur programs....

#

Re: ns-2 network simulator: Free, yes; friendly, no

Posted by: Anonymous [ip: 127.0.0.1] on February 23, 2008 05:59 PM
hello ,
dear friend i can send u the link of ns2 link to install it all in one version.note my mail id ganeshgupta81@yahoo.com.
i m also working on that .

#

ns-2 network simulator: Free, yes; friendly, no

Posted by: Anonymous [ip: 59.92.11.238] on October 05, 2007 01:55 PM
i need ns2 sofware for doing some lab experiments so kindly privide the software

#

ns-2 network simulator: Free, yes; friendly, no

Posted by: Anonymous [ip: 202.177.170.1] on December 06, 2007 04:49 PM
Respected Sir
Hello
Hope you will be fine there.I am pursuing M.Tech in "Information and Communication Technology "(ICT)
I have done survey on "Study and implementation of Routing Protocols and Trust Management Algorithm on Security in Wireless Ad Hoc Network". As this is my final year project.

I need your help in implementation work.If you have implemented some work related to Routing Protocols or Trust Management please guide me. Tell me some tools which can be used while implementing Algorithms/Protocols in this area. I had used TURBO C for implementing DES algorithm.

Which tool should I use. I have heard about OPNET and ns-2 but I have neither use them and nor I have these tools. From where I can get these tools. Which one is easier to understand and for coding purpose because my guide is saying to implement some protocols like AODV or DSR and a research papper on Trust Management in c or c++ language or with the help of some tool if available.
Here I don't have any team . I am the only member. I am finding it tough to implement.

Please send me some implemented work or coding related to "Routing Protocols or Trust Management Algorithm on Security in Wireless Ad Hoc Network" as I have to implement something.I will be highly oblige to you.

Thanks & Regards

#

Re: ns-2 network simulator: Free, yes; friendly, no

Posted by: Anonymous [ip: 127.0.0.1] on February 23, 2008 06:03 PM
i can help u mail me on ganeshgupta81@yahoo.com.
u have to work with ns2 for DSR or AODV

#

ns-2 network simulator: Free, yes; friendly, no

Posted by: Anonymous [ip: 69.86.153.150] on January 31, 2008 01:26 AM
is there a ns2 simulator which includes cryptographic algorithms likes DES, RSA or others

#

ns-2 network simulator: Free, yes; friendly, no

Posted by: Anonymous [ip: 203.197.140.86] on January 31, 2008 01:31 PM
Respected Sir Hello Hope you will be fine there, i am doing my final year project in detection and isolation of routing misbehavior in manet .for coding purpose because my guide is saying to implement some protocols like AODV or DSR . Here I don't have any team . I am the only member. I am finding it tough to implement. Please send me some implemented work or coding related to it . also i do need to know how to implement MD-5 algorithm in it.thank you .yours faithful manish jain

#

ns-2 network simulator: Free, yes; friendly, no

Posted by: Anonymous [ip: 117.193.160.122] on February 08, 2008 12:18 AM
Respected sir hello, i am doig my first year BE. in chennai. I m the beginner for ns2. can u provide some sample problems to check in ns2.

#

how to change the mobile node behaviour in ns2

Posted by: Anonymous [ip: 172.16.7.2] on March 07, 2008 12:02 PM
how to change the node behaviour in ns2,is it possible ?

#

ns-2 network simulator: Free, yes; friendly, no

Posted by: Anonymous [ip: 192.168.5.1] on March 10, 2008 08:16 AM
I am doing my project on key distribution protocol ca n some one help me for coding only for key distribuiton method in ns2

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya