4/23/2007

Some thoughts on WSN routing protocols, and prob facing

I'm currently working on my graduation thesis about routing protocols
of Wireless sensor network. Proposed by researchers from USC/ISI, a
protocol called "Directed Diffusion" is one of the most widely known
sensor net protocols. Although it was originally implemented on real
hardware testbed(Lucent WaveLAN), it has been migrated to the network
simulator 2 some years ago.

I have been reading the C++ code and Tcl scripts the last two weeks.
I've also been testing results for some simple scripts in the test
suite. It works, but the implementation in NS-2, diffusion 3, is far
from mature. The diffusion mailing list of USC/ISI has been quite for
years, and seems no one is doing research based on DD anymore, partly
bcoz the hard-to-use and immature implementation of NS-2 version of
DD. As the consequences, many researchers turn to some other kinds of
protocols such as LEACH, a cluster-based network protocols.

What I have in mind is to design a multi-tier sensor network protocols
with the help of multi-sink cooperation. There is too much
concentration on multi-source cooperation, or data aggregation, data
fusion etc. But few attention on multi-source condition. Since last
year, there have been few proposals about multi-sink data gathering,
but still some mathematical stuff. The work is done mainly by
mathematicians, not network specialists. And multi-sink cooperation is
of very much importance, especially when remembering the
application-specific nature of sensor network protocols.

Let's see what can I coin out. But before that, I need to carry out a
better way rather than solely depends on NS version DD. In the current
situation, it's impossible for me to reach a real testbed like the one
the guys in USC/ISI are using.

3/03/2007

Adding new partition in /etc/fstab with UUID

If you want to add a new partition in /etc/fstab under file system you no longer have /dev/xxx but an UUID (Unique unit ID).

To find out the UUID of your partition just use the following command:
sudo vol_id -u <device>

for example, if you want to find the UUID of /dev/sda6, using the command:
sudo vol_id -u /dev/sda6

The rest is then as in the past.

I found the solution here: http://ralph.n3rds.net/index.php?/archives/175-Adding-a-new-partition-in-fstab-with-UUID.html

2/12/2007

Understanding NS's packet flow procedure and package structure


  1. package flow procedure



Figure 1. Packet Flow Example

(http://nile.wpi.edu/NS/)


The problem interested to me, in the figure above is, why the package in red must be handled, both in the source and the sink, using a Addr Classifier. This is a little illogical to let the package flowing out of the node(the circle in Fig.1) and getting back again. It might be possible to do it in a much easier way: the source send the package, only using a Port Classifier(or no classifier, since there is only one port in the Port Classifier), and the sink receive the package. That's all. Why they design like this?


The answer is, pay attention on the package size. At the beginning, a "short" red package is generated as the node entry point. It is forwarded to the Port Classifier by the Addr Classifier, which means the "Addr" of the "short" red package is 0. And the "short" package arrives at the TCP entry. Let me remind you, TCP, in NS, a discrete event-driven simulator, is designed as Agent, rather than a actual Protocol in the network layer. And FTP, is considered as one of the applications above TCP, which is only responsible for the data source. Knowing this, it will not be difficult for us to understand why there are two "burdensome" routes outside the nodes. The entire procedure should be descried like this: At the beginning, The event of sending a TCP package from node n1 to node n2 is generated. Then, a "short" message requesting data is sent towards the FTP application inside node n0(the "short" red package we've seen). As soon as the FTP application receive the message, it generated a "long" red package and send it to the TCP agent. The "long" red package is actually the data we want to send through the link. The TCP agent then forward the data package to node n0 again. And, at this time, the data package is classified as "Addr = 1" by the Addr Classifier inside node n0. Then, the similar procedure happens at the sink side. The sink receive the data package, and forward it to the sink agent. After the package is successfully received by the sink agent, it generate a "ACK" message, resend it to the node n2. n2 classified the "ACK" message as "Addr = 0" and send it back to node n0 through the link. The agent(TCP, Sink) and the application(FTP) remain independent for node n0 and n1 during the entire simulation procedure.


It's of top importance for us to understand throughly the event-scheduling and network component abstraction in NS-2.



  1. package structure

The concept of "package" in real-world computer and telecoms networks are quite different from the concept in NS. Package in NS, is only a abstraction and generalization of all network packages. Thus, the structure of the package in NS is entirely different from the real-world.

A NS packet is composed of a stack of headers, and an optional data space (see Figure 2). As briefly mentioned in the "Simple Simulation Example" section, a packet header format is initialized when a Simulator object is created, where a stack of all registered (or possibly usable) headers, such as the common header that is commonly used by any objects as needed, IP header, TCP header, RTP header (UDP uses RTP header) and trace header, is defined, and the offset of each header in the stack is recorded. What this means is that whether or not a specific header is used, a stack composed of all registered headers is created when a packet is allocated by an agent, and a network object can access any header in the stack of a packet it processes using the corresponding offset value.



Figure 2. NS Packet Format
(http://nile.wpi.edu/NS/)

Usually, a packet only has the header stack (and a data space pointer that is null). Although a packet can carry actual data (from an application) by allocating a data space, very few application and agent implementations support this. This is because it is meaningless to carry data around in a non-real-time simulation.

2/11/2007

Problem during environmental variable setting under Ubuntu

I've been working on making NS-2(Network Simulator 2) working today. After the installation, you have to add some environmental variables. Follow the instructions below:

----------------------------------------------------------------------------------

Please put /home/george/ns-allinone-2.30/bin:/home/george/ns-allinone-2.30/tcl8.4.13/unix:/home/george/ns-allinone-2.30/tk8.4.13/unix
into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.

IMPORTANT NOTICES:

(1) You MUST put /home/george/ns-allinone-2.30/otcl-1.12, /home/george/ns-allinone-2.30/lib,
into your LD_LIBRARY_PATH environment variable.
If it complains about X libraries, add path to your X libraries
into LD_LIBRARY_PATH.
If you are using csh, you can set it like:
setenv LD_LIBRARY_PATH <paths>
If you are using sh, you can set it like:
export LD_LIBRARY_PATH=<paths>

(2) You MUST put /home/george/ns-allinone-2.30/tcl8.4.13/library into your TCL_LIBRARY environmental
variable. Otherwise ns/nam will complain during startup.

(3) [OPTIONAL] To save disk space, you can now delete directories tcl8.4.13
and tk8.4.13. They are now installed under /home/george/ns-allinone-2.30/{bin,include,lib}

After these steps, you can now run the ns validation suite with
cd ns-2.30; ./validate

For trouble shooting, please first read ns problems page
http://www.isi.edu/nsnam/ns/ns-problems.html. Also search the ns mailing list archive
for related posts.


But, you should pay special attention on the environmental variable setting.

The problem is, actually, demonstrated below:
I tried to add the following line of code in the /etc/profile,
export PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games:/usr/local/matlab7/bin:/home/george/ns- allinone-2.30/bin:/home/george/ns-allinone-2.30/tcl8.4.13/unix:/home/george/ns-allinone-2.30/tk8.4.13/unix"

and I logged out the system, but I found I can not start the X session. The error occurred when X was starting, and it was given like this:
line 21, export, bad variable name

At the beginning, I thought that maybe I forget to add the path to X. But, It's didn't work no matter how I modify the /etc/profile.

FINALLY, I found the point. I deleted the space between the keyword export and "=", and the space between "=" to the following path. AND IT WORKS!

Please pay attention to the difference on the following two lines of code:

export PATH = "..."
export PATH="..."

This is the reason of the early failures.


I don't know, even now, why they design like this. The space between "=" and the variable value is OKEY in almost any kind of programming language, including C/C++, JAVA, Perl, Python, Assembly etc...

Anyway, don't get frustrated if you encounter the same problem!

2/10/2007

Eclipse Plugin Problem @ Ubuntu 6.10

Recommended reading: https://help.ubuntu.com/community/EclipseIDE

To install plugins for eclipse in Ubuntu (ie CDT), start Eclipse as root and install the plugins via the Eclipse update manager.

gksudo eclipse