In ns2; for analysis and creation of a network we have to do the following procedures;
1. Write OTCL program.
2. Run program in terminal.
3. Analyse trace file using gawk.
1. Write OTCL Program
In ns2 ,we use object oriented tool command language as front end language or simply to write programs to generate a network scenario.One of the reason is that it is simple and easy to code.To know more about ns2 languages,click here. To write an OTCL script, we use editors [notepad] in the linux.
Open gedit
For that go to accessories-> gedit or search gedit on dashhome [For ubundu 12.04]
you will get the following window;
gedit window |
Write your tcl script on here. For tcl scripting tutorials, go through following links: Link 1 Link 2
After writing program, save it in .tcl format.[ for ex: dd.tcl ].
After that you can see your program changed like this i.e as multicolored
Now we have to run the tcl scripting................................................................!!!!!!
2. Run program in Terminal
To run the program, open terminal window from accessories->terminal or search on dash home.
You will get the following window;
now you have to run the tcl script, for that you have to change to the directory where the program is located.
For example: In here we are going to run aodv.tcl which is located at folder program. In terminal we have to change to directory where program located.For that use command cd
To run the program, open terminal window from accessories->terminal or search on dash home.
You will get the following window;
Terminal window |
For example: In here we are going to run aodv.tcl which is located at folder program. In terminal we have to change to directory where program located.For that use command cd
It can shown as below;
The directory is changed....!!!!!!
Now we have to run the TCL script, for that type ns filename in terminal. For example; ns aodv.tcl
Now simulation starts..........................!!!!!!!
Now simulation started and you can get network animator window,xgraph and trace files [You will get this only depend upon the codes wriiten on TCL script].
3. Analyse trace file using awk scripts
We add it in the later pages. Click here to read.
Click different topics to know more about NS2.
HAPPY HUNTING......................!!!!!!!
Comments
Post a Comment