Installing NS-2.27 and LEACH extension on Fedora Core and Ubuntu
Step 0: Prepare neccesary files for installation
- NS-2.27 package: ns-allinone-2.27.tar.gz
- Patch for compiling NS-2.27 with GCC 4.1.x: ns-2.27-gcc410.patch
- MIT’s LEACH extension: mit.tar.gz
- LEACH’s Makefile patch: leach_makefile-2.27.patch
Step 1: Download NS-2.27, apply ns-2.27-gcc410.patch, and install it
Under your home directory (~):
-
apt-get install build-essential autoconf automake libxmu-dev kernel-package libncurses5-dev fakeroot wget bzip2 (커널 설정!)
- wget http://www.internetworkflow.com/downloads/ns2leach/ns-allinone-2.27.tar.gz
- tar zxvf ns-allinone-2.27.tar.gz
- wget http://www.tekno.chalmers.se/~yusheng/reports/ns-2.27-gcc410.patch
- patch -p0 < ns-2.27-gcc410.patch (설치시 Ubuntu package 과정 및 업데이트 되어있어야함!)
- cd ns-allinone-2.27/
- ./install
- 설치후에 bash_profile, vimrc를 넣는다.(vim bash_profile해서 수정하여야함!!IP주소등..참고로 .bash_profile을 사용해서 숨긴다.)
-출처:http://tmtam.wordpress.com/2007/07/31/installing-ns-227-and-leach-extension-on-ubuntu-704-feisty-fawn/ -
[출처] Install NS-2.27 and Ubuntu|작성자 울라짱구
LEACH 설치
1) 실행 : /home/cjm/ns-allinone-2.27/ns-2.27 디렉토리에서
./test
(ns tcl/ex/wireless.tcl -sc mit/uAMPS/sims/100nodescen -rp leach -x
1000 -y 1000 -nn 101 -stop 100 -eq_energy 1 -init_energy 2 -filename
leach_file -dirname leach_dir -num_clusters 5 -bs_x 0 -bs_y 0)
2) 설치 단계(gcc 버젼 확인,,, 4.1.2 이상 권장)
Step 1: Download NS-2.27
다운로드 : wget http://www.isi.edu/nsnam/dist/ns-allinone-2.27.tar.gz
압축 해제 : tar zxvf ns-allinone-2.27.tar.gz
Step 2: You need to apply a patch to ns-2.27 to make it works with gcc4.1. You can get the patch here
gcc 다운 : wget http://www.tekno.chalmers.se/~yusheng/reports/ns-2.27-gcc410.patch
위치 : ns-allinone-2.27 디렉토리 밖에서
패치 : patch -p0 <ns-2.27-gcc410.patch in bash
Step 3 : tk-8.4 최신버전으로 패치
위치 : cd ns-allinone-2.27/tk8.4.5
패치 : patch -p0 < tk-8.4-lastevent.patch
Step 4 : ns-allinone-2.27 인스톨
위치 : cd ns-allinone-2.27
설치 : ./install
Step 5 : Add the environmental variables to /etc/profile
NS=/srv/ns-allinone-2.27
export PATH=$PATH:$NS/bin:$NS/tcl8.4.5/unix:$NS/tk8.4.5/unix:$NS/ns-2.27:$NS/nam-1.13
export LD_LIBRARY_PATH=$NS/otcl-1.8:$NS/lib:$/usr/X11R6/lib:$/usr/local/lib
export TCL_LIBRARY=$NS/tcl8.4.5/library:$/usr/lib
source /etc/profile
Step 5-1 : 만약 cygwin으로 NS2를 실행하기 위해서는 startxwin.bat 실행
위치 : cygwin 실행창
실행 : startxwin.bat
출력화면 : startxwin.bat - Starting on Windows NT/2000/XP/2003
Step 6 : ns확인
위치 : cd ns-allinone-2.27/ns-2.27
실행 : ns tcl/ex/simple.tcl
Step 7 : Download LEACH code, extract it under ~ns-2.27/ directory.
위치 : cd ns-2.27
다운로드 : wget http://www.internetworkflow.com/downloads/ns2leach/mit.tar.gz
압축 해제 : tar zxvf mit.tar.gz
Step 8 : Add the following line in ~ns2.27/mac/wireless-phy.cc, line 59, that is, after the line #define max(a,b) (((a)<(b))?(b):(a))
#define min(a,b) (((a)>(b))?(b):(a))
Step9 : Install the LEACH code by following instructions below:
Step 5.1: Edit the Makefile as follows:
Add DMIT_uAMPS to the DEFINE list
Add -I./mit/rca -I./mit/uAMPS to the INCLUDE list
Add the following just prior to the line gaf/gaf.o \
mit/rca/energy.o mit/rca/rcagent.o \
mit/rca/rca-ll.o mit/rca/resource.o \
mac/mac-sensor-timers.o mac/mac-sensor.o mit/uAMPS/bsagent.o \
Step 5.2 : Add the environmental variables to /etc/profile
export RCA_LIBRARY=$NS/ns-2.27/mit/rca
export uAMPS_LIBRARY=$NS/ns-2.27/mit/uAMPS
Step 5.3: source /etc/profile and clean up previous build
source /etc/profile
make clean
Step 5.4: Rebuild ns2, redirecting output
make ( or => nohup make 2>error.log >make.log & )
Step 10 : Test default wireless demo and LEACH
./test
Step 11 : Validate the full installation, redirect the output
nohup ./validate-full 2> validate.error >validate.log &
[출처] NS2- LEACH 설치 방법|작성자 둘리
'research > Simulation & Performance Evaluation' 카테고리의 다른 글
| ns2 LEACH extension installing (9) | 2009/10/05 |
|---|




댓글을 달아 주세요
ukdissertationwritinghelp 2011/01/26 14:54 댓글주소 수정/삭제 댓글쓰기
It’s a great tip on Do It yourself stuff. Thanks!
ukdissertationwritinghelp 2011/01/26 14:54 댓글주소 수정/삭제 댓글쓰기
It’s a great tip on Do It yourself stuff. Thanks!
term paper assignment 2011/04/09 19:17 댓글주소 수정/삭제 댓글쓰기
It’s very rare that you find the relevant information on the net but your article did provide me the relevant information. I am going to save your URL and will definitely visit the site again.
Tablet Android Honeycomb Terbaik Murah 2011/08/15 19:27 댓글주소 수정/삭제 댓글쓰기
이 사이트에 우리의 제 3의 휴가는 것입니다. 이 블로그 사이트 때문에 단순히 아주 같은 전문적인 틈새 안에 새로운 프로젝트를 시작했다. 귀하의 블로그 게시물은 사용 사람 중요한 데이터를 가구. 당신은 훌륭한 일을 했어. 자신의 피부 색상을 보존할 수 사랑스러운 여자 문제와 함께 방법을 plumped 그 자신의 무기가이 사람을 얻을 것이다 지켜보고 결국.
mesothelioma lawyers 2011/08/16 16:29 댓글주소 수정/삭제 댓글쓰기
선물 감싸 관련된 훌륭한 팩의 그! 난 당신이 그들 모두 (항상되지 않습니다?)에 대해 매우 걱정하고 있고 볼 수 있습니다. 당연히 당신은 송곳니 돌을을 수행할 수 있습니다. 난 그녀가 매우 신속하게 밖으로 작동한 폭풍 인형을 인수했습니다. 더 많은 강아지 간식을 읽어 모든. 인터넷 마케팅 기쁘게 사람이 현재 선물을 좋아했습니다.
Lawyer Marketing 2011/08/18 06:13 댓글주소 수정/삭제 댓글쓰기
당신은 완전히 당신이 달 일이 작업을 통해 지출을 방문 무료입니다. 그들이 고려 수있는 이야기에 대해 정확하게 일반적으로 문제가없는 사람 때문에 세계는 훨씬 더 열렬한 아웃소싱 헬퍼를 기원합니다. 일반적으로 현재 심혈관 가신 답니다.
Ban Terbaik di Indonesia GT Radial 2011/11/24 13:35 댓글주소 수정/삭제 댓글쓰기
내가 아주이 블로그에 대한 즐길입니다. 그 정보를 주제. 그것은 몇 가지 문제를 해결하기 위해 절 그다지 도움이됩니다. 그 기회가 너무 빠른 너무 환상적이고 일하는 스타일입니다. 난 당신이 모두 도움이 될 것 같아요. 나와 함께이 아름다운 블로그를 즐기는 줘서 고마워. 나는 정말 그것을 감사 해요! 다른 훌륭한 블로그를 기대하겠습니다.작성자에게 행운을 빕니다! 모두 제일 좋다
ultrabook notebook tipis harga murah terbaik 2012/01/29 14:16 댓글주소 수정/삭제 댓글쓰기
시작하기 위해 내 배우자를 언급하고 새로운 설문 조사가 부가 확인란되고이 후 의견을 포함시킬 수 때 같은 검토를 고집 일부 메시지를 구입하는 동안 당신 - 알림을해서 교전이 동안. 아마 그러나 당신이 도움이됩니다 통해 멀리 데려다해야 있나요? 건배!
AGEN BOLA 2012/08/20 12:24 댓글주소 수정/삭제 댓글쓰기
agen bola bv berkomentar situs anda sangat menarik dan saya harap anda terus mengembangkanya 귀하는 차단되었으므로 사용