NS-2.28 with DYMO ad-hoc routing protocol support

|

This HOWTO covers installation on Ubuntu Linux.

[소스 다운 받기]

$ cd ~ $ wget http://www.isi.edu/nsnam/dist/ns-allinone-2.28.tar.gz
$ tar xzf ns-allinone-2.28.tar.gz



[GDB debugger를 위한 수정]

1. install 파일 수정

$ cd ns-allinone-2.28
$ vim install


1.1 408번 줄에 더하기  --enable-synbols

./configure --enable-gcc --disable-shared --prefix=$CUR_PATH || die "tcl8.3.2 configuration failed! Exiting ..." becomes,

./configure --enable-symbols --enable-gcc --disable-shared --prefix=$CUR_PATH || die "tcl8.3.2 configuration failed! Exiting ..."


1.2 498번 줄에 더하기 –enable-debug

./configure || die "tclcl-$TCLCLVER configuration failed! Exiting ..." becomes,

./configure --enable-debug || die "tclcl-$TCLCLVER configuration failed! Exiting ..."



2. ns의 Makefile.in수정하기
$ cd ns-2.28
$ vim Makefile.in


82번째 줄에 더하기  -g 

CFLAGS = $(CCOPT) $(DEFINE) becomes, CFLAGS = -g $(CCOPT) $(DEFINE)


3. 필요 패키지 설치하기


3.1 X11/Intrinsic.h 는 otcl1-9 설치시 필요하므로

$ apt-get install -f libxt-dev libxt6 libsm-dev libsm6 libice-dev libice6 libncurses5-dev


3.2 /usr/X11R6/include/X11/Xmu/WinUtil.h는 nam-1.1에 필요함

$ apt-get install libxmu-dev

확인 : /usr/include/X11/Xmu/WinUtil.h  에 파일 생성 안되면 아래 링크 이용 http://www.koders.com/cpp/fid8242d90801 ··· 7d0.aspx



4. xgraph Makefile수정하기
$ cd ../xgraph-12.1
$ ./configure
$ vim Makefile


4.1 85번째 줄에 더하기 -L/usr/X11R6/lib

xgraph_LDADD = $(ADDITIONAL_LIBS) $(X_LIBS) $(X_PRE_LIBS) $(X_EXTRA_LIBS) -lX11 -lm becomes,

xgraph_LDADD = $(ADDITIONAL_LIBS) $(X_LIBS) $(X_PRE_LIBS) $(X_EXTRA_LIBS) -L/usr/X11R6/lib -lX11 -lm



5. gt-itm 은  sgb2ns에 필요함


5.1 sgb설치를 위한 apt수정

$ vi /etc/apt/sources.list 에 아래 추가

deb-src http://au.archive.ubuntu.com/ubuntu hoary main restricted deb http://au.archive.ubuntu.com/ubuntu hoary-updates main restricted deb-src http://au.archive.ubuntu.com/ubuntu hoary-updates main restricted deb http://au.archive.ubuntu.com/ubuntu hoary universe deb-src http://au.archive.ubuntu.com/ubuntu hoary universe deb http://security.ubuntu.com/ubuntu hoary-security main restricted deb-src http://security.ubuntu.com/ubuntu hoary-security main restricted deb http://security.ubuntu.com/ubuntu hoary-security universe deb-src http://security.ubuntu.com/ubuntu hoary-security universe deb http://archive.ubuntu.com/ubuntu hoary multiverse deb-src http://archive.ubuntu.com/ubuntu hoary multiverse deb http://archive.ubuntu.com/ubuntu hoary-backports main universe multiverse restricted


$ apt-get update


5.2 sgb 다운 받기

$ apt-get install sgb



6. eval 파일 수정

$ cd ./gt-itm/src
$ vim eval.c


162번째 둘줄로 나누어져 있는 아래 내용을 한줄로 수정

printf(" and %d (this ends a connected component of the graph)\n", idx(g, artic_pt));


7. gt-itm관련 작업


gt-itm 하부에 bin 디렉토리 없으면 생성

$ cd ./gt-itm
$ mkdir bin
$ cd ./gt-itm/src
$ make



8. gt-itm 와 sgb2ns 필요로 하는 라이브러리 링크 하기

$ cd ./gt-itm
$ mkdir lib
$ ln -s /usr/lib/libgb.a /root/ns-allinone-2.28/gt-itm/lib



9. 발생 가능 에러 해결


9.1 tcl 컴파일 에러

에러 메시지:syntax error near unexpected token `)' ./configure: line 7068: `    OSF*)'

해결 : http://mailman.isi.edu/pipermail/ns-users/2006-September/057322.html


- apt-get install autoconf            


- rm configure (이전 설정파일 삭제)

./autoconf

./configure



9.2  make: *** [queue/cbq.o] ## 에러 해결 하기

vi /root/ns-allinone-2.28/ns-2.28/queue/cbq.cc  

88 #define POWEROFTWO  16  
89  
90 class CBQueue; <-- 추가된 부분  
91  
92 class CBQClass : public Connector
vi /root/ns-allinone-2.28/ns-2.28/tora/tora_neighbor.h  

46     LINK_DN = 0x0002,   // downstream  
47     LINK_UN = 0x0004,   // undirected  
48 };  
49  
50 class toraAgent; <-- 추가된 부분  
51  
52 class TORANeighbor {  
53     friend class TORADest;  
54     friend class toraAgent;
vi /root/ns-allinone-2.28/ns-2.28/diffusion3/filter_core/filter_core.hh

103 typedef list NeighborList;  
104 typedef list HashList;  
105 typedef list BlackList;  
106  
107 class DiffRoutingAgent; <-- 추가된 부분  
108  
109 class DiffusionCoreAgent {  
110 public:  
111 #ifdef NS_DIFFUSION  
112 friend class DiffRoutingAgent;

[ * dymo 기능 추가 하기 ]


 -소스 다운 받기 ( http://sourceforge.net/projects/dymoum/ )

cd /root/ns-allinone-2.28/ns-2.28
wget http://jaist.dl.sourceforge.net/sourcef ··· -0.3.tgz
tar zvfx dymoum-0.3.tgz

-링크 걸기
cd /root/ns-allinone-2.28/ns-2.28
ln -s ./dymoum-0.3 ./dymoum

-패치 하기
patch -p1 < dymoum/dymoum_ns-2.28_v0.1.patch

If you haven't installed ns2 yet, then do the following:

$ cd ..

$ ./install

On the other hand, if you are installing DYMOUM on a running installation of ns2:

$ ./configure

$ make distclean

$ ./configure

$ make


10. ns컴파일 하기

$ cd ..
$ ./install &> compile.out

9.1 install 스크립트로 한번데 되면 좋은데 ...안될경우 각 패키지 별로 설치하며 확인하기



11. Environmental variables.

$ vim ./NS2.sh

#!/bin/sh

# LD_LIBRARY_PATH OTCL_LIB=/home/lucsp/ns-allinone-2.28/otcl-1.9 NS2_LIB=/home/lucsp/ns-allinone-2.28/lib X11_LIB=/usr/X11R6/lib export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:/usr/local/lib

# TCL_LIBRARY export TCL_LIBRARY=/home/lucsp/ns-allinone-2.28/tcl8.4.5/library:/usr/lib

# PATH XGRAPH=/home/lucsp/ns-allinone-2.28/bin:/home/lucsp/ns-allinone-2.28/tcl8.4.5/unix:/home/lucsp/ns-allinone-2.28/tk8.4.5/unix

PATH=$PATH:$XGRAPH:/home/lucsp/ns-allinone-2.28/ns-2.28/

[ 결과 ] vi ~/.bashrc     or     vi /etc/profiles

OTCL_LIB=/root/ns-allinone-2.28/otcl-1.9 NS2_LIB=/root/ns-allinone-2.28/lib X11_LIB=/usr/X11R6/lib export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:/usr/local/lib # TCL_LIBRARY export TCL_LIBRARY=/root/ns-allinone-2.28/tcl8.4.5/library:/usr/lib # PATH XGRAPH=/root/ns-allinone-2.28/bin:/root/ns-allinone-2.28/tcl8.4.5/unix:/root/ns-allinone-2.28/tk8.4.5/unix export PATH=$PATH:$XGRAPH:/root/ns-allinone-2.28/bin:/root/ns-allinone-2.28/tcl8.4.5/unix:/root/ns-allinone-2.28/tk8.4.5/unix


gcc 에러 보고 되고 있음 : http://blog.naver.com/etenallove/100016553174

[패치방법] /root/ns-allinone-2.28 patch -p1 < ../ns-allinone-2.28/ns228-gcc40.patch


작성 : 2006.6.07 by 임헌정

http://www.4ellene.net

참고http://www.ics.mq.edu.au/~phillipl/documents/NS-2.28AllInOne_HOWTO.html
출처: http://www.4ellene.net/tt/category/Network

And