2: Installation & Configuration of NS2 and Introduction To TCL Hello Programming
2: Installation & Configuration of NS2 and Introduction To TCL Hello Programming
ROLL NO: 79
LASS: SE-IT
SUB: NL
NS2 consists of two key languages: C++ and Object-oriented Tool Command Language
(OTcl). While the C++ defines the internal mechanism (i.e., a backend) of the simulation
objects, the OTcl sets up simulation by assembling and configuring the objects as well as
scheduling discrete events. The C++ and the OTcl are linked together using TclCL.
Procedure to install:
Step 1:
- Go to the links and download all three files and place them in one folder
Step 2:
- Extract the NS 2.35 part one only. It will extract the part 2 and part 3 automatically.
Extract after complete download do not extract the part 2 and 3.
Step 3:
- After extracting NS 2.35 you will get a folder named NS 2.35. inside the folder you
get ygwin setup up and bashrc etc.
- Press next.
- Click on next.
- Click on circle.
- Now copy the bashrc file from the download extract folder.
- Now go to C:\cygwin\home\vcet.
- Now open the cygwin command window in your desktop and type bashrc.
- Now type ns "$" change to "%".
- Now press star when you will get a window like this:
- Now hold the main tab and drag your mouse to quit from cygwin window.
- Important : go to task manager and search for xwin.exe and end the process.
- Now open the cygwin command window andnow open the cygwin command window
and type yourfilename.tcl then the nam file is generated and type nam
yourfilename.nam.
- Write your code in notepad plus plus and save with “ .TCL” extension.
Program:-
$ns run
Output: