aodv wireless proc record?

View: New views
1 Messages — Rating Filter:   Alert me  

aodv wireless proc record?

by imranuk :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
    could anybody please help me, actually i am trying to get the output in graph of my wireless aodv scenerio code but it is showing some error and if i am missing someting in my code, i will really appreciate if somebody point it out please.

the code is below...

proc record {} {
        global null0 ns_ tracefd

        #Get an instance of the simulator
        set ns_ [Simulator instance]
        #set the time after which the procedure should be called again
        set time 0.5
        #How many bytes have been received by the traffic sinks?
        set bw0 [$null0 set bytes_]
        #Get the current time
        set now [$ns_ now]
        #Calculate the bandwidth (in MBit/s) and write it to the files
        puts $tracefd "$now [expr $bw0/$time*8/1000000]"
        #Reset the bytes_ values on the traffic sinks
        $null0 set bytes_ 0
        #Re-schedule the procedure
        $ns_ at [expr $now+$time] "record"
}

and the error is below...

Starting Simulation...
ns: record: can't read "bytes_": no such variable
         while executing
"subst $[subst $var]"
        (procedure "_o568" line 5)
        (Object next line 5)
         invoked from within
"_o568 next bytes_"
        ("eval" body line 1)
         invoked from within
"eval $self next $args"
         (procedure "_o568 line 18)
          invoked from within
"$null0 set bytes_"
          (procedure "record" line 9)
          invoked from within
"record"

I would be really thankfull and appreciate your people help

Muhammad Imran khan
MSc Data Telecommunication and Network
Salford university, Manchester,U.K.