[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Re: [ns] queue monitor
thanks,
sorry if my question was confusing. Actually i'm trying to find out the available bandwidth of a wireless link at a particular instance of time dynamically(not a post simulation) and provide this information to the routing agent.
Can u help me??
On Fri, 26 Oct 2001 Jonathan Hicks wrote :
> Sagar,
> I don't know if this is what you wanted, but here is
> code to find what
> percentage of a link is being used at any time (uses
> queuemonitor).
> Jonathan Hicks
>
> set LFile [open linkutil.out w]
> #Monitor the queue on link from n2 to n3
> set qmon [$ns monitor-queue $Node2 $Node3 $LFile]
> set linkmon [$ns link $Node2 $Node3]
> set interval 0.5
> proc calc {} {
> global ns qmon LFile linkmon interval
> set now [$ns now]
> #amount of bytes leaving the queue, entering the
> link
> set rxbytes [$qmon set bdepartures_]
> #bandwidth is in bits/second
> set linkbw [[$linkmon link] set bandwidth_]
> set utilpercentage [expr
> $rxbytes*8*100/$interval/$linkbw]
> puts $LFile "$utilpercentage"
> $qmon set bdepartures_ 0
> # templine to print output to screen. Remove it if
> your code works
> puts $LFile "time = $now, interval = $interval,
> received_bytes =
> $rxbytes, linkbw = $linkbw, linkutilization =
> $utilpercentage"
>
> $ns at [expr $now+$interval] "calc"
> }
>
>
>
> >From: "Sagar A G" <[email protected]>
> >Reply-To: "Sagar A G" <[email protected]>
> >To: [email protected]
> >Subject: [ns] queue monitor
> >Date: 26 Oct 2001 10:38:23 -0000
> >
> >
> >hi..
> >can i use lossmonitor or queue monitor to find out
> bandwidth at any
> >instatce of time?
> >
> >any pointers?
> >
> >Sagar
> >
>
>
> ________________________________________________________-
> _________
> Get your FREE download of MSN Explorer at
> http://explorer.msn.com/intl.asp
>