Ns-allinone Currently the package contains: * Tcl release 8.4.18 (required component) * Tk release 8.4.18 (required component) * Otcl release 1.13 (required component) * TclCL release 1.19 (required component) * Ns release 2.34 (required component) * Nam release 1.14 (optional component) * Xgraph version 12 (optional component) * CWeb version 3.4g (optional component) * SGB version 1.0 (?) (optional component, builds sgblib for all UNIX type platforms) * Gt-itm gt-itm and sgb2ns 1.1 (optional component) * Zlib version 1.2.3 (optional, but required should Nam be used) Currently, ns-allinone works on Unix systems and under Cygwin for Windows 9x/2000/XP. Download source: http://sourceforge.net/projects/nsnam/files/allinone/ns-allinone-2.34/ current release 2.34 (Jun 17 2009): ns-allinone-2.34.tar.gz
Environment (1) Windows / Cygwin http://www.cygwin.com/ Linux
Environment (2) Σημαντικό είναι να μετά την ολοκλήρωση της εγκατάστασης να προσθέσετε μόνοι σας τις παραμέτρους στο περιβάλλον Προσθέτεις στο $PATH: sudo /etc/enviroment LD_LIBRARY_PATH="/home/user/ns-allinone-2.33/otcl-1.13, /home/user/ns-allinone-2.33/lib" TCL_LIBRARY="/home/user/ns-allinone-2.33/tcl8.4.18/library" και: gedit ~/.bashrc # LD_LIBRARY_PATH OTCL_LIB=/your/path/ns-allinone-2.33/otcl-1.13 NS2_LIB=/your/path/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=/your/path/ns-allinone-2.33/tcl8.4.14/library USR_LIB=/usr/lib export TCL_LIBRARY=$TCL_LIB:$USR_LIB # PATH XGRAPH=/your/path/ns-allinone-2.33/bin:/your/path/ns-allinone-2.33/tcl8.4.14/unix:/your/path/nsallinone-2.33/tk8.4.14/unix NS=/your/path/ns-allinone-2.33/ns-2.33/ NAM=/your/path/ns-allinone-2.33/nam-1.13/ PATH=$PATH:$XGRAPH:$NS:$NAM
Environment (3)
Σενάρια (1) example.tcl set ns [new Simulator] set nf [open out.nam w] $ns namtrace-all $nf proc finish {} { global ns nf $ns flush-trace close $nf exec nam out.nam & exit 0 } $ns at 5.0 "finish" $ns run
Σενάρια (2) example.tcl set ns [new Simulator] set nf [open out.nam w] $ns namtrace-all $nf proc finish {} { global ns nf $ns flush-trace close $nf exec nam out.nam & exit 0 } set n0 [$ns node] set n1 [$ns node] $ns duplex-link $n0 $n1 1Mb 10ms DropTail $ns at 5.0 "finish" $ns run
Σενάρια (3) example.tcl set ns [new Simulator] set nf [open out.nam w] $ns namtrace-all $nf proc finish {} { global ns nf $ns flush-trace close $nf exec nam out.nam & exit 0 } set n0 [$ns node] set n1 [$ns node] $ns duplex-link $n0 $n1 1Mb 10ms DropTail #Create a UDP agent and attach it to node n0 set udp0 [new Agent/UDP] $ns attach-agent $n0 $udp0 # Create a CBR traffic source and attach it to udp0 set cbr0 [new Application/Traffic/CBR] $cbr0 set packetsize_ 500 $cbr0 set interval_ 0.005 $cbr0 attach-agent $udp0 set null0 [new Agent/Null] $ns attach-agent $n1 $null0 $ns connect $udp0 $null0 $ns at 0.5 "$cbr0 start" $ns at 4.5 "$cbr0 stop" $ns at 5.0 "finish" $ns run
Σενάρια (4) example.tcl set opt(chan) Channel/WirelessChannel ;#Channel Type set opt(prop)propagation/tworayground set opt(netif) Phy/WirelessPhy set opt(mac) Mac/802_11 ;# radio-propagation model ;# network interface type ;# MAC type set opt(ifq) Queue/DropTail/PriQueue ;# interface queue type set opt(ll) LL ;# link layer type set opt(ant) Antenna/OmniAntenna ;# antenna model set opt(ifqlen) 400 ;# max packet in ifq
Σενάρια (5) example.tcl Antenna/OmniAntenna set X_ 0 Antenna/OmniAntenna set Y_ 0 Antenna/OmniAntenna set Z_ 1.5 Antenna/OmniAntenna set Gt_ 1.0 Phy/WirelessPhy set CPThresh_ 10.0 Phy/WirelessPhy set CSThresh_ 1.559e-11 Phy/WirelessPhy set RXThresh_ 3.652e-10 Phy/WirelessPhy set Rb_ 2*1e6 Phy/WirelessPhy set Pt_ 0.2818 Phy/WirelessPhy set freq_ 914e+6 Phy/WirelessPhy set L_ 1.0
Σενάρια (6) example.tcl proc log-movement {} { global logtimer ns_ ns set ns $ns_ source../ns-2.1b9a/tcl/mobility/timer.tcl Class LogTimer -superclass Timer LogTimer instproc timeout {} { global opt node_; for {set i 0} {$i < $opt(nn)} {incr i} { $node_($i) log-movement } $self sched 0.1 }
Σενάρια (7) example.tcl $node color [color] $node shape [shape] $node label [label] $node label-color [lcolor] $node label-at [ldirection] label $node add-mark [name] [color] [shape] $node delete-mark [name] node ;# sets color of node ;# sets shape of node ;# sets label on node ;# sets color of label ;# sets position of ;# adds a mark to node ;# deletes mark from
Ανάλυση - Tracegraph Matlab 6.5 Tracegraph
Θέματα Θέμα 1ο Θέμα 2ο Ασύρματο σενάριο Ασύρματο σενάριο Πλήθος κόμβων 60 Πλήθος κόμβων 30 10 σταθεροί 0 σταθεροί 50 μετακινούμενοι Τυχαία κίνηση DSR, DSDV, AODV Μετακίνηση με μεγάλη ταχύτητα DSR, DSDV, AODV Αποτελέσματα: Σύγκριση αλγορίθμων σύμφωνα με καθυστέρηση δικτύου και ποσοστό χαμένων πακέτων