Friday, January 18, 2008

NS2 for Wireless Sensor Network

NS2 has been widely used for network simulation for wired and wireless.
Me and friends get some fund from e-science fund to do the performance evaluation on available wireless sensor network routing protocol and suggests new improvement if any.

For simulation NS2 is suggested to be used in this project it is mainly because we know a little bit of NS2. It is open source and extensible. Researcher or user can add their own module as an extension for NS2.

So I think there are 2 main thing our group member should know:
  1. The WSN technology itself including the architecture , routing , performance evaluation and so on.
  2. How to create new module on NS2
Of course there must be someone else who are conducting the same project. That's why it is important to do some literature survey and Internet search on what has been done by others. The top Google search result with keyword "NS2 for WSN" show this website URL:
Mannasim ( )

Maybe we should start from here?

Wednesday, January 16, 2008


There are not much about programming and electronics done last weeks.

For programming related part :
  • Installation of TCL\TK (for Windows) in my HP laptop , I used the free TCL\TK from ActiveState TCL distribution. Just google it you will find one.
  • Install the ASED TCL\TK IDE and test it out (also in my HP laptop). The observation are as follows:
    • Layout
    • Pro:
      • code browser are very helpful to browse through tcl program especially the consisting a lot of procedure. Scrolling down using mouse sometimes is not friendly (especially using the laptop touchpad). Certain procedures can be observed by browse and click at the code browser
      • The automatic braces and code highlighting are very useful to avoid unnecessary syntax errors
      • It comes together with other few utilities
    • Cons (The only one)
      • its seems that come tk command especially the labelframe command cannot be evaluated using the toolbar [with run label]. Is it because the ASED is not up to date? I don't bother to find out.
    • Solution
      • I decide to use the ASED to help me reduce syntax error and nicer look compared to writing program in notepad or word pad
      • To run it I just need to find the .tcl script file and click it! It will automatically interpret the code. Thanks to ActiveStateTCL.
  • Documentation of old tcl program (In form of diagram of course). Draw some mind maps to see how the code is implemented. Especially on procedures and procedures call. ASED has been a great help.
  • Study and testing the canvas binding and canvas item binding
For Electrical & Electronic :
  • Nothing much to do , but I think I will write a general guide on Design and Implementation of Digital logic circuit using TTL IC.
  • I have a PIC boot loader PCB. Still not assembled. Maybe I should just keep it and play around with it later, next 2 or 3 months.
  • Discussion with my friend regarding printer to use for transparency printing. It is not a normal printing but the transparency printout will be used for Printed Circuit Board fabrication.
  • Play chess online
  • Someone ask me to be an arbiter for a small chess tournament. I agree to take it
  • Technical write up -- still not very good. Easily stuck.
Thats all about last week. Hopefully I have time and mood to write something beneficial in this blog.

Tuesday, January 8, 2008

NS2 & XandrOS problem with Toshiba Laptop

A friend who attended the NS2 workshop last November (Where I presented some basic on Tcl) , come with a Toshiba Laptop installed with XandrOS 2.0 . He encountered some problem in NS2 installation which is the common problem : the gcc cannot be detected. It seems easy at first. However the major problem comes when we found out that the network adapter cannot be detected hence the gcc cannot be easily installed through Xandros Network. After some discussion we come up with 3 options:

1. Search the xandros forums at regarding the network problem. There must be someone else who face the same problem.
2. Install the newer version of XandrOS hopefully it detects the network adapter
3. Manual installation of gcc which is expected to be time consuming. The gcc distribution is freely available at

I'm wondering maybe installing NS2 in windows should be an option for those using laptop.
I'm using IBM Thinkpad for XandrOS, so far there are no problems with NS2 installation.
Anyway I hope that the discussion helps him. Me myself do not have much time to play around troubleshooting the problem.

Monday, January 7, 2008

Block diagram: A ‘lazy(?)’ way to study

Since these few days I sketched quite a lot of block diagram for my project (Some of it goes to the dustbin .... ) , I think it is good to write something about block-diagramming.
A picture tells thousands words
so do block diagram (err... maybe not a thousand, but just enough to get an idea of something)

Before spending time reading lengthy explanation of software/hardware architecture, consider looking at the block diagram first. The lengthy paragraph actually further explaining the block diagram.

Given below is some information I think will help in understanding some architecture:

  • Block usually in square represent components or modules
  • Block(s) within a block represent the sub-modules or “the component consists of ….. components”
  • Usually the blocks are connected with connector. The connector can be categorized as:
    • Bidirectional : Interdependent / data can flow in both direction
    • Unidirectional : one block depends on another block / data flows from one direction to another direction
    • Thick connector : represent large data / bigger relationship
    • Single line connector : represent less data
  • There are labels most of the times are in short form. Labels represent what is the block and most of the time hints its function. Example (relevant for Microcontroller or Microprocessor subjects ):
    • CPU (Central Processing Unit) is a unit that is central (most/every component should connect to it), it process something (in this case program and data)
    • ALU (Arithmetic Logic Unit) is a unit that does something (logically operation/calculation) arithmetically or logically. The basic arithmetic is addition, subtractions, division and multiplication. The basic logic is AND, OR, NOT, XOR ………….
    • Memory is to memorize something (obviously data/program)
  • The functions of each block are specific. Memory does not process it just stores, while CPU specific for processing not for storage
  • Keep in mind that designer also use block diagram in the thinking process to build the system/architecture.

Precaution: This tips helps, but I believe that to gain marks in exam, students are required to write the definition as in the text book / given by the lecturers.