⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 faq.html

📁 相关搜索: ns2仿真结果分析 all-awk ns2 ns2 无限网络中awk文件 ... [2.tcl.rar] - 在ns2平台上实现对AODV协议的模拟
💻 HTML
字号:
<html><head><title>NS@WPI FAQ</title></head><body background="parchment.gif" tppabs="http://nile.wpi.edu/NS/Icons/parchment.gif" text="#000000" link="#0000FF"vlink="#000080" alink="#FF0000"><br><p align=center><a href="javascript:if(confirm('http://www.wpi.edu/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.wpi.edu/'" tppabs="http://www.wpi.edu/" target=_top><img src="banner.gif" tppabs="http://nile.wpi.edu/NS/Icons/banner.gif"      alt="WPI Worcester Polytechnic Institue"     border=0 width=418 height=40></a><p align=center><a href="javascript:if(confirm('http://www.cs.wpi.edu/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.cs.wpi.edu/'" tppabs="http://www.cs.wpi.edu/" target=_top><img src="cs_banner.gif" tppabs="http://nile.wpi.edu/NS/Icons/cs_banner.gif"     alt="Computer Science Department"     border=0></a><br><img src="hr.gif" tppabs="http://nile.wpi.edu/NS/Icons/hr.gif"     alt="-----------------------------------------" ><br><h1><center>NS@WPI FAQ</center></h1><ol><!----------------------------------------------------------><hr><li><p><b>Is there an NS tutorial somplace?</b></p><p>Try: <ahref="javascript:if(confirm('http://www.isi.edu/nsnam/ns/tutorial/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.isi.edu/nsnam/ns/tutorial/'" tppabs="http://www.isi.edu/nsnam/ns/tutorial/" target=_top>http://www.isi.edu/nsnam/ns/tutorial/</a></p><!----------------------------------------------------------><hr><li><p><b>How do setup to use NS on nile?</b></p><p>Add <code>/users/ns/bin</code> is in your path:<pre>   set path=(/users/ns/bin $path) # for csh/tcsh</pre></p><p>Make a working directory for your scripts:<pre>   cd /users/claypool   mkdir my-sim</pre></p><p>Then, make sims and run normally.</p><!----------------------------------------------------------><hr><li><p><b>How do setup to modify NS (edit the simulator) on nile?</b></p><p>Check that you are part of the "ns" group:<pre>   groups (if you don't see "ns" send email to claypool@cs)</pre></p><p>Set your <code>CVSROOT</code> variable (for tcsh):<pre>   setenv CVSROOT /users/cvsroot (put in your .tcshrc)</pre></p><p>Make a working directory:<pre>   cd /users/claypool   mkdir my-ns</pre></p><p>Check out ns-2:<pre>   cd /users/claypool/my-ns   cvs co ns-2</pre></p><p>Link in supporting directories:<pre>   cd /users/claypool/my-ns   ln -s /users/ns/* .   (will give error for ns-2 link, but that's ok)</pre>  <p>Compile ns:<pre>	   cd /users/claypool/my-ns/ns-2   make</pre></p><p>Make sure your scripts now use your NEW ns under<code>/users/claypool/my-ns/ns-2/ns</code>!  Then, make sims and runnormally.</p><p>To edit a file:	<pre>	   cd /users/claypool/my-ns/ns-2   (edit file)   (compile, debug, test, compile, debug test...)   (MAKE SURE YOUR CODE COMPILES AND WORKS BEFORE SUBMITTING)   cvs commit</pre>	</p><p>To add a file:<pre>	   cd /users/claypool/my-ns/ns-2   (edit new file)   (compile, debug, test, compile, debug test...)   (MAKE SURE YOUR CODE COMPILES AND WORKS BEFORE SUBMITTING)   cvs add   cvs commit</pre><p><!----------------------------------------------------------><hr><li><p><b>Where are some sample scripts I can start from?</b></p><p>Many sample scripts can be found in the NS distribution in<code>/users/ns-2/ns-2/tcl/ex</code> and<code>/users/ns/ns-2/tcl/test</code>.  You might also try<code>/users/ns/ns-2/tcl/ns-tutorial/</code>.</p><!----------------------------------------------------------><hr><li><p><b>Entering flows by hand is a pain.How do you "generate", say, 200 flows automatically?</b></p><p>You can do so with a for loop.  Here is an example:</p><pre>  #######################  # Creat Network Topology #  #######################  #Set number of TCP connections  set tcp_num 50  #Making two network nodes  set n(1) [$ns node]  set n(2) [$ns node]  #Making edge nodes  for {set i 1} {$i <= $tcp_num} {incr i} {      set s($i) [$ns node]      set r($i) [$ns node]  }  #Creating the network link  $ns duplex-link $n(1) $n(2) 20Mb 20ms DropTail  #Creating edge links  for {set i 1} {$i <= $tcp_num} {incr i} {      $ns duplex-link $s($i) $n(1) 20Mb 5ms DropTail      $ns duplex-link $n(2) $r($i) 20Mb 5ms DropTail  }  #########################  # Setup FTP-TCP connections #  #########################  #Setup TCP  for {set i 1} {$i <= $tcp_num} {incr i} {      set tcp($i) [new Agent/TCP/Reno]      set sink($i) [new Agent/TCPSink]      $ns attach-agent $s($i) $tcp($i)      $ns attach-agent $r($i) $sink($i)      $ns connect $tcp($i) $sink($i)      $tcp($i) set ecn_ true      $tcp($i) set fid_ $i      $tcp($i) set window_ 20      $tcp($i) set packetSize_ 1000  }  #Setup FTP Applications  for {set i 1} {$i <= $tcp_num} {incr i} {      set ftp($i) [new Application/FTP]      $ftp($i) attach-agent $tcp($i)      $ftp($i) set type_ FTP  }  ##########################  # Start FTP Applications #  ##########################  for {set i 1} {$i <= $tcp_num} {incr i} {      $ns at 0 "$ftp($i) start"      $ns at 80 "$ftp($i) stop"  }  $ns run</pre></p><!----------------------------------------------------------><hr><li><p><b>How do I measure things like packet loss, throughput, etc?</b></p><p>You pull data you need from the trace file NS produces.  That fileis in text format, so you can parse it by whatever tools you wouldlike.  For example, to calculate throughput you'd look for how manypackets arrived per second at a node coming from another node maybewith the protocol TCP. </p><!----------------------------------------------------------><hr><li><p><b>Where are the defaults kept for the NS objects?</b></p><p><code>/users/ns/ns-2/tcl/lib</code></p><!----------------------------------------------------------><hr><li><p><b>Are there some tools somewhere that do some things I would like?</b></p><p>Not as many as we'd like.  But there is a start in:<code>/users/ns/tools</code></p><!----------------------------------------------------------><hr><li><p><b>Does NS simulate the 3-way TCP handshake?</b></p><p>Yes.  You set the <code>syn_</code> variable to TRUE in<code>Agent/TCP</code> in order to simulate the 3-way handshake.  Inns-2.1b7a, syn_ is set to FALSE by default.  However since ns-2.1b8,the default setting for syn_ has been changed to TRUE.</p><!----------------------------------------------------------><hr><li><p><b>I get the exact same drops everytime with my RED router. Is there a way to "seed" the NSrandom number generator?</b></p><p>You do it with the RNG class from OTcl. For example, a new RNG iscreated and seeded with: <pre>  set rng [new RNG]  $rng seed 0 # seeds the RNG heuristically;  $rng seed n # seeds the RNG with value n;</pre></p><p>Other uses could be:<pre>  $rng next-random #  return the next random number;  $rng uniform a b # return a number uniformly distributed on [a, b];  $rng integer k   # return an integer uniformly distributed on [0, (k-1)];  $rng exponential # return a number from an exponential distribution		   # with average 1.;</pre></p><p>Currently there is no way to select predefined seeds from OTcl.</p></ol></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -