[ns] ns-2.28: multicast aodv protocol for ad hoc, simulation error, help needed

Shuang Hu whhushuang at gmail.com
Wed Sep 28 11:34:25 PDT 2005


Hi, there,

I am trying to do some multicast routing protocol simulation for Ad
hoc with ns-2.28 these days. I found the multicast aodv(maodv) code
from  http://www.sce.carleton.ca/wmc/code.html (using ns-2.26). I
followed the document provided and modified aodv, node, wireless-phy
and related files in ns-2.28, almost step by step. after recompiling
ns-2.28(make clean, then make...), I ran the tcl script that using
maodv protocol and got the following error:

************************************************************************************************nodes
is set 50

INITIALIZE THE LIST xListHead

    (_o17 cmd line 1)

    invoked from within

"_o17 cmd port-dmux _o26"

    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 "_o17" line 2)

    (SplitObject unknown line 2)

    invoked from within

"$agent port-dmux $dmux_"

    (procedure "_o14" line 11)

    (Node/MobileNode add-target-rtagent line 11)

    invoked from within

"$self add-target-rtagent $agent $port"

    (procedure "_o14" line 23)

    (Node/MobileNode add-target line 23)

    invoked from within

"$self add-target $agent $port"

    (procedure "_o14" line 15)

    (Node attach line 15)

    invoked from within

"$node attach $ragent [Node set rtagent_port_]"

    (procedure "_o3" line 68)

    (Simulator create-wireless-node line 68)

    invoked from within

"_o3 create-wireless-node"

    ("eval" body line 1)

    invoked from within

"eval $self create-wireless-node $args"

    (procedure "_o3" line 14)

    (Simulator node line 14)

    invoked from within

"$ns_ node"

    ("for" body line 2)

    invoked from within

"for {set i 0} {$i < $nodes} {incr i} {

        set node_($i) [$ns_ node]

        $node_($i) random-motion 0;

}"

  (file "ns.tcl" line 43)

***********************************************************************************************

The tcl script looks like:

************************************************************************************************

if {$argc != 3} {

        error "Usages: ns ns.tcl <no_of_senders> <no_receivers> <scenario>"

}


set opt(stop) 910.0

set nodes       50

set mobility    1

set scenario    [lindex $argv 2]

set pausetime   0

set traffic     cbr

set senders     [lindex $argv 0]

set receivers   [lindex $argv 1]


set ns_ [new Simulator]

set topo [new Topography]

$topo load_flatgrid 1500 300


set tracefd [open ./trace-$pausetime-$mobility-$scenario-$senders-$receivers w]

$ns_ trace-all $tracefd

set god_ [create-god $nodes]

$ns_ node-config -adhocRouting AODV \

                        -llType LL \

                        -macType Mac/802_11 \

                        -ifqLen 50 \

                        -ifqType Queue/DropTail/PriQueue \

                        -antType Antenna/OmniAntenna \

                        -propType Propagation/TwoRayGround \

                        -phyType Phy/WirelessPhy \

                        -channel [new Channel/WirelessChannel] \

                        -topoInstance $topo \

                        -agentTrace ON \

                        -routerTrace ON \

                        -macTrace OFF \

                        -movementTrace OFF


for {set i 0} {$i < $nodes} {incr i} {

        set node_($i) [$ns_ node]

        $node_($i) random-motion 0;

}

puts "Loading connection pattern ..."

source "traffic/$traffic-$senders-$receivers"

puts "Loading scenarios file..."

source "scenarios/scen-1500x300-$nodes-$pausetime-$mobility-$scenario"

for {set i 0} {$i < $nodes} {incr i} {

        $ns_ at $opt(stop) "$node_($i) reset";

}

$ns_ at $opt(stop) "$ns_ halt"

puts "Starting Simulation ..."

$ns_ run

************************************************************************************************
It seems the node cannot be properly configured at the first glance. I
have tried GDB but in vain. Any idea what may be missing from the
error info? By the way, I am not sure what's "#define
UPPER_LEVEL_RECEIVE" and "#define UPPER_LEVEL_PORT 100"(aodv.h) for as
stated in document. And I used the original scenarios and traffic
files from the maodv package.

Btw, anybody has tried this package in ns-2.28 and succeeded?

Thanks,

Shuang



More information about the Ns-users mailing list