part 1. installationmmlab.snu.ac.kr/~mchen/weicai/slides/1-installation.pdf · ·...
TRANSCRIPT
Introduction to NS-2
Min ChenSchool of Computer Science and Engineering
Seoul National University
Part 1. Installation
1
What is NS-2
Full Name: Network Simulator 2 Began as a variant of the REAL network
simulator in 1989 Open Source Software Resource:
ns-2 homepage, including tutorial, manual... BBS and mail list about ns-2 Google
3
NS-2 Features
Open Source Discrete event simulator Provides substantial support for simulation
TCP Routing Multicast Protocols …
Wired and Wireless
4
Otcl: for the network topology
Otcl is used when we are generating network scenarios for different topologies
Network Topology in NS-2 Network Topology in OPNET6
C++: for the node configuration
C++ is used when we are describing a detail mechanism of node, connection, ...
Node Model in OPNET7
NS-2 Running Platform
Windows On Cygwin (Slow running and millions errors)
Unix and Unix like System Sun Solaris FreeBSD Linux
We use Ubuntu as the OS
8
Introduction to Ubuntu
Most Famous Linux Version Open Source Software Default Genome Desktop Latest Version: 9.10 Resource
http://www.ubuntu.com/
9
Ubuntu Installation
There is two ways to install Ubuntu in your PC
1)Use the Ubuntu CD to boot your PC and install
2)Install Ubuntu as an application in Windows
I suggest you to start the setup in Windows for the following merits: Setup errors will not damage your Windows System You can delete Ubuntu OS without making changes
on your Windows system Ubuntu 9.10 now supports Win 7
10
NS-2 all-in-one package
Download the NS 2.34 all-in-one package from NS-2 website and extract it
The all-in-one package includes ns-2 : the simulation core nam : the network animator xgraph Tcl-debug ...
13
tar xfzv ns-allinone-2.34.tar.gz
5 steps Installation of NS-2
5 steps to setup NS-2.34 in Ubuntu 9.10
1.Update your Ubuntu source
2.Install the tools for compile
3.Fix the bug for gcc in otcl-1.13
4.Install ns-all-in-one-2.34 package
5.Register environment parameters in Ubuntu
14
1. Update your source
Open your terminal Open source list
Add the following content into your source list
Update the source
deb http://archive.ubuntu.com/ubuntu/ hoary universe main restricted multiversedeb http://security.ubuntu.com/ubuntu/ hoary-security universe main restricted multiversedeb http://archive.ubuntu.com/ubuntu/ hoary-updates main restricted universe multiverse
sudo apt-get update
sudo gedit /etc/apt/sources.list
15
2. Install the tools for compile
Use apt-get to install
Make sure all of the packages have been installed successfully
sudo apt-get install build-essentialsudo apt-get install tcl8.4 tcl8.4-dev tk8.4 tk8.4-dev gcc-4.3sudo apt-get install libxmu-dev libxmu-headers
16
3. Fix the bugs for gcc in otcl-1.13
in ~/ns-allinone-2.34/otcl-1.13/ Edit file ' Makefile.in ' 7th line From : CC = @CC@ To : CC = gcc-4.3
Else an error will occur when installation: otcl-1.13 make failed! Exiting
17
4. Install ns-allinone-2.34
Enter the ns-allinone-2.34 directory
Type in:
Wait until the installation complete If errors occur, you can read the message and
search for the solution in google
./install
cd ns-allinone-2.34
18
5. Environment Parameter
For the ubuntu to find your ns-2 path, you have to register the enviroment parameter
Open the bash resource file
Add the following section into the file and saveexport NS_HOME=/home/weicai/ns-allinone-2.34
export PATH=$NS_HOME/tcl8.4.18/unix:$NS_HOME/tk8.4.18/unix:$NS_HOME/bin:$PATH
export LD_LIBRARY_PATH=$NS_HOME/tcl8.4.18/unix:$NS_HOME/tk8.4.18/unix:$NS_HOME/otcl-1.13:$NS_HOME/lib:
$LD_LIBRARY_PATH
export TCL_LIBRARY=$NS_HOME/tcl8.4.18/library
sudo gedit /etc/bash.bashrc
19
Verify the completeness of NS-2
Restart your terminal and type in
If ”%” is shown, then you have successfully install NS-2 in your ubuntu system
Type in
If the Network Animator is shown, then you have successfully install nam
ns
nam
20