ns2 2.27 ubuntu

분류없음 2008.08.23 01:15

Step 0: Prepare neccesary files for installation

  1. NS-2.27 package: ns-allinone-2.27.tar.gz
  2. Patch for compiling NS-2.27 with GCC 4.1.x: ns-2.27-gcc410.patch
  3. MIT’s LEACH extension: mit.tar.gz
  4. 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 (~):

  1. wget http://www.isi.edu/nsnam/dist/ns-allinone-2.27.tar.gz
    wget http://www.internetworkflow.com/downloads/ns2leach/ns-allinone-2.27.tar.gz
  2. tar zxvf ns-allinone-2.27.tar.gz
  3. wget http://www.tekno.chalmers.se/~yusheng/reports/ns-2.27-gcc410.patch
  4. patch -p0 < ns-2.27-gcc410.patch
  5. cd ns-allinone-2.27/
  6. ./install

Step 2: Set the environment variables to make NS-2.27 works

  1. cd ~
  2. gedit .bashrc
    # PATH
  3. source .bashrc

Step 3: Download, copy, and extract MIT’s LEACH extension

  1. wget http://www.internetworkflow.com/downloads/ns2leach/mit.tar.gz
  2. cp mit.tar.gz ~/ns-allinone-2.27/ns-2.27/
  3. cd ~/ns-allinone-2.27/ns-2.27/
  4. tar xzvf mit.tar.gz
  5. rm mit.tar.gz

Step 4: Modify NS-2 source code

  1. gedit ~/ns-allinone-2.27/ns-2.27/mac/wireless-phy.cc
    Goto line 59, that is after line 58:
    #define max(a,b) (((a)<(b))?(b):(a))
    #define min(a,b) (((a)>(b))?(b):(a))

Step 5: Add enviroment variables for LEACH extension

  1. gedit ~/.bashrc
    Goto line 59, that is after line 58:
    export RCA_LIBRARY=$NS/mit/rca
    export uAMPS_LIBRARY=$NS/mit/uAMPS
  2. source ~/.bashrc

Step 6: Download and apply patch for Makefile.vc, edit Makefile and re-compile NS-2.27 with LEACH extension

  1. wget http://voyager.ce.fit.ac.jp/wiki/tool/leach_makefile-2.27.patch
  2. patch -p0 < leach_makefile-2.27.patch
  3. gedit Makefile
    • 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 \
    • make clean
    • make

Step 7: Test and debug

  1. Modify file test:
    Move line:
    cd ../../
    above line:
    ./leach_test./test You may find the follwing warnings in leach.out: Warning dst_ is no longer being supported in NS. dst_ 0xffffffff
    Use dst_addr_ and dst_port_ instead

    Use this Linux command to search dst_ and replace with dst_addr_ (Note: dst_port_ is 0 by default and we don’t need to search it) :
  2. cd ~/ns-allinone-2.27/ns-2.27/mit/uAMPS/
    perl -pi -w -e ’s/dst_/dst_addr_/g;’ *.tcl
  3. cd ~/ns-allinone-2.27/ns-2.27/mit/uAMPS/sims
    perl -pi -w -e ’s/dst_/dst_addr_/g;’ *.tcl

//RTP 관련 소스 붙여넣기 하고 파일 오픈- 스페이스바- 저장 > make clean > make
Posted by remos

일단 오늘 해결(?) 이 아니라 컴파일 하는 방법을 찾았는데요. 제대로 동작하는지는 쓰면서 알아봐야 될것 같습니다.;;

configure 파일에서 같은 방식으로 에러나는 부분이 2군데가 있는데요

/etc/.relid'` 라고 되어있는 부분입니다. 여기서 '때문에 끝나지 않는다고 하는데요.

/etc/.relid`로 고치시면 configure가 제대로 동작 합니다.(적어도 하는것처럼 보입니다.)

도움되시길 바래요 :)

Posted by remos


분류없음 2008.06.10 11:31
Posted by remos
jongkimqos@jongkim-desktop:~/example$ ns test2.tcl
warning: no class variable Tracefile::debug_

        see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Session/RTP::debug_

        see tcl-object.tcl in tclcl for info about this warning.


Tracefile set debug_ 0
Session/RTP set debug_ 0 0
Posted by remos

qos streaming

분류없음 2008.06.10 01:26
Posted by remos

티스토리 툴바