Tuesday, October 17, 2006

Throughput Algorithm not from Trace File

I found a thread from Velocity Reviews, the author was trying to implement a method in JAVA programming language to calculate the UDP throughput while the simulation is running. The throughput is calculated when the simulation ends. This is not the same as calculating the throughput from ns-2 discrete event network simulator trace file. Click here to view the thread.

Monday, October 16, 2006

Right Shift Operator >>

In the last post, I mentioned about the left shift operator in Java. The right shift operator is to shift the binary to the right. A right shift for non-negative integer is similar to :

value >> 3 is equivalent to value / 2^3


For more information.Click here [source]

Left Shift Operator <<

Silly me, I did not realized that the code:-

size << 3 is actually similar to size*2^3 or size * 8


The size in bytes are converted to the number of bits. I solved the flaw when the VBR generic traffic source transmit higher than the defined maxrate parameter.

Next plan to code call admission into MIRAI-SF3.1 network simulator. So far I have not seen any free source code on the Internet. For the time being, I have to reviewed some literature on call admission to get the basic idea.

Monday, October 09, 2006

Perl Throughput Script

Throughput perl script can be use to calculate the througpuht from the ns-2 trace file.This perl script is available from NS Simulator Course for Beginners page. Click here.

ALternatively, ns-2 user has another option to analyze their ns-2 trace file quickly. Ankur Jain has written a Java program called Network Analyzer for Network Simulator ns-2 (NANS) to quickly analyze and view results in graph. Clik here to find out more.

AvgStats, Instant Jitter and Instant Throughput Awk Script

In the previous post, I mentioned I use instant Troughput awk script from Marco Fiore Website. The downloadable tar file includes avgStats.awk, instantThroughput.awk and instantJitter.awk to analyze your ns-2 trace file.

Click here to get your awk scripts.

Awk script to compute the average and standard deviation from NS Simulator Course for Beginners website. Click here.

Lloyd Wood made a simple awk script to calculate end-to-end delay.Click here.

User of discrete event network simulator ns-2 has another option to analyze their ns-2 trace file quickly. Ankur Jain has written a Java program called Network Analyzer for Network Simulator ns-2 (NANS) to quickly analyze and view results in graph. Clik here to find out more.

Sunday, October 08, 2006

Mersenne Twister

MIRAI-SF3.1 network simulator does not include random generator class. The purpose of random generator because I need to find use the uniform distribution. I was translating the source code of Håkan Byström's VBR traffic model which is C++ to JAVA. A little adjustment have to be made so it can be integrate inside MIRAI-SF3.1 network simulator. Then, I found out that I need a code to generate the uniform distribution.

After some googling on the web, I found a website which offers a Free Java & JavaScript Source code. A random number generator which is I think based on Merseene Twister developed by by Makoto Matsumoto and Takuji Nishimura (alphabetical order) in 1996/1997.

Mersenne Twister(MT) is a pseudorandom number generating algorithm developped by Makoto Matsumoto and Takuji Nishimura (alphabetical order) in 1996/1997. An improvement on initialization was given on 2002 Jan.[source]


The random number generateor code is succefully integrated in to MIRAI-SF network simulator.

Thursday, October 05, 2006

Instant Throughput Dilemma

After numerous compiling the code and observing the output, I think have achieve in calculating the instant throughput and hope it will be accurate enough. Instant throughput is the total number of bits divided the total time. The total time is the difference between the current packet time and the previous time. So why is throughput is important?

It is a good measure of the channel capacity of a communications link, and connections to the internet are usually rated in terms of their bitrate, how many bits they transmit per second (bit/s).[Wikipedia]


The idea of calculating the instant looks simple but I was having a hard time coding the method lol.I added two methods in MIRAI-SF3.1 network simulator's 3g base station subclass.

Instant Throughput method is based on an awk script that can be found at Marco Fiore website.

Here my Pseudocode:

instantThroughput method {

Calibrate tk if the currentpackettime > tk when the method is called for the first time.
Sum the total bytes of data being transmitted.
Sum the total by add the time different between the currentpackettime and previous packet time.
Check if the currentpackettime is larger or equal to time interval, if true then calculate the instant throughput, set the totalBytes and totalTime to zero.
Increase tk by adding interval constant value.
Set the currentpackettime to previouspackettime.

}


calibratetk method{
//check if the method is running for the first time, if true then set the first
//boolean flag to true and add the current tk to the current packet time and return //the tk value.

}


Sometimes, I noticed the currentpackettime is greater than tk when the method is called. The logical reason behind is that the base station does not transmit any packet all time. Instant throughput is calculated every
time the method is called until the tk becomes larger than then
currentpackettime(i.e. Every time instant throughput is calculated, tk is
increased, tk+=interval). To make sure that the current packet time is smaller than tk when the first transmission of packet. Thanks to Kentaro a MIRAI-SF developer from NICT for replying my email.

Now, how do i code a variable bit rate (VBR) application? Scratching my head again.

Wednesday, October 04, 2006

How to fold a shirt in Japan

Shirt folding is all the rave in japan


By the way, I'm lazy at folding my T-shirt but like to hang them straight away.

Riding the Superconducting Maglev Train - Linear Motor Car

Riding Japan's Superconducting Maglev "Linear Motor Car" Train at 502 kilometers/hour on a beautiful day at JR Railway Technical Research Institute's Yamanashi Maglev Test Line.
This was shot with a JVC Everio GZ-MC500 3CCD hard disk drive camcorder. The length is 6 minutes and 11 seconds. Courtesy of Harvard Club of Japan and Central Japan Railway Company