Error In Umts Verical Handover Wih Wlan

Hey,
please find attached the code
I got this error :
can't read "mac_(0)": no such variable
while executing
"subst $[subst $var]"
(procedure "_o112" line 5)
(SplitObject set line 5)
invoked from within
"$iface2 set mac_(0)"
invoked from within
"set tmp2 [$iface2 set mac_(0)] "
(file "umts.tcl" line 319)




can anyone help to solve the error??


Similar Content



Ns2 Black Hole Attack Code Runing Problem

I installed ns2 using (sudo apt-get install ns2)
I hav code for black hole attack in aodv manet and while trying to run it on ns2 Im getting the fallowing error message
please tell me how to fix this..??

INITIALIZE THE LIST xListHead

(_o58 cmd line 1)
invoked from within
"_o58 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 "_o58" line 2)
(SplitObject unknown line 2)
invoked from within
"_o58 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"
invoked from within
"set node_(2) [$ns node]"
(file "atk3.tcl" line 55)

URGENT HELP!!! GPSR Patch With Ns-2.34 Ubuntu 12.04

Hey guys
I have been trying to patch GPSR with ns-2.34.The operating system i am using is ubuntu 12.04.
I have made all the necessary changes required in the various files .

I have another version of ns (ns-2.35 ) too but it is in a different directory.
Everytime I run my tcl file an error keeps coming up.
I will be greatful if somebody can help me.This is very very URGENT.


(_o29 cmd line 1)
invoked from within
"_o29 cmd if-queue _o23"
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 "_o29" line 2)
(SplitObject unknown line 2)
invoked from within
"$agent if-queue [$self set ifq_(0)] "
(procedure "_o17" line 28)
(Node/MobileNode add-target line 28)
invoked from within
"$self add-target $agent $port"
(procedure "_o17" line 15)
(Node attach line 15)
invoked from within
"$node attach $ragent [Node set rtagent_port_]"
(procedure "create-gpsr-routing-agent" line 29)
invoked from within
"create-gpsr-routing-agent $node $id"
(procedure "gpsr-create-mobile-node" line 41)
invoked from within
"gpsr-create-mobile-node $i"
("for" body line 2)
invoked from within
"for {set i 0} {$i < $opt(nn) } {incr i} {
gpsr-create-mobile-node $i
}"

Problem In Running Codes Of TORA

Hi,
I am new in linux. I have following problem while running the codes of TORA in ns-2.35 in ubuntu.Can you please help me?


num_nodes is set 6
INITIALIZE THE LIST xListHead

(_o22 cmd line 1)
invoked from within
"_o22 cmd port-dmux _o37"
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 "_o22" line 2)
(SplitObject unknown line 2)
invoked from within
"$agent port-dmux $dmux_"
(procedure "_o19" line 11)
(Node/MobileNode add-target-rtagent line 11)
invoked from within
"$self add-target-rtagent $agent $port"
(procedure "_o19" line 28)
(Node/MobileNode add-target line 28)
invoked from within
"$self add-target $agent $port"
(procedure "_o19" line 15)
(Node attach line 15)
invoked from within
"$node attach $ragent [Node set rtagent_port_]"
(procedure "_o3" line 85)
(Simulator create-wireless-node line 85)
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 n(0) [$ns node]"
(file "tora2.tcl" line 115)

Error In Running Leach_test In NS-2.34

Hi all,

I am trying to simulate leach on NS2 but I've had problems with running the leach_test. I've followed all steps from installing NS2 up to installing the LEACH patch (used the latest one from exidus). Here's the error message in the leach.err I found.

Code:
couldn't read file "/mit/uAMPS/uamps.tcl": no such file or directory
    while executing
"source.orig /mit/uAMPS/uamps.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel source.orig[list $fileName]"
    invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
    (procedure "source" line 8)
    invoked from within
"source /mit/uAMPS/uamps.tcl"
    (file "tcl/mobility/leach.tcl" line 18)
    invoked from within
"source.orig tcl/mobility/leach.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel source.orig[list $fileName]"
    invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
    (procedure "source" line 8)
    invoked from within
"source tcl/mobility/$opt(rp).tcl"
    (file "tcl/ex/wireless.tcl" line 187)

Your help are very much appreciated, thanks!

I Get An Error While Executing Leach.tcl

couldn't read file "mit/uAMPS/ns-leach.tcl": no such file or directory
while executing
"source.orig mit/uAMPS/ns-leach.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source mit/uAMPS/ns-leach.tcl"
(file "leach.tcl" line 7)

Grayhole Attack In Ns2 Using Aodv Protocol

i am getting the folowing error while running the tcl script:-
can't read "source1": no such variable
while executing
"set source1"
(file "gray.tcl" line 109)
abhishek@ubuntu:~/Ns2$ ns gray.tcl
num_nodes is set 9
INITIALIZE THE LIST xListHead
can't read "source=1": no such variable
while executing
"set source=1"
(file "gray.tcl" line 109)

Urgently Plz Reply Error In The Code

Helllo,
I defined the variable like this : set interval [lindex $argv 1].
When i execute my code, i got this error :



can't read "interval": no such variable
while executing
"$cbr_ set interval_ $interval"
(file "te.tcl" line 597)



How can i read this variable



Plz replyyy

How To Patch GPSR Routing Protocol To Ns-2.35

Hi,
I have patched GPSR to ns-2.35 using keliu' code. It works fine with given tcl file. I need to move nodes according to mine own mobility scenario and compare them to AODV protocol.
I have two problems
1. I don't understand what this command in gpsr.tcl file means Code:
proc gpsr-create-mobile-node { id args } {
         .........................	
if [info exists opt(energy)] {
	$node addenergymodel [new $opt(energy) $node 10 0.5 0.2]}
         .............

What are these figures (0.5, 0.2), are these energy consumed in reception and transmission or some thing else.

Secondly I want move mobile node created using proc defined in gpsr.tcl file according to my own mobility plan e.g. Code:
 $ns_ at 0.000000000000 "$node_(0) setdest 144.816950690450 20.073824649527 0.324133202939"
$ns_ at 0.000000000000 "$node_(1) setdest 93.957720171475 192.140808646867 1.452613500562"
$ns_ at 12.158688172971 "$node_(23) setdest 113.137798368154 39.443538618334 0.902003496971"
$ns_ at 14.805074599534 "$node_(2) setdest 152.227654369397 20.766089279052 1.742469780423"

But when I run simulation it gives error like this:[QUOTE]Load complete...
Starting Simulation...
ns: _o18 setdest 144.816950690450 20.073824649527 0.324133202939:
(_o18 cmd line 1)
invoked from within
"_o18 cmd setdest 144.816950690450 20.073824649527 0.324133202939"
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 "_o18" line 2)
(SplitObject unknown line 2)
invoked from within
"_o18 setdest 144.816950690450 20.073824649527 0.324133202939"
[\QUOTE]
Urgent help is needed please

I Am Trying To Run CRCN Protocol In Ns2.31 But Every Time I Am Getting This Error,

Hello guys. When ever i tried to run CRCN protocol i am getting following error:
harsh@ubuntu:~/ns3/test$ ns test1.tcl
num_nodes is set 10
missing operator at _@_
in expression "$i < $val(ni) _@_$val(channum) "
(parsing expression "$i < $val(ni) $val(cha...")
invoked from within
"for {set i 0} {$i < $val(ni) $val(channum) } {incr i} {
$ns_ add-channel $i $chan_($i)
}"
(file "test1.tcl" line 48)

Can someone guide me how to correct this error??

Thank you

Simulation Of Handoff B/w Umts And 802.11

Hello,I want to simulate seamless handoff b/w umts and 802.11,simulation works fine for one umts and one 802.11 base station but i want to simulate the senario of 3 802.11 base stations and one umts base station,when i add two 802.11 base stations,i got following error..
Please help me.

Simulation is running ... please wait ...
can't read "Node_(8)": 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 1]"
(procedure "_o3" line 15)
(Simulator compute-hier-routes line 15)
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 "_o343" 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 "new.tcl" line 329)


CODE is...



#set debug attributes
Agent/ND set debug_ 1
Agent/MIH set debug_ 1
Agent/MIHUser/IFMNGMT/MIPV6/Handover/Simple set debug_ 1

# set global variables
set output_dir .

#create the simulator
set ns [new Simulator]
#$ns use-newtrace

#open file for trace
set f [open out1.tr w]
$ns trace-all $f

# set up for hierarchical routing (needed for routing over a basestation)
$ns node-config -addressType hierarchical
AddrParams set domain_num_ 6 ;# domain number
AddrParams set cluster_num_ {1 1 1 1 1 1} ;# cluster number for each domain
AddrParams set nodes_num_ {3 1 1 1 2 2} ;# number of nodes for each cluster

# configure UMTS.
# Note: The UMTS configuration MUST be done first otherwise it does not work
# furthermore, the node creation in UMTS MUST be as follow
# rnc, base station, and UE (User Equipment)
$ns set hsdschEnabled_ 1addr
$ns set hsdsch_rlc_set_ 0
$ns set hsdsch_rlc_nif_ 0

# configure RNC node
$ns node-config -UmtsNodeType rnc
set rnc [$ns create-Umtsnode 0.0.0] ;# node id is 0.
puts "rnc: tcl=$rnc; id=[$rnc id]; addr=[$rnc node-addr]"

# configure UMTS base station
$ns node-config -UmtsNodeType bs \
-downlinkBW 384kbs \
-downlinkTTI 10ms \
-uplinkBW 384kbs \
-uplinkTTI 10ms \
-hs_downlinkTTI 2ms \
-hs_downlinkBW 384kbs

set bsUMTS [$ns create-Umtsnode 0.0.1] ;# node id is 1
puts "bsUMTS: tcl=$bsUMTS; id=[$bsUMTS id]; addr=[$bsUMTS node-addr]"

# connect RNC and base station
$ns setup-Iub $bsUMTS $rnc 622Mbit 622Mbit 15ms 15ms DummyDropTail 2000

$ns node-config -UmtsNodeType ue \
-baseStation $bsUMTS \
-radioNetworkController $rnc

set iface0 [$ns create-Umtsnode 0.0.2] ;# node id is 2
puts "iface0(UMTS): tcl=$iface0; id=[$iface0 id]; addr=[$iface0 node-addr]"

# Node address for router0 and router1 are 3 and 4, respectively.
set cn [$ns node 1.0.0]
puts "cn: tcl=$cn; id=[$cn id]; addr=[$cn node-addr]"
set router1 [$ns node 2.0.0]
puts "router1: tcl=$router1; id=[$router1 id]; addr=[$router1 node-addr]"


# connect links
$ns duplex-link $rnc $router1 622Mbit 0.4ms DropTail 1000
$ns duplex-link $router1 $cn 100MBit 5ms DropTail 1000
$rnc add-gateway $router1

# creation of the MutiFaceNodes. It MUST be done before the 802.11
$ns node-config -multiIf ON ;#to create MultiFaceNode
set multiFaceNode [$ns node 5.0.0] ;# node id is 5
$ns node-config -multiIf OFF ;#reset attribute
puts "multiFaceNode: tcl=$multiFaceNode; id=[$multiFaceNode id]; addr=[$multiFaceNode node-addr]"

# parameter for wireless nodes
set opt(chan) Channel/WirelessChannel ;# channel type for 802.11
set opt(prop) Propagation/TwoRayGround ;# radio-propagation model 802.11
set opt(netif) Phy/WirelessPhy ;# network interface type 802.11
set opt(mac) Mac/802_11 ;# MAC type 802.11
set opt(ifq) Queue/DropTail/PriQueue ;# interface queue type 802.11
set opt(ll) LL ;# link layer type 802.11
set opt(ant) Antenna/OmniAntenna ;# antenna model 802.11
set opt(ifqlen) 50 ;# max packet in ifq 802.11
set opt(adhocRouting) DSDV ;# routing protocol 802.11
set opt(umtsRouting) "" ;# routing for UMTS (to reset node config)

set opt(x) 800 ;# X dimension of the topography
set opt(y) 800 ;# Y dimension of the topography

# configure rate for 802.11
Mac/802_11 set basicRate_ 11Mb
Mac/802_11 set dataRate_ 11Mb
Mac/802_11 set bandwidth_ 11Mb

#create the topography
set topo [new Topography]
$topo load_flatgrid $opt(x) $opt(y)
#puts "Topology created"

# create God
create-god 10 ;# give the number of nodes


# configure Access Points
$ns node-config -adhocRouting $opt(adhocRouting) \
-llType $opt(ll) \
-macType $opt(mac) \
-channel [new $opt(chan)] \
-ifqType $opt(ifq) \
-ifqLen $opt(ifqlen) \
-antType $opt(ant) \
-propType $opt(prop) \
-phyType $opt(netif) \
-topoInstance $topo \
-wiredRouting ON \
-agentTrace ON \
-routerTrace OFF \
-macTrace ON \
-movementTrace OFF


proc finish {} {
global ns f
$ns flush-trace
close $f
#exec nam mih.nam &
puts " Simulation ended."
exit 0
}

# configure Base station 802.11
set bstation1 [$ns node 3.0.0] ;
$bstation1 set X_ [expr 500.0]
$bstation1 set Y_ 300.0
$bstation1 set Z_ 0.0
puts "bstation802.11: tcl=$bstation1; id=[$bstation1 id]; addr=[$bstation1 node-addr]"
# we need to set the BSS for the base station
set bstationMac [$bstation1 getMac 0]
set AP_ADDR_0 [$bstationMac id]
puts "bss_id for bstation 1=$AP_ADDR_0"
$bstationMac bss_id $AP_ADDR_0
$bstationMac enable-beacon
$bstationMac set-channel 1

# creation of the wireless interface 802.11
$ns node-config -wiredRouting OFF \
-macTrace ON
set iface1 [$ns node 3.0.1] ;# node id is 7.
$iface1 random-motion 0 ;# disable random motion
$iface1 base-station [AddrParams addr2id [$bstation1 node-addr]] ;#attach mn to basestation
$iface1 set X_ 50.0
$iface1 set Y_ 200.0
$iface1 set Z_ 0.0
[$iface1 set mac_(0)] set-channel 1
# define node movement. We start from outside the coverage, cross it and leave.
$ns at 10 "$iface1 setdest 590.0 200.0 30.0"
puts "iface1: tcl=$iface1; id=[$iface1 id]; addr=[$iface1 node-addr]"


# configure Base station 802.11
set bstation2 [$ns node 4.0.0] ;
$bstation2 set X_ [expr 300.0]
$bstation2 set Y_ 300.0
$bstation2 set Z_ 0.0
puts "bstation802: tcl=$bstation2; id=[$bstation2 id]; addr=[$bstation2 node-addr]"
#we need to set the BSS for the base station
set bstationMac [$bstation2 getMac 0]
set AP_ADDR_0 [$bstationMac id]
puts "bss_id for bstation 2=$AP_ADDR_0"
$bstationMac bss_id $AP_ADDR_0
$bstationMac enable-beacon
$bstationMac set-channel 2
$iface1 base-station [AddrParams addr2id [$bstation2 node-addr]] ;#attach mn to basestation


# add link to backbone
$ns duplex-link $bstation1 $router1 100MBit 15ms DropTail 1000
$ns duplex-link $bstation2 $router1 100MBit 15ms DropTail 1000

# add interfaces to MultiFaceNode
$multiFaceNode add-interface-node $iface1
#$multiFaceNode add-interface-node $iface2
$multiFaceNode add-interface-node $iface0


# install ND modules

# take care of UMTS
# Note: The ND module is on the rnc node NOT in the base station
set nd_rncUMTS [$rnc install-nd]
$nd_rncUMTS set-router TRUE
$nd_rncUMTS router-lifetime 5
$nd_rncUMTS enable-broadcast FALSE
$nd_rncUMTS add-ra-target 0.0.2 ;#in UMTS there is no notion of broadcast.
#We fake it by sending unicast to a list of nodes
set nd_ue [$iface0 install-nd]

# now WLAN
set nd_bs1 [$bstation1 install-nd]
$nd_bs1 set-router TRUE
$nd_bs1 router-lifetime 7

set nd_bs2 [$bstation2 install-nd]
$nd_bs2 set-router TRUE
$nd_bs2 router-lifetime 7

set nd_mn1 [$iface1 install-nd]
#set nd_mn2 [$iface1 install-nd]

set nd_router [$router1 install-nd]
$nd_router set-router TRUE
$nd_router router-lifetime 5


# install interface manager into multi-interface node and CN
set handover [new Agent/MIHUser/IFMNGMT/MIPV6/Handover/Simple]
$multiFaceNode install-ifmanager $handover
$nd_mn1 set-ifmanager $handover
$handover nd_mac $nd_mn1 [$iface1 set mac_(0)] ;#to know how to send RS
#$nd_mn2 set-ifmanager $handover
#$handover nd_mac $nd_mn2 [$iface2 set mac_(0)] ;#to know how to send RS


set ifmgmt_cn [$cn install-default-ifmanager]

# install MIH in multi-interface node
set mih [$multiFaceNode install-mih]

$handover connect-mih $mih ;#create connection between MIH and iface management

# install MIH on AP
set mih_bs1 [$bstation1 install-mih]
set tmp_bs1 [$bstation1 set mac_(0)]
$tmp_bs1 mih $mih_bs1
$mih_bs1 add-mac $tmp_bs1

set mih_bs2 [$bstation2 install-mih]
set tmp_bs2 [$bstation2 set mac_(0)]
$tmp_bs2 mih $mih_bs2
$mih_bs2 add-mac $tmp_bs2

# create a TCP agent and attach it to multi-interface node
set tcp_(0) [new Agent/TCP/FullTcp]
# $ns attach-agent $iface0 $tcp_(0) ;# old command to attach to node
$multiFaceNode attach-agent $tcp_(0) $iface0 ;# new command: the interface is used for sending
set app_(0) [new Agent/Null] ;#we can use this or the next line

# create a TPC agent and attach it to router0
set tcp_(1) [new Agent/TCP/FullTcp]
$ns attach-agent $cn $tcp_(1)
set app_(1) [new Application/TcpApp $tcp_(1)] ;#activate this line if done created abot
puts "App1 id=$app_(1)"

#Create a CBR traffic source and attach it to tcp_(1)
set cbr_(0) [new Application/Traffic/CBR]
$cbr_(0) set packetSize_ 1000
$cbr_(0) set interval_ 0.5
$cbr_(0) attach-agent $tcp_(1)
$handover add-flow $tcp_(0) $tcp_(1) $iface0 1
$tcp_(0) listen
puts "tcp stream made from [$cn node-addr] and [$iface0 node-addr]"

# do registration in UMTS. This will create the MACs in UE and base stations
$ns node-config -llType UMTS/RLC/AM \
-downlinkBW 384kbs \
-uplinkBW 384kbs \
-downlinkTTI 20ms \
-uplinkTTI 20ms \
-hs_downlinkTTI 2ms \
-hs_downlinkBW 384kbs

# for the first HS-DCH, we must create. If any other, then use attach-dch
set dch0 [$ns create-dch $iface0 $tcp_(0)]
$ns attach-dch $iface0 $handover $dch0
$ns attach-dch $iface0 $nd_ue $dch0
puts "dch channel"

# Now we can register the MIH module with all the MACs
set tmp2 [$iface0 set mac_(2)] ;#in UMTS and using DCH the MAC to use is 2 (0 and 1 are for RACH and FACH)
$tmp2 mih $mih
$mih add-mac $tmp2 ;#inform the MIH about the local MAC
set tmp2 [$iface1 set mac_(0)] ;#in 802.11 one interface is created
$tmp2 mih $mih
$mih add-mac $tmp2 ;#inform the MIH about the local MAC



Application/TcpApp instproc recv {data} {
global ns
$ns trace-annotate "$self received data \"$data\""
puts "$self received data \"$data\" at [$ns now]"
}


$ns at 10 "$cbr_(0) start" ;#we should make sure we have UMTS link up before starting to send.

# set original status of interface. By default they are up..so to have a link up,
# we need to put them down first.
$ns at 0 "[eval $iface0 set mac_(2)] disconnect-link" ;#UMTS UE


# set the starting time for Router Advertisements
$ns at 3 "$nd_bs1 start-ra"
#$ns at 3 "$nd_bs2 start-ra"
#$ns at 3 "$nd_bs3 start-ra"
$ns at 1 "$nd_rncUMTS start-ra"
$ns at 1 "$nd_router start-ra"

$ns at 9 "[eval $iface0 set mac_(2)] connect-link" ;#umts link

$ns at 45 "finish"

puts " Simulation is running ... please wait ..."
$ns run