[manet]AODV + ns2 help!

"kingpaul" <kingpaul@ustc.edu> Wed, 27 October 2004 14:19 UTC

Received: from ietf-mx.ietf.org (ietf-mx.ietf.org [132.151.6.1]) by ietf.org (8.9.1a/8.9.1a) with ESMTP id KAA06748 for <manet-web-archive@ietf.org>; Wed, 27 Oct 2004 10:19:12 -0400 (EDT)
Received: from megatron.ietf.org ([132.151.6.71]) by ietf-mx.ietf.org with esmtp (Exim 4.33) id 1CMorj-00064A-Pc for manet-web-archive@ietf.org; Wed, 27 Oct 2004 10:33:36 -0400
Received: from localhost.localdomain ([127.0.0.1] helo=megatron.ietf.org) by megatron.ietf.org with esmtp (Exim 4.32) id 1CMoba-0000j2-NE; Wed, 27 Oct 2004 10:16:50 -0400
Received: from odin.ietf.org ([132.151.1.176] helo=ietf.org) by megatron.ietf.org with esmtp (Exim 4.32) id 1CMoaJ-0008NE-0y for manet@megatron.ietf.org; Wed, 27 Oct 2004 10:15:31 -0400
Received: from ietf-mx.ietf.org (ietf-mx.ietf.org [132.151.6.1]) by ietf.org (8.9.1a/8.9.1a) with ESMTP id KAA06211 for <manet@ietf.org>; Wed, 27 Oct 2004 10:15:28 -0400 (EDT)
Message-Id: <200410271415.KAA06211@ietf.org>
Received: from [218.22.21.7] (helo=ustc.edu) by ietf-mx.ietf.org with esmtp (Exim 4.33) id 1CMon3-0005yG-L0 for manet@ietf.org; Wed, 27 Oct 2004 10:29:51 -0400
Received: (qmail 15389 invoked by uid 8021); 27 Oct 2004 13:42:03 -0000
Received: from kingpaul@ustc.edu by mail.ustc.edu by uid 0 with qmail-scanner-1.20 (hbedv: 6.28.0.7/6.28.0.38. Clear:RC:0(202.38.75.80):. Processed in 0.016061 secs); 27 Oct 2004 13:42:03 -0000
Received: from unknown (HELO jbhuang) (kingpaul@[202.38.75.80]) (envelope-sender <kingpaul@ustc.edu>) by 0 (magicmail-2.1) with SMTP for <manet@ietf.org>; 27 Oct 2004 13:42:03 -0000
Date: Wed, 27 Oct 2004 21:41:49 +0800
From: kingpaul <kingpaul@ustc.edu>
To: "manet@ietf.org" <manet@ietf.org>
Subject: [manet]AODV + ns2 help!
X-mailer: Foxmail 5.0 [cn]
Mime-Version: 1.0
Content-Type: text/plain; charset="gb2312"
Content-Transfer-Encoding: 7bit
X-Qmail-Scanner-Message-ID: <109888452391215384@mail.ustc.edu>
X-Spam-Score: 2.9 (++)
X-Scan-Signature: 67c1ea29f88502ef6a32ccec927970f0
Content-Transfer-Encoding: 7bit
X-BeenThere: manet@ietf.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Mobile Ad-hoc Networks <manet.ietf.org>
List-Unsubscribe: <https://www1.ietf.org/mailman/listinfo/manet>, <mailto:manet-request@ietf.org?subject=unsubscribe>
List-Post: <mailto:manet@ietf.org>
List-Help: <mailto:manet-request@ietf.org?subject=help>
List-Subscribe: <https://www1.ietf.org/mailman/listinfo/manet>, <mailto:manet-request@ietf.org?subject=subscribe>
Sender: manet-bounces@ietf.org
Errors-To: manet-bounces@ietf.org
X-Spam-Score: 3.7 (+++)
X-Scan-Signature: 2086112c730e13d5955355df27e3074b
Content-Transfer-Encoding: 7bit

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
manet@ietf.org
https://www1.ietf.org/mailman/listinfo/manet