LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-28-2016, 01:24 AM   #1
fozia kosar
LQ Newbie
 
Registered: Jul 2016
Posts: 9

Rep: Reputation: Disabled
Please tell how to fix following error while implementing centroid protocol. I am using ns 2.34 on ubuntu14.04lts


root@it-HP-Compaq-6530b-NA407UC-ABA:/home/it/Desktop/centroid2d# ns centroid_802_11.tcl
num_nodes is set 9
INITIALIZE THE LIST xListHead
ns: _o18 anchor:
(_o18 cmd line 1)
invoked from within
"_o18 cmd anchor"
invoked from within
"catch "$self cmd $args" ret"
invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
(procedure "_o18" line 2)
(SplitObject unknown line 2)
invoked from within
"_o18 anchor"
 
Old 07-28-2016, 05:38 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2021 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,440

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
Welcome to LQ.

"centroid" : Unknown ns2 addition.
Please show a link to information about {ns2 + centroid}, and the code.

centroid_802_11.tcl : Unknown file.
Please upload the file to 'Google drive' or a pastebin site.
.. Or you can attach the file to a new post : As centroid_802_11.tcl.txt
* Attachments :
That's the paper clip tool in the 'Advanced Editor'.


ns2 INFO http://www.linuxquestions.org/questions/tags/ns2/


-
 
1 members found this post helpful.
Old 07-28-2016, 12:00 PM   #3
fozia kosar
LQ Newbie
 
Registered: Jul 2016
Posts: 9

Original Poster
Rep: Reputation: Disabled
here is the centroid.tcl file

# Generated by Topology Generator for Network Simulator (c) CENTROID

set val(chan) Channel/WirelessChannel ;# channel type
set val(prop) Propagation/TwoRayGround ;# radio-propagation model
set val(netif) Phy/WirelessPhy ;# network interface type
set val(mac) Mac/802_11 ;# MAC type
set val(ifq) Queue/DropTail/PriQueue ;# interface queue type
set val(ll) LL ;# link layer type
set val(ant) Antenna/OmniAntenna ;# antenna model
set val(ifqlen) 50 ;# max packet in ifq
set val(nn) 9 ;# number of mobilenodes
set val(rp) CENTROID ;# protocol type
set val(x) 1000 ;# X dimension of topography
set val(y) 1000 ;# Y dimension of topography
set val(stop) 100 ;# simulation period

set ns [new Simulator]
$ns use-scheduler Heap

set tracefd [open centroid-802-11.tr w]
set namtrace [open centroid-802-11.nam w]

$ns trace-all $tracefd
$ns namtrace-all-wireless $namtrace $val(x) $val(y)

# set up topography object
set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)

create-god $val(nn)

# configure the nodes
$ns node-config -adhocRouting $val(rp) \
-llType $val(ll) \
-macType $val(mac) \
-ifqType $val(ifq) \
-ifqLen $val(ifqlen) \
-antType $val(ant) \
-propType $val(prop) \
-phyType $val(netif) \
-channel [new $val(chan)] \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace OFF \
-movementTrace OFF \

for {set i 0} {$i < $val(nn) } { incr i } {
set mnode_($i) [$ns node]
$mnode_($i) random-motion 0
}


# Position of Anchor 1
$mnode_(0) set X_ 150.00
$mnode_(0) set Y_ 200.00
$mnode_(0) set Z_ 0.0
$mnode_(0) label "Anchor1"

# Position of Anchor 2
$mnode_(1) set X_ 480.00
$mnode_(1) set Y_ 500.00
$mnode_(1) set Z_ 0.0
$mnode_(1) label "Anchor2"

# Position of Anchor 3
$mnode_(2) set X_ 980.00
$mnode_(2) set Y_ 150.00
$mnode_(2) set Z_ 0.0
$mnode_(2) label "Anchor3"

# Position of Node 1
$mnode_(3) set X_ 300.00
$mnode_(3) set Y_ 350.00
$mnode_(3) set Z_ 0.0

# Position of Node 2
$mnode_(4) set X_ 400.00
$mnode_(4) set Y_ 250.00
$mnode_(4) set Z_ 0.0

# Position of Node 3
$mnode_(5) set X_ 520.00
$mnode_(5) set Y_ 300.00
$mnode_(5) set Z_ 0.0

# Position of Node 4
$mnode_(6) set X_ 620.00
$mnode_(6) set Y_ 180.00
$mnode_(6) set Z_ 0.0

# Position of Node 5
$mnode_(7) set X_ 720.00
$mnode_(7) set Y_ 210.00
$mnode_(7) set Z_ 0.0

# Position of Node 6
$mnode_(8) set X_ 920.00
$mnode_(8) set Y_ 230.00
$mnode_(8) set Z_ 0.0

#start sending beacon message
$ns at 0.0 "[$mnode_(0) set ragent_] anchor"

#start sending beacon message
$ns at 0.0 "[$mnode_(1) set ragent_] anchor"

#start sending beacon message
$ns at 0.0 "[$mnode_(2) set ragent_] anchor"


for {set i 0} {$i < $val(nn)} { incr i } {
$ns initial_node_pos $mnode_($i) 5
}

# Telling nodes when the simulation ends
for {set i 0} {$i < $val(nn) } { incr i } {
$ns at $val(stop) "$mnode_($i) reset;"
}

# ending nam and the simulation
$ns at $val(stop) "$ns nam-end-wireless $val(stop)"
$ns at $val(stop) "stop"
$ns at [expr $val(stop) + 0.01] "puts "end simulation"; $ns halt"
proc stop {} {
global ns tracefd namtrace
$ns flush-trace
close $tracefd
close $namtrace
#exec nam dvhop-802-11.nam &

}

$ns run
 
Old 07-28-2016, 12:31 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2021 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,440

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
@fozia kosar, please edit post #3 to use code tags around the tcl code :
http://www.linuxquestions.org/questi....php?do=bbcode
I.e. : [code]code text[/code]

Editing : That's the 'Edit' button in post #3.

And : You will get an answer, when you have showed the required centroid information.
See post #2.


-

Last edited by knudfl; 07-28-2016 at 12:38 PM.
 
Old 07-28-2016, 12:56 PM   #5
fozia kosar
LQ Newbie
 
Registered: Jul 2016
Posts: 9

Original Poster
Rep: Reputation: Disabled
Sorry sir icant understand what u want to say ?
 
Old 07-28-2016, 03:54 PM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2021 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,440

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
Assume centroid2d.zip from http://master.dl.sourceforge.net/pro...centroid2d.zip

centroid2d.zip provides {centroid_802_11.tcl, centroid.cc, centroid.h, centroid_packet.h}
and "How to add Centroid algorithm in NS2.pdf".

? Is that what you are using ?
 
Old 07-28-2016, 03:54 PM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2021 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,440

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
... Sorry, hiccup
 
Old 07-30-2016, 12:37 PM   #8
fozia kosar
LQ Newbie
 
Registered: Jul 2016
Posts: 9

Original Poster
Rep: Reputation: Disabled
yes sir i am using same centroid2d.zip folder in ns-2.34 on ubuntu 14.04lts . this folder contains centroid.cc, centroid.h,centroid_802_11.tcl, centroid_pkt.h, how to add centroid algorithm in NS2 files.
 
Old 07-30-2016, 03:22 PM   #9
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2021 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,440

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
Re #8.
Quote:
how to add centroid algorithm in NS2 files
Like described in the file "How to add Centroid algorithm in NS2.pdf"
Should be fairly easy to understand.

I created a patch from the changes : centroid-pre0_ns234.patch
https://drive.google.com/file/d/0B7S...ew?usp=sharing

There are some issues with the code added to cmu-trace.cc : The 49 lines starting at line 1071. I hope you can fix the c++ code.


-

Last edited by knudfl; 07-30-2016 at 03:30 PM.
 
Old 07-31-2016, 02:01 AM   #10
fozia kosar
LQ Newbie
 
Registered: Jul 2016
Posts: 9

Original Poster
Rep: Reputation: Disabled
how to add centroid algorithm in NS2 files

thank you for your replying
yes i have fixed those issues in cmu-trac.cc file and now the make goes successful but in last centroid_802_11.tcl generates error. and one thing new is that when ever i change the protocol type in .tcl file centroid to dsdv then the same file generates less errors then before I have send those errors in poat#1.




when i set protocol type = centroid, it generates error like this....
#####################
d# ns centroid_802_11.tcl
num_nodes is set 9

(_o15 cmd line 1)
invoked from within
"_o15 cmd addr"
invoked from within
"catch "$self cmd $args" ret"
invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
(procedure "_o15" line 2)
(SplitObject unknown line 2)
invoked from within
"_o15 addr"
("eval" body line 1)
invoked from within
"eval $node addr $args"
("default" arm line 2)
invoked from within
"switch -exact $routingAgent_ {
DSDV {
set ragent [$self create-dsdv-agent $node]
}
DSR {
$self at 0.0 "$node start-dsr"
}
AODV {
set ragent [$self cre..."
(procedure "_o3" line 14)
(Simulator create-wireless-node line 14)
invoked from within
"_o3 create-wireless-node"
("eval" body line 1)
invoked from within
"eval $self create-wireless-node $args"
(procedure "_o3" line 23)
(Simulator node line 23)
invoked from within
"$ns node"
("for" body line 2)
invoked from within
"for {set i 0} {$i < $val(nn) } { incr i } {
set mnode_($i) [$ns node]
$mnode_($i) random-motion 0
} "
(file "centroid_802_11.tcl" line 48)

# and whenever i set protocol type = AODV, it generates error like this....
#########################3
d# ns centroid_802_11.tcl


num_nodes is set 9
INITIALIZE THE LIST xListHead
ns: _o18 anchor:
(_o18 cmd line 1)
invoked from within
"_o18 cmd anchor"
invoked from within
"catch "$self cmd $args" ret"
invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
(procedure "_o18" line 2)
(SplitObject unknown line 2)
invoked from within
"_o18 anchor"

############################

please tell me how to solve these errors ????
 
Old 07-31-2016, 05:41 AM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2021 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,440

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
Re #10.
Quote:
i have fixed those issues in cmu-trace.cc file
Please upload the edited cmu-trace.cc to 'Google Drive' or pastebin.
 
Old 08-01-2016, 12:35 AM   #12
fozia kosar
LQ Newbie
 
Registered: Jul 2016
Posts: 9

Original Poster
Rep: Reputation: Disabled
thanku sir, i have uploaded cmu_trace.cc file on google drive.
foziakosar13@gmail.com
 
Old 08-02-2016, 04:20 PM   #13
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2021 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,440

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
Re #12.
Quote:
i have uploaded cmu_trace.cc file on google drive.
OK, then please show a link to the file.

→ → Please click the 'Share' button in your 'Google Drive'.
And select "Advanced", and change the settings to 'On - Anyone with the link'.


-
 
  


Reply

Tags
centroid, 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
Why do i get these error when running leach protocol on ns-2.35? what should i do to fix it? dindatasya Linux - Newbie 2 02-27-2016 09:44 AM
[SOLVED] NS2.33 installation Problem On Ubuntu14.04Lts tiwana07763 Linux - Networking 1 01-30-2016 11:16 AM
DFS packages for Ubuntu14.04LTS crothman Ubuntu 0 11-05-2014 08:44 PM
firefox28 in ubuntu14.04lts? ivtec Ubuntu 4 05-14-2014 12:57 PM
[SOLVED] Help me in implementing RTP protocol nikhilvs9999 Linux - Networking 11 09-06-2012 07:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:11 PM.

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