1. Download LWX (這就不用說了,要下載才能用阿)
2. Copy all the file in code directory into your ns2 program directory
(可以從下載的LWX資料夾中找到code這個資料夾,所以我們要從code資料夾中複製整個LWX資料夾到NS2的MAC資料夾中,作者的路徑是在ns2.33/ns-2.33/MAC下,ns2.33的路徑可參考Ubuntu 9.04 + ns-allinone-2.33 )
LWX File List: (此處只是要告知使用者:LWX資料夾內含下列4個檔案,清單如下)
- mac/lwx/lwx.cc
- mac/lwx/lwx_bind_tcl.cc
- mac/lwx/lwx_tool.cc
- mac/lwx/lwx_mac.h
(這個步驟是要修改原本在ns-2.33/common中的agent.cc和packet.h兩個檔案,從LWX資料夾中的common資料夾可找到相同檔名的檔案,可同時比對修改。切記!不要偷懶用覆蓋的方式,我應該就是這樣才一直搞不定,囧)
- common/agent.cc
- common/packet.h
(修改ns-2.33裡的Makefile檔,也就是將下列 mac/lwx/lwx.o \ 加到適當的位置)
Adding the following in the suitable position in Makefile:
- mac/lwx/lwx.o \ ← 切記!反斜線不要忘記打
- mac/mac-simple.o \
- mac/lwx/lwx.o \ s
- atellite/sat-hdlc.o \
(重新編譯NS2嚕,編譯路徑當然是在ns2.33/ns-2.33底下)
make clean; make ;make install
(遇到權限問題可使用:sudo make clean;make;make install,再不行就使用殺手鐧,進入root底下,哈)
5. Run LWX.
另外還要提醒一點,由於作者是在ubuntu上跑NS2,所以在安裝的過程中有時會碰到使用者權限的問題,這時請毫不吝嗇的使用sudo或root權限處理你要的指令!
Reference site: http://sites.google.com/site/lwxns2/
沒有留言:
張貼留言