Subject: [manet]AODV + ns2 help!

From: "kingpaul" <[email-masked]>
Date: Wed, 27 Oct 2004 21:41:49 +0800

Dear All,
	I am a newer to AODV+ns2, I wrote a simple TCL file as follows:

################## 	example2.tcl start	####################
set val(chan)           Channel/WirelessChannel    ;# channel type
set val(prop)           Propagation/TwoRayGround   ;# radio-propagation model
set val(netif)          Phy/WirelessPhy            ;# network interface type
set val(mac)            Mac/802_11                 ;# MAC type
set val(ifq)            Queue/DropTail/PriQueue    ;# interface queue type
set val(ll)             LL                         ;# link layer type
set val(ant)            Antenna/OmniAntenna        ;# antenna model
set val(ifqlen)         50                         ;# max packet in ifq
set val(nn)             2                          ;# number of mobilenodes
set val(rp)             AODV                       ;# routing protocol
set val(x)              500                        ;# X dimension of the topography
set val(y)              500                        ;# Y dimension of the topography

set ns [new Simulator]

set tracefd [open example2.tr w]
$ns trace-all $tracefd
set namtracefd [open example2.nam w]
$ns namtrace-all-wireless $namtracefd $val(x) $val(y)

proc finish {} {
	global ns tracefd namtracefd
	$ns flush-trace

	close $tracefd
	close $namtracefd
	
	exec nam example2.nam &
	exit 0    
}

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

create-god $val(nn)

$ns node-config -addressType flat
		-adhocRouting $val(rp) \
		-llType $val(ll) \
		-macType $val(mac) \
		-ifqType $val(ifq) \
		-ifqLen $val(ifqlen) \
		-antType $val(ant) \
		-propType $val(prop) \
		-phyType $val(netif) \
		-channelType $val(chan) \
		-topoInstance $topo \
		-agentTrace ON \
		-routerTrace ON \
		-macTrace OFF \
		-movementTrace OFF			
			 
for {set i 0} {$i < $val(nn) } {incr i} {
	set node_($i) [$ns node]	
	$node_($i) random-motion 0		;# disable random motion
}

$node_(0) set X_ 5.0
$node_(0) set Y_ 2.0
$node_(0) set Z_ 0.0
$node_(1) set X_ 390.0
$node_(1) set Y_ 385.0
$node_(1) set Z_ 0.0

$ns at 10.0 "$node_(0) setdest 20.0 18.0 1.0"
$ns at 50.0 "$node_(1) setdest 25.0 20.0 15.0"
$ns at 100.0 "$node_(1) setdest 490.0 480.0 15.0" 

set tcp [new Agent/TCP]
$tcp set class_ 2
set sink [new Agent/TCPSink]
$ns attach-agent $node_(0) $tcp
$ns attach-agent $node_(1) $sink
$ns connect $tcp $sink
set ftp [new Application/FTP]
$ftp attach-agent $tcp
$ns at 10.0 "$ftp start" 

for {set i 0} {$i < $val(nn) } {incr i} {
    $ns at 150.0 "$node_($i) reset";
}
$ns at 150.0 "finish"

$ns run

################## 	example2.tcl end	####################

	but I got the error:

[root@jbhuangRH root]# ns example2.tcl
num_nodes is set 2
ns-address.tcl:set-address-format: Unknown address format flat
    while executing
"error "ns-address.tcl:set-address-format: Unknown address format $opt""
    (procedure "_o3" line 20)
    (Simulator set-address-format line 20)
    invoked from within
"$self set-address-format $addressType_ "
    (procedure "_o3" line 43)
    (Simulator node-config line 43)
    invoked from within
"$ns node-config -addressType flat"
    (file "example2.tcl" line 37)
[root@jbhuangRH root]#

	what is the problem with my TCL file?

Best Regards,
Kingpaul Huang

_______________________________________________
manet mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/manet