LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 03-02-2012, 03:04 AM   #1
janak-g
LQ Newbie
 
Registered: Mar 2012
Posts: 5

Rep: Reputation: Disabled
Question security issues in MANET wrt AODV


my test file:

#Parameters like number of nodes and routing protocol should be changed.
#scenario file val(cp) and val(sc) should be changed according to the number of nodes.
#=======================================================
# Define options
#=======================================================
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(x) 500 ;# X dimension of the topography
#set val(y) 500 ;# Y dimension of the topography
set val(ifqlen) 50 ; # max packet in ifq
set val(seed) 0.0
set val(adhocRouting) OLSR
#set val(adhocRouting) DSDV
#set val(adhocRouting) AODV
set val(nn) 21
set val(cp) "cbr-20.sc" ;# connection pattern
set val(sc) "mobile-20.sc" ;# mobility
set val(stop) 200.0 ;# simulation time
#=======================================================
# Main Program
#=======================================================
set ns_ [new Simulator]
set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)
set god_ [create-god $val(nn)]
#create-god $val(nn)
# create trace object for ns and nam
puts "Routing Protocol is $val(adhocRouting)"
set tracefd [open $val(adhocRouting).tr w]
set namtrace [open $val(adhocRouting).nam w]
$ns_ trace-all $tracefd
$ns_ namtrace-all-wireless $namtrace $val(x) $val(y)
# node configuration
$ns_ node-config -adhocRouting $val(adhocRouting) \
-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 OFF\
-movementTrace ON
# common initialization should be done before creating the nodes.
if { $val(adhocRouting) == 'OLSR' } {
#Agent/OLSR set debug_ true
#Agent/OLSR set hello_ival_ 2
#Agent/OLSR set enc_rate_ 50 in MBps, 0.0 means no ecnryption.
#Agent/OLSR set delay_enc_session_key_ 0.0
# 0.0 means no encryption.
}
# Create the specified number of nodes [$val(nn)]
for {set i 0} {$i < $val(nn) } {incr i} {
set node_($i) [$ns_ node]
# $node_($i) random-motion 0 ;# disable random motion
}
puts "Loading connection pattern..."
source $val(cp)
puts "Loading scenario file..."
source $val(sc)
# Define node initial position in nam
for {set i 0} {$i < $val(nn)} {incr i} {
$ns_ initial_node_pos $node_($i) 30
}
# Specific settings for OLSR
#if { $val(adhocRouting) == "OLSR" } {
#$ns_ at 1.0 "print_all_for_all_nodes";
#$ns_ at 105.0 "print_all_for_all_nodes"
#$ns_ at 160.0 "print_all_for_all_nodes"
#$ns_ at 135.0 "print $node_(8)"
#$ns_ at 135.0 "print $node_(4)"
#$ns_ at 135.0 "print $node_(7)"
#}
# Tell nodes when the simulation ends
for {set i 0} {$i < $val(nn) } {incr i} {
$ns_ at $val(stop).0 "$node_($i) reset";
}
$ns_ at $val(stop).0002 "puts \"NS EXITING...\" ; $ns_ halt"

puts $tracefd "M 0.0 nn $val(nn) x $val(x) y $val(y) rp
$val(adhocRouting)"
puts $tracefd "M 0.0 prop $val(prop) ant $val(ant)"
puts "Starting Simulation..."
$ns_ run
#=======================================================
# utility procedures
#=======================================================
# print all possible OLSR repository for this node.
proc print { node } {
[$node agent 255] print_rtable
[$node agent 255] print_linkset
[$node agent 255] print_nbset
[$node agent 255] print_nb2hopset
[$node agent 255] print_mprset
[$node agent 255] print_mprselset
}

# print routing table for all nodes in this simulation
proc print_all_rtable { } {
global node_ val
for {set i 0} {$i < $val(nn)} {incr i} {
[$node_($i) agent 255] print_rtable
}
}
# print all nodes tables
proc print_all_for_all_nodes { } {
global node_ val
for {set i 0} {$i < $val(nn)} {incr i} {
print $node_($i)
}
}
# END of script.

-----------------------------------------------------------------------
Result error:
(_o14 cmd line 1)
invoked from within
"_o14 cmd addr"
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 "_o14" line 2)
(SplitObject unknown line 2)
invoked from within
"_o14 addr"
("eval" body line 1)
invoked from within
"eval $node addr $args"
("default" arm line 2)
invoked from within
"switch -exact $routingAgent_ {
DSDV {
set ragent [$self create-dsdv-agent $node]
}
DSR {
$self at 0.0 "$node start-dsr"
}
AODV {
set ragent [$self cre..."
(procedure "_o3" line 14)
(Simulator create-wireless-node line 14)
invoked from within
"_o3 create-wireless-node"
("eval" body line 1)
invoked from within
"eval $self create-wireless-node $args"
(procedure "_o3" line 23)
(Simulator node line 23)
invoked from within
"$ns_ node"
("for" body line 2)
invoked from within
"for {set i 0} {$i < $val(nn) } {incr i} {
set node_($i) [$ns_ node]
#$node_($i) random-motion 0 ;# disable random motion
}"
(file "test.tcl" line 63)
--------------------------------------------------------------------
 
Old 03-03-2012, 10:48 PM   #2
janak-g
LQ Newbie
 
Registered: Mar 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Unhappy PLz help...

Hey need help ASAP..

PLZZZZZZZZZZ/



Quote:
Originally Posted by janak-g View Post
my test file:

#Parameters like number of nodes and routing protocol should be changed.
#scenario file val(cp) and val(sc) should be changed according to the number of nodes.
#=======================================================
# Define options
#=======================================================
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(x) 500 ;# X dimension of the topography
#set val(y) 500 ;# Y dimension of the topography
set val(ifqlen) 50 ; # max packet in ifq
set val(seed) 0.0
set val(adhocRouting) OLSR
#set val(adhocRouting) DSDV
#set val(adhocRouting) AODV
set val(nn) 21
set val(cp) "cbr-20.sc" ;# connection pattern
set val(sc) "mobile-20.sc" ;# mobility
set val(stop) 200.0 ;# simulation time
#=======================================================
# Main Program
#=======================================================
set ns_ [new Simulator]
set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)
set god_ [create-god $val(nn)]
#create-god $val(nn)
# create trace object for ns and nam
puts "Routing Protocol is $val(adhocRouting)"
set tracefd [open $val(adhocRouting).tr w]
set namtrace [open $val(adhocRouting).nam w]
$ns_ trace-all $tracefd
$ns_ namtrace-all-wireless $namtrace $val(x) $val(y)
# node configuration
$ns_ node-config -adhocRouting $val(adhocRouting) \
-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 OFF\
-movementTrace ON
# common initialization should be done before creating the nodes.
if { $val(adhocRouting) == 'OLSR' } {
#Agent/OLSR set debug_ true
#Agent/OLSR set hello_ival_ 2
#Agent/OLSR set enc_rate_ 50 in MBps, 0.0 means no ecnryption.
#Agent/OLSR set delay_enc_session_key_ 0.0
# 0.0 means no encryption.
}
# Create the specified number of nodes [$val(nn)]
for {set i 0} {$i < $val(nn) } {incr i} {
set node_($i) [$ns_ node]
# $node_($i) random-motion 0 ;# disable random motion
}
puts "Loading connection pattern..."
source $val(cp)
puts "Loading scenario file..."
source $val(sc)
# Define node initial position in nam
for {set i 0} {$i < $val(nn)} {incr i} {
$ns_ initial_node_pos $node_($i) 30
}
# Specific settings for OLSR
#if { $val(adhocRouting) == "OLSR" } {
#$ns_ at 1.0 "print_all_for_all_nodes";
#$ns_ at 105.0 "print_all_for_all_nodes"
#$ns_ at 160.0 "print_all_for_all_nodes"
#$ns_ at 135.0 "print $node_(8)"
#$ns_ at 135.0 "print $node_(4)"
#$ns_ at 135.0 "print $node_(7)"
#}
# Tell nodes when the simulation ends
for {set i 0} {$i < $val(nn) } {incr i} {
$ns_ at $val(stop).0 "$node_($i) reset";
}
$ns_ at $val(stop).0002 "puts \"NS EXITING...\" ; $ns_ halt"

puts $tracefd "M 0.0 nn $val(nn) x $val(x) y $val(y) rp
$val(adhocRouting)"
puts $tracefd "M 0.0 prop $val(prop) ant $val(ant)"
puts "Starting Simulation..."
$ns_ run
#=======================================================
# utility procedures
#=======================================================
# print all possible OLSR repository for this node.
proc print { node } {
[$node agent 255] print_rtable
[$node agent 255] print_linkset
[$node agent 255] print_nbset
[$node agent 255] print_nb2hopset
[$node agent 255] print_mprset
[$node agent 255] print_mprselset
}

# print routing table for all nodes in this simulation
proc print_all_rtable { } {
global node_ val
for {set i 0} {$i < $val(nn)} {incr i} {
[$node_($i) agent 255] print_rtable
}
}
# print all nodes tables
proc print_all_for_all_nodes { } {
global node_ val
for {set i 0} {$i < $val(nn)} {incr i} {
print $node_($i)
}
}
# END of script.

-----------------------------------------------------------------------
Result error:
(_o14 cmd line 1)
invoked from within
"_o14 cmd addr"
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 "_o14" line 2)
(SplitObject unknown line 2)
invoked from within
"_o14 addr"
("eval" body line 1)
invoked from within
"eval $node addr $args"
("default" arm line 2)
invoked from within
"switch -exact $routingAgent_ {
DSDV {
set ragent [$self create-dsdv-agent $node]
}
DSR {
$self at 0.0 "$node start-dsr"
}
AODV {
set ragent [$self cre..."
(procedure "_o3" line 14)
(Simulator create-wireless-node line 14)
invoked from within
"_o3 create-wireless-node"
("eval" body line 1)
invoked from within
"eval $self create-wireless-node $args"
(procedure "_o3" line 23)
(Simulator node line 23)
invoked from within
"$ns_ node"
("for" body line 2)
invoked from within
"for {set i 0} {$i < $val(nn) } {incr i} {
set node_($i) [$ns_ node]
#$node_($i) random-motion 0 ;# disable random motion
}"
(file "test.tcl" line 63)
--------------------------------------------------------------------
 
Old 03-05-2012, 09:46 PM   #3
janak-g
LQ Newbie
 
Registered: Mar 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
plz get me help for this program code..
 
Old 03-08-2012, 09:33 PM   #4
janak-g
LQ Newbie
 
Registered: Mar 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
plz debug my test file:
 
Old 03-09-2012, 11:52 PM   #5
janak-g
LQ Newbie
 
Registered: Mar 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
My work related with comparing AODV,SAODV wrt security issues. I am performing various programs.

Can anyone please describe error & solution to this program:
--------------------------------------------------------------------
#below is the script
set val(chan) Channel/WirelessChannel
set val(prop) propagation/tworayground
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) 50
set val(nn) 2
set val(rp) AODV
set val(x) 500
set val(y) 500

set ns [new Simulator]

set tracefd [open example2.tr w]
$ns trace-all $tracefd
set namtracefd [open example2.nam w]
$ns namtrace-all-wireless $namtracefd $val(x) $val(y)

proc finish {} {
global ns tracefd namtracefd
$ns flush-trace
close $tracefd
close $namtracefd
exec nam example2.nam&
exit 0
}

set chan_1_ [new $val(chan)]
set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)

create-god $val(nn)

$ns node-config -addresstype flat \
-adhocRouting $val(rp) \
-llType $val(ll) \
-macType $val(mac) \ \
-ifqtype $val(ifq) \
-ifqlen $val(ifqlen) \
-anttype $val(ant) \
-proptype $val(prop) \
-phytype $val(netif) \
-channel $chan_1_ \
-topoinstance $topo \
-agenttrace on \
-mactrace off \
-movementtrace off

#for {set i 0} {$i < $val(nn)} {incr i} {
# set node_($i) [$ns node]
# $node_($i) random-motion 0;
#}

set node_(0) [$ns node]
set node_(1) [$ns node]

$node_(0) random-motion 0
$node_(1) random-motion 0

for {set i 0} {$i < $val(nn)} {incr i} {
$ns initial_node_pos $node_($i) 20
}
node_(0) set x_ 5.0
node_(0) set y_ 2.0
node_(0) set z_ 0.0

node_(1) set x_ 390.0
node_(1) set y_ 385.0
node_(1) set z_ 0.0

$ns at 1.0 "$node_(1) setdest 25.0 20.0 15.0"
$ns at 2.0 "$node_(0) setdest 20.0 18.0 1.0"
$ns at 20.0 "$node_(1) setdest 49.0 48.0 15.0"

set tcp [new agent/tcp]
$tcp set class_2
set sink [new agent/tcpsink]
$ns attach-agent $node_(0) $tcp
$ns attach-agent $node_(1) $sink
$ns connect $tcp $sink
set ftp [new application/ftp]
$ftp attach-agent $tcp
$ns at 3.0 "$ftp start"

for {set i 0} {$i<$val(nn)} {incr i} {
$ns at 150.0 "$node_($i) reset";
}
$ns at 150.0 "finish"
$ns run
===========================================================

Error:

num_nodes is set 2
can't read "chan": no such variable
while executing
"$node add-interface $chan $propInstance_ $llType_ $macType_ $ifqType_ $ifqlen_ $phyType_ $antType_ $topoInstance_ $inerrProc_ $outerrProc_ $FECProc_"
(procedure "_o3" line 83)
(Simulator create-wireless-node line 83)
invoked from within
"_o3 create-wireless-node"
("eval" body line 1)
invoked from within
"eval $self create-wireless-node $args"
(procedure "_o3" line 23)
(Simulator node line 23)
invoked from within
"$ns node"
invoked from within
"set node_(0) [$ns node]"
(file "test-11.tcl" line 58)
----------------------------------------------------
 
  


Reply



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
trust calculation in manet nandhiniraja Linux - Newbie 4 09-18-2014 04:26 AM
NS2 simulator in manet raji27 Linux - Software 7 02-24-2013 09:44 AM
manet in ns2-wormhole attack(modifying aodv) indumit18 Linux - Software 2 02-02-2012 03:12 AM
NS2 simulator in manet raji27 Linux - Software 2 09-13-2011 10:38 PM
MANET ad-hoc test pierre44 Linux - Networking 0 08-11-2005 08:01 AM

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

All times are GMT -5. The time now is 06:42 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
Open Source Consulting | Domain Registration