LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-09-2016, 10:17 PM   #1
aradhi
LQ Newbie
 
Registered: Apr 2016
Posts: 9

Rep: Reputation: Disabled
Antnet is not running


hello,

I am trying to run antnet in ns2.35 on centOS 6.3

antnet.tcl is running but how do i specify that im using antnet in the tcl script?
When i disable a link in the topology the packets do no take another route.
I'm confused that after patching antnet do i have to make any changes to route-proto.tcl??

Please Help.
 
Old 07-10-2016, 06:24 AM   #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
$ ns(-antnet) antnet.tcl
... works perfectly in the 32bits CentOS 6.8 (update 6.3 is an old version : year 2012.)

The file 'antnet.tcl' is a text file. Please read the file.
Line 44 : #Create Antnet agents
Line 46 : set nn($i) [ new Agent/Antnet $i]

( Line 44 .. 52 is the Antnet settings.)


More examples : antnet-examples.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing


-

Last edited by knudfl; 07-10-2016 at 05:25 PM.
 
Old 07-10-2016, 08:04 AM   #3
aradhi
LQ Newbie
 
Registered: Apr 2016
Posts: 9

Original Poster
Rep: Reputation: Disabled
Hello Sir,

I am running antnet-aradhi.tcl on the version of CentOS which you have suggested in my earlier post:-
http://www.linuxquestions.org/questi...-a-4175581240/

All examples are running, I have attatched CBR traffic in antnet.tcl. But when a link is broken, the traffic does not take another route.
It seems like the traffic is not moving according to the routing table in rtable.txt file.

It maybe that I am doing something wrong. Here is my tcl script:

Code:
#number of nodes
set sz 12

#Create event Schedular
set ns [ new Simulator ]


$ns color 1 Blue
$ns color 2 Red

#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 udp(0) [new Agent/UDP]
$udp(0) set class_ 1
$ns attach-agent $n(0) $udp(0)

set cbr(0) [new Application/Traffic/CBR]
$cbr(0) set packetSize_ 32768
$cbr(0) set interval_ 0.010
$cbr(0) attach-agent $udp(0)

set udp(1) [new Agent/UDP]
$udp(1) set class_ 2
$ns attach-agent $n(1) $udp(1)

set cbr(1) [new Application/Traffic/CBR]
$cbr(1) set packetSize_ 32768
$cbr(1) set interval_ 0.010
$cbr(1) attach-agent $udp(1)

set null0 [new Agent/LossMonitor]
$ns attach-agent $n(11) $null0

set null1 [new Agent/LossMonitor]
$ns attach-agent $n(6) $null1

puts " udp agents and cbr traffic generated.. "
$ns connect $udp(0) $null0
$ns connect $udp(1) $null1

$ns at 0.5 "$cbr(0) start"
puts " cbr0 started.. "
$ns at 1.0 "$cbr(1) start"
$ns at 10.0 "$cbr(1) stop"
$ns at 10.5 "$cbr(0) stop"

# 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.001
	$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
	exec nam out.nam &
	exit 0
}

$ns rtmodel-at 2 down $n(5) $n(6)
$ns rtmodel-at 7 up $n(5) $n(6)

$ns  at 14.0 "Finish"

# Start the simulator
$ns run

Last edited by aradhi; 07-10-2016 at 08:20 PM.
 
Old 07-10-2016, 12:17 PM   #4
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
Please edit post #3 :
The tcl code must be inside code tags → [code]code text[/code]

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

Besides that : It's not antnet.tcl . A new file must have a new name, e.g. antnet-aradhi.tcl .


-
 
Old 07-10-2016, 08:22 PM   #5
aradhi
LQ Newbie
 
Registered: Apr 2016
Posts: 9

Original Poster
Rep: Reputation: Disabled
Sir I have edited it.

Is there something which im missing in the script?
 
Old 06-04-2017, 10:56 PM   #6
newthink
LQ Newbie
 
Registered: May 2017
Posts: 2

Rep: Reputation: Disabled
@aradhi

Quote:
All examples are running, I have attatched CBR traffic in antnet.tcl. But when a link is broken, the traffic does not take another route.
It seems like the traffic is not moving according to the routing table in rtable.txt file.

Hello, Aradhi

Did you solve the problem?

I have the same problem..

Would you give me a hand? if you solved the problem...

Last edited by newthink; 06-04-2017 at 11:02 PM.
 
Old 06-05-2017, 10:41 AM   #7
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
Re #6.

Have you read the examples / run the examples ?
There are three examples with cbr, may be one is working better :
100AbdusySyarif-antnet.tcl, arahdi-antnet.tcl, stop36-AbdusySyarif-antnet.tcl
→ antnet-examples-05.17.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing
 
  


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
Problem running an AntNet tcl script! zakizakizaki Linux - Newbie 6 01-04-2020 01:17 PM
[SOLVED] Error while running AntNet in ns2.35 aradhi Linux - Networking 8 06-05-2016 11:37 AM
Antnet must Linux - Networking 1 02-02-2015 09:47 AM
error while running tcl file on Antnet algorithm. R.Mosheca Linux - Software 0 07-31-2014 09:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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