2008年2月28日 星期四

lab2 nsBench

1. learn how to use nsBench to create TCL files.

2.try to use java VM to excute the nsBench

basically, use java -jar filename to execute the jar file.(type java to find all the doc.)

3.

and then you can open the nsBench program


4.add some node according to the ref. book. And separate all the nodes as in the following fig.
Also, get a link between two nodes.


5. click the link, you can get the properties to set to the value.


6. We want to set up a FTP connection, in the beginning , create TCP Tahoe first.


6.add sink, ftp
and a connection between tcp and sink

in n1, insert udp and CBR program.
in n3, insert null.



7.
edit the CBR


8. Scenario setting


9. code configuration
all the names you can rename


10. save and generate TCL file.


11.Do a simulation





11.
mulicast test
layout the topology like this


12.
routing type


13.

click udp0 and destination address is multicast


14.


2008年2月21日 星期四

Building Ns-allinone Under Cygwin

1. 在google搜尋ns2可以找到一個wiki教如何在Cygwin環境下使用Ns-allinone
2.取得 the lastest ns
3.將下載得到的檔案放在cygwin的目錄下,要找一下,可以在c:\cygwin\home\sky下找到

4.在unix介面下可以利用 ls -a 列出所有的檔案,參考基本的unix指令就有了
5.打入指令 tar xvfz ns-allinone-2.23.tar.gz 就可以開始解壓縮

6.在打入./install 就可以開始安裝
7.安裝開始前都會檢查有沒有少了什麼東西

8.少了什麼沒有關係,在點cygwin.exe 就可以開始選擇沒有安裝的package
這時候安裝的時候,右上角選full,就可以展開所的程式,按照字母排列

9.每次都會少一些東西,就跟wiki上面講的差不多,如果沒有缺少什麼東西,就開始安裝了。
這次就安裝了有點久了
10.這是成功嗎?


11.錯了 ns command not found
要來degbug了....

12.我沒有按照課本,因為我還沒有課本,不過我安裝完沒有toturial,以後要用課本範例,還是要用作者的file吧! 不過,我先用 ./validate先check一下為什麼不能跑 ns.exe

13.跑太久了,放棄,又參考此網頁,改了環境變數在.bashrc 加入
export NS_HOME=`pwd`/ns-allinone-2.32

export PATH=$NS_HOME/tcl8.4.15/unix:$NS_HOME/tk8.4.15/unix:$NS_HOME/bin:$PATH

export LD_LIBRARY_PATH=$NS_HOME/tcl8.4.15/unix:$NS_HOME/tk8.4.15/unix:$NS_HOME/otcl-1.13:$NS_HOME/lib:$LD_LIBRARY_PATH

要記得改成自己使用套件的名字

14.
結果輸入ns 有%符號出現,可以執行了,要執行x-win


15.
x-win順利執行,但是我下載的ns-2沒有example,不能測試,不過執行nam,network animator,順利執行,沒有問題,的確是安裝成功了,不過還是要重裝,未來使用課本的範例才好用。



16.
玩了一個example,可以動得





setting up Cygwin

1. 開始安裝Cygwin,C=Cygnus G=GUN Win=windows,其中我只知道window是什麼
如果安裝遇到什麼問題可以看
help file http://cygwin.com/cygwin-ug-net/setup-net.html

2.按下
Cygwin!
Install or update
now!

(using setup.exe)


就可以開始下載,這個執行檔會從網路上下載檔案。

3.
都先設定成recommended


4.
cache檔放置處


5.
這邊就是比較不一樣之處,選擇package


選了curr. 就是用現在穩定的版本(current version),exp代表experiment,
基本上如果沒有在選擇其他的套件,就是會安裝Base選項的東西,tutorial上面是這樣寫的。

6.
如預期的就開始安裝了。


7.
大概5分鐘就裝好了吧。
在桌面上點了shortcut,應該沒有什麼錯誤訊息。