Installing Cognitive Radio Extension on ns-2
The following article explains the way of installing cognitive radio extension on ns-2 simulator with a detailed step by step procedure.
One may follow the old multichannel patching procedure as follows:
Procedure for Installing (Preparing) ns2.31 for applying the CRCN Multichannel patch.
For installation of Linux and ns2.31, refer internet for the procedure for installing Linux and installing ns2.
1. If you are not having ns2.31, then download ns2.31 from the following link
http://www.isi.edu/nsnam/dist/ns-allinone-2.31.tar.gz
2. login as root copy the ns-allinone-2.31.tar.gz file in / (the root of the filesystem)
#cd /
3. #gunzip –d ns*.gz this will extract ns-allinone-2.31.tar in the / file system
4. #tar –xvf ns*.tar this will extract ns.28 under the directory /ns-allinone-2.31
5. First install ns2.31
# cd /ns-allinone-2.31/
#./ install – to install ns2.
The following is very very important
6. After successful installation, edit the /root/.bash_profile with the following values – then only the following commands will work from any project directory) [/.bash_profile is a hidden file]
(in some cases you may need to edit .bashrc file instead of .bash_profile
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/ns-allinone-2.31/otcl-1.13:/ns-allinone-2.31/lib:/root/bin/glnx86/
TCL_LIBRARY=/ns-allinone-2.31/tcl8.4.14/library
PATH=$PATH:$HOME/bin:/ns-allinone-2.31/bin:/ns-allinone-2.31/tcl8.4.14/unix:/ns-allinone-2.31/tk8.4.14/unix
export USERNAME BASH_ENV PATH LD_LIBRARY_PATH TCL_LIBRARY
Reboot the system and login again
Check the good working of ns2 by just typing the following command.
#ns – this will produce % prompt (Ctrl+C to exit)
#nam – This will start nam
#xgraph – it should wait for input (Ctrl+C to exit)
If ns, nam and xgraph are running good, then only you can proceed to the next part of the project.
Patching ns2.31 with CRCN Multichannel patch
If you are getting any errors, then immediately send it to me – I may tell you the mistake which you made.
After installing ns2.31 and testing the good working of ns, nam and xgraph, just copy the entire folder ns-allinone-2.31 and make a backup of it and store it safely.
Now you may patch ns2 for multichannel.
In fact, the original link for this patch is http://stuweb.ee.mtu.edu/~ljialian/crcn.zip
But it will not work.
So download it from the following link.
https://docs.google.com/file/d/0B7S255p3kFXNNXEtS3ozTHpmRHM/edit?pli=1
and try installing it 🙂
The following is the official procedure for installing this multichannel patch which is explained in CRCN USER GUIDE
Installation of NS2 COMPONENTS
SYSTEM REQUIREMENTS
This simulator is based on NS-2 (version 2.31). All codes have been tested in ns-2.31 under a Linux environment.
Step 1: Make sure your system meets the system requirements.
Step 2: Download crcn.zip.
(http://faculty.uml.edu/Tricia_Chigan/Research/CRCN%20user%20code%203/CRCN%20user%20code%203/crcn.zip)
Step 3: Make sure that your ns can be called from any directory.
Step 4: Unzip the crcn.zip. Copy the files under each sub folders in crcn into the corresponding folders in XXX/ns-allinone-2.31/ns-2.31/. For example, copy the files under crcn/mac/ into XXX/ns-allinone-2.31/ns-2.31/mac/. Please note that it will overwrite some of your ns files in the same directory. Thus, backup the ns directory before executing this command.
Step 5: Add the following three lines in the Makefile, which is under XXX/ns-allinone-2.31/ns-2.31/.
wcett/wcett_logs.o wcett/wcett.o \
wcett/wcett_rtable.o wcett/wcett_rqueue.o \
mac/macng.o mac/maccon.o \
Step 6: Run the following commands under XXX/ns-allinone-2.31/ns-2.31/ directory:
./configure
make clean
make depend
make
*Important note: in the above procedure, XXX means the home directory.
ok, if you are successful then you may test your installation as follows:
Run the simulation “test4macng random topo 2 channels.tcl” which will be inside that extension package.
#ns “test4macng random topo 2 channels.tcl”
If everything is good, then it will create a nam file named “test.nam”
#nam test.nam
Now, will show a simple multichannel simulation.
If you see any error such as split object unknown, then it means, you failed to install it correctly.
Installing Cognitive Radio Extension on ns-3
The following article explains the way of installing cognitive radio extension on ns-3 simulator.
Installation of Cognitive Radio Extension for ns-3 (CRE-NS3)