Thursday, 2 August 2012

A little trick :P

Synchronising ns-3 according to the RTI clock was quite a hectic job, we initially started by assuming we have to write a new scheduler for the job then we looked into writing a new simulator for getting our worked done. Probably this was the correct design choice and we looked into various implementation.

Finally, we managed to trick ns-3 into thinking that Read time is nothing but the RTI time by creating a new simulator "RtiSimulator" similar to Real Time Simulator Implementation. The synchroniser implementation tweaked from wall clock synchroniser helped in doing the trick.

Now, in the present code, ns-3 advances according to the RTI clock and when ns-3 has nothing to do, it sends a time-advance request to the RTI and once all federates have send such requests for time equal to or less than the ns-3 Time Advance Request, RTI grants the request and time advances in ns-3.

What I understood an HLA to be

I suppose it's fair say that there is quite inadequate literature on HLA. I have been talking to people and reading about HLA in bits and pieces. The federates can basically chit-chat with each other by two means :

1. Publishing and Subscribing Objects

2. Sending and Receiving Interactions

Let us consider a case where two federates communicate by publishing and subscribing objects. Let us consider two federates ns3 and dummy, the process of having multiple federates running though a RTI can be summarised as below:

1. Both federates publish and subscribe object through the RTI.

2. Whenever one federate changes any attributes of the object, a callback is send by the RTI to the federate and also the changed attributes.

3. RTI only grants a time advance request when all federates have finished their simulation till the present time.

This is how the entire federation works.

Run Time Interface Dilemma

An RTI or Run Time Infrastructure is required in order to implement HLA. RTI can be considered as the middleware between different federates. It offers various services to the federates like time management, object sharing and interactions.

There are various RTIs available but few open source. We analysed two RTIs for our project (tried CERTI only when we faced a few problems with portico :P) :

1. portico 

portico is a well written and has a C++ and a JAVA API. The source is in JAVA and the C++ API is using JNI (Java Native Interface). The project is well documented and ample of examples for both C++ and JAVA. Although there is a very - very small team :P supporting the project and seems to have issues with some operating systems. Running a federation is comparatively easier  with scripts for running them and not many variables to set.


CERTI on the other hand is written in C++ and has a great C++ API. A JAVA API also exits. It seems good for the job but I didn't find the example very basic/self-explanatory (Billard). Another issue is number of variables one has to set, although it seems that using CERTI it will be quite easier to run the federates on different mmachines as compared to portico.

At present the code uses a portico federate.

Wednesday, 23 May 2012

NS_LOG_UNCOND ("Hello World");

Hello Everyone,

I am Mudit,  final year Electronics and Instrumentation and Chemistry student at BITS - Pilani, Goa Campus. I like hacking and I will be posting on this blog through out Google Summer of Code - 2012 about my project with The Network Simulator -3. 

GSoC is a program ( an awesome one :)) in which Google hires student developers to work on open source projects. For more details check out  this and ns-3 (remember CompNet (Computer Networks) assignments), well check out  this

This is my first blog post and I would like to accept that both the post and the blog name is not so innovative.

Firstly, the most innovative name I could come up with was - "The HLA ns-3 blog" ( :( ), but it quite aptly conveys what the blog is about ( This is what how-to-name-your-blog blogs suggested :) ). As you might have guessed from the blog title "The HLA ns-3 Blog" that this blog will be full of stuff making ns-3 HLA compliant. I will be explaining the project in subsequent posts.

Secondly, The post title - "NS_LOG_UNCOND ("Hello World");". Yeah, another lame attempt by a programmer to be innovative (:p), but this is just to show the mentors that I have read the documentation ( ;) ), actually no, it is something that you would find in all programming blogs.**

In coming months you will see posts about my progress on the project (with futile efforts to make them fun :( ) Till then you can check out some other pages related to the project which are formally written.

Project Wiki Page
Project Proposal

Other Cool GSoC Projects for ns-3

Will be writing soon!!!

**Don't tell me you don't remember reading posts - "printf("Hello World!!!"); cout<<"Hello World!!!"; echo "Hello World"; etc. :)