Zelengora, Bosnia and Herzegovina

How to install ns-2.35 with AntNet on Centos6.8

Prerequisites:

yum install gcc-c++ gcc44-c++ compat-gcc-34-c++ automake autoconf libtool libXmu-devel

Important: These codes will work well with fresh installation of ns-allinone-2.35. If you have already compiled any other simulation in ns-2.35, kindly take a back up before you proceed. So, download fresh ns-235-allinone

Make sure you have gcc of version 4 (best 4.4.7): execute

gcc -v

to test the installed version;

Install ns-2.35

Building ns-2.35, CentOS 6.8

    • tar xvf ns-allinone-2.35.tar.gz
    • cd ns-allinone-2.35/ && sh install
    • you should receive following content if everything is fine:
    Please put
    into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.
    
    IMPORTANT NOTICES:
    
    (1) You MUST put /root/ns2/ns-allinone-2.35/otcl-1.14, /root/ns2/ns-allinone-2.35/lib,
    into your LD_LIBRARY_PATH environment variable.
    If it complains about X libraries, add path to your X libraries
    into LD_LIBRARY_PATH.
    If you are using csh, you can set it like:
    setenv LD_LIBRARY_PATH If you are using sh, you can set it like:
    export LD_LIBRARY_PATH=
    
    (2) You MUST put /root/ns2/ns-allinone-2.35/tcl8.5.10/library into your TCL_LIBRARY environmental
    variable. Otherwise ns/nam will complain during startup.
    
    After these steps, you can now run the ns validation suite with
    cd ns-2.35; ./validate
    • so execute
      export TCL_LIBRARY=$TCL_LIBRARY:/root/ns2/ns-allinone-2.35/tcl8.5.10/library into your TCL_LIBRARY
      export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/ns2/ns-allinone-2.35/otcl-1.14:/root/ns2/ns-allinone-2.35/lib
      export PATH=$PATH:/root/ns2/ns-allinone-2.35/bin:/root/ns2/ns-allinone-2.35/tcl8.5.10/unix:/root/ns2/ns-allinone-2.35/tk8.5.10/unix
      
    • cd ns-2.35; ./validate

    Install AntNet

  • Download http://www.mehic.info/wp-content/uploads/2018/05/Antnet-20180522T221131Z-001.zip
  • Unzip the folder and move files to ns-2.35 folder (overwrite and replace existing files)
  • Execute
    cd ns-2.35; ./configure
  • Execute
    make clean
  • Execute
    make
  • Finally execute
    ns simpleant.tcl
  • The final command will create three files:
    rtable.txt (The routing table of all the nodes),
    simple.nam ( A network animation file) and
    simple.out (A Trace file)

 

Instructions taken from: https://www.nsnam.com/2015/03/ant-colony-algorithm-antnet-in-ns-235.html