[Previous section] [Next section] [Back to the index]
III.1. Downloading/Installing ns&nam
III.1. ns&namをダウンロード/インストールする
You can build ns either from the the various packages (Tcl/Tk, otcl,
etc.), or you can download an 'all-in-one' package. I would recommend
that you start with the all-in-one package, especially if you're not
entirely sure which packages are installed on your system, and where
exactly they are installed. The disadvantage of the all-in-one
distribution is the size, since it contains some components that you
don't need anymore after you compiled ns and nam. It's still good
for first tests, and you can always switch to the single-package
distribution later.
いくつかのパッケージ(tcl/tk, otcl, etc.)からnsを作ることもできるし, 'all-in-one'パッケージをダウンロードするのでも可. どのパッケージが自分のシステムに入ってるかわかんないとか, 実際にどこにインストールされてるかわからないって場合には, 'all-in-one'パッケージから始めることをお勧めします. nsとnamをコンパイルした後にはもう必要ないってコンポーネントも all-in-oneパッケージには含まれているので, ディスク容量が all-in-oneパッケージの問題点. それでも最初のテストには良いし, 後からいつでも単体のパッケージに 変えることだってできるよね.
Note: The all-in-one package only works on Unix systems.
注意: all-in-one パッケージはUnix上じゃないとダメ.
You can download the package from the ns download page at UCB. If you have any problems with your installation, take a look at the installation problems page on their server. If that also doesn't solve your problem, you might want to ask the ns-users mailing list.
パッケージは ns download pageからダウンロードできます. もしインストールに関して問題があったら, installation problems pageを見てみると良いかも. もし問題が解決しないようだったら, ns-users mailing listで聞いてみることもできる.
After the installation is complete, you should make sure that your path points to the 'ns-allinone/bin' directory (if you installed the ns-allinone package) where links to the ns and nam executables in the 'ns-2' and 'nam-1' directories can be found or (if you built ns and nam from the pieces) let your path point directly to the directories with the ns and nam executables.
インストールが終わったら, pathにns-allinone/binディレクトリ (allinoneパッケージ使用時), ここにはns-2およびnam-1ディレクトリ内にある nsとnamの実行ファイルへのリンクがある, が含まれてることを確認しましょう. または, (nsとnamをばらばらに作った場合には), pathが nsとnamの実行ファイルのあるディレクトリを直接指すようにしないとダメです.
On some systems you will also have to make sure that ns can find the library 'libotcl.so'. If you installed the ns-allinone package, it should be in 'ns-allinone/otcl/'. On Solaris systems you would have to add this path to the 'LD_LIBRARY_PATH' environment variable. For help with other systems, consult the installation problem page, the ns-users mailing list or your local Unix gurus.
いくつかのシステムでは, nsがlibotcl.soライブラリを見つけられることを 確認しなくちゃいけません. もしns-allinoneパッケージをインストールしたのであれば, ライブラリはns-allinone/otclの下にあります. ソラリスでは, このpathをLD_LIBRARY_PATH環境変数に足さなければなりません. 他のシステムに関してのヘルプは, installation problem pageか, ns-usersか 身近にいる神様にあたってみてください.
A note concerning the ns-allinone version 2.1b3: There is a bug in it which causes some problems on Solaris systems when nam trace generation is turned on. You can either download ns-allinone version 2.1b2 instead or go to the ns web page to download a current snapshot of ns. If you do that, you have to unzip and untar the file in your allinone directory. Then you change into the new directory and run './configure', then 'make'.
ns-allinone verion 2.1b3に関する注意: ソラリスでは, nam用の出力ファイルを生成しようとした場合に 不具合が生じるバグがあります. 2.1b2を使うか, ns web page へ行ってスナップショット版を取ってきましょう. そうする場合には, ファイルをunzip+untarでallinoneディレクトリに展開して, 新しいディレクトリに移って./configure, makeと叩きます.
You start ns with the command 'ns <tclscript>' (assuming that you are in the directory with the ns executable, or that your path points to that directory), where '<tclscript>' is the name of a Tcl script file which defines the simulation scenario (i.e. the topology and the events). You could also just start ns without any arguments and enter the Tcl commands in the Tcl shell, but that is definitely less comfortable. For information on how to write your own Tcl scripts for ns, see section IV.
'ns <tclscript>'と叩いてnsを起動します(nsの実行ファイルのあるディレクトリ にいるか, pathにそのディレクトリが含まれていることを仮定してます). ここで, '<tclscript>'は, シミュレーションシナリオ(トポロジとかイベントとか) を定義するTclスクリプトファイルの名前です. nsを引数なしで起動することもできて, その場合には, tclシェル内でtclコマンドを入力するわけなんだけど, これって全然快適じゃないです. ns用のtclスクリプトの書き方に関しての情報は section IVを見てください.
Everything else depends on the Tcl script. The script might create some output on stdout, it might write a trace file or it might start nam to visualize the simulation. Or all of the above. These possibilities will all be discussed in later sections.
すべてはtclスクリプトにかかっています. スクリプトは出力結果を標準出力に吐き出すこともあるし, 出力ファイルに書きこむかもしれないし, シミュレーションを視覚化するために namを起動することだってあります. もちろん上記の全部を実行することだってOK. これらの方法については後の節で説明します.
You can either start nam with the command 'nam <nam-file>' where '<nam-file>' is the name of a nam trace file that was generated by ns, or you can execute it directly out of the Tcl simulation script for the simulation which you want to visualize. The latter possibility will be described in Section IV. For additional parameters to nam, see the nam manual page. Below you can see a screenshot of a nam window where the most important functions are being explained.
namを実行するには,
'nam <nam-file>'とたたくか
視覚化したいシミュレーションのtclスクリプトから直接実行させます.
'<nam-file>'はnsによって生成されたnam用の出力ファイルの名前です.
後者の方法はSection IVで説明します.
他のnamのパラメータに関しては,
nam manual pageを見てください.
最も重要な機能に説明書きを加えたnam windowのスクリーンショットを
下の図に示します.
[Previous section] [Next section] [Back to the index]
ns-users日本語に関しての文句などは,
こちら