Pages

Wednesday 28 November 2012

Installing WSN LEACH Protocol on NS-2.34 in Fedora


Here I am sharing my experience of installing WSN LEACH protocol on NS-2.34 in fedora 8 system. After searching in the Google a lot, I came across the following few useful links, explaining about installing Leach on NS-2. Here they are:

And
Linuxquestions.org (few valuable posts)

So, here the Step-by-Step method  to install LEACH.

You system need to be installed with NS-2.34 and the compiler gcc-4.3. these two are pre-requisite for installing LEACH.

Let, the home directory of ns-2.34 is "/opt/ns-allinone-2.34"

Download the package "ns-234-leach.tar.gz" into the directory "/opt/ns-allinone-2.34/ns-2.34".

Download the bash file "leach-setup.sh" into the directory "/opt/ns-allinone-2.34/ns-2.34".

Note:  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 file "leach-setup.sh".

Now, move to the directory "/opt/ns-allinone-2.34/ns-2.34" and patch the file "leach-setup.sh".

cd  /opt/ns-allinone-2.34/ns-2.34/
bash  leach-setup.sh

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

Edit both “Makefile” & “Makefile.in” as following:
CC = gcc-4.3
CPP = g++-4.3

Once the above steps are done, run the following commands in the Terminal:
./configure
make clean
make depend
make

When you using the make command you will get the following error:
Code:
********************************************************************
trace/cmu-trace.cc: In member function ‘void CMUTrace::format(Packet*, const char*)’:
trace/cmu-trace.cc:1327: error: ‘format_rca’ was not declared in this scope
trace/cmu-trace.cc: At global scope:
trace/cmu-trace.cc:1523: error: no ‘void CMUTrace::format_rca(Packet*, int)’ member function declared in class ‘CMUTrace’
make: *** [trace/cmu-trace.o] Error 1
********************************************************************
  To fix it you need to add the following code in “cmu-trace.h” file starting from line 165:
Code:
********************************************************************

#ifdef MIT_uAMPS
      void    format_rca(Packet *p, int offset);
#define ADV_CHAR             'A'
#define REQ_CHAR             'R'
#define DATA_CHAR            'D'

#endif
********************************************************************

 And following into ns-default.tcl (line 765) to suppress few warnings:
 ********************************************************************
# ——————————————————
Phy/WirelessPhy set alive_ 1
Phy/WirelessPhy set Efriss_amp_ 100e-12
Phy/WirelessPhy set Etwo_ray_amp_ 0.013e-12

Phy/WirelessPhy set EXcvr_ 50e-9
Phy/WirelessPhy set sleep_ 0
Phy/WirelessPhy set ss_ 1
Phy/WirelessPhy set dist_ 0
# ——————————————————
********************************************************************
Now run the following the commands to re-compile ns in terminal.
make clean
make depend
make

 If the above commands passed successfully then you are ready to test your "Leach" by running “./test_leach” command.
 ./test_leach

Now go to the following directory “yourpath/ns-allinone-2.34/ns-2.34/ns-234-leach/mit/leach_sims” and check the file "leach.err",

You may get few errors in the leach.err file as follows:
******************************************************************** 
can't read "env(RCA_LIBRARY)": no such variable
    while executing
"source $env(RCA_LIBRARY)/ns-ranode.tcl"
    (file "mit/uAMPS/sims/uamps.tcl" line 9)
      ......................
      .....Code Omitted.....
      ......................
      (procedure "source" line 8)
    invoked from within
"source tcl/mobility/$opt(rp).tcl"
    (file "tcl/ex/wireless.tcl" line 187)

******************************************************************** 

The problem is in the path. What modify all the paths in “ns-allinone-2.34/ns-2.34/mit/uAMPS/sims/uamps.tcl”. Here is the modified code below the commented out lines (lines beginning with '#'):
Code:
********************************************************************   
############################################################################
#
# This code was developed as part of the MIT uAMPS project. (June, 2000)
#
############################################################################

global opt bs

#source $env(RCA_LIBRARY)/ns-ranode.tcl
source /hema/home/ns-allinone-2.35-RC4/ns-2.35/mit/rca/ns-ranode.tcl

#source $env(uAMPS_LIBRARY)/ns-bsapp.tcl
source /hema/home/ns-allinone-2.35-RC4/ns-2.35/mit/uAMPS/ns-bsapp.tcl

#source $env(uAMPS_LIBRARY)/extras.tcl
source /hema/home/ns-allinone-2.35-RC4/ns-2.35/mit/uAMPS/extras.tcl

#source $env(uAMPS_LIBRARY)/stats.tcl
source /hema/home/ns-allinone-2.35-RC4/ns-2.35/mit/uAMPS/stats.tcl

#Uncomment these lines to use gdb to debug the c code
#source mit/uAMPS/ns-bsapp.tcl
#source mit/uAMPS/extras.tcl
#source mit/uAMPS/stats.tcl

#source $env(RCA_LIBRARY)/resources/ns-resource-manager.tcl
source /hema/home/ns-allinone-2.35-RC4/ns-2.35/mit/rca/resources/ns-resource-manager.tcl

#source $env(RCA_LIBRARY)/resources/ns-energy-resource.tcl
source /hema/home/ns-allinone-2.35-RC4/ns-2.35/mit/rca/resources/ns-energy-resource.tcl

#source $env(RCA_LIBRARY)/resources/ns-neighbor-resource.tcl
source /hema/home/ns-allinone-2.35-RC4/ns-2.35/mit/rca/resources/ns-neighbor-resource.tcl
********************************************************************  
Now run the following the commands to re-compile ns in terminal.
make clean
make depend
make

and execute following again: ./test_leach
Now check the file "leach.err", if no error reported then go to "leach.out"  for results!

88 comments:

  1. Thank you for your explanation about leach installation. sir i have ubuntu version 12.10 and the version of gcc is 4.6, is it possible to install leach with this gcc version?..I have only 6 months of experience in ns2..

    ReplyDelete
    Replies
    1. Hi, Thank you..!! Since the linker is the same for both gcc versions gcc 4.5 and gcc 4.6. it will not create any problem.
      Don't worry, just follow the steps carefully while installing the protocol.. all the best... :)

      Delete
  2. thank you sir,
    i tried again , but when i tried the command ./test, i got the following message
    ns:
    [code omitted because of length]
    : invalid command name "Agent/DYMOUM"
    while executing
    "Agent/DYMOUM instproc init args {

    $self next $args
    }"
    i checked the "leach.err" file, i found the following text
    INITIALIZE THE LIST xListHead
    SORTING LISTS ...DONE!

    Is this will make problem..Can you please help me

    ReplyDelete
    Replies
    1. yeh, i think so.. once your make is completed... please try "ns" command if a "%" symbol comes it means your make is sucessfull....

      and during the path setting give the correct path..
      for ex:
      **********************************************
      #source $env(RCA_LIBRARY)/ns-ranode.tcl
      source /hema/home/ns-allinone-2.35-RC4/ns-2.35/mit/rca/ns-ranode.tcl
      *****************************************

      here "hema" is my username, for your case change it with your username... similarly for all others......
      The above procedure working fine for me under fedora 14....

      Delete
  3. Sir, again I installed it. i followed all the steps , and make command is successful.when i tried the command ./test, i got the following message
    num_nodes is set 3
    warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
    INITIALIZE THE LIST xListHead
    Loading connection pattern...
    Loading scenario file...
    Starting Simulation...
    channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
    highestAntennaZ_ = 1.5, distCST_ = 89.8
    SORTING LISTS ...DONE!
    NS EXITING...

    i checked the leach.err

    INITIALIZE THE LIST xListHead
    SORTING LISTS ...DONE!

    Is the installation successful.?.How can i see the animation of the simulation ?..How can I run other scripts with different scenarios. ?

    Thanks and regards


    ReplyDelete
    Replies
    1. Hi,

      Yeh, Your installation is successful.. now go to "leach.out" for results! the file contains the trace of the Protocol... use the file for your result analysis...

      the protocol generates a "nam" file run the nam file to see the animation of the simulation. to run the scripts under different scenarios, edit the corresponding tcl scripts and include your new TCL code and run it by recompiling it .

      Thanks
      Hema :-)

      Delete
  4. thank you very much sir,I am really sorry to ask the following questions.. i found the results in the leach.out file, but i didnt understand which file got executed,,i didnt find nam file also..i found the nam and trace file for the tcl file wireless-demo-csci694.tcl..which file i have to modify and execute under different scenarios? Could you please specify it? Please help me.

    ReplyDelete
  5. hello sir..
    i have fallowed your instructions for setup till

    Edit both “Makefile” & “Makefile.in” as following:
    CC = gcc-4.3
    CPP = g++-4.3

    Once the above steps are done, run the following commands in the Terminal:
    ./configure

    but after this if i try "make clean" commond
    i am getting the following error

    make: *** No rule to make target `tcp/linux/tcp_naivereno.cc', needed by `depend'. Stop.

    so i have edited makefile as per the instrustion given in

    http://ramakrishnamundugar.blogspot.in/2013/04/error-while-adding-new-protocol-in-ns2-2.html?showComment=1366972986242#c8605587901421579554

    after ./configue... i am getting the following error

    makefile:348: *** Commands Commence before first target. stop.

    please help me out... my project deadline is nearing.
    thank you

    ReplyDelete
  6. Hi,

    Apologies for late reply as i was out of station.

    In my NS, under the TCL forlder there is no folder nammed, "LINUX".. as well as not in the leach patch as well.

    What is the version of NS you are using... the above one is working fine in NS 2.35, you can have a try.

    Just follow the steps carefully while installing the protocol.. all the best... :)

    ReplyDelete
  7. Sir, thank you for your valuable post. I followed your step ns make was successful. when i did ./leach-test i didn't get any message at the terminal, but when i opened the leach.err i got the following error,
    couldn't read file "tcl/lib/ns-mobilenode.tcl": no such file or directory
    while executing
    "source.orig tcl/lib/ns-mobilenode.tcl"
    ("uplevel" body line 1)
    invoked from within
    "uplevel source.orig [list $fileName]"
    invoked from within
    "if [$instance_ is_http_url $fileName] {
    set buffer [$instance_ read_url $fileName]
    uplevel eval $buffer
    } else {
    uplevel source.orig [list $fileName]
    ..."
    (procedure "source" line 8)
    invoked from within
    "source tcl/lib/ns-mobilenode.tcl"
    (file "tcl/ex/wireless.tcl" line 184

    leach.tr trace file got generated,

    s 0.000071903 _30_ AGT --- 0 rca 2 [0 1e000000 0 0] ------- [A 30 -1 -1]
    s 0.000073477 _25_ AGT --- 1 rca 2 [0 19000000 0 0] ------- [A 25 -1 -1]
    s 0.000148575 _52_ AGT --- 2 rca 2 [0 34000000 0 0] ------- [A 52 -1 -1]

    Can you please tell me What is the meaning of "[A 30 -1 -1]" .

    Thanks in advance

    ReplyDelete
    Replies
    1. you go to the cmu-trace.cc in the trace folder and check what they are actually tracing. from there you can get an brief idea about the trace result

      Delete
  8. hello sir

    i am using LEACH protocol in ns2 i need tcl script for cluster formation plz help me.

    my email-id hemanth9695@gmail.com

    ReplyDelete
    Replies
    1. i am doing my project on wsn using leach protocol, did u get any tcl file for cluster formation if possible please forward it to me.......i am totally stuck in my project and the last is already near...
      plz help me out.

      kumar ashish(nishu.jss@gmail.com)

      Delete
  9. Hello Sir. First tanks for this great tutorial. My Problem is that when i start ./leach_test i get this Message in leach.err

    opened the leach.err i got the following error,
    couldn't read file "tcl/lib/ns-mobilenode.tcl": no such file or directory
    while executing
    "source.orig tcl/lib/ns-mobilenode.tcl"
    ("uplevel" body line 1)
    invoked from within
    "uplevel source.orig [list $fileName]"
    invoked from within
    "if [$instance_ is_http_url $fileName] {
    set buffer [$instance_ read_url $fileName]
    uplevel eval $buffer
    } else {
    uplevel source.orig [list $fileName]
    ..."
    (procedure "source" line 8)
    invoked from within
    "source tcl/lib/ns-mobilenode.tcl"
    (file "tcl/ex/wireless.tcl" line 184).

    Tnkx for ur reply.

    ReplyDelete
    Replies
    1. Hi,
      Thank you for your comment.
      The problem may be due to the missing of the ns-mobilenode.tcl file.
      from the ns 2.31 folder you just traverse tcl/lib/ folder and check is there any file named with ns-mobilenode.tcl or not.
      If file is present then just go to the ./leach_test and check it's code carefully.

      all the best

      Delete
    2. tank you for replying i changed the place of the file into ns-allinone-2.34/ns-2.34/ and it run. tanks so much for answering. but the problem that i don't know how to use the file leach.out to visualize the result? if you can help me i'm little beginner in leach protocol.

      Many tanks.

      Delete
    3. couldn't read file "tcl/lib/ns-mobilenode.tcl": no such file or directory
      while executing
      "source.orig tcl/lib/ns-mobilenode.tcl"
      ("uplevel" body line 1)
      invoked from within
      "uplevel source.orig [list $fileName]"
      invoked from within
      "if [$instance_ is_http_url $fileName] {
      set buffer [$instance_ read_url $fileName]
      uplevel eval $buffer
      } else {
      uplevel source.orig [list $fileName]
      ..."
      (procedure "source" line 8)
      invoked from within
      "source tcl/lib/ns-mobilenode.tcl"
      (file "tcl/ex/wireless.tcl" line 184)

      help me

      Delete
    4. Please refer the above comments and follow it..

      Delete
  10. Hi,

    i am also getting the same error while running the wireless.tcl

    couldn't read file "tcl/lib/ns-mobilenode.tcl": no such file or directory
    while executing
    "source.orig tcl/lib/ns-mobilenode.tcl"
    ("uplevel" body line 1)
    invoked from within
    "uplevel source.orig [list $fileName]"
    invoked from within
    "if [$instance_ is_http_url $fileName] {
    set buffer [$instance_ read_url $fileName]
    uplevel eval $buffer
    } else {
    uplevel source.orig [list $fileName]
    ..."
    (procedure "source" line 8)
    invoked from within
    "source tcl/lib/ns-mobilenode.tcl"
    (file "tcl/ex/wireless.tcl" line 184).

    and i tried whatever you have the solution like to check the ns-mobilenode.tcl file, its there in the same place but still i am getting the same error.plz rectify it..

    thanx for your reply

    ReplyDelete
  11. Dear Sir, I am working NS 2.34 in ubuntu 12.04 and i need your help to install leach with my ns2. i followed the steps but i got some warning at ./configure and at make also some warnings. and where those leach_test.err and leach_test.out file will be available and i cant found any file in ns2.34 folder. please help me in this regard and also tell me how to use leach_test.out file to view the simulation. becuause if i give nam leach_test.out means it shows some output.

    ReplyDelete
    Replies
    1. you can ignore the warnings.... for the time being...
      You will get the 2 files in the following folder
      "/ns-allinone-2.34/ns-2.34/ns-234-leach/mit/leach_sims"

      Delete
  12. Dear sir,i am working NS2.34 in ubuntu and when i check leach.tr file is empty why ?

    ReplyDelete
    Replies
    1. Have you checked leach.err, if there is any error, then you will get and empty trace file..

      Thank you..

      Delete
    2. thanks sir for your reply,when i use this command ns wireless.tcl -x1000 -y1000 i have :
      ns wireless.tcl -x1000 -y1000
      Usage: wireless.tcl
      mandatory arguments:
      [-x MAXX] [-y MAXY]
      optional arguments:
      [-cp conn pattern] [-sc scenario] [-nn nodes]
      [-seed seed] [-stop sec] [-tr tracefile]

      and when i check leach.tr is empty.
      thans you

      Delete
    3. You should run " ./leach_test" in the terminal. then check the leach error. If you get any error, please fix it and repeat the process.

      If there is no error, the following will be printed in the leach.err.
      "INITIALIZE THE LIST xListHead
      SORTING LISTS ...DONE!

      This means, your simulation is successful. Now got to leach.tr for the trace.

      Thank you.. :)

      Delete
    4. Dear sir .thanks for your steps .leach.err file in ok but i didn't find leach.tr file. Pls help from where i will find it for result analysis.thanks

      Delete
  13. Hi,

    Greetings!

    I have a question regarding MIT uAMPS project, I am unable to execute this project by LEACH ns-2.34, I am getting some errors, and somehow i figured it out while reading your earlier suggestions or comments. Now, i am getting this following errors, i was unable to clear this. Could you please suggest me to clear this, please take a look at the errors.

    Error 1: on Ubuntu terminal
    @ubuntu:~/ns-allinone-2.34/ns-2.34$ ./leach_test
    Usage: tcl/ex/wireless.tcl
    mandatory arguments:
    [-x MAXX] [-y MAXY]
    optional arguments:
    [-cp conn pattern] [-sc scenario] [-nn nodes]
    [-seed seed] [-stop sec] [-tr tracefile]

    Error 2: on leach.err file
    ./leach_test: line 38: -sc: command not found

    Best Regards,
    KSR.

    ReplyDelete
  14. hi sir, i am implementing k-means clustring in wsn by centralised clustering as well as in distributed clustering in ns-2 but not getting how to select the nodes

    ReplyDelete
  15. Hello Sir...

    Thanks a lot for this tutorial....it is really helpful...

    i have installed NS-2.34 on Ubuntu 12.04 gcc-4.6
    i have configured LEACH protocol....
    at the end when i give ./test command it gives me the following error:

    bash: ./test: Permission denied

    when i run ./leach_test command at terminal....it gives me nothing ...but when i opened leach.err file it had following contents:

    INITIALIZE THE LIST xListHead
    SORTING LISTS ...DONE!


    (1) is this means i have successfully configured LEACH in ns-2.34???

    (2) how can i run the animation for LEACH????

    Please help !!!

    ReplyDelete
    Replies
    1. Greetings..!!

      1) Yeh, You have successfully configured LEACH. Your simulation is traced in "leach.tr". Now, open the file for trace content.

      2)For this, there is no animation trace.

      Thank You.. :)

      Delete
  16. Thanks Sir your your tutorial, it's very helpful for me.
    When I opened leach.out file, I got the message and I think I should change from dst_ to dst_addr_.
    Is it correct or not. How can I set dst_port_
    The message is:
    Warning dst_ is no longer being supported in NS. dst_ 0xffffffff
    Use dst_addr_ and dst_port_ instead

    Please help

    ReplyDelete
    Replies
    1. Hi, if your simulation setup is successful, then a success message will be placed in the leatch.out file.

      If you receive the success message, them just negative to folder, where "leach.tr" is present. The Leach.tr file contains the trace result of the simulation.

      Else, there is some thing wrong in the setup. Please go through the steps carefully.

      Thank you

      Delete
    2. Thanks for your reply.
      In leach.out, I got the message:
      BS Received data 52 , 539.3831480827514 from 52 at time 540.77788834263151
      This represents data from nodes: 24
      Node 24 is DEAD!!!!
      Node 99 is DEAD!!!!

      At 540.80000000005441:
      Total Energy = 377.94908675965144
      Total Data = 54221
      Total Alive = 4

      Simulation complete.

      I hope that based on the above results, it has already worked well, am I right ?
      But in the file : leach.tr , I got the message:
      M 27.60000 100 (50.00, 175.00, 0.00), (0.00, 0.00), 0.00
      r 27.631596267 _69_ AGT --- 3592 rca 4016 [0 5c000000 ffff0008 0] ------- [r 92 69 -1]
      s 27.632858273 _90_ AGT --- 3593 rca 4016 [0 5a000000 0 0] ------- [s 90 69 -1]
      s 27.659546061 _66_ AGT --- 3594 rca 4016 [0 42000000 0 0] ------- [s 66 10 -1]

      From the above output, how to read / analyze the results ?
      I also read the paper from Prof. Wendi Heinzelman i.e. An Application-Specific Protocol Architecture for Wireless Microsensor Networks.
      From the experiment result of the paper, how can I get the graph (like Optimum Number of Clusters) from the above result in leach.tr ?
      Do I need awk file to parse data from leach.tr ?
      Thank you very much and please help.

      Delete
    3. Yeh, the protocol is working well.
      The format for the leach.tr file is specified in "cmutrace.cc" file of NS or you may find it separately in the leach patch as well. Yes, you require awk or perl script to get the required result from the trace file. Once the results are obtained, you can plot the hraph using xGraph or any similar utility.

      Thank you..!!

      Delete
    4. Thanks for your information.
      Do you have a sample of awk or perl script to get the data from leach.tr ?

      Thank you

      Delete
    5. No, i don't have any script file to process leach.tr file.
      But you can get the script files to process the trace files in the web, just make changes according to your need. Thank you.

      Delete
    6. thank you very much Sir for your information.
      It's valuable information for me.

      Thank you.

      Delete
    7. I already got the result by using matlab cause I'm not familiar with awk, but when I run the simulation, it gives me different result with Heinzelman's paper.
      I made 5 experiments based on Heinzelman's paper:
      1. Number of clusters vs average energy dissated per round (J).
      It gives the same result.

      2. Time(s) vs Number of data signals received at the base station.
      It gives the same result.

      3. Energy(J) vs Number of data signals received at base station
      Leach is the same result but Leach-c is worse.

      4. Time(s) vs number of nodes alive
      Leach is the same result but Leach-c is worse.

      5. Number of data items received at BS vs number of nodes alive.
      Leach is the same result but Leach-c is worse.

      Do you any suggestion for me regarding my result of simulation ?
      Please help me.
      Thank you for your attention.

      Delete
    8. Dear Zen hadi,
      I hope that you will be fine. I am working on LEACH and need the simulation results as you did.I shall be very grateful if you share that graphs and their codes with me. Please...

      my id is: mykpk.pk@gmail.com

      Delete
  17. Hello sir

    I am using ubuntu 12.04 and ns-2.34
    And want to integrate LEACH, but as usual errors regarding Resource/Energy...

    Is it compulsory to have gcc-4.3?
    If not, then i followed the steps given in your blog except for gcc-4.3 updates, but i am getting this error

    invalid command name "Resource/Energy"
    while executing
    "Resource/Energy instproc setParams {args} {
    $self instvar energyLevel_ alarmLevel_
    set energyLevel_ [lindex $args 0]
    set alarmLevel_ [lind..."
    (file "/home/manjula/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl" line 11)
    invoked from within
    "source.orig /home/manjula/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl"
    ("uplevel" body line 1)
    invoked from within
    "uplevel source.orig [list $fileName]"
    invoked from within
    "if [$instance_ is_http_url $fileName] {
    set buffer [$instance_ read_url $fileName]
    uplevel eval $buffer
    } else {
    uplevel source.orig [list $fileName]
    ..."
    (procedure "source" line 8)
    invoked from within
    "source /home/manjula/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl"
    (file "mit/uAMPS/sims/uamps.tcl" line 31)
    invoked from within
    "source.orig mit/uAMPS/sims/uamps.tcl"
    ("uplevel" body line 1)
    invoked from within
    "uplevel source.orig [list $fileName]"
    invoked from within
    "if [$instance_ is_http_url $fileName] {
    set buffer [$instance_ read_url $fileName]
    uplevel eval $buffer
    } else {
    uplevel source.orig [list $fileName]
    ..."
    (procedure "source" line 8)
    invoked from within
    "source mit/uAMPS/sims/uamps.tcl"
    (file "tcl/mobility/leach.tcl" line 18)
    invoked from within
    "source.orig tcl/mobility/leach.tcl"
    ("uplevel" body line 1)
    invoked from within
    "uplevel source.orig [list $fileName]"
    invoked from within
    "if [$instance_ is_http_url $fileName] {
    set buffer [$instance_ read_url $fileName]
    uplevel eval $buffer
    } else {
    uplevel source.orig [list $fileName]
    ..."
    (procedure "source" line 8)
    invoked from within
    "source tcl/mobility/$opt(rp).tcl"
    (file "tcl/ex/wireless.tcl" line 187)

    Please help me out.
    Regards
    Manjula

    ReplyDelete
    Replies
    1. Hi,

      Yes, is it compulsory to have gcc-4.3 or higher. If you do not have it, please update it and follow the aforesaid procedures carefully.

      Thank you..!!

      Delete
    2. No not yet. The same problem persists even with ubuntu 14.04 and ns-allinone-2.35

      Delete
  18. getting this error when the command "make depend"
    "emulate/net-pcap.cc:64:18: fatal error: pcap.h: No such file or directory
    compilation terminated."

    ReplyDelete
    Replies
    1. Hi,
      Instal the NS carefully and follow the aforesaid steps for installing leach patch... It will work perfectly. The error is mainly due to missing of the file.

      Thanks

      Delete
  19. Sir, I installed leach following steps but in leach.out i get some warnings like
    0: Warning!!! No Cluster Head ADVs were heard!
    Data being sent to the Base Station
    Data was sent to the base station
    1: Warning!!! No Cluster Head ADVs were heard!
    Data being sent to the Base Station
    Data was sent to the base station
    2: Warning!!! No Cluster Head ADVs were heard!
    Data being sent to the Base Station
    Data was sent to the base station
    3: Warning!!! No Cluster Head ADVs were heard!
    Data being sent to the Base Station
    Data was sent to the base station
    4: Warning!!! No Cluster Head ADVs were heard!
    Data being sent to the Base Station
    Data was sent to the base station
    5: Warning!!! No Cluster Head ADVs were heard!
    Data being sent to the Base Station
    Data was sent to the base station
    6: Warning!!! No Cluster Head ADVs were heard!
    Data being sent to the Base Station
    Data was sent to the base station
    ....
    .
    ....
    .
    .
    .
    .
    99: Warning!!! No Cluster Head ADVs were heard!
    Data being sent to the Base Station
    Data was sent to the base station
    also
    total data is found to be 0

    ReplyDelete
    Replies
    1. @Kasi, I got the same problem as well.
      As I learn, this means the LEACH protocol never proceeds successfully to even form the cluster (yes, the CHs are there though).

      If you check the folder ns-2.34/mit/leach_sims, there will be only 1 TDMA schedule file produced every time you launch the simulation (only the TDMAschedule.0.txt).

      If the simulation runs properly, there should be twenty-something TDMAschedule.xxx.txt files. Where those files are produced every 20 seconds (according to the system parameter in the script, 1 round takes 20 seconds).

      I'm working on it to find the solution. Please share if you got any.

      Regards,
      LEACH lover

      Delete
  20. Hello;
    When I simulate wireless.tcl I have this error:
    cheima@hajlaoui-PC:~/ns-allinone-2.34/ns-2.34/ns-234-leach/tcl/ex$ ns wireless.tcl
    couldn't open "leach.tr": permission denied
    while executing
    "open leach.tr w"
    invoked from within
    "set tracefd [open leach.tr w]"
    (file "wireless.tcl" line 218)
    Please help me. thx

    ReplyDelete
  21. In the leach.err:
    no such variable
    (read trace on "env(RCA_LIBRARY)")
    invoked from within
    "source $env(RCA_LIBRARY)/ns-ranode.tcl"
    (file "mit/uAMPS/sims/uamps.tcl" line 9)
    invoked from within
    "source.orig mit/uAMPS/sims/uamps.tcl"
    ("uplevel" body line 1)
    invoked from within
    "uplevel source.orig [list $fileName]"
    invoked from within
    "if [$instance_ is_http_url $fileName] {
    set buffer [$instance_ read_url $fileName]
    uplevel eval $buffer
    } else {
    uplevel source.orig [list $fileName]
    ..."
    (procedure "source" line 8)
    invoked from within
    "source mit/uAMPS/sims/uamps.tcl"
    (file "/home/cheima/ns-allinone-2.34/ns-2.34/tcl/mobility/leach.tcl" line 18)
    invoked from within
    "source.orig /home/cheima/ns-allinone-2.34/ns-2.34/tcl/mobility/leach.tcl"
    ("uplevel" body line 1)
    invoked from within
    "uplevel source.orig [list $fileName]"
    invoked from within
    "if [$instance_ is_http_url $fileName] {
    set buffer [$instance_ read_url $fileName]
    uplevel eval $buffer
    } else {
    uplevel source.orig [list $fileName]
    ..."
    (procedure "source" line 8)
    invoked from within
    "source /home/cheima/ns-allinone-2.34/ns-2.34/tcl/mobility/$opt(rp).tcl"
    (file "tcl/ex/wireless.tcl" line 187)
    What is mean that?

    ReplyDelete
  22. hello sir, i hv followed the steps bt i got following error
    trace/cmu-trace.cc:1531: error: stray ‘\342’ in program
    trace/cmu-trace.cc:1531: error: stray ‘\200’ in program
    trace/cmu-trace.cc:1531: error: stray ‘\230’ in program
    trace/cmu-trace.cc:1531: error: stray ‘\342’ in program
    trace/cmu-trace.cc:1531: error: stray ‘\200’ in program
    trace/cmu-trace.cc:1531: error: stray ‘\231’ in program
    trace/cmu-trace.cc:1535: error: stray ‘\342’ in program
    trace/cmu-trace.cc:1535: error: stray ‘\200’ in program
    trace/cmu-trace.cc:1535: error: stray ‘\230’ in program
    trace/cmu-trace.cc:1535: error: stray ‘\342’ in program
    trace/cmu-trace.cc:1535: error: stray ‘\200’ in program
    trace/cmu-trace.cc:1535: error: stray ‘\231’ in program
    trace/cmu-trace.cc:1539: error: stray ‘\342’ in program
    trace/cmu-trace.cc:1539: error: stray ‘\200’ in program
    trace/cmu-trace.cc:1539: error: stray ‘\230’ in program
    trace/cmu-trace.cc:1539: error: stray ‘\342’ in program
    trace/cmu-trace.cc:1539: error: stray ‘\200’ in program
    trace/cmu-trace.cc:1539: error: stray ‘\231’ in program
    trace/cmu-trace.cc: In member function ‘void CMUTrace::format_rca(Packet*, int)’:
    trace/cmu-trace.cc:1531: error: ‘A’ was not declared in this scope
    trace/cmu-trace.cc:1535: error: ‘R’ was not declared in this scope
    trace/cmu-trace.cc:1539: error: ‘D’ was not declared in this scope
    make: *** [trace/cmu-trace.o] Error 1
    please give me instruction to remove these errors

    ReplyDelete
  23. Hello sir,

    I'm Sunil, i need help in implementing trust model (i.e, Giving trust value for every nodes) in clustering of WSN. can u please send me some materials and codes which will be helpful to implement.

    Thanks in advance.

    Mail me at: sungowda2008@gmail.com

    ReplyDelete
  24. hello sir

    I have followed all you steps for configuring and installing leach with ns2.34
    Now one Qs is I got two folders in my /ns-allinone-2.34/ns-2.34: one is /mit and other one is /ns-234-leach/mit
    Are both folders required to be retained or only one of them is to be retained and if one than which one.
    Second Qs is leach.err file in /mit/leach_sims folder is showing number of errors but leach.err in /ns-2.34/mit/leach_sims is showing successful execution of ./leach_test or ./test. Why results of both of these files are different
    Third Qs is I am not having any leach.tr file available in my PC...... What is the reason?

    Please help.........

    ReplyDelete
  25. when i m running leach.out file i get this on terminal

    yaksh@yaksh007:~/ns-allinone-2.34/ns-2.34/mit/leach_sims$ ./leach.out
    ./leach.out: line 1: Creating: command not found
    ./leach.out: line 2: syntax error near unexpected token `('
    ./leach.out: line 2: `0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 (100 == BS)'

    plz help me out for this error

    ReplyDelete
  26. invalid command name "Resource/Energy"
    while executing
    "Resource/Energy instproc setParams {args} {
    $self instvar energyLevel_ alarmLevel_
    set energyLevel_ [lindex $args 0]
    set alarmLevel_ [lind..."
    (file "/home/saurabh/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl" line 11)
    invoked from within
    "source.orig /home/saurabh/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl"
    ("uplevel" body line 1)
    invoked from within
    "uplevel source.orig [list $fileName]"
    invoked from within
    "if [$instance_ is_http_url $fileName] {
    set buffer [$instance_ read_url $fileName]
    uplevel eval $buffer
    } else {
    uplevel source.orig [list $fileName]
    ..."
    (procedure "source" line 8)
    invoked from within
    "source /home/saurabh/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl"
    (file "mit/uAMPS/sims/uamps.tcl" line 29)
    invoked from within
    "source.orig mit/uAMPS/sims/uamps.tcl"
    ("uplevel" body line 1)
    invoked from within
    "uplevel source.orig [list $fileName]"
    invoked from within
    "if [$instance_ is_http_url $fileName] {
    set buffer [$instance_ read_url $fileName]
    uplevel eval $buffer
    } else {
    uplevel source.orig [list $fileName]
    ..."
    (procedure "source" line 8)
    invoked from within
    "source mit/uAMPS/sims/uamps.tcl"
    (file "tcl/mobility/leach.tcl" line 18)
    invoked from within
    "source.orig tcl/mobility/leach.tcl"
    ("uplevel" body line 1)
    invoked from within
    "uplevel source.orig [list $fileName]"
    invoked from within
    "if [$instance_ is_http_url $fileName] {
    set buffer [$instance_ read_url $fileName]
    uplevel eval $buffer
    } else {
    uplevel source.orig [list $fileName]
    ..."
    (procedure "source" line 8)
    invoked from within
    "source tcl/mobility/$opt(rp).tcl"
    (file "tcl/ex/wireless.tcl" line 187)

    m getting errors in my leach.err file in /mit/leach_sims folder
    Can you please guide how to remove these errors.........
    I hope this may be the reason for non availability of leach.tr file

    ReplyDelete
  27. I am trying to run leach protocol on ns2.34 using ubuntu 10.04 as platform.
    I get an error when i try to execute the code leach_test, after entering the right path (/home/shaftri/ns-allinone-2.34/ns-2.34/ns-234-leach/)
    i give the command ./leach_test i get the error in the file leach.err as this

    couldn't read file "tcl/lib/ns-mobilenode.tcl": no such file or directory
    while executing
    "source.orig tcl/lib/ns-mobilenode.tcl"
    ("uplevel" body line 1)
    invoked from within
    "uplevel source.orig[list $fileName]"
    invoked from within
    "if [$instance_ is_http_url $fileName] {
    set buffer [$instance_ read_url $fileName]
    uplevel eval $buffer
    } else {
    uplevel source.orig[list $fileName]
    ..."
    (procedure "source" line 8)
    invoked from within
    "source tcl/lib/ns-mobilenode.tcl"
    (file "tcl/ex/wireless.tcl" line 184)

    Which is this file mobilenode.tcl which has been referred to ?? i tried running the file "test" also but i get the error as this:

    couldn't read file "wireless-demo-csci694.tcl": no such file or directory

    Why does this happen?? And how can i get the nam to run for leach protocol.
    Please guide me as i am a little confused about how to get the outputs .

    Regards
    shaftri

    ReplyDelete
    Replies
    1. Hi,
      Make sure you have ns-mobilenode.tcl in the "tcl/lib/" directory of the ns folder.
      The problem is due to missing of the above stated file.

      Delete
  28. I have a problem during installation of leach,
    when I execute the command: ./configure
    it shows me:
    checking for gcc... gcc
    checking for C compiler default output file name... a.out
    checking whether the C compiler works... yes
    checking whether we are cross compiling... no
    checking for suffix of executables...
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ISO C89... none needed
    checking how to run the C preprocessor... gcc -E
    checking for grep that handles long lines and -e... /usr/bin/grep
    checking for egrep... /usr/bin/grep -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking minix/config.h usability... no
    checking minix/config.h presence... no
    checking for minix/config.h... no
    checking whether it is safe to define __EXTENSIONS__... yes
    No .configure file found in current directory
    Continuing with default options...
    checking build system type... i686-pc-linux-gnu
    checking host system type... i686-pc-linux-gnu
    checking target system type... i686-pc-linux-gnu
    checking for gcc... (cached) gcc
    checking whether we are using the GNU C compiler... (cached) yes
    checking whether gcc accepts -g... (cached) yes
    checking for gcc option to accept ISO C89... (cached) none needed
    checking for g++... g++
    checking whether we are using the GNU C++ compiler... yes
    checking whether g++ accepts -g... yes
    checking for ANSI C header files... (cached) yes
    checking for string.h... (cached) yes
    checking for main in -lXbsd... no
    checking for socket in -lsocket... no
    checking for gethostbyname in -lnsl... yes
    checking for dcgettext in -lintl... no
    checking for getnodebyname in -ldnet_stub... no
    checking that g++ can handle -O2... no
    checking if C++ libraries work without any namespace... no
    checking if C++ libraries work with namespace std... yes
    checking if STL works without any namespace... no
    checking if STL works with namespace std... yes
    checking should use STL... yes
    checking for tcl.h... -I../include
    checking for tclInt.h... -I../include
    checking for libtcl8.4... -L../lib -ltcl8.4
    checking for init.tcl... ../lib/tcl8.4
    checking for http.tcl... ../lib/tcl8.4/http1.0
    checking Tcl http.tcl library... yes
    checking for tclsh8.4.18... no
    checking for tclsh8.4... ../bin/tclsh8.4
    checking for tk.h... -I../include
    checking for libtk8.4... -L../lib -ltk8.4
    checking for tk.tcl... ../lib/tk8.4
    checking for otcl.h... -I../otcl
    checking for libotcl1.13... -L../otcl -lotcl
    checking for tclcl.h... -I../tclcl-1.19
    checking for libtclcl... -L../tclcl-1.19 -ltclcl
    checking for tcl2c++... ../tclcl-1.19
    checking for X11 header files
    can't find X includes
    and when i execute the comand: make
    i have this error: ./config.h:60:19: erreur fatale: tclcl.h : Aucun fichier ou dossier de ce type
    compilation terminée.
    make: *** [tools/random.o] Erreur 1
    please help I will be very grateful,I'm stuck for a few days please help!

    ReplyDelete
    Replies
    1. Please do reply....

      Delete
    2. Hi,
      I have installed the same before posting it in the blog. However, i have never encountered such kind of errors.
      BTW, what is the OS and NS version you are using... Please reply.
      Also install the same by following the above stated procedure one more time .

      Thank you...

      Delete
    3. Thank you, the OS is mageai and version of ns is 2.34!

      Delete
  29. Sir I have NS2.35 with ubuntu 13.04.. Can I try the above mentioned Procedure of patching LEACH with this configuration too???
    Thanks and Regards.

    ReplyDelete
    Replies
    1. Hi,
      Yes, you can try with the aforementioned configurations. However, i have tested the patch with configuration mentioned in the post.

      All the best.. :)

      Delete
  30. hey
    Do you have any idea how to change trace file format to newtrace and also how to set DATA to our user generated data ( e.g. video traces) in leach with ns2.34.

    ReplyDelete
  31. sir,
    I didn't find the leach.tr file in the ns2.34 directory ?
    plz help me sir
    when i executing the ns wireless.tcl I am getting the follwoing error message
    couldn't read file "tcl/lib/ns-mobilenode.tcl": no such file or directory
    while executing
    "source.orig tcl/lib/ns-mobilenode.tcl"
    ("uplevel" body line 1)
    invoked from within
    "uplevel source.orig [list $fileName]"
    invoked from within
    "if [$instance_ is_http_url $fileName] {
    set buffer [$instance_ read_url $fileName]
    uplevel eval $buffer
    } else {
    uplevel source.orig [list $fileName]
    ..."
    (procedure "source" line 8)
    invoked from within
    "source tcl/lib/ns-mobilenode.tcl"
    (file "wireless.tcl" line 184)



    ReplyDelete
  32. hello sir,
    while executing make command i shows following error
    mac/ll.cc:244:13: error: redefinition of ‘void LL::hdr_dst(Packet*, int)’
    inline void LL::hdr_dst(Packet *, int)
    ^
    In file included from ./mac/mac.h:47:0,
    from mac/ll.cc:43:
    ./mac/ll.h:99:22: error: ‘virtual void LL::hdr_dst(Packet*, int)’ previously defined here
    inline virtual void hdr_dst(Packet *p, int macDA) {}
    ^
    make: *** [mac/ll.o] Error 1


    please give me the solution for this.i have installed ns2.35 on ubuntu 14.04..

    ReplyDelete
  33. Hello sir,
    As per the above steps i have tried to install Leach on ns2.34 ubuntu 10.04. I have made all the changes mentioned to all the files said. Even ns-234-leach folder has got created inside ns-allinone-2.34 folder inside home folder. But .o, .h and .cc files are not getting included inside ns-234-leach folder and Makefile as well. And i am getting the following error inside leach.err (/home/username/ns-allinone-2.34/ns-2.34/mit/leach_sims/leach.err)file:
    can't read "opt(hdr_size)": no such element in array
    while executing
    "expr $opt(hdr_size) + 4"
    invoked from within
    "TxTime [expr $opt(hdr_size) + 4]"
    invoked from within
    "set opt(ra_adv) [TxTime [expr $opt(hdr_size) + 4]] "
    (file "tcl/mobility/leach.tcl" line 23)
    invoked from within
    "source.orig tcl/mobility/leach.tcl"
    ("uplevel" body line 1)
    invoked from within
    "uplevel source.orig [list $fileName]"
    invoked from within
    "if [$instance_ is_http_url $fileName] {
    set buffer [$instance_ read_url $fileName]
    uplevel eval $buffer
    } else {
    uplevel source.orig [list $fileName]
    ..."
    (procedure "source" line 8)
    invoked from within
    "source tcl/mobility/$opt(rp).tcl"
    (file "tcl/ex/wireless.tcl" line 187)

    So my question is why are .o .h and .cc files not getting created in the appropriate folders and even after following the steps mentioned above i am not able to install leach. Please help me out.

    ReplyDelete
    Replies
    1. During the installation give the correct path..
      for ex:
      **********************************************
      #source $env(RCA_LIBRARY)/ns-ranode.tcl
      source /hema/home/ns-allinone-2.35-RC4/ns-2.35/mit/rca/ns-ranode.tcl
      *****************************************
      here "hema" is my username, for your case change it with your username... similarly for all others......
      The above procedure working fine for me under fedora 14....

      In your case, it seems the problem is with your path settings

      Delete
    2. Hi sir,
      Thanks, i could get rid of the error but still .o, .h .c files are not getting created in ns-234-leach folder. could u please help.And can please mention the list of files inside leach_sims, rca and uAMPS folder.

      Delete
    3. I am not getting what you mean by ".o, .h .c files are not getting created". If you follow the above procedure carefully, thing works fine and worked for all. Currently, I am no longer working on Leach or WSN, and the patch is also not installed in my PC anymore. The one assurance , i can give you is you just install from the scratch you will be able to solve the problems...

      --
      Hema

      Delete
  34. hi sir i got this error
    root@safaa-XPS-L412Z:~/ns-allinone-2.34/ns-2.34# bash ./test
    num_nodes is set 3
    warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
    INITIALIZE THE LIST xListHead
    Loading connection pattern...
    Loading scenario file...
    Starting Simulation...
    channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
    highestAntennaZ_ = 1.5, distCST_ = 550.0
    SORTING LISTS ...DONE!
    NS EXITING...
    ./test: ligne 7: ./leach_test: Aucun fichier ou dossier de ce type

    ReplyDelete
    Replies
    1. Sorry, i am not able to get what error you have exactly.. Please explain it more elaborately, so that i will be in a position to help you out..

      --
      Hema

      Delete
  35. hello sir ,
    i have successfully simulated Leach via mannsim on ns2.35. trace file is also generated. now the problem with the trace file is that it is not showing rca in the trace format.
    pl. help what should i change in the cmu-trace file.
    my trace file is looking as shown below.
    s -t 0.033653807 -Hs 9 -Hd -2 -Ni 9 -Nx 89.20 -Ny 37.53 -Nz 0.00 -Ne 10.000000 -Nl AGT -Nw --- -Ma 0 -Md 9000000 -Ms 0 -Mt 0 -Is 9.0 -Id -1.0 -It tcp -Il 1 -If 0 -Ii 0 -Iv 32 -Pn tcp -Ps 0 -Pa 0 -Pf 0 -Po 0
    r -t 0.033653807 -Hs 9 -Hd -2 -Ni 9 -Nx 89.20 -Ny 37.53 -Nz 0.00 -Ne 10.000000 -Nl RTR -Nw --- -Ma 0 -Md 9000000 -Ms 0 -Mt 0 -Is 9.0 -Id -1.0 -It tcp -Il 1 -If 0 -Ii 0 -Iv 32 -Pn tcp -Ps 0 -Pa 0 -Pf 0 -Po 0
    s -t 0.033653807 -Hs 9 -Hd -2 -Ni 9 -Nx 89.20 -Ny 37.53 -Nz 0.00 -Ne 10.000000 -Nl RTR -Nw --- -Ma 0 -Md 9000000 -Ms 0 -Mt 0 -Is 9.0 -Id -1.0 -It tcp -Il 1 -If 0 -Ii 0 -Iv 32 -Pn tcp -Ps 0 -Pa 0 -Pf 0 -Po 0
    s -t 0.033678807 -Hs 9 -Hd -2 -Ni 9 -Nx 89.20 -Ny 37.53 -Nz 0.00 -Ne 10.000000 -Nl MAC -Nw --- -Ma 0 -Md 9000000 -Ms ffff0008 -Mt 0 -Is 9.0 -Id -1.0 -It tcp -Il 21 -If 0 -Ii 0 -Iv 32 -Pn tcp -Ps 0 -Pa 0 -Pf 0 -Po 0
    N -t 0.033679 -n 1 -e 9.999998
    N -t 0.033679 -n 0 -e 99.999958
    N -t 0.033679 -n 10 -e 9.999998
    N -t 0.033679 -n 7 -e 9.999998
    N -t 0.033679 -n 3 -e 9.999998
    N -t 0.033679 -n 2 -e 9.999998
    N -t 0.033679 -n 6 -e 9.999998
    N -t 0.033679 -n 5 -e 9.999998
    N -t 0.033679 -n 8 -e 9.999998
    N -t 0.033679 -n 4 -e 9.999998

    ReplyDelete
  36. pl. help. i need the documentation of mannasim generated leach protocol as i am not able to understand the flow of leach code . i searched it out but dont find the interpretation of leach code.

    ReplyDelete
  37. I am getting str2addr error while executing leach in ns2.35. Kindly please suggest how to solve the error :/

    ReplyDelete
    Replies
    1. Do post the complete error, so that i can infer something out of it..

      Delete
  38. This comment has been removed by the author.

    ReplyDelete
  39. chinh@ubuntu:~$ cd /home/chinh/ns-allinone-2.35/2.35/
    bash: cd: /home/chinh/ns-allinone-2.35/2.35/: No such file or directory
    chinh@ubuntu:~$ cd /home/chinh/ns-allinone-2.34/ns-2.34/
    chinh@ubuntu:~/ns-allinone-2.34/ns-2.34$ clear
    chinh@ubuntu:~/ns-allinone-2.34/ns-2.34$ ./configure
    ./configure: line 1520: config.log: Permission denied
    ./configure: line 1530: config.log: Permission denied
    chinh@ubuntu:~/ns-allinone-2.34/ns-2.34$ make clean
    Makefile.in is newer than Makefile.
    You need to re-run configure.
    false
    make: *** [Makefile] Error 1
    chinh@ubuntu:~/ns-allinone-2.34/ns-2.34$ make depend
    Makefile.in is newer than Makefile.
    You need to re-run configure.
    false
    make: *** [Makefile] Error 1
    chinh@ubuntu:~/ns-allinone-2.34/ns-2.34$ make
    Makefile.in is newer than Makefile.
    You need to re-run configure.
    false
    make: *** [Makefile] Error 1
    chinh@ubuntu:~/ns-allinone-2.34/ns-2.34$


    ??????????
    ??///

    ReplyDelete
    Replies
    1. Hi,

      Each time you make changes in your Makefile.in, you are require to run the ./configure command to generate the new make file.

      Followed by this, you have execute the three make commands in super user mode.

      Hope this will work for you else just post your problem clearly. Thank you.!!

      Delete

  40. ha@ubuntu:~/ns-allinone-2.34/ns-2.34$ make depend
    make: *** No rule to make target `tcp/linux/tcp_naivereno.cc', needed by `depend'. Stop.




    help me?

    ReplyDelete
  41. This comment has been removed by the author.

    ReplyDelete
  42. I have installed leach and leach-c protocol but how to plot graph from leach.alive, leach.energy and leach.data file......
    And how to calculate network lifetime and remaining energy for both leach and leach-c protocol.

    ReplyDelete
  43. Hi friends,
    I​ want to apply k means clustering ​on leach ​protocol for WSN based in NS2 .
    I have leach protocol installed and the file kmeans.tcl but i don't know to apply it !!
    Please help me.
    Thank you very much.My email : haitam09@hotmail.fr

    ReplyDelete
  44. Hello sir,
    Can LEACH protocol gives energy of mobile nodes? means can i implement LEACH in MANET? only for energy purpose because it is protocol for wsn.

    ReplyDelete
  45. invalid command name "Resource/Energy"
    while executing
    "Resource/Energy instproc setParams {args} {
    $self instvar energyLevel_ alarmLevel_
    set energyLevel_ [lindex $args 0]
    set alarmLevel_ [lind..."
    (file "/home/pahuja/Desktop/ns-allinone-2.35/ns-2.35/mit/rca/resources/ns-energy-resource.tcl" line 11)
    invoked from within
    "source.orig /home/pahuja/Desktop/ns-allinone-2.35/ns-2.35/mit/rca/resources/ns-energy-resource.tcl"
    ("uplevel" body line 1)
    invoked from within
    "uplevel source.orig [list $fileName]"
    invoked from within
    "if [$instance_ is_http_url $fileName] {
    set buffer [$instance_ read_url $fileName]
    uplevel eval $buffer
    } else {
    uplevel source.orig [list $fileName]
    ..."
    (procedure "source" line 8)
    invoked from within
    "source /home/pahuja/Desktop/ns-allinone-2.35/ns-2.35/mit/rca/resources/ns-energy-resource.tcl"
    (file "mit/uAMPS/sims/uamps.tcl" line 18)
    invoked from within
    "source.orig mit/uAMPS/sims/uamps.tcl"
    ("uplevel" body line 1)
    invoked from within
    "uplevel source.orig [list $fileName]"
    invoked from within
    "if [$instance_ is_http_url $fileName] {
    set buffer [$instance_ read_url $fileName]
    uplevel eval $buffer
    } else {
    uplevel source.orig [list $fileName]
    ..."
    (procedure "source" line 8)
    invoked from within
    "source mit/uAMPS/sims/uamps.tcl"
    (file "/home/pahuja/Desktop/ns-allinone-2.35/ns-2.35/tcl/mobility/leach.tcl" line 18)
    invoked from within
    "source.orig /home/pahuja/Desktop/ns-allinone-2.35/ns-2.35/tcl/mobility/leach.tcl"
    ("uplevel" body line 1)
    invoked from within
    "uplevel source.orig [list $fileName]"
    invoked from within
    "if [$instance_ is_http_url $fileName] {
    set buffer [$instance_ read_url $fileName]
    uplevel eval $buffer
    } else {
    uplevel source.orig [list $fileName]
    ..."
    (procedure "source" line 8)
    invoked from within
    "source /home/pahuja/Desktop/ns-allinone-2.35/ns-2.35/tcl/mobility/$opt(rp).tcl"
    (file "./tcl/ex/wireless-leach.tcl" line 194)

    I am working on Fedora 16 with perfect ally installed ns-2.35. i am unable run ns-leach-2.35. pl provide the solution

    ReplyDelete
  46. invalid command name "Resource/Energy"
    while executing
    "Resource/Energy instproc setParams {args} {
    $self instvar energyLevel_ alarmLevel_
    set energyLevel_ [lindex $args 0]
    set alarmLevel_ [lind..."
    (file "/home/madhura/ns-allinone-2.35/ns-2.35/mit/rca/resources/ns-energy-resource.tcl" line 11)
    invoked from within
    "source.orig /home/madhura/ns-allinone-2.35/ns-2.35/mit/rca/resources/ns-energy-resource.tcl"
    ("uplevel" body line 1)
    invoked from within
    "uplevel source.orig [list $fileName]"
    invoked from within
    "if [$instance_ is_http_url $fileName] {
    set buffer [$instance_ read_url $fileName]
    uplevel eval $buffer
    } else {
    uplevel source.orig [list $fileName]
    ..."
    (procedure "source" line 8)
    invoked from within
    "source /home/madhura/ns-allinone-2.35/ns-2.35/mit/rca/resources/ns-energy-resource.tcl"
    (file "mit/uAMPS/sims/uamps.tcl" line 18)
    invoked from within
    "source.orig mit/uAMPS/sims/uamps.tcl"
    ("uplevel" body line 1)
    invoked from within
    "uplevel source.orig [list $fileName]"
    invoked from within
    "if [$instance_ is_http_url $fileName] {
    set buffer [$instance_ read_url $fileName]
    uplevel eval $buffer
    } else {
    uplevel source.orig [list $fileName]
    ..."
    (procedure "source" line 8)
    invoked from within
    "source mit/uAMPS/sims/uamps.tcl"
    (file "/home/madhura/ns-allinone-2.35/ns-2.35/tcl/mobility/leach.tcl" line 18)
    invoked from within
    "source.orig /home/madhura/ns-allinone-2.35/ns-2.35/tcl/mobility/leach.tcl"
    ("uplevel" body line 1)
    invoked from within
    "uplevel source.orig [list $fileName]"
    invoked from within
    "if [$instance_ is_http_url $fileName] {
    set buffer [$instance_ read_url $fileName]
    uplevel eval $buffer
    } else {
    uplevel source.orig [list $fileName]
    ..."
    (procedure "source" line 8)
    invoked from within
    "source /home/madhura/ns-allinone-2.35/ns-2.35/tcl/mobility/$opt(rp).tcl"
    (file "tcl/ex/wireless.tcl" line 187)

    I am getting the this error can anybody solve.... I am using ns.2.35 and gcc 4.8.4. please help

    ReplyDelete
  47. This comment has been removed by the author.

    ReplyDelete
  48. Hello sir I am facing an issue so its like
    First I installed ns-2,35 succesfully and installed mit leach patch as well
    then I ran the ./leach_test file with leach as alg
    I got the results for it
    But when I replaced the algorithm with leach-c. I didn't get any error but only nodes were created in the leach.out file. Simulation didn't start.
    So after reading a lot. I installed ns-2.34 with leach+pegasis-ns234-files-2.tar.gz patch.
    Now also when I am running leach as protocol it runs fine.
    but with leach-c as algo it generates incomplete results in leach-c.out and leach-c.alive,leach-c.energy and leach-c.data empty
    I have searched a lot for the solution but I am not able to find it. Sir Please help me, its very important. I will be highly obliged.

    ReplyDelete