Archive for the ‘Uncategorized’ Category

How to install leach on ubuntu 10. +

I suppose that ns-2.34 is installed with the compiler gcc-4.3.

The home directory of ns-2.34 is “/buddharaj/ns-allinone-2.34”
1- download the package “ns-234-leach.tar.gz” into the directory “/buddharaj/ns-allinone-2.34/ns-2.34”. and Unzip the ns-234-leach.tar.gz
https://docs.google.com/uc?id=0BzLWx…CNWG1NQK&hl=en
2- download the bash file “leach-setup.sh” into the directory “/buddharaj/ns-allinone-2.34/ns-2.34”.
https://docs.google.com/uc?id=0BzLWx…CJSU5ZYG&hl=en
3- Go to the terminal and go into that directory as:
wsn@ubuntu:~$ cd /opt/ns-allinone-2.34/ns-2.34/ and Open the file “leach-setup.sh” and replace the all occurences
of “/opt/ns-allinone-2.34” with “/home/buddharaj/ns-allinone-2.34” and run  the leach-setup.sh file as:

wsn@ubuntu:/opt/ns-allinone-2.34/ns-2.34$./leach-setup.sh
4- Open two files
– “Makefile” : found in the directory “yourpath/ns-allinone-2.34/ns-2.34”.
– “Makefile.in” : found in the directory “yourpath/ns-allinone-2.34/ns-2.34”.

5- If the home directory of your “ns-2.34” is other than “/opt/…”, then you need to find “/opt/ns-allinone-2.34” and replace with “yourpath/ns-allinone-2.34” for the follwoing two files:
– “Makefile” : found in the directory “yourpath/ns-allinone-2.34/ns-2.34”.
– “Makefile.in” : found in the directory “yourpath/ns-allinone-2.34/ns-2.34”.
6. Edit both “Makefile” as
CC    = gcc-4.3
CPP    = g++

& “Makefile.in” as following:
CC    = gcc-4.3
CPP    = @CXX@

7- Insert following code into “yourpath/ns-allinone-2.34/ns-2.34/trace/cmu-trace.h” after the line 59.

#ifdef MIT_uAMPS
#define ADV_CHAR ‘A’
#define REQ_CHAR ‘R’
#define DATA_CHAR ‘D’
#endif

and go to the line number 167 and insert following function there

void     format_rca(Packet *p, int offset);

8- Again delete the code in file “yourpath/ns-allinone-2.34/ns-2.34/mit/uAMPS/sims/uamps.tcl” from line number 8 to 20
and insert the following code there

source mit/rca/ns-ranode.tcl
source mit/uAMPS/ns-bsapp.tcl
source mit/uAMPS/extras.tcl
source mit/uAMPS/stats.tcl
source mit/rca/resources/ns-resource-manager.tcl
source mit/rca/resources/ns-energy-resource.tcl
source mit/rca/resources/ns-neighbor-resource.tcl

9- run the following commands
wsn@ubuntu:/opt/ns-allinone-2.34/ns-2.34$./configure
wsn@ubuntu:/opt/ns-allinone-2.34/ns-2.34$make clean
wsn@ubuntu:/opt/ns-allinone-2.34/ns-2.34$make

10- If the previous commands passed successfully then you are ready to test your “Leach” by running ./test:
wsn@ubuntu:/opt/ns-allinone-2.34/ns-2.34$./test

11- check the file “leach.err”, if no error reported then go to “leach.out” and enjoy your results!

Advertisements

Brightness Problem in Ubuntu 10.10

I’ve got the problem with Ubuntu 10.10.  The brightness function keys work, but the screen always stays at max brightness.

  • A quick-fixes solution to adjust the brightness is:

1.) Install deb file from http://us.archive.ubuntu.com/ubuntu/pool/universe/x/xcalib/xcalib_0.8.dfsg1-2_i386.deb. As this this the deb file u can directly install on ur system.

2.)  Open ur terminal and type

$xcalib -co 60 -a (where 60 can be any percent) to dim the screen and xcalib -c to clear the settings and restore brightness. You could also map these commands to keyboard shortcuts, essentially rigging up two new brightness keys.

Granted, these don’t address the real problem, but they were the only solutions that worked for me. Hope this helps.

  • If u want to change ur sceen contrast then do this:

type the command

$xgamma -gamma .xx

where xx takes values between [01-99](lowest to highest)

ex. $xgamma -gamma .60

Or

$sudo setpci -s 00:02.0 F4.B=xx
where xx takes values between [00-FF](lowest to highest)
ex. $sudo setpci -s 00:02.0 F4.B=E0

Installation of ns2.34 on ubuntu10.10

Procedure:
Step1: Download the ns-allinone-2.34 from this site:
http://bit.ly/downloadns

Step2: Place the ns-allinone-2.34.tar.gz package in your home
folder(/home/micman in my case). Right click the package and
extract the contents in the same folder.

Step3: Next, open the Terminal(Applications–>Accessories–>Terminal)

Step4: Change to ns-allinone2.34 directory
$ cd /home/buddharaj/ns-allinone-2.34
Step5: First install all the dependencies
$ sudo apt-get install build-essential autoconf automake libxmu-dev gcc-4.3

Edit Makefile.in found at this location ns-allinone-2.34/otcl-1.13/Makefile.in as
follows:
Find the line that says:
CC= @CC@
and change it to:
CC= gcc-4.3

Step 6: Begin ns2.34 installation
$ sudo su
# ./install
Step 7: Once the installation is successful i.e without any errors, we need to
add the path information to the file ~/.bashrc
# gedit /home/micman/.bashrc
I remind you once again that micman is my username, replace it with your
username.

Step8: Append the following lines to the file ~/.bashrc
# LD_LIBRARY_PATH
OTCL_LIB=/home/micman/ns-allinone-2.34/otcl-1.13
NS2_LIB=/home/micman/ns-allinone-2.34/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB
# TCL_LIBRARY
TCL_LIB=/home/micman/ns-allinone-2.34/tcl8.4.18/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB
# PATH
XGRAPH=/home/micman/ns-allinone-2.34/bin:/home/micman/ns-allinone-
2.34/tcl8.4.18/unix:/home/micman/ns-allinone-2.34/tk8.4.18/unix
#the above two lines beginning from xgraph and ending with unix should come on the same line
NS=/home/micman/ns-allinone-2.34/ns-2.34/
NAM=/home/micman/ns-allinone-2.34/nam-1.14/
PATH=$PATH:$XGRAPH:$NS:$NAM

Step 9: Give command
root@ubuntu:~/ns-allinone-2.34/ns-2.34#./validate
it will take several minutes to complete the validation process.

After this simply quit the Terminal and open it again.

After this, type ns to see % and type nam to show the nam startup window.
This proves that your installation has been successful.

Hello world!

Welcome to WordPress.com. After you read this, you should delete and write your own post, with a new title above. Or hit Add New on the left (of the admin dashboard) to start a fresh post.

Here are some suggestions for your first post.

  1. You can find new ideas for what to blog about by reading the Daily Post.
  2. Add PressThis to your browser. It creates a new blog post for you about any interesting  page you read on the web.
  3. Make some changes to this page, and then hit preview on the right. You can always preview any post or edit it before you share it to the world.