Wednesday, December 9, 2009
128-bit node id space in p2p systems
However in my research work I wanted to generate a nodeId based on not neither the IP nor the Public key of the node but using some unique key/number given or that can be used to identified the node. For an example the mobile number of a mobile device(phone, PDA, iPhone, etc) which represents a peer in a p2p network. Since I am using Freepastry API this capability is not provided directly. But extending its NodeIdFactory class this can be done easily. Its quite simple. :)
Friday, November 20, 2009
Finally my freepastry nodes are working
Initially It was not working because of that I had forget to implement one code line that perform the call to register() method of endpoint reference object.
Not only that. There are some other points also that I found and which was not mentioned in freepastry tutorial.
1) For the Bootstrap node bootAdress(InetAdrress) should be the real Ip( or the domain name also could be worked but I didn't check ) of the machine and the boot port and bind port should be equal.
e.g
int bindport = Integer.parseInt(args[0]);
InetAdress bootaddr = InetAddress.getByName(args[1]);
int bootport = Integer.parseInt(args[2]);
..............
............
node.boot(bootaddress);
Note that here if you start new node as the bootstrap(parent) node then you should pass local IP or domain name of local maching as as the bootaddr and same port number for both bindport and bootport.
So if the ip of the local machin is 192.168.1.100 then your command line arguments should be like
$java [-options] class
2) In FreePastry Application class (in this example MyApp) where we normally initiate the reference for Endpoint, dont forget to call register() method.
import rice.p2p.commonapi.Application;
import rice.p2p.commonapi.Endpoint;
import rice.p2p.commonapi.Id;
import rice.p2p.commonapi.Message;
import rice.p2p.commonapi.Node;
import rice.p2p.commonapi.NodeHandle;
import rice.p2p.commonapi.RouteMessage;
public class MyApp implements Application {
protected Endpoint endpoint;
public MyyApp(Node node) {
this.endpoint = node.buildEndpoint(this, "myinstance");
this.endpoint.register();
}
//some codes go here
................
..................
}
Therefore the Warning is...
If somebody wish to implement freepastry and forget to call this register() method your other pastry nodes who are waiting to receive messages from the first node wont receive pastry messages.
Monday, November 16, 2009
Changing default java setting on ubuntu
Nothing much. we only need to change two things in advance that is java and javac command.
To choose Java
Just installing new Java flavours does not change the default Java pointed to by /usr/bin/java. You must explicitly set this:
$ sudo update-java-alternatives -l to see the current configuration and possibilities.
$sudo update-java-alternatives -s XXXX to set the XXX java version as default. For Sun Java 6 this would be sudo update-java-alternatives -s java-6-sun
Run java -version to ensure that the correct version is being called.
Alternative way
$sudo update-alternatives --config java
Although the above changes are done the system may still refer to old 'javac' setting.
To choose javac
To check which javac is fired when type javac -version use
$which javac
/usr/bin/javacTo check this javac is a real program or a symlink
$ls -al /usr/bin/javac
lrwxrwxrwx 1 root root 23 2009-07-29 19:42 /usr/bin/javac -> /etc/alternatives/javac
It is a symlink. follow the same command again.
$ls -al /etc/alternatives/javac
lrwxrwxrwx 1 root root 42 2009-11-16 14:59 /etc/alternatives/javac -> /usr/lib/jvm/java-gcj/bin/javac
So probably the /etc/alternatives/javac link will point to the not desired javac. Change it (as root) using:
Friday, October 23, 2009
Fine example to explain a Mutex and Threads
I found this example while 'google'ing.
[When I am having a big heated discussion at work, I use a rubber chicken which I keep in my desk for just such occassions. The person holding the chicken is the only person who is allowed to talk. If you don't hold the chicken you cannot speak. You can only indicate that you want the chicken and wait until you get it before you speak. Once you have finished speaking, you can hand the chicken back to the moderator who will hand it to the next person to speak. This ensures that people do not speak over each other, and also have their own space to talk.
Replace Chicken with Mutex and person with thread and you basically have the concept of a mutex.]
Wednesday, October 14, 2009
Advanced Collaboration Grids
Collaboration become regular and important in the grid paradigm. But so far collaboration has not been used in a consistence fashion by different communities for many reasons. Hence Identifying the related issues with the collaboration has become one of major concern among research communities for last couple of year. The challenge is to finding an open standard that can be agreed by every communities.
A grid is basically built on services. In other words a grid is a better example for Service Oriented Architecture(SOA). These services are at each separate layers in the grid architecture according to their functionality. Approaching to the concept of collaboration in the current grid services hierarchy collaboration can also be identified to a set of services. Therefore implementing a service based middleware to handle the the concurrent events coming from grid participants is quite natural. The same kind of implementation has been done by Indiana university but again its a shared event model using common message broker. They have proved the concept instantiating that model that enable working concurrently on a single OpenOffice files by many peers from any corner of the world. But the problem I see in this is the solution is application specific and so no common interface provided that can be used commonly. Therefore I believe that extending this concept to model a Service Based middleware instead of it's shared event based model that would be a more flexible in general.
Thursday, October 8, 2009
Dcache/Delasa Nominates for the e-Swabhimani award !
Summing up the last 9 moths spent on this it was a great experience specially in implementing a research idea. It has a lot of varieties in terms of many common working experiences we meet in the commercial software development environment. As every elements in the world, these two environments also have good and bad. But I would rather satisfy by working in a environment like LSF, doing research. It catered me the freedom most importantly, let myself to be enjoyed of the work done, no QA team to reports bug :), also it keeps me on the study track.
Finally we believe that Dcache will be smart enough and beautiful to win the award. So that we would future treat to take her to a another level.
Friday, September 18, 2009
FOSS-ed 2009 -Trinco
This was not the first time that i had been to Trinco. I had my first visit to Trico in 2004 when Tsunami came. The purpose of that journey was to provide water with IDPs.
Now when I look at these two visits, the objective of both visits was to help people. This time I spent a great couple of days at Trinco. I could able to be relaxed myself and felt the freedom of the life itself.


The people who had come to the event and the organizers of the event welcomed us at a great deal. This was a good example to how it is easy to live for northern and southern people in Sri Lanka in peace. Mindset is the most important factor for being good or bad. What I felt was the war is just a creation of group of people(what ever they are defined to be like). Even though I come up with lot of unorganized ideas about the conflict had I am not going to write those in here as its now over. This is ABOUT FOSS. Completely different from a war. :)


The two days conference and training session held at Northern governor office at Trinco. All the people who had participated for the event were public workers and they had several levels in IT knowledge but each had good enough knowledge at their levels rather I expected. So it was easy for us give to introduce FOSS and things and gave some practical session with the FOSS applications. Even the term FOSS was totally a new experience for them I hope we could able to convice them a lot about the context in it.