[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ns] queue
How fast you're pumping packets into the link?
You might want to check it against the BW of your link
to see if there is actually any packet would be queued.
Kun-chan Lan
On Mon, 6 Aug 2001, Cavallin L. wrote:
> I would like to monitor queue size, I tried this but it seems doesn't
> work:
>
> $ns_ duplex-link $node_(2) $node_(3) 1Mb 2ms DropTail
> $ns_ queue-limit $node_(2) $node_(3) 28
> set queue_tr(0) [open "output/queue_2-3.tr" "w"]
> set queue_(0) [$ns_ monitor-queue $node_(2) $node_(3) ""]
>
> proc trace_queue { } {
> global queue_ queue_tr ns_
> set interval 0.10
> set now [$ns_ now]
> set s [$queue_(0) set size_]
> set p [$queue_(0) set pkts_]
> puts $queue_tr(0) "$now $s $p"
> $ns_ at [expr $now + $interval] "trace_queue"
> }
>
> $ns_ at 0.0 "trace_queue"
>
> but the file queue_2-3.tr contains this:
> 0 0 0
> 0.10000000000000001 0 0
> 0.20000000000000001 0 0
> 0.30000000000000004 0 0
> 0.40000000000000002 0 0
> 0.5 0 0
> 0.59999999999999998 0 0
> 0.69999999999999996 0 0
> 0.79999999999999993 0 0
> 0.89999999999999991 0 0
> 0.99999999999999989 0 0
> 1.0999999999999999 0 0
> 1.2 0 0
> 1.3 0 0
> 1.4000000000000001 0 0
> 1.5000000000000002 0 0
> 1.6000000000000003 0 0
> 1.7000000000000004 0 0
> 1.8000000000000005 0 0
>
>
>
> What is it wrong??
>