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 08-29-2015, 03:15 AM   #16
mohawad
LQ Newbie
 
Registered: Aug 2015
Posts: 11

Original Poster
Rep: Reputation: Disabled

thank for help the blackholeaodv is run
now i wont the solution of it
what step shoud i do
how to prevent the blackholeaodv
this is my edit blackholeaodv



Code:
set val(chan) Channel/WirelessChannel ;
set val(prop) Propagation/TwoRayGround ;
set val(netif) Phy/WirelessPhy ;
set val(mac) Mac/802_11 ;
set val(ifq) Queue/DropTail/PriQueue ;
set val(ll) LL ;
set val(ant) Antenna/OmniAntenna ;
set val(ifqlen) 40 ;
set val(nn) 11;
set val(rp) AODV ;
set val(brp) blackholeAODV ; # blackhole aodv protocol mentioned here....
set val(x) 4000 ;
set val(y) 2000 ;
set val(stop) 20 ;

set ns [new Simulator]
set tracefd [open bhatk.tr w]
set namtracefd [open wrlsaodv.nam w]
$ns trace-all $tracefd
$ns use-newtrace
$ns namtrace-all-wireless $namtracefd $val(x) $val(y)
set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)

#GOD (General Operations Director)
create-god $val(nn)
$ns node-config -adhocRouting $val(rp) \
-llType $val(ll) \
-macType $val(mac) \
-ifqType $val(ifq) \
-ifqLen $val(ifqlen) \
-antType $val(ant) \
-propType $val(prop) \
-phyType $val(netif) \
-channelType $val(chan) \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace ON \
-movementTrace ON \


for {
set i 0
} {
$i < $val(nn)
} {
 incr i
} {
 
set node_($i) [$ns node]
 
}
$node_(0) label "sender"
$node_(10) label "destination"
#########################################
$ns node-config -adhocRouting $val(brp)
set node_(9) [$ns node]
#blackhole node creation
#######################################

$node_(0) set X_ 300.0
$node_(0) set Y_ 1700.0
$node_(0) set Z_ 0.0
 
$node_(1) set X_ 300.0
$node_(1) set Y_ 1800.0
$node_(1) set Z_ 0.0
 
$node_(2) set X_ 480.0
$node_(2) set Y_ 1850.0
$node_(2) set Z_ 0.0
 
$node_(3) set X_ 600.0
$node_(3) set Y_ 1900.0
$node_(3) set Z_ 0.0
 
$node_(4) set X_ 730.0
$node_(4) set Y_ 1850.0
$node_(4) set Z_ 0.0
 
$node_(5) set X_ 850.0
$node_(5) set Y_ 1750.0
$node_(5) set Z_ 0.0
 
$node_(6) set X_ 1000.0
$node_(6) set Y_ 1700.0
$node_(6) set Z_ 0.0
 
$node_(7) set X_ 400.0
$node_(7) set Y_ 1500.0
$node_(7) set Z_ 0.0
 
$node_(8) set X_ 500.0
$node_(8) set Y_ 1600.0
$node_(8) set Z_ 0.0
 
$node_(9) set X_ 670.0
$node_(9) set Y_ 1550.0
$node_(9) set Z_ 0.0
 
$node_(10) set X_ 800.0
$node_(10) set Y_ 1500.0
$node_(10) set Z_ 0.0
 
#$node_(11) set X_ 950.0
#$node_(11) set Y_ 1500.0
#$node_(11) set Z_ 0.0
 
#$node_(12) set X_ 950.0
#$node_(12) set Y_ 1500.0
#$node_(12) set Z_ 0.0
 
#$node_(13) set X_ 950.0
#$node_(13) set Y_ 1500.0
#$node_(13) set Z_ 0.0
 
 
# Generation of movements     
$ns at 0.1 "$node_(0) setdest 3300.0 150.0 10.0"        
$ns at 0.1 "$node_(1) setdest 3600.0 440.0 10.0"
$ns at 0.1 "$node_(2) setdest 3650.0 550.0 10.0"
$ns at 0.1 "$node_(3) setdest 3700.0 450.0 10.0"
$ns at 0.1 "$node_(4) setdest 3750.0 540.0 10.0"
$ns at 0.1 "$node_(5) setdest 3750.0 400.0 10.0"
$ns at 0.1 "$node_(6) setdest 3800.0 500.0 10.0"
$ns at 0.1 "$node_(7) setdest 3300.0 260.0 10.0"
$ns at 0.1 "$node_(8) setdest 3480.0 300.0 10.0"
$ns at 0.1 "$node_(9) setdest 3600.0 400.0 10.0"
$ns at 0.1 "$node_(10) setdest 3700.0 300.0 10.0"

#$ns at 10.0 "$node_(11) setdest 3700.0 300.0 10.0"

set udp [new Agent/UDP]
$udp set class_ 1
set sink [new Agent/UDP]
$ns attach-agent $node_(0) $udp
$ns attach-agent $node_(1) $sink
$ns attach-agent $node_(2) $sink
$ns attach-agent $node_(3) $sink
$ns attach-agent $node_(4) $sink
$ns attach-agent $node_(5) $sink
$ns attach-agent $node_(6) $sink
$ns attach-agent $node_(7) $sink
$ns attach-agent $node_(8) $sink
$ns attach-agent $node_(9) $sink
$ns attach-agent $node_(10) $sink
#$ns attach-agent $node_(11) $sink
$ns connect $udp $sink

set cbr [new Application/Traffic/CBR]
$cbr attach-agent $udp
$cbr set packetSize_ 512


$ns at 0.1 "$cbr start"
$ns at 19.0 "$cbr stop"

$ns at 0.01 "$node_(9) label "blackhole node""

for {set i 0} {$i < $val(nn) } {incr i} {
$ns initial_node_pos $node_($i) 10
}

for {set i 0} {$i < $val(nn) } {incr i} {
$ns at $val(stop) "$node_($i) reset"
}

$ns at $val(stop) "stop"

proc stop {} {
global ns tracefd namtracefd
$ns flush-trace
close $tracefd
close $namtracefd
exec nam wrlsaodv.nam &
exit 0
}
$ns run

Last edited by mohawad; 08-29-2015 at 04:52 AM.
 
Old 08-29-2015, 04:28 AM   #17
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
Re #16.

Tcl code must be inside CODE Tags. Please edit post #16
http://www.linuxquestions.org/questi....php?do=bbcode
I.e. [code]code text[/code]
Editing post #16 : The 'Edit' button in post #16.

You can run (all) the examples from blackholeaodv2005-examples-2.tar.gz with 'ns235-blackhole+idsaodv'.
... Which means : No edits for idsAODV.
Also : Please read idsaodv2.tcl : Nothing is added for idsAODV ?
? Is probably an in-built function in the new idsAODV executable, "ns235-blackhole+idsaodv".


Note : The backspaces are invisible in post #16. As is, with no CODE Tags.

Link to blackholeaodv2005-examples-2.tar.gz :
https://drive.google.com/file/d/0B7S...ew?usp=sharing


-

Last edited by knudfl; 08-29-2015 at 04:33 AM.
 
Old 08-29-2015, 05:46 AM   #18
mohawad
LQ Newbie
 
Registered: Aug 2015
Posts: 11

Original Poster
Rep: Reputation: Disabled
i dont know why it gives single blackhole node without any other node in ex-2005__Mar2015 when i use "ns235-blackhole-idsaodv
"
 
  


Reply

Tags
blackhole, 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
after installing NS2 termina shows the message ns2 not installed profaditya Linux - Newbie 2 09-25-2014 03:15 PM
NS2: How to set idle(sleeping) time to a node in wireless network in ns2 pon Linux - Newbie 0 08-19-2014 07:45 PM
NS2: Require eap-sim authentication code for simulation in ns2.24 noamankhatib Linux - Software 0 04-29-2013 01:03 PM


All times are GMT -5. The time now is 10:55 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration