LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 03-15-2012, 11:55 PM   #1
Pravin Pandirkar
LQ Newbie
 
Registered: Mar 2012
Posts: 7

Rep: Reputation: Disabled
Antagent Algorithm on NS2 in Fedora15


Hi,
Hi,

I am doing my master`s research thesis on Antagent.

I am working on NS2 for antagent.
I have successfully installed ns2 and When I run the script of antagent, I get the following the error:

ns: [Simulator instance] get-drop-queue 0 5:
(_o3 cmd line 1)
invoked from within
"_o3 cmd get-drop-queue 0 5"
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 "_o3" line 2)
(SplitObject unknown line 2)
invoked from within
"[Simulator instance] get-drop-queue 0 5"


Can you please help me to workout on this???

What I need to do ?

Regards,

Pravin C.Pandirkar
 
Old 03-16-2012, 12:03 AM   #2
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
Hi,

Welcome to LQ!

What command you executed to run the script?
 
Old 03-16-2012, 12:10 AM   #3
Pravin Pandirkar
LQ Newbie
 
Registered: Mar 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Satyaveer Arya View Post
Hi,

Welcome to LQ!

What command you executed to run the script?
Hi,

http://code.google.com/p/antalgorithm/downloads/list

I followed this link and made the changes as per mentioned in the pdf files.

I have executed that file in root mode by following command,

#ns <filename>
 
Old 03-16-2012, 05:01 AM   #4
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
The errors you got seems to be because of the incorrect code. You need to check your code also..
 
Old 03-17-2012, 03:31 PM   #5
Pravin Pandirkar
LQ Newbie
 
Registered: Mar 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
I can share a code with you,


# tcl script for AntNet algorithm on an arbitrary topology of 12 nodes

#number of nodes
set sz 12

#Create event Schedular
set ns [ new Simulator ]

#Open the Trace file
set tf [open antnet_trace.out w]
$ns trace-all $tf

# nam trace initialization
#set namtrace [open sooa-out.nam w] ; # for wireless traces
#$ns_ namtrace-all-wireless $namtrace $val(x) $val(y)
set nf [open out.nam w]
$ns namtrace-all $nf

#Create 12 nodes
for {set i 0} {$i < $sz} {incr i} {
set n($i) [$ns node]
}

#Create links between the nodes
$ns duplex-link $n(0) $n(5) 512Mb 155ms DropTail
$ns duplex-link $n(1) $n(2) 512Mb 155ms DropTail
$ns duplex-link $n(2) $n(3) 512Mb 155ms DropTail
$ns duplex-link $n(2) $n(5) 512Mb 155ms DropTail
$ns duplex-link $n(2) $n(7) 512Mb 155ms DropTail
$ns duplex-link $n(3) $n(6) 512Mb 155ms DropTail
$ns duplex-link $n(3) $n(7) 512Mb 155ms DropTail
$ns duplex-link $n(4) $n(5) 512Mb 155ms DropTail
$ns duplex-link $n(5) $n(6) 512Mb 155ms DropTail
$ns duplex-link $n(5) $n(8) 512Mb 155ms DropTail
$ns duplex-link $n(5) $n(9) 512Mb 155ms DropTail
$ns duplex-link $n(6) $n(7) 512Mb 155ms DropTail
$ns duplex-link $n(6) $n(9) 512Mb 155ms DropTail
$ns duplex-link $n(6) $n(10) 512Mb 155ms DropTail
$ns duplex-link $n(7) $n(11) 512Mb 155ms DropTail
$ns duplex-link $n(9) $n(10) 512Mb 155ms DropTail
$ns duplex-link $n(10) $n(11) 512Mb 155ms DropTail

#Create Antnet agents
for {set i 0} {$i < $sz} {incr i} {
set nn($i) [ new Agent/Antnet $i]
}

#Attach each node with Antnet agent
for {set i 0} {$i < $sz} {incr i} {
$ns attach-agent $n($i) $nn($i)
}

#Create connection between the nodes
$ns connect $nn(0) $nn(5)
$ns connect $nn(5) $nn(0)
$ns connect $nn(1) $nn(2)
$ns connect $nn(2) $nn(1)
$ns connect $nn(2) $nn(3)
$ns connect $nn(3) $nn(2)
$ns connect $nn(2) $nn(5)
$ns connect $nn(5) $nn(2)
$ns connect $nn(2) $nn(7)
$ns connect $nn(7) $nn(2)
$ns connect $nn(3) $nn(6)
$ns connect $nn(6) $nn(3)
$ns connect $nn(3) $nn(7)
$ns connect $nn(7) $nn(3)
$ns connect $nn(4) $nn(5)
$ns connect $nn(5) $nn(4)
$ns connect $nn(5) $nn(6)
$ns connect $nn(6) $nn(5)
$ns connect $nn(5) $nn(8)
$ns connect $nn(8) $nn(5)
$ns connect $nn(5) $nn(9)
$ns connect $nn(9) $nn(5)
$ns connect $nn(6) $nn(7)
$ns connect $nn(7) $nn(6)
$ns connect $nn(6) $nn(9)
$ns connect $nn(9) $nn(6)
$ns connect $nn(6) $nn(10)
$ns connect $nn(10) $nn(6)
$ns connect $nn(7) $nn(11)
$ns connect $nn(11) $nn(7)
$ns connect $nn(9) $nn(10)
$ns connect $nn(10) $nn(9)
$ns connect $nn(10) $nn(11)
$ns connect $nn(11) $nn(10)

#Add neighbors
$ns at now "$nn(0) add-neighbor $n(0) $n(5)"
$ns at now "$nn(0) add-neighbor $n(1) $n(2)"
$ns at now "$nn(0) add-neighbor $n(2) $n(3)"
$ns at now "$nn(0) add-neighbor $n(2) $n(5)"
$ns at now "$nn(0) add-neighbor $n(2) $n(7)"
$ns at now "$nn(0) add-neighbor $n(3) $n(6)"
$ns at now "$nn(0) add-neighbor $n(3) $n(7)"
$ns at now "$nn(0) add-neighbor $n(4) $n(5)"
$ns at now "$nn(0) add-neighbor $n(5) $n(6)"
$ns at now "$nn(0) add-neighbor $n(5) $n(8)"
$ns at now "$nn(0) add-neighbor $n(5) $n(9)"
$ns at now "$nn(0) add-neighbor $n(6) $n(7)"
$ns at now "$nn(0) add-neighbor $n(6) $n(9)"
$ns at now "$nn(0) add-neighbor $n(6) $n(10)"
$ns at now "$nn(0) add-neighbor $n(7) $n(11)"
$ns at now "$nn(0) add-neighbor $n(9) $n(10)"
$ns at now "$nn(0) add-neighbor $n(10) $n(11)"

# Set parameters and start time
for {set i 0} {$i < $sz} {incr i} {
$nn($i) set num_nodes_ $sz
$nn($i) set timer_ant_ 0.03
$nn($i) set r_factor_ 0.05
$ns at 1.0 "$nn($i) start"
}

#Set stop time for AntNet algorithm
for {set i 0} {$i < $sz} {incr i} {
$ns at 10.8 "$nn($i) stop"
}

#Print routing tables generated by AntNet
for {set i 0} {$i < $sz} {incr i} {
$ns at 12.0 "$nn($i) print_rtable"
}

# Final Wrap up
proc Finish {} {
global ns tf nf
$ns flush-trace
close $nf
#Close the Trace file
close $tf
}

$ns at 14.0 "Finish"

# Start the simulator
$ns run




Quote:
Originally Posted by Satyaveer Arya View Post
The errors you got seems to be because of the incorrect code. You need to check your code also..
 
Old 03-17-2012, 03:33 PM   #6
Pravin Pandirkar
LQ Newbie
 
Registered: Mar 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
First of all thanks alot for helping me in my doubts putting your valueable time in it. Really appreciated for your kindness.


Can you please check my code and tell me is my code is right or wrong?

Last edited by Pravin Pandirkar; 03-18-2012 at 07:28 PM.
 
Old 03-19-2012, 07:57 PM   #7
Pravin Pandirkar
LQ Newbie
 
Registered: Mar 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Hi Satyaveer Arya,

Will u please check and let me know whether my code is right or not???

Quote:
Originally Posted by Pravin Pandirkar View Post
First of all thanks alot for helping me in my doubts putting your valueable time in it. Really appreciated for your kindness.


Can you please check my code and tell me is my code is right or wrong?
 
Old 03-19-2012, 08:21 PM   #8
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
Pravin,

I'm not the expert in ns coding. You need to check it yourself or someone who is expert in this. But I can tell you this much that what the errors you posted in your first post, is due to some errors in coding.

Best of luck!
 
Old 03-23-2012, 09:38 PM   #9
enab1e
LQ Newbie
 
Registered: Mar 2012
Posts: 1

Rep: Reputation: Disabled
Smile do you have solve this problem?

Quote:
Originally Posted by Pravin Pandirkar View Post
Hi,
Hi,

I am doing my master`s research thesis on Antagent.

I am working on NS2 for antagent.
I have successfully installed ns2 and When I run the script of antagent, I get the following the error:

ns: [Simulator instance] get-drop-queue 0 5:
(_o3 cmd line 1)
invoked from within
"_o3 cmd get-drop-queue 0 5"
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 "_o3" line 2)
(SplitObject unknown line 2)
invoked from within
"[Simulator instance] get-drop-queue 0 5"


Can you please help me to workout on this???

What I need to do ?

Regards,

Pravin C.Pandirkar
hi,I have the same problem with you ,do you solve this problem ? can you send email to me ? globalinheart@gmail.com

Last edited by enab1e; 03-23-2012 at 09:42 PM.
 
1 members found this post helpful.
Old 04-04-2012, 12:15 AM   #10
Pravin Pandirkar
LQ Newbie
 
Registered: Mar 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Now I am getting some wierd error while running tcl file.

I have tcl file and I am error:

[pravin@localhost scripts]$ ns antnet_pravin-5.tcl
--- Classfier::no-slot{} default handler (tcl/lib/ns-lib.tcl) ---
_o15: no target for slot 4294967295
_o15 type: Classifier/Hash/Dest
content dump:
classifier _o15
0 offset
0 shift
2147483647 mask
1 slots
slot 1: _o39 (Classifier/Port)
-1 default
---------- Finished standard no-slot{} default handler ----------






and another tcl file I am getting error:

[pravin@localhost scripts]$ ns antnet_pravin-4.tcl
Segmentation fault (core dumped)



Can you please help me to get out of this error.
 
1 members found this post helpful.
Old 04-04-2012, 12:23 AM   #11
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
As far as I know, there might be some mistake in your topology, make sure it is fully connected.
check if you have attached agent such as Null and TCPSink correctly and you must also pay attention to your topology if you use hierachical address.
 
Old 04-04-2012, 01:02 AM   #12
Pravin Pandirkar
LQ Newbie
 
Registered: Mar 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Here is my code, can you please check and let me know if it is correct??

#number of nodes
set sz 2

#Create event Schedular
set ns [new Simulator]

#Open the Trace file
set tf [open antnet_trace.out w]
$ns trace-all $tf

# nam trace initialization
set nf [open out.nam w]
$ns namtrace-all $nf

#Create 12 nodes
for {set i 0} {$i < $sz} {incr i} {
set n($i) [$ns node]
}

#Create links between the nodes
$ns duplex-link $n(0) $n(1) 512Mb 155ms DropTail

#Attach one node with Antnet agent
set nn(0) [new Agent/Antnet]
$ns attach-agent $n(0) $nn(0)
set nn(1) [new Agent/Antnet]
$ns attach-agent $n(1) $nn(1)

$ns attach-agent $nn(0) $nn(1)
$ns attach-agent $nn(1) $nn(0)

#Schedule events for the CBR agents
$ns at 0.0 "$nn(0) start"
$ns at 1.0 "$nn(0) stop"

#Call the finish procedure for 10 seconds
$ns at 10.0 "finish"

#Run the simulation
$ns run
 
Old 09-11-2012, 10:21 AM   #13
bhawnatalwar
LQ Newbie
 
Registered: Sep 2012
Posts: 1

Rep: Reputation: Disabled
Antnet simulation error

I am also encountering the same error in TCl library file:
Please need urgent help to recover from this error and want to know why exactly this error has incured???

[pravin@localhost scripts]$ ns antnet_pravin-5.tcl
--- Classfier::no-slot{} default handler (tcl/lib/ns-lib.tcl) ---
_o15: no target for slot 4294967295
_o15 type: Classifier/Hash/Dest
content dump:
classifier _o15
0 offset
0 shift
2147483647 mask
1 slots
slot 1: _o39 (Classifier/Port)
-1 default
---------- Finished standard no-slot{} default handler ----------
 
  


Reply

Tags
antnet, ns2



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
How to change the algorithm of a node in ns2 Swathinag Linux - Software 11 10-04-2016 05:21 AM
simulation code(tcl) for ras algorithm in NS2? subrahmanya Linux - Newbie 5 01-07-2015 08:55 AM
k-hop clustering algorithm on ns2 DeepanAnbu Linux - Newbie 0 02-03-2012 02:09 AM
How to write a program based on algorithm in ns2 raviteja99 Linux - Wireless Networking 4 09-14-2010 07:33 PM
Attaching an algorithm to tcl script in ns2 raviteja99 Linux - Wireless Networking 2 09-12-2010 07:16 PM

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

All times are GMT -5. The time now is 01:50 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