Ns2 FAQ for dummies


This faq is provided "as is", I take no responsibility for anything anyone does using information contained here. Use of any information is at your own risk. The accuracy of the assertions made here is not guaranteed, why, it might all well be fictional. USE AT YOUR OWN RISK
 


  1. Ns2 FAQ for dummies
    1. Introductory Questions
    2. General Programming Questions
    3. Some Specific Questions
    4. Downloads
    5. Some ns2 Links
    6. Conclusion

Introductory Questions/Also  known as stupid questions :)

      
1. can any one guide me how to start simulation using ns2 ?
	You asked this question before looking properly into ns2 home page for available documentation
Anyway you can start here http://www.isi.edu/nsnam/ns/tutorial/index.html

2. What shall I do when I encounter problem with ns2

1. Search in the ns2 mailing list http://www.isi.edu/nsnam/htdig/search.html
2. Look for relevant information from ns2 home page http://www.isi.edu/nsnam/ns/index.html and all tutorials
3. Try to find yourself the answer by reading source code ( C++ / OTCL )
4. Send mail to mailing list
Before shooting a mail to mailing list you may read this link
http://www.catb.org/~esr/faqs/smart-questions.html#urgent

3. What are the languages I need to know for using ns2
1. For using existing network elements implemented in ns2 and run simulations you need to know OTCL
2. For adding new network elements / new protocols you need to know C++
3. For analyzing trace files you may use perl/awk/sed

4. What is OTCL and how do I learn it?
OTCL is very similar to TCL and you may look at its tutorial here
http://bmrc.berkeley.edu/research/cmt/cmtdoc/otcl/tutorial.html

5. What are the programming methodologies I need to know for using ns2
As a beginner you may not need to know any special methodology . But if you are into implementing more
serious stuff (like adding new protocols) it is always better to know Object Oriented Programming (Ooops !)

6. how do I debug C++ source code of ns2
This question is already answered in ns2 home page.
Adding my comment:-
Ns2 is a software written in C++ and OTCL. Like any other C++ program you can use gdb. Alternatively
you may use GUI versions of gdb like Kdebug

7. I don't know gdb how do I get info about gdb?
Ask this question to ur linux system :)

$info gdb

8. how do I debug OTCL code of ns2
This question is already answered in ns2 home page. But I still uses puts " " :-)

9. I got a problem which is not there in tutorials/manuals and no one answers in mailing list. How do I solve it?

The best way to study any software is not solely depending on any documentation. Have a "do it yourself " approach and start
understanding source code and help yourself with the answer.

It is difficult but it is the only and best way many times...

One good tool available for help is "grep"

10. How do I know which c++ files implements the code for "xyz" feature.

Read answer to previous question.

11. I am unable to install ns2/related package. I got "xyz" error, what shall I do?

If you are newbie to ns2 I recommend to install "ns-allinone" version in Linux. It will be very easy to install

If you are an experienced programmer in unix environment you know how to fix it :-)

12. can any one please tell me how can i assign IP address to the nodes

There is nothing like ip addresses in ns2. ns2 nodes have hirearchichal addressing scheme which is similar to ip adderss
but it is not the same.





General Programming Questions


1. I would like to know Why does no slot error occur?

No slot error happens for 2 reasons
1. There is no way to reach a particular node. Means route entry (in ns2 terms it is classifier ) for a particulat node is
not found
2. There is no agent available. This means a packet reached addrezsed node but while port demultiplexing classifier could not
find the corresponding agent.
Eg : If I send a ping packet to a node which doesnot have ping agent in it.

2. How to correct
no slot error ?
Make sure your the nodes which you want to reach are reachable.

1. If you are using a wired scenrio make sure topology is ccorrect
2. If you are using wired cum wireless scenario make sure in addition to topology make sure about node addresses and numbers of
domains,clusters,number of nodes etc
3. Make sure that route entries are available in case of hirearchichal routing
4. Make sure that agnets are avaiable.

2.
Why segmentation faults occur?

The first question indicates you are not familiar with C/C++ programming. C/C++ programming experience are mandatory
to do something serious with ns2

3.
Is there any method to avoid segmentation faults ?
Debug the code.

4. How do I add multiple interfaces for a mobile node.
As far as I know multiple interfaces are not supported by ns2.
But I found one implemeantion for same here

Some Specific Questions

  1. I was wondering if you could tell me if I could implement  soft handover for 2G in NS2  simulator.

My immediate answer is yes you can implement.Any simulation is nothing but a peace of software. As far as you know
programming and if you know how to model the stuff ,you can simulate.

But next question pops up is how difficult it is?
For some experiments the basic infrastructure to try to do an experiment is already there. E.g. : writing a new adhoc protocol
writing a new queuing mechanism etc. For some others basic infrastructure you need to build.

I guess 2G handover case fist better in second category. You can look at the example of mobile ip implementation.
Take that example as a reference model and go ahead with your implementation


Downloads


1. Patch to compile ns-2.1b9a with gcc 3.2

Some ns2 Links


1. GPRS code of Jeisa


2. SGSN and GGSN with UMTS module written by the Paula and Pablo.

http://www.geocities.com/opahostil/



Conclusion


I will be adding more info to this FAQ whenever I get time.If you got some use/guidance with this faq send me an email

This will be a motivation for me when I come to know some body benefited from it.

If you have any suggestions or question please email me to rajesh_s_george@yahoo.com
This page is last updated on  Thu May  5 15:08:49 IST 2005
1 1 1 1 1 1 1