Hi
I tried to simulate sctp multi-homing over wired-cum-wireless
network on ns-2.30
I have read the paper on
http://www.lib.ncsu.edu/theses/available/etd-05162005-094333/.
<http://www.lib.ncsu.edu/theses/available/etd-05162005-094333/>
According to The FAQS of the paper , I modified two parts.
1.$ns_ node-config -wiredRouting OFF
2.commented out the line
//Tcl::instance().evalf("\%s no-slot \%ld", name(), cl)
in classifier.cc
I created multihoming nodes(mobile node) in WLAN .
while i execute ... it shows the following error message which is
the same as the paper mentioned.
num_nodes is set 4
INITIALIZE THE LIST xListHead
Starting Simulation...
can't read "Node_(5)": no such element in array
while executing
"return $Node_($id)"
(procedure "_o3" line 3)
(Simulator get-node-by-id line 3)
invoked from within
"$self get-node-by-id [lindex $L 0]"
(procedure "_o3" line 14)
(Simulator compute-hier-routes line 14)
invoked from within
"$self compute-hier-routes "
invoked from within
"if [Simulator hier-addr?] {
$self compute-hier-routes
} else {
$self compute-flat-routes
}"
(procedure "_o3" line 2)
(Simulator compute-routes line 2)
invoked from within
"[Simulator instance] compute-routes"
(procedure "Agent/rtProto/Static" line 2)
(Agent/rtProto/Static init-all line 2)
invoked from within
"Agent/rtProto/Static init-all"
invoked from within
"if [info exists rtprotos_] {
foreach proto [array names rtprotos_] {
eval Agent/rtProto/$proto init-all $rtprotos_($proto)
}
} else {
Agent/rtProto/St..."
(procedure "_o191" line 3)
(RouteLogic configure line 3)
invoked from within
"[$self get-routelogic] configure"
(procedure "_o3" line 5)
(Simulator run line 5)
invoked from within
"$ns_ run"
(file "wired-cum-wireless-sim_miga3.tcl" line 215)
I have succeed ... when using mobilenode without multihoming .
My script is as following.
## This simulation is an example of combination of wired and wireless
### topologies.
Trace set show_sctphdr_ 1
global opt
set opt(chan) Channel/WirelessChannel
set opt(prop) Propagation/TwoRayGround
set opt(netif) Phy/WirelessPhy
set opt(mac) Mac/802_11
set opt(ifq) Queue/DropTail/PriQueue
set opt(ll) LL
set opt(ant) Antenna/OmniAntenna
set opt(x) 1000
set opt(y) 1000
set opt(ifqlen) 50
set opt(tr) wired-and-wireless.tr
set opt(namtr) wired-and-wireless.nam
set opt(nn) 3
set opt(adhocRouting) DSDV
set opt(cp) ""
set opt(stop) 250
set num_wired_nodes 1
set num_bs_nodes 1
set ns_ [new Simulator]
# set up for hierarchical routing
$ns_ node-config -addressType hierarchical
AddrParams set domain_num_ 2
lappend cluster_num 1 1
AddrParams set cluster_num_ $cluster_num
lappend eilastlevel 4 2
AddrParams set nodes_num_ $eilastlevel
$ns_ use-newtrace
set tracefd [open $opt(tr) w]
$ns_ trace-all $tracefd
set namtracefd [open $opt(namtr) w]
$ns_ namtrace-all-wireless $namtracefd $opt(x) $opt(y)
set topo [new Topography]
$topo load_flatgrid $opt(x) $opt(y)
# god needs to know the number of all wireless interfaces
create-god [expr $opt(nn) + $num_bs_nodes]
#create wired nodes
set W(0) [$ns_ node 0.0.0]
set W(1) [$ns_ node 0.0.1]
$W(0) set X_ 500.0
$W(0) set Y_ 500.0
$W(0) set Z_ 0.0
$W(1) set X_ 500.0
$W(1) set Y_ 800.0
$W(1) set Z_ 0.0
#$ns_ initial_node_pos $W(0) 20
#$ns_ initial_node_pos $W(1) 20
#configure BS node
$ns_ node-config -adhocRouting $opt(adhocRouting) \
-llType $opt(ll) \
-macType $opt(mac) \
-ifqType $opt(ifq) \
-ifqLen $opt(ifqlen) \
-antType $opt(ant) \
-propInstance [new $opt(prop)] \
-phyType $opt(netif) \
-channel [new $opt(chan)] \
-topoInstance $topo \
-wiredRouting ON \
-agentTrace ON \
-routerTrace OFF \
-macTrace OFF
set BS(0) [$ns_ node 1.0.0]
$BS(0) random-motion 0
$BS(0) set X_ 100.0
$BS(0) set Y_ 100.0
$BS(0) set Z_ 0.0
#$ns_ initial_node_pos $BS(0) 20
#configure for mobilenodes
$ns_ node-config -wiredRouting OFF
#Create SCTP moblie nodes
#set node_(0) [$ns_ node 1.0.1]
set node0_if0 [$ns_ node 1.0.2]
set node0_if1 [$ns_ node 1.0.3]
$node0_if0 color Red
$node0_if1 color Red
$ns_ node-config -multihome-core\
-wiredRouting OFF
set node_(0) [$ns_ node 1.0.1]
$node_(0) color Red
#$ns_ set-multihome-core $node_(0)
$ns_ multihome-add-interface $node_(0) $node0_if0
$ns_ multihome-add-interface $node_(0) $node0_if1
$node_(0) base-station [AddrParams addr2id [$BS(0) node-addr]]
$node0_if0 base-station [AddrParams addr2id [$BS(0) node-addr]]
$node0_if1 base-station [AddrParams addr2id [$BS(0) node-addr]]
$node_(0) set X_ 50.0
$node_(0) set Y_ 10.0
$node_(0) set Z_ 0.0
$ns_ initial_node_pos $node_(0) 20
$node0_if0 set X_ 5.0
$node0_if0 set Y_ 10.0
$node0_if0 set Z_ 0.0
$ns_ initial_node_pos $node0_if0 20
$node0_if1 set X_ 80.0
$node0_if1 set Y_ 10.0
$node0_if1 set Z_ 0.0
$ns_ initial_node_pos $node0_if1 20
#create links between wired and BS nodes
$ns_ duplex-link $W(0) $W(1) 5Mb 2ms DropTail
$ns_ duplex-link $W(0) $BS(0) 5Mb 2ms DropTail
$ns_ duplex-link-op $W(0) $W(1) orient up
$ns_ duplex-link-op $W(0) $BS(0) orient left-down
#Create a SCTP agent and attach it to node_(0)
set sctp0 [new Agent/SCTP]
$ns_ multihome-attach-agent $node_(0) $sctp0
$sctp0 force-source $node0_if0
#Create a SCTP agent and attach it to node n1
set sctp1 [new Agent/SCTP]
$ns_ attach-agent $W(1) $sctp1
$ns_ connect $sctp0 $sctp1
# Create a CBR traffic source and attach it to sctp0 at 400kbps
set cbr0 [new Application/Traffic/CBR]
$cbr0 attach-agent $sctp0
$cbr0 set packetSize_ 1000
$cbr0 set rate_ 2Mb
$cbr0 set random_ false
$ns_ at 80 "$cbr0 start"
$ns_ at $opt(stop).0000010 "$node_(0) reset";
$ns_ at $opt(stop).0000010 "$node0_if0 reset";
$ns_ at $opt(stop).0000010 "$node0_if1 reset";
$ns_ at $opt(stop).0000010 "$BS(0) reset";
$ns_ at $opt(stop).1 "finish"
#$ns_ at $opt(stop).1 "puts \"NS EXITING...\" ; $ns_ halt"
proc finish { } { ;# new a procedure finish
global ns_ namtracefd tracefd opt ;# set global variable
$ns_ flush-trace
close $namtracefd ;# close file
close $tracefd ;# close file
exec nam $opt(namtr) &
exit 0
}
puts "Starting Simulation..."
$ns_ run
Please help me.
Thank you very much.