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