Tuesday, May 27, 2008

ns2 multicase problem in x86_64 system

I use ns-allinone-2.31 to build a ns2 enviroment in x86_64 linux system.
But there is a problem while running multicase in dense mode ( i don't this problem also happen in sparse mode). The multicased packets are flooding over the entire network.

The reason of this problem is in "MCastClassifier::classify(Packet *pkt)" in classifier-mcast.cc.

The original code is:
 if (p == 0) {
   // Didn't find an entry.
   tcl.evalf("%s new-group %d %d %d cache-miss", name(), src, dst, iface);

Try to change into:
 if (p == 0) {
   // Didn't find an entry.
   tcl.evalf("%s new-group %ld %ld %d cache-miss", name(), src, dst, iface);

Monday, May 19, 2008

ns2 nam編譯問題

使用ns2提供的allinone2.31.tar編譯時,nam會發生下面這個問題

......
nam_stream.o: In function `NamStreamCompressedFile::gets(char*, int)':
nam_stream.cc:(.text+0x1071): undefined reference to `gzgets'
nam_stream.o: In function `NamStreamCompressedFile::NamStreamCompressedFile(char const*)':
nam_stream.cc:(.text+0x10b4): undefined reference to `gzopen'
nam_stream.o: In function `NamStreamCompressedFile::NamStreamCompressedFile(char const*)':
nam_stream.cc:(.text+0x1136): undefined reference to `gzopen'
collect2: ld returned 1 exit status
make: *** [nam] Error 1

這個問題只要把nam資料夾下的Makefile稍作修改即可

LIB = \
-L/home/hct/ns-allinone-2.31/tclcl-1.19 -ltclcl -L/home/hct/ns-allinone-2.31/otcl -lotcl -L/home/hct/ns-allinone-2.31/lib -ltk8.4 -L/home/hct/ns-allinone-2.31/lib -ltcl8.4 -lz \

(紅字為增加部份)

Wednesday, May 14, 2008

Gtkmm under Windows using Microsoft Visual Stuido 2005

Gtkmm基本上算是GTK的延伸,差異在於他將GTK修改成C++的語法
在Visual Stuido 2005的安裝方法gtkmm_windows
首先要先下載Gtk+Gtkmm development package
若是使用vista的使用者,Visual Stuido 2005須先安裝sp1

照著網頁上的說明即可,不過我編譯的時候出現下列錯誤
LNK1104 : cannot open file 'cairo.lib'
不知道為什麼,明明我都沒有連結到cairo.lib.
最後我把安裝C:\GTK\lib\cairomm-1.0d.lib複製一份名稱改成cairo.lib
這樣就可以正常編譯執行,非常的神奇....