LinuxQuestions.org
Help answer threads with 0 replies.
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 01-23-2017, 08:37 AM   #16
keerat
LQ Newbie
 
Registered: Jan 2017
Posts: 12

Original Poster
Rep: Reputation: Disabled
Unhappy error:- no-slot{} default handler


Code:
--- Classfier::no-slot{} default handler (tcl/lib/ns-lib.tcl) ---
	_o27: no target for slot -1
	_o27 type: Classifier/Hash/Dest
content dump:
classifier _o27
	0 offset
	0 shift
	1073741823 mask
	1 slots
		slot 5: _o403 (Classifier/Port)
	-1 default
---------- Finished standard no-slot{} default handler ----------
 
Old 01-23-2017, 08:41 AM   #17
keerat
LQ Newbie
 
Registered: Jan 2017
Posts: 12

Original Poster
Rep: Reputation: Disabled
Exclamation tcl file antnet.tcl

Code:
# 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
 
Old 01-31-2017, 12:08 AM   #18
keerat
LQ Newbie
 
Registered: Jan 2017
Posts: 12

Original Poster
Rep: Reputation: Disabled
Unhappy error:- no-slot{} default handler

Code:
error:- 

--- Classfier::no-slot{} default handler (tcl/lib/ns-lib.tcl) ---
	_o27: no target for slot -1
	_o27 type: Classifier/Hash/Dest
content dump:
classifier _o27
	0 offset
	0 shift
	1073741823 mask
	1 slots
		slot 5: _o403 (Classifier/Port)
	-1 default
---------- Finished standard no-slot{} default handler ----------

tcl script :- 
# 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
 
Old 03-25-2017, 08:05 AM   #19
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,424

Rep: Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622
Antnet INFO http://www.linuxquestions.org/questions/tags/antnet/

Valid examples are antnet-examples-2016.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing
 
Old 11-10-2017, 07:55 AM   #20
mithun810
LQ Newbie
 
Registered: Nov 2017
Posts: 1

Rep: Reputation: Disabled
Thumbs down How did you fix it

I wanted to knw how u fixed this error

"Agent/Antnet create _o36 _o10"
invoked from within

code is
Code:
#Create Antnet agents
set nn0 [new Agent/Antnet $n0]
set nn1 [new Agent/Antnet $n1]
 
Old 11-10-2017, 08:31 AM   #21
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,424

Rep: Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622
Post #20, @mithun810 : Welcome to LQ.

We have one simulation example only with these lines

#Create Antnet agents
set nn0 [new Agent/Antnet $n0]
set nn1 [new Agent/Antnet $n1]

.... That's "Pradeepkumar-antnet.tcl". See antnet-examples-07.17.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing

And : All the examples can be run with no errors, As Far As I Remember →
$ ns235-antnet Pradeepkumar-antnet.tcl
... No terminal output.
The files simple.nam 235kB, simple.out 85.7kB are created.

HOWTO Antnet
Code:
tar xvf ns-allinone-2.35_gcc5.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing
cd ns-allinone-2.35/
patch -p0 < antnet_ns235.patch
https://drive.google.com/file/d/0B7S...ew?usp=sharing
./install
cd ns-2.35/
cp ns ns235-antnet
sudo cp ns235-antnet /usr/local/bin/

------------- Simulation ------------------
$ ns235-antnet arahdi-antnet-1.tcl
$ ns235-antnet stop36-AbdusySyarif-antnet-1.tcl

Last edited by knudfl; 11-10-2017 at 08:40 AM.
 
  


Reply

Tags
antnet, 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
invalid command name "Agent/Antnet" while executing avinash20 Linux - Newbie 1 09-12-2012 07:46 AM
invalid command name "Agent/Antnet" while executing avinash20 Linux - Newbie 0 09-11-2012 12:55 PM

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

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