[ns] Fw: info.

mohamed saad mohammed2742007 at yahoo.com
Wed Jun 10 09:32:36 PDT 2009



--- On Wed, 6/10/09, mohamed saad <mohammed2742007 at yahoo.com> wrote:


From: mohamed saad <mohammed2742007 at yahoo.com>
Subject: info.
To: "nsusers" <ns-users at isi.edu>
Date: Wednesday, June 10, 2009, 7:31 PM







                                    a salamo alikom 
how are dear 
when i run this script: 
set val(chan) Channel/WirelessChannel 
set val(prop) Propagation/TwoRayGround 
set val(netif) Phy/WirelessPhy 
set val(mac) Mac/802_11 
set val(ifq) Queue/DropTail/PriQueue 
set val(ll) LL 
set val(ant) Antenna/OmniAntenna 
set val(x) 1000 ;# X dimension of the topography 
set val(y) 1000 ;# Y dimension of the topography 
set val(ifqlen) 50 ;# max packet in ifq 
set val(seed) 0.0 
set val(adhocRouting) SEAD # Same code will be implemented for Ariadne 
# by changing the protocol to Ariadne. 
# The source code for SEAD and Ariadne was taken from 
# http://www.monarch.cs.rice.edu/software.html 
# By Yih-Chun Hu, David B. Johnson, and Adrian Perrig. 
set val(nn) 20 ;# how many nodes are simulated 
set val(sc) "scen-20-test" 
set val(cp) "cbr-20-test" 
set val(stop) 800.0 ;# simulation time 
# ===================================================================== 
# Core Program 
# ===================================================================== 
#How many packets have been received by the traffic links? 
#Get the current time 
set now [$ns_ now] 
set bw1 [$sink1 set bytes_] 
set bw2 [$sink2 set bytes_] 
if $now = 25 
#Calculate the packets (in kbytes/s) and write it to the trace file 
puts $sead1 "$now [expr $[ (bw2/1024)/512) / (bw1/1024)/512) ]" 
else 
puts $sead1 "$now [expr $ (bw2/1024)/512) / (bw1/1024)/512) ]" 
#Reset the bytes_ values on the traffic sinks 
$sink1 set bytes_ 0 
$sink2 set bytes_ 0 
#Re-schedule the procedure 
$ns_ at [expr $now+$now] "record" 
} 
  
appear this error: 
  
can't read "ns_": no such variable 
    while executing 
"$ns_ now" 
    invoked from within 
set now [$ns_ now]" 
  
what i do to solve this error?



      


More information about the Ns-users mailing list