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…CNWG1NQK&hl=en
2- download the bash file “” into the directory “/buddharaj/ns-allinone-2.34/ns-2.34”.…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 “” and replace the all occurences
of “/opt/ns-allinone-2.34” with “/home/buddharaj/ns-allinone-2.34” and run  the file as:

4- Open two files
– “Makefile” : found in the directory “yourpath/ns-allinone-2.34/ns-2.34”.
– “” : 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”.
– “” : found in the directory “yourpath/ns-allinone-2.34/ns-2.34”.
6. Edit both “Makefile” as
CC    = gcc-4.3
CPP    = g++

& “” 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’

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$make clean

10- If the previous commands passed successfully then you are ready to test your “Leach” by running ./test:

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


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 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


$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

Step1: Download the ns-allinone-2.34 from this site:

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 found at this location ns-allinone-2.34/otcl-1.13/ as
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

Step8: Append the following lines to the file ~/.bashrc
#the above two lines beginning from xgraph and ending with unix should come on the same line

Step 9: Give command
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 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.