Thursday, December 14, 2006

Configuring Simulation

Yesterday, I spent the whole day configuring the simulation script. In MIRAI=SF network simulator it is called a MNDL script. In every network simulation, it has a topology of network node. Each node consists of communication stack which is similar to OSI layers. ns network simulator uses TCL script to configure the simulation scenario.

Today,I just found out there is a problem with packet classification. I already make some changes and added few conditions that I did not covered last time.

Sunday, December 10, 2006

Basic concept

I just found out that my text book for computer networking contains all the basic concept for packet scheduling and all the different type of delay definition. I wish I had refer to this book earlier. Arghhh!

Thursday, December 07, 2006

Redo and make changes

The packet scheduler that coded by me is wrong. I have wrong idea of how the packet scheduler works. What I need to now is to refer to some reference to polish my understanding of a packet scheduler and basic network.

update on 08/12/2006:

I only have to change the a scheduler process code which only activate for a duration of time.The scheduler have an array list of which queue need to be serve. Every loop the scheduler will remove packet from a different packet. In short, it term of packet scheduler code not many changes I have to make. My code is not yet complicated. There is still room for improvement. However I still need worry about:-

1) The code for traffic generator that simulates background traffic.
2) I have not start on working congestion control.
3) I need to add some behaviour like dropping packet for the packet scheduler.

Scheduler is like a traffic light on the intersection and array list is a procedural list for the traffic light to signal a green light for each of the intersection in clockwise rotation.

Tuesday, December 05, 2006

How to monitor each other progress?

Last night, Kimin and I had a mutual agreement to monitor each other progress in our final project. Since the year 2007 is around the corner, we agreed to use the blog as a medium to monitor our project's progress. We hope through this method it will boost our motivation to finish off the project as soon as possible. Let see how the pact (i.e a new word that I learned to today from Kimin) will turn out. Click here to check out Kimin's UHF RFID Tag Antenna Design Blog.

Malam kelmarin, saya dan Kimin telah berjanji untuk memantau kemajuan projek masing-masing agar kami dapat menyelesaikan projek kami hi hujung tahnun ini. Kami telah berpakat untuk mencatat segala kemajuan di dalam blog untuk setiap minggu. Kami berharap dengan adanya pendekatan sebegini dapat memberi sedikit motivasi kepada diri masing-masing.

Monday, December 04, 2006

Rate Queuing

I already coded a simple packet scheduler with rate based queuing. However, there is still room for improvement due to some flaws in the code that I did not notice. In the RFC 4594 gave a analogy of rate based queuing.

a rate-based queuing system is a combination of a set ofqueues and a scheduler that empties each at a specified rate. An example of a rate-based queuing system is a road intersection with a stoplight. The stoplight acts as a scheduler, giving each lane a certain opportunity to pass traffic through the intersection.


Saya telah menprogramkan 'packet scheduler' yang mempunyai 'rate-based queuing'. Walau bagaimanapun program tersebut boleh diperbaiki kerana masih terdapat kesalahan yang belum dikenal pasti. Di dalam dokumen standard RFC 4594, memberi satu contoh tentang 'rate-based queuing' seperti tercatat di atas. 'Scheduer' digambarkan sebagai sebuah lampu isyarat yang memberi isyarat kepada setiap persimpangan jalan.

Wednesday, November 22, 2006

Top Ten Errors in Java

I found an article on Top Ten Errors Java Programmers Make in www.javacoffeebreak.com. The author lists the top ten the Java programmers make during coding.The number one mistake is Null pointers.I agreed with the author because I always get the NullPointerException during source code compilation.

Seperti tercatit di atas, saya juga sering mengalami kesilapan NullPointerException. Menurut penulis aritkel itu, adalah satu tanggungjawab 'programmer' untuk memastikan aturcara program bebas dari kesilapan Null Pointer ini.

Tuesday, November 21, 2006

How to Schedule a Process?

I would like to code so that a packet scheduler can dequeue between two queues. The scheduler must dequeue packet from first at constant interval time. In between those interval, I would like the scheduler to dequeue from the second queue.

I know that most network simulator such as NS-2 and other kind of simulators implement the scheduling method. So I going to implement one in MIRAI-SF network simulator. I did manage to implement where there is one queue. Right now, I'm scratching my head to implement the scheduler with two queues.. Blur

'Packet Scheduler' boleh ibaratkan sebagai seorang polis trafik di jalan yang mempunyai tiga laluan kemudian menjadi satu laluan. Setiap laluan mempunyai tahap kepentingan masing-masing. Sebagai contoh, laluan pertama ada khas untuk kenderaan yg bergerak laju yang biasa digunakan oleh Orang Kaya dan ambulan. Laluan kedua pula biasa digunakan kenderaan yg bergerak pada kelajuan biasa. Laluan ketiga pula digunakan oleh kenderaan yang dipandu oleh orang tua. Tugas 'polis trafik' ini memberi keutamaaan laluan pertama agar kenderaan itu sampai pada destinasi tepat pada waktunya. Jika tidak, kesesakan lalu lintas akan berlaku di laluan pertama dan menyebabkan kenderaan seperti ambulan lambat sampai ke hospital. Sebenarnya, packet itu adalah kenderaan dan scheduler tu adalah polis.

Friday, November 17, 2006

Post Processing of Trace File using grep and Excel

I always use grep command to filter out the required information from the MIRAI-SF network simulator . User of ns-2 network simulator also able to use grep command to filter their trace file. For example, the syntax command is:

grep ["keyword to filter"] [source file] > [destination file]
e.g. grep "UDP" source.out >> destination.tr


After that, launch your Microsoft Excel and open the destination file that your previously have run with grep command. Usually the information in column for ns-2 network simulator trace file is separated by space. MIRAI-SF network simulator log file is separated by comma. Text Import Wizard in Microsoft Excel will be launch automatically. In step 1 of 3 window, tab limited radio button is chosen by default and click the Next button to proceed. Now you can use the delimiters option depends on how your information is separated. For example, MIRAI-SF user will choose space option . Then click Finish button.

Now, you able to plot a graph using Microsoft Excel. Alternatively, you can use gnuplot or xgraph which requires some knowledge in their syntax command. ns-2 user can opt to use NANS to view their simulation quickly.

Thursday, November 16, 2006

Traffic Class field IPv6 packet

According RFC 2460, the 8-bit Traffic Class field in the IPv6 header can be for identifying different classes or priorites of IPv6 packets. This is similat to Type of Service (TOS) in IPv4 packet.

Mirai-SF network simulator has all the source code which defined the IPv6 packet, routing of IPv6 in router and IPv6 layer which can handles protocol messages from above and below layers.

I have some trouble in extracting the traffic class information from the IPv6 packets. May be, I just dont know how to use to method to extract the information that I want.

private byte packet[];

packet = new byte[40];

The initial values are:
packet[0]=0;
packet[1]=0;


Is this true?

10:30 pm. Still no luck. I have browsed through source code which does the similar thing to extract the IPPacket from the Frame packet.

14:40 pm. Here is an update on Friday afternoon. I just received an email from the MIRAI-SF developer regarding the traffic field of the IPv6 packet. There is a bug in the source code which caused the value for traffic class does not remain when reached the destination node.

Evening of 18th Nov 2006, I found the tunnelling method which did not pass the Traffic Class information in the IPv6 packets. I will double check if this is correct.

Thursday, November 09, 2006

MIRAI-SF UDP Trace does not include bit length information

Calculating throughput using the byte information in the MAC Layer 2 only produce the aggregated throughput of data packets and protocol message. The throughput Perl Script use to trace ns-2 network simulator trace file is modified so that it can process MIRAI-SF network simulator log file.

A reminder to myself,I have to modify the traceUDP method in MIRAI-SF TraceLog class so it can include byte information. I was wandering why the developer left this out. The developer did made the TCP trace to include the bit length information. NS-2 trace also include the bit length of data payload which is called packet length. Perhaps, I can calculate the end-to-end to delay using the modified AWK script.

note: It is ok to measure in frame because it reflects the utilization of the bandwidth.

Thursday, November 02, 2006

How to Model a 3G Bandwidth

Oh Man, I'm so desperate! How to implement Bandwidth on Demand for 3G in this network simulator? Somebody out there? Any hints...

I have some rough idea how to code it. I have to create a simple admission control, congestion control, variables queues and a process method to simulate the packet scheduler on the downlink

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