Name: Yash Sanjay Samant
ROLL NO: 79
LASS: SE-IT
SUB: NL
2: Installation & configuration of NS2 and introduction to TCL Hello
Programming
Aim: Installation and configuration of ns2
Theory: NS2 stands for Network Simulator Version [Link] is an Open-Source event-driven
simulator designed specifically for research in computer communication networks.
Features:
1. It is a discrete event simulator for networking research.\
2. It provides substantial support to simulate bunch of protocols like TCP, FTP, UDP, https
and DSR.
3. It simulates wired and wireless network.
4. It is primarily Unix based.
5. Uses TCL as it’s scripting language.
6. Octl: Object Oriented Support.
7. Tclcl: C++ and octl linkage.
8. Discrete event scheduler.
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.
- Now install the setup and choose the local directory.
- Press next.
- Do not change the default root directory.
- In local package repository field browse to Ns2.3/nslocal/release.
- Click on next.
- Click on circle.
- After clicking the circle the default turn to install.
- After this press next it will install the necessary packages.
- Check create a desktop shortcut and create a menu shortcut.
- Now create a folder in C:\cygwin\home.
No copy the NS 2.35 all inone. Extract it it and you will get the NS 2.35 rc7 folder
- 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 type the NS version it will show like:
- Now press next .
- Now press star when you will get a window like this:
- Now type name and you will get a screen .
- Now go to file and quit the nam window.
- Now hold the main tab and drag your mouse to quit from cygwin window.
- And exit from cygwin command window.
- Important : go to task manager and search for [Link] and end the process.
- Now open the cygwin command window andnow open the cygwin command window
and type [Link] then the nam file is generated and type nam
[Link].
- Write your code in notepad plus plus and save with “ .TCL” extension.
Program:-
set ns [new Simulator]
$ns at 1 "puts \"Hello World!\""
$ns at 1.5 "exit"
$ns run
Output: