Hello NS-users:
I  create another identical AODV ad hoc routing  protocol  in Ns-2 but I  
renamed  it as ZIGBEE.
I copy all the files in AODV to a new folder call zigbee and renamed all 
AODV files (.cc & .h) to zigbee files (.cc & .h). Then I clone the code and  
I have changed all the words where the aodv word appears by the zigbee word 
(C++ classes, packet headers, variables, TCL bindings,...). I do all 
modifications that are needed to integrate a new module  in NS2 (tutorial 
http://masimum.dif.um.es/nsrt-howto/html/ and Marc Greis s tutorials are 
very helpful).
My first error was:

(zigbee/zigbee.o:(.bss+0x10): multiple definition of `hdr_zigbee::offset_'
zigbee/zigbee.o:(.bss+0x10): first defined here
/usr/lib/gcc-lib/sparc-unknown-linux-gnu/3.3.5-20050130/../../
...)

It happened because in 'makefile' there was two lines with zigbee/zigbee.o.

After this error, I have obtained that 'make' does not give me errors. Then 
the next step was to simulate a tcl script.  I have taken a script that 
works with AODV and I have changed val(rp)=AODV for val(rp)=zigbee ($ns_ 
node-config -adhocRouting $val(rp) ). But when I run the ns, I obtain the  
new error:

/home/ns-allinone-2.29/ns-2.29/tcl/ex/wpan $ ns demo1.tcl
num_nodes is set 4

    (_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 cr..."
    (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 "demo1.tcl" line 110)


Then I go to .../tcl/lib/ns-lib.tcl and I verified that I have been mistaken 
in the zigbee word. The correct word is ZIGBEE.
Finally I run the ns script and all run ok. I have a new protocol name 
ZIGBEE that it is the same that AODV.
The following step is to modify this protocol so that it does exactly what I 
want.  But this is other history.
I hope that this message helps more people.  Thank you.

_________________________________________________________________
¿Estás pensando en cambiar de coche? Todas los modelos de serie y extras en 
MSN Motor. http://motor.msn.es/researchcentre/

Reply via email to