LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Antagent Algorithm on NS2 in Fedora15 (https://www.linuxquestions.org/questions/linux-newbie-8/antagent-algorithm-on-ns2-in-fedora15-934710/)

Pravin Pandirkar 03-15-2012 11:55 PM

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

Satyaveer Arya 03-16-2012 12:03 AM

Hi,

Welcome to LQ!

What command you executed to run the script?

Pravin Pandirkar 03-16-2012 12:10 AM

Quote:

Originally Posted by Satyaveer Arya (Post 4628004)
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>

Satyaveer Arya 03-16-2012 05:01 AM

The errors you got seems to be because of the incorrect code. You need to check your code also..

Pravin Pandirkar 03-17-2012 03:31 PM

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 (Post 4628200)
The errors you got seems to be because of the incorrect code. You need to check your code also..


Pravin Pandirkar 03-17-2012 03:33 PM

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?

Pravin Pandirkar 03-19-2012 07:57 PM

Hi Satyaveer Arya,

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

Quote:

Originally Posted by Pravin Pandirkar (Post 4629334)
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?


Satyaveer Arya 03-19-2012 08:21 PM

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!

enab1e 03-23-2012 09:38 PM

do you have solve this problem?
 
Quote:

Originally Posted by Pravin Pandirkar (Post 4627998)
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

Pravin Pandirkar 04-04-2012 12:15 AM

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.

Satyaveer Arya 04-04-2012 12:23 AM

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.

Pravin Pandirkar 04-04-2012 01:02 AM

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

bhawnatalwar 09-11-2012 10:21 AM

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


All times are GMT -5. The time now is 11:38 AM.