Error while adding new protocol

26 views
Skip to first unread message

Andy tadesse

unread,
Jun 15, 2020, 5:23:35 PM6/15/20
to Network Simulator 2 (NS2)
Dears;

Why i always face the  same kind of error while adding a new protocol in ns2?  Please  help me on the following error?

$ ns tclwithsink.tcl
(_o234 cmd line 1)
    invoked from within
"_o234 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 "_o234" line 2)
    (SplitObject unknown line 2)
    invoked from within
"_o234 addr"
    ("eval" body line 1)
    invoked from within
"eval $node addr $args"
    ("default" arm line 2)
    invoked from within
"switch -exact $routingAgent_ {
ZRP  {
set ragent [$self create-zrp-agent $node]
}
DSDV {
set ragent [$self create-dsdv-agent $node]
}
AODV{
ser 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(nnaodv)} {incr i} {
      set node_($i) [$ns_ node]
      $node_($i) random-motion 0    ;#disable random motion
      }"
    (file "tclwithsink.tcl" line 72)


NB:  May I know the relation between ns-2.35\tcl\lib\ns-lib.tcl and my tcl file which is attached here.

please please support me !

--

THANXS FOR YOUR RESPECT

Anduamlak Yitayeh(#NDY)

CPM Super Admin

Ethio-Telecom
Tel: +251 (0)929377885

tclwithsink.tcl
ns-lib.tcl

knudfl

unread,
Jun 15, 2020, 6:51:46 PM6/15/20
to Network Simulator 2 (NS2)
Hi.

There is no "SINKHOLEAODV" in ns2 by default.
? Did you do any changes to ns-2.35/"c++ code" ?

About your ns-lib.tcl :
$ grep -ni sinkhole ns-lib.tcl
633:                    # ADDING SINKHOLE AGENT
634:                    SINKHOLEAODV{
636:               set ragent [$self create-sinkholeaodv-agent $node]
868:# sinkholeAODV
869:Simulator instproc create-sinkholeaodv-agent { node } {
871:set ragent [new Agent/sinkholeAODV [$node node-addr]]

.... so these lines are different from the default ns-lib.tcl
-----------------------------

P.S.:  There is sinkhole for `NetSim´

Andy tadesse

unread,
Jun 16, 2020, 12:29:11 AM6/16/20
to ns-u...@googlegroups.com
Sir , i know ns2 has not a default sinkhole node, but i have modified aodv algorithm  by adding a new protocol called sinkholeaodv. I've modified all the source code (.cc) and header files(.h) too to have a sinkhole node.

But when i compiling i've got this error.


--
-----------------------------

THANXS FOR YOUR RESPECT
Anduamlak Yitayeh(#NDY)
CPM Super Admin
Ethio-Telecom
Tel: +251 (0)929377885
--
You received this message because you are subscribed to the Google Groups "Network Simulator 2 (NS2)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-users+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-users/130f532d-cd55-41c1-85c2-8345c4cd744bo%40googlegroups.com.

knudfl

unread,
Jun 16, 2020, 5:29:39 AM6/16/20
to Network Simulator 2 (NS2)
For comparison :  blackholeaodv code is attached.



blackholeaodv_ns234.tar.xz
Reply all
Reply to author
Forward
0 new messages