Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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??
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
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...
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.