can't read "numifs": no such variable

21 views
Skip to first unread message

nkengr-eshete

unread,
Dec 14, 2017, 7:54:20 AM12/14/17
to Network Simulator 2 (NS2)
I will get the following error while executing any .tcl file, recently I clone aomdv


can't read "numifs": no such variable
    while executing
"subst $[subst $var]"
    (procedure "_o13" line 5)
    (SplitObject set line 5)
    invoked from within
"$ns set numifs"
    (procedure "_o24" line 6)
    (Node/MobileNode add-interface line 6)
    invoked from within
"$node add-interface $chan $propInstance_ $llType_ $macType_  $ifqType_ $ifqlen_ $phyType_ $antType_ $topoInstance_  $inerrProc_ $outerrProc_ $FECProc_"
    (procedure "_o13" line 90)
    (Simulator create-wireless-node line 90)
    invoked from within
"_o13 create-wireless-node"
    ("eval" body line 1)
    invoked from within
"eval $self create-wireless-node $args"
    (procedure "_o13" line 23)
    (Simulator node line 23)
    invoked from within
"$ns node"
    ("for" body line 2)
    invoked from within
"for {set i 0} {$i < $val(nodes)} { incr i } {
            set node_($i) [$ns node]
            $node_($i) random-motion 0 
            $node_($i) col..."
    (file "lblqaomdv.tcl" line 147)

knudfl

unread,
Dec 14, 2017, 8:44:07 AM12/14/17
to Network Simulator 2 (NS2)
Suggest :  Use your  {un-patched / unmodified / stock} executable /usr/local/bin/ns-orig :
Then all default simulations can be run ...

Note :  You can have as many ns-allinone-2 as you want, installed at the same time.

About the "clone aomdv" :  May be you got it to work with some simulation(s)  ?
.... Don't expect a modified ns2 to work with default simulations.
( Though some (a few) added protocols are harmless.)

nkengr-eshete

unread,
Dec 14, 2017, 9:20:02 AM12/14/17
to Network Simulator 2 (NS2)

yes I was using ns tclexample. tcl but with the above error, It only works in another tcl which don't have numif it works fine but those tcl having numif and node conf it have above error

nkengr-eshete

unread,
Dec 14, 2017, 9:40:17 AM12/14/17
to Network Simulator 2 (NS2)
how to solve this error

letaomdv/letaomdv.cc:311:9: error: redefinition of ‘struct hdr_cmn’
 }struct hdr_cmn {
         ^
In file included from ./trace/trace.h:43:0,
                 from ./trace/cmu-trace.h:42,
                 from ./letaomdv/letaomdv.h:92,
                 from letaomdv/letaomdv.cc:85:
./common/packet.h:603:8: error: previous definition of ‘struct hdr_cmn’
 struct hdr_cmn {
        ^
letaomdv/letaomdv.cc:1865:1: error: expected unqualified-id at end of input
 }
 ^
Makefile:93: recipe for target 'letaomdv/letaomdv.o' failed
make: *** [letaomdv/letaomdv.o] Error 1
Ns make failed!
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems

when ./install in ns-all-in-one2.35

I add in
int lblqaomdv_salvage_count_;
 struct hdr_cmn in common/packet.h after this error
struct hdr_cmn’ has no member named ‘letaomdv_salvage_count_’ ch->maodv_salvage_count_ = 0; ^

nkengr-eshete

unread,
Dec 14, 2017, 10:36:24 AM12/14/17
to Network Simulator 2 (NS2)
I solved the above error but still when I run .tcl file containing ad hoc node configuration, it says
can't read "numifs": no such variable ....
i use ns adhoc.tcl

knudfl

unread,
Dec 14, 2017, 11:53:36 AM12/14/17
to Network Simulator 2 (NS2)
"adhoc.tcl" :  Please attach the file, renamed to a new unique name.
... Unless it's the default adhoc.tcl or Adhoc.tcl :  Both are attached  ( + adhoc_tcp.tcl )

You can look here to know the ~2500 names.tcl already in use ...
https://drive.google.com/file/d/0B7S255p3kFXNWUxzQ09uclA4TjQ/view?usp=sharing
https://drive.google.com/drive/folders/0B7S255p3kFXNSmRYb2lGcDRUdWs?usp=sharing
adhoc_tcp.tcl
Adhoc.tcl
adhoc.tcl

knudfl

unread,
Dec 14, 2017, 12:18:49 PM12/14/17
to Network Simulator 2 (NS2)
There are some typos in the adhoc.tcl, I attached.
The new edited version adhoc-17.tcl is included in manet-examples-4.tar.gz
https://drive.google.com/file/d/1UgjhJ2YsPDBjfXbufl87Wt7BVhL0tHWW/view?usp=sharing

adhoc-17.tcl :  $ ns adhoc.tcl  Routing_Protocol Traffic_Pattern Scene_Pattern Num_Of_Node
My example :  $ ns235-64-orig adhoc.tcl AOMDV cbr mob_10 20

nkengr-eshete

unread,
Dec 15, 2017, 1:19:47 AM12/15/17
to Network Simulator 2 (NS2)
 it is not the reason of .tcl file, I tried it with my friends pc it works fine, I want to remove dir antenna patch from my orginal ns How can I do that?

knudfl

unread,
Dec 15, 2017, 6:59:36 AM12/15/17
to Network Simulator 2 (NS2)
»» I want to remove dir antenna patch from my orginal ns «« :

Why care ?  You can have a hundred times ns-allinone-2.35 installed at the same time.
Just keep all the executable 'ns-any-name' in /usr/local/bin/ .
/usr/local/bin/{ ns-orig, ns235-dir-antenna, etc. etc.}
... And no *PATH text can be added to .bashrc : Never required.
The old year ~1999 text ....
»» Please put .... ,,   IMPORTANT NOTICES: You MUST put .. ««
.. was meant only for a "University Computer" :
.. i.e. when you had no write permissions to /usr/local/. 

However, it is possible to remove a patch :
cd ns-2.35/
cp ns ns235
-dir-antenna
make distclean
&& exit

cd ns
-allinone-2.35/
patch
-p0 -R < dir-antenna_ns235.patch
Reply all
Reply to author
Forward
0 new messages