[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] Reg bandwidth utilization!!



On Thursday 05 July 2001 13:57, Archana Krishna wrote:
> Hi,
> I have the following topology.
>
>    node0 ----------- node1
>
> They are connected by the following :
> $ns duplex-intserv-link $n0 $n1 $bandwidth 1ms SimpleIntServ SALink
> $adc $est CL
>
> Now the bandwidth is initialized to be 1mb

<SARCASM>
I just can't resist.  1mb??  Each bit takes 1000 seconds to get onto 
the wire?  BW utilization is just about guaranteed to be 100% for any 
packets (since the smallest is 320 bits).
</SARCASM>

OK.  Now that I've pushed my evil twin away from the keyboard, I'll 
assume that you meant 1Mb as the bandwidth, which will allow for some 
reasonable results.

>
> My question is :
>
> At an interval of every 1sec I would like to know how much of my
> bandwidth is being utilized.
>
> Can anyone suggest how to find this information.

1.  Read Chapter 22 of the ns Manual.  Of primary interest, see 
section 22.4 (Trace File Format).

2.  Enable tracing in your script.  Example can be found in Chapter 1 
of the ns Manual.

3.  Run your script.

4.  Write a program to parse the trace file.  I recommend Perl for 
this.

Here is a Perl regular expression (regexp) to find packets being 
dequeued from node0 headed to node1.

/-\s([\d\.]+)\s0\s1\s(\w+)\s(\d+)\s/

After this little monster runs, you will have three "special 
variables" set in your Perl script:  $1, $2, and $3.
	$1	time the packet left node 0 bound for node 1
	$2	the packet type
	$3	the packet size in bytes

I think that is enough information to figure out the one way BW 
utilization over a given period of time.

-- 
Brian Lee Bowers	|	RADIANT Team (Summer Intern)
[email protected]	|	Los Alamos National Laboratory