Beruflich Dokumente
Kultur Dokumente
Network Simulators
GNS3 Installation
Download:
http://www.gns3.net/ all-in-one installation Download Cisco/Juniper IOS
NS2 Installation
Preparation
sudo apt-get install libxt-dev libx11-dev libxmu-dev kdebase-dev build-essential autoconf automake g++
Installation
Download: sudo su tar -xzvf ns-allinone-2.33.tar.gz cd ns-allinone-2.33 ./install ./validate ns
NS2 Installation
After Installation
sudo su gedit ~/.bashrc
Change lines:
# LD_LIBRARY_PATH OTCL_LIB=/teu/caminho/ns-allinone-2.33/otcl-1.13 NS2_LIB=/teu/caminho/ns-allinone-2.33/lib X11_LIB=/usr/X11R6/lib USR_LOCAL_LIB=/usr/local/lib export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL _LIB # TCL_LIBRARY TCL_LIB=/teu/caminho/ns-allinone-2.33/tcl8.4.18/library USR_LIB=/usr/lib export TCL_LIBRARY=$TCL_LIB:$USR_LIB # PATH XGRAPH=/teu/caminho/ns-allinone-2.33/bin:/teu/caminho/ns-allinone2.33/tcl8.4.18/unix:/teu/caminho/ns-allinone-2.33/tk8.4.14/unix NS=/teu/caminho/ns-allinone-2.33/ns-2.33/ NAM=/teu/caminho/ns-allinone-2.33/nam-1.13/ PATH=$PATH:$XGRAPH:$NS:$NAM
NS2 Initialization
#Create a simulator object set ns [new Simulator] #Open a trace file set nf [open out.nam w] $ns namtrace-all $nf #Define a 'finish' procedure proc finish {} { global ns nf $ns flush-trace close $nf exec nam out.nam & exit 0 } #CODE #Call the finish procedure after 5 seconds of simulation time $ns at 5.0 "finish" #Run the simulation $ns run
NS2 Options
#Define different colors for data flows $ns color 1 Blue $ns color 2 Red $ns color 3 green
set ftp1 [new Application/FTP] $ftp1 set packetSize_ 500 $ftp1 set interval_ 0.005 $ftp1 attach-agent $tcp1
10
NS2 Events
#Schedule events for the CBR agent $ns at 0.5 "$cbr0 start" inicio aos 0,5 $ns at 4.5 "$cbr0 stop" fim aos 4,5 $ns at 0.8 "$ftp1 start" $ns at 4.5 "$ftp1 stop" $ns at 0.3 "$cbr2 start" $ns at 4.5 "$cbr2 stop" #Call the finish procedure after 5 seconds of simulation time $ns at 5.0 "finish" #Run the simulation $ns run correr a simulao
11
NS3 Installation
Ns3
Download:http://www.nsnam.org/releases/ns-3.3.tar.bz2 sudo su tar xvf ns-3.X.tar.bz2 (descompactao) cd ns-3.X (pasta descompactada) ./waf configure (configurao da instalao) ./waf build (compilao) ./waf check (verificao) ./waf --run first
Este comando compila e executa o programa examples/first.cc e gera os ficheiros .pcap (captura de trfego) e .tr (trace data) relativos simulao.
Pyviz
http://code.nsnam.org/gjc/ns-3-pyviz-dev sudo apt-get install python-dev python-pygraphviz python-kiwi pythonpygoocanvas python-gnome2 use --pyrun instead of --run
12