Hi,
First time posting here.

I studied famous document "Implementing new MANET protocol in ns-2" n wrote
the same code in ns-2. that was compiled
OK. I made necessary changes in ns-2 files as packet type declaration in
common/packet.h and so on
n added changes in ns-lib.tcl for routing agent.

Added code is of the above mentioned tutorial as under

 in tcl/lib/ns-lib.tcl

Simulator instproc create-wireless-node args {

switch -exact $routingAgent_ {

Protoname {

 set ragent [$self create-protoname-agent $node]

 }

}

}

and the this procedure implementation is as under

in tcl/lib/ns-lib.tcl

 Simulator instproc create-protoname-agent { node } {

 # Create Protoname routing agent

 set ragent [new Agent/Protoname [$node node-addr]]

 $self at 0.0 "$ragent start"

 $node set ragent_ $ragent

 return $ragent

 }

After making all the chnages i recompile ns-2 by typing make at ns-2 dir n
it got compiled well. But when i try to use this protocol in my simulation
script, it couldnt find ( i think so) the protocol mentioned in ns-lib.tcl

and produce the following error.

[EMAIL PROTECTED]:/home/programs# ns test-wireless.tcl
num_nodes is set 2

    (_o14 cmd line 1)
    invoked from within
"_o14 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 "_o14" line 2)
    (SplitObject unknown line 2)
    invoked from within
"_o14 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 11)
    (Simulator create-wireless-node line 11)
    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(nn) } {incr i} {
                set node_($i) [$ns_ node]
                $node_($i) random-motion 0              ;# disable random
motion
        }"
    (file "test-wireless.tcl" line 98)
[EMAIL PROTECTED]:/home/programs#

To my best efforts i can only say that ns-lib.tcl is not getting recompiled.
i 'm saying it because i comment out one of the existing protocol name AODV
recompile ns2 n  still using that  protocol  in my simulation scripts well.
How can i force ns2 to reconsider this file while recompiling.???

Any other suggestions also welcomed.

I 'm using ns2.29 all in one package on slackware distribution.

Thanx
----
Love not soldiers because they die young...

Reply via email to