LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-10-2013, 12:59 PM   #1
linuxUser123linux
LQ Newbie
 
Registered: Jul 2013
Posts: 22

Rep: Reputation: Disabled
Post LEACH connection pattern file


Why is

set opt(cp) "../mobility/scene/cbr-50-20-4-512" ;# connection pattern file

not working after installing LEACH on ns2.34?
 
Old 07-10-2013, 02:28 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
? May be the relative path is broken somewhere in the long chain .. ?

Suggest : Use an absolute path, like this example
Code:
set opt(cp) "/home/<name>/ns-allinone-2.34/ns-2.34/tcl/mobility/scene/cbr-50-20-4-512"
 
Old 07-10-2013, 04:50 PM   #3
linuxUser123linux
LQ Newbie
 
Registered: Jul 2013
Posts: 22

Original Poster
Rep: Reputation: Disabled
Post This works! Thanks a lot. But now have.

ns: _o26 send_now 0xffffffff 1 0 16 1084.0 1: wrong # args: should be "_o26 self class proc mac_dst link_dst type msg data_size dist code"
(Application/LEACH send_now line 1)
invoked from within
"_o26 send_now 0xffffffff 1 0 16 1084.0 1"
num_nodes is set 151
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 1737.5
 
Old 07-10-2013, 08:57 PM   #4
linuxUser123linux
LQ Newbie
 
Registered: Jul 2013
Posts: 22

Original Poster
Rep: Reputation: Disabled
Post Found solution

A weakness in the current clusterhead based algorithm is that it depends on a somewhat uniform sensor field to create the network topology.

http://ns2.blogspot.com/2004/07/prob...script-is.html
 
Old 08-14-2013, 03:34 AM   #5
ljmiller
LQ Newbie
 
Registered: Aug 2013
Posts: 3

Rep: Reputation: Disabled
Hi, I have the same problem.
ns: _o1130 send_now 0xffffffff 1 46 16 139.0 1: wrong # args: should be "_o1130 self class proc mac_dst link_dst type msg data_size dist code"
(Application/LEACH send_now line 1)
invoked from within
"_o1130 send_now 0xffffffff 1 46 16 139.0 1"

I wonder if your leach has worked or not, if it worked, what did you do to fix it? I have modified my wireless.tcl and leach_test by adding -cp as the URL above said, but it still cannot work. Would someone help?

Last edited by ljmiller; 08-14-2013 at 03:35 AM.
 
Old 08-21-2013, 04:44 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 5 .

Guessing : You are running ./test ?

Running "./test" :
Code:
$ cd ns-2.34/
$ export RCA_LIBRARY=/home/miller/ns-allinone-2.34/ns-2.34/mit/rca && export uAMPS_LIBRARY=/home/miller/ns-allinone-2.34/ns-2.34/mit/uAMPS && ./test
 
Old 08-22-2013, 08:41 PM   #7
ljmiller
LQ Newbie
 
Registered: Aug 2013
Posts: 3

Rep: Reputation: Disabled
Smile Reply #6

No, I'm running ./leach_test. Actually my original leach_test works well when using wireless.tcl copyed from ns2.27, but I have modified the wireless.tcl for some reason, and I got this error. So I'm wondering if it's the wireless.tcl's problem. My leach_test is as following, please help me check it and if you need to see the wireless.tcl maybe I can send in email. Thanks a lot.

Code:
#!/bin/bash
# This file runs a generic LEACH protocol simulation.

#This is the algorithm that we are going to run.
alg=leach

#dirname, filename =  
#   The directory and filename that we want our output to be written.
dirname="mit/leach_sims"
filename=$alg

#Topology
#  This file is the scenario that we are going to run.
#  This file can be editted manually if you are very careful to create
#    a predefined topology.  To generate a random topology go to the
#    ./mit/uAMPS/sims directory and run 'ns genscen'.
topology_file="mit/uAMPS/sims/100nodes.txt"
# add by jael @20130814
cp_file="tcl/mobility/scene/scen-670x670-50-600-20-2"

#number of clusters we want.  It is recommended to use 5% of the total
#   number of nodes in the scenario.
num_clusters=5
# energy values.  How much energy does each node have initially
eq_energy=1
init_energy=2
# stop is the time to stop the simulation if it is still running
stop=3600
# x,y is the size of the field
x=1000
y=1000
# bs_x, bs_y is the location of the base station in the field.
bs_x=50
bs_y=175
# Number of nodes.  WARNING!  This should be 1 higher then the number
#  of nodes generated in the scenario.
nn=101
tr=leach-lj.tr

RCA_LIBRARY=mit/rca
export RCA_LIBRARY
uAMPS_LIBRARY=mit/uAMPS
export uAMPS_LIBRARY
ns tcl/ex/wireless-lj.tcl  \
-sc mit/uAMPS/sims/nodescen \
-rp $alg \
-x $x \
-y $y \
-nn $nn \
-tr $tr \
-stop $stop \
-eq_energy $eq_energy \
-init_energy $init_energy \
-filename $filename \
-dirname $dirname \
-topo $topology_file \
-cp $cp_file \
-num_clusters $num_clusters \
-bs_x $bs_x \
-bs_y $bs_y 2>$dirname/$filename.err 1>$dirname/$filename-lj.out &
 
  


Reply

Tags
leach, ns2


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with running leach protocol in ns2.34 leach.er Mohamed69 Linux - Software 14 04-16-2018 07:10 AM
[SOLVED] LEACH connection pattern file not working linuxUser123linux Linux - Newbie 10 07-15-2013 09:15 PM
a tcl sample file using leach saeed.m Linux - Software 2 07-15-2013 04:47 AM
[SOLVED] How to replace newline pattern in file by other newline pattern in a shell script XXLRay Linux - Software 9 11-29-2010 07:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration