Hi...
i am trying to simulate mobile node a a multihome.....
while i execute...i am getting following error....
# scenario1.tcl
# simulation of a mSCTP in UMTS/WLAN environment
# Mobile to Core node(MN-to-CN) traffic
#########################
# WLAN network interface#
#########################
Mac/802_11 set basicRate_ 1Mb
Mac/802_11 set dataRate_ 11Mb ;# 802.11b data rate
#########################
# UMTS network interface#
#########################
Phy/WirelessPhy set freq_ 2.4e+9 ;#UMTS radio frequency
Phy/WirelessPhy set Pt_ 3.3962527e-2 ;#UMTS coverage
Phy/WirelessPhy set RXThresh_ 6.309573e-11
Phy/WirelessPhy set CSThresh_ 6.309573e-11
Mac/802_11 set dataRate_ 2.0Mb ;# UMTS data rate
#
======================================================================
# Define options
#
======================================================================
set opt(chan) Channel/WirelessChannel ;# channel type
set opt(prop) Propagation/TwoRayGround ;# radio-propagation model
set opt(netif) Phy/WirelessPhy ;# network interface type
set opt(mac) Mac/802_11 ;# MAC type
set opt(ifq) Queue/DropTail/PriQueue ;# interface queue type
set opt(ll) LL ;# link layer type
set opt(ant) Antenna/OmniAntenna ;# antenna model
set opt(ifqlen) 50 ;# max packet in ifq
set opt(nn) 1 ;# number of mobilenodes
set opt(adhocRouting) DSDV ;# routing protocol
set opt(x) 670 ;# x coordinate of topology
set opt(y) 670 ;# y coordinate of topology
set opt(seed) 0.0 ;# random seed
set opt(ftp-start) 100.0
set opt(cbr-start) 150.0
set opt(stop) 250 ;# time to stop simulation
#
======================================================================
# Define options for UMTS
#
======================================================================
set opt(umtsType) NodeB ;# Umts node UE/NodeB
set opt(phylayer) Phy/UmtsNodeB ;# nodeB
set opt(Umac) Mac/UmtsNodeb ;# MAC type
set opt(ftp-start) 100.0
set opt(stop) 250 ;# time to stop simulation
set num_wired_nodes 2
#
======================================================================
# create simulator instance
set ns_ [new Simulator]
# set up for hierarchical routing
$ns_ node-config -addressType hierarchical
AddrParams set domain_num_ 3
lappend cluster_num 2 1 1
AddrParams set cluster_num_ $cluster_num
lappend eilastlevel 1 1 2 1
AddrParams set nodes_num_ $eilastlevel
set tracefd [open msctp-out.tr w]
set namtrace [open msctp-out.nam w]
$ns_ use-newtrace
$ns_ trace-all $tracefd
$ns_ namtrace-all-wireless $namtrace $opt(x) $opt(y)
# Here the topography object define
set topo [new Topography]
$topo load_flatgrid $opt(x) $opt(y)
create-god [expr $opt(nn) + 2]
#Here wired nodes
set temp {0.0.0 0.1.0}
for {set i 0} {$i < $num_wired_nodes} {incr i} {
set W($i) [$ns_ node [lindex $temp $i]]
}
# Configure for ForeignAgent and HomeAgent nodes
#HOME AGNET =NODE-B or base station
$ns_ node-config -mobileIP ON \
-adhocRouting $opt(adhocRouting) \
-llType $opt(ll) \
-macType $opt(mac) \
-ifqType $opt(ifq) \
-ifqLen $opt(ifqlen) \
-antType $opt(ant) \
-propType $opt(prop) \
-phyType $opt(netif) \
-channelType $opt(chan) \
-topoInstance $topo \
-wiredRouting ON \
-agentTrace ON \
-routerTrace OFF \
-macTrace ON
$ns_ node-config -UmtsNodeType bs \
# Here Node-B and Access Point
set HA [$ns_ node 1.0.0]
set FA [$ns_ node 2.0.0]
$HA random-motion 0
$FA random-motion 0
# Position (fixed) for base-station nodes (HA & FA).
$HA set X_ 1.000000000000
$HA set Y_ 2.000000000000
$HA set Z_ 0.000000000000
$FA set X_ 650.000000000000
$FA set Y_ 600.000000000000
$FA set Z_ 0.000000000000
# Configure a mobilenode that would be moving between UMTS and WLAN.
$ns_ node-config -multihome-core \
-wiredRouting OFF \
-mobileIP OFF \
-macTrace ON
set MH [$ns_ node 0.0.0]
set MH_if0 [$ns_ node 1.0.1]
set MH_if1 [$ns_ node 2.0.1]
$MH addif $MH_if0
$MH addif $MH_if1
#$ns_ multihome-add-interface $MH $MH_if0
#$ns_ multihome-add-interface $MH $MH_if1
#set node_(0) $MH
#set node_(1) $MH
set fid_ 2
set HAaddress [AddrParams addr2id [$HA node-addr]]
[$MH_if0 set regagent_] set home_agent_ $HAaddress
set FAaddress [AddrParams addr2id [$FA node-addr]]
[$MH_if1 set regagent_] set foreign_agent_ $FAaddress
# movement of the Mobile Node
$MH set Z_ 0.000000000000
$MH set Y_ 2.000000000000
$MH set X_ 2.000000000000
# MH starts to move towards FA
$ns_ at 100.000000000000 "$MH setdest 640.000000000000
610.000000000000 20.000000000000"
# goes back to HA
$ns_ at 200.000000000000 "$MH setdest 2.000000000000 2.000000000000
20.000000000000"
# links between wired and BaseStation nodes
$ns_ duplex-link $W(0) $W(1) 10Mb 5ms DropTail
$ns_ duplex-link $W(1) $HA 5Mb 2ms DropTail
$ns_ duplex-link $W(1) $FA 5Mb 2ms DropTail
$ns_ duplex-link-op $W(0) $W(1) orient down
$ns_ duplex-link-op $W(1) $HA orient left-down
$ns_ duplex-link-op $W(1) $FA orient right-down
# setup SCTP connections between a wired node and the MobileHost
$ns_ node-config -mobileIP OFF
set sctp1 [new Agent/SCTP]
$sctp1 set class_ 2
$ns_ multihome-attach-agent $MH_if0 $sctp1
set sink1 [new Agent/SCTP]
$ns_ attach-agent $W(0) $sink1
$ns_ connect $sctp1 $sink1
$sctp1 force-source $MH_if0
$ns_ at 200.0 "$sctp1 force-source $MH_if0"
$ns_ at 100.0 "$sctp1 force-source $MH_if1"
$sctp1 set fid_ 1
set ftp [new Application/FTP]
$ftp attach-agent $sctp1
$ftp set packet_size_ 1000
$ftp set rate_ 1mb
#Setup a UDP connection
set udp [new Agent/UDP]
$ns_ attach-agent $MH $udp
set null [new Agent/Null]
$ns_ attach-agent $W(0) $null
$ns_ connect $udp $null
$udp set fid_ 2
#CBR over UDP connection
set cbr [new Application/Traffic/CBR]
$cbr attach-agent $udp
$cbr set type_ CBR
$cbr set packet_size_ 1000
$cbr set rate_ 1mb
$ns_ at $opt(ftp-start) "$ftp start"
$ns_ at $opt(cbr-start) "$cbr start"
# Define initial node position in nam
#for {set i 0} {$i < $opt(nn)} {incr i} {
# 20 defines the node size in nam, must adjust it according to your
# scenario
# The function must be called after mobility model is defined
# $ns_ initial_node_pos $node_($i) 20
#}
# Tell all nodes when the siulation ends
#for {set i 0} {$i < $opt(nn) } {incr i} {
#$ns_ at $opt(stop).0 "$node_($i) reset";
#}
$ns_ at $opt(stop).0 "$HA reset";
$ns_ at $opt(stop).0 "$FA reset";
$ns_ at $opt(stop).0002 "puts \"NS EXITING...\" ; $ns_ halt"
$ns_ at $opt(stop).0001 "stop"
$ns_ run