Hi all,

Sorry to be sending multiple emails to this list but I'm really 
struggling with this.  I managed to get DSR routing working by changing 
the queue type as suggested by others to CMUPriQueue.  However TORA 
still won't work and I can't work out what is going wrong or find any 
solutions on the net.  The error is shown below, with the tcl further 
down.  There is no difference between this code and the other protocol 
code except for changing the protocol type.  I have even tried to 
download TORA examples 
(http://www-sop.inria.fr/maestro/personnel/Eitan.Altman/ns.htm) which 
also don't work. 

Any help is appreciated!

Michael.

-------------------------------- ERROR 
--------------------------------------

$ ns test.tcl
num_nodes is set 3
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead

    (_o17 cmd line 1)
    invoked from within
"_o17 cmd port-dmux _o32"
    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 76)
    (Simulator create-wireless-node line 76)
    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.tcl" line 54)

---------------------------- TCL FILE 
------------------------------------------

# ======================================================================
# Define options
# ======================================================================

set val(chan)         Channel/WirelessChannel  ;# channel type
set val(prop)         Propagation/TwoRayGround ;# radio-propagation model
set val(ant)          Antenna/OmniAntenna      ;# Antenna type
set val(ll)           LL                       ;# Link layer type
set val(ifq)        CMUPriQueue              ;# Interface queue type
#set val(ifq)          Queue/DropTail/PriQueue  ;# Interface queue type
set val(ifqlen)       50                       ;# max packet in ifq
set val(netif)        Phy/WirelessPhy          ;# network interface type
set val(mac)          Mac/802_11               ;# MAC type
set val(rp)           TORA                     ;# ad-hoc routing protocol
set val(nn)           3                        ;# number of mobilenodes
set val(stop)         500                 ;# length of the simulation
set val(x)                500                 ;# size of the square one side
set val(y)               500                 ;# size of the square one side

# ======================================================================
# Standard Setup
# ======================================================================

set ns_        [new Simulator]
$ns_ use-newtrace

set tracefd        [open thesis-out.tr w]
$ns_ trace-all $tracefd      

set topo        [new Topography]
$topo load_flatgrid $val(x) $val(y)

create-god $val(nn)


# ======================================================================
# Configure Nodes
# ======================================================================

$ns_ node-config -adhocRouting $val(rp) \
                 -llType $val(ll) \
                 -macType $val(mac) \
                 -ifqType $val(ifq) \
                 -ifqLen $val(ifqlen) \
                 -antType $val(ant) \
                 -propType $val(prop) \
                 -phyType $val(netif) \
                 -topoInstance $topo \
                 -channelType $val(chan) \
                 -agentTrace ON \
                 -routerTrace ON \
                 -macTrace ON

for {set i 0} {$i < $val(nn) } {incr i} {
    set node_($i) [$ns_ node ]
    $node_($i) random-motion 0       ;# disable random motion
}


# ======================================================================
# Initial Positioning
# ======================================================================

$node_(0) set X_ 20.0
$node_(0) set Y_ 20.0
$node_(0) set Z_ 0.0

$node_(1) set X_ 450.0
$node_(1) set Y_ 450.0
$node_(1) set Z_ 0.0

$node_(2) set X_ 250.0
$node_(2) set Y_ 250.0
$node_(2) set Z_ 0.0


# ======================================================================
# Movement
# ======================================================================

$ns_ at 5.0 "$node_(2) setdest 300.0 250.0 15.0"
$ns_ at 10.0 "$node_(1) setdest 250.0 300.0 15.0"
$ns_ at 20.0 "$node_(0) setdest 200.0 200.0 15.0"
$ns_ at 75.0 "$node_(2) setdest 300.0 300.0 15.0"
$ns_ at 100.0 "$node_(1) setdest 300.0 450.0 15.0"
$ns_ at 120.0 "$node_(1) setdest 250.0 300.0 15.0"

# ======================================================================
# Connections
# ======================================================================

#
# 1 connecting to 2 at time 10
#
set udp_(0) [new Agent/UDP]
$ns_ attach-agent $node_(0) $udp_(0)
set null_(0) [new Agent/Null]
$ns_ attach-agent $node_(1) $null_(0)
set cbr_(0) [new Application/Traffic/CBR]
$cbr_(0) set packetSize_ 512
$cbr_(0) set interval_ 0.25
$cbr_(0) set random_ 1
$cbr_(0) attach-agent $udp_(0)
$ns_ connect $udp_(0) $null_(0)
$ns_ at 10 "$cbr_(0) start"

# ======================================================================
# Tell nodes when the simulation ends, and start the simulation
# ======================================================================

for {set i 0} {$i < $val(nn) } {incr i} {
    $ns_ at $val(stop).0 "$node_($i) reset";
}
$ns_ at $val(stop).0001 "stop"
$ns_ at $val(stop).0002 "puts \"NS EXITING...\" ; $ns_ halt"
proc stop {} {
    global ns_ tracefd
    close $tracefd
}

puts "Starting Simulation..."
$ns_ run




Reply via email to